diff -Nru barry-0.14/aclocal.m4 barry-0.0.20110506/aclocal.m4 --- barry-0.14/aclocal.m4 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,7379 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 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. - -# 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. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# 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 -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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 conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$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>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - 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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -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*) - 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 - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - 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 -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $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 .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != 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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[[123]]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -AC_MSG_RESULT([$dynamic_linker]) -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 -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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 -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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 <&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 - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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 &1 /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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -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 -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - 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 - 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]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f 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 -]) -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 - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = 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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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]].*|aix5*) - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) 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. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# 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. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi - -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[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. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 2002, 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. - -# 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. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 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. - -# 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 -# 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 7 - -# 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]) -AC_SUBST([$1_FALSE]) -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 -# 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 8 - -# 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], 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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 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 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 -# 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 - -# 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.58])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 -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -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 - 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) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -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 -]) -]) - - -# 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_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 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. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -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 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_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.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 -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 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 4 - -# 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 -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 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 3 - -# _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], -[AC_FOREACH([_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])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 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 4 - -# 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 -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# 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="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 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 - -# _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. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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/ax_c_check_flag.m4]) -m4_include([m4/ax_cxx_check_flag.m4]) diff -Nru barry-0.14/AUTHORS barry-0.0.20110506/AUTHORS --- barry-0.14/AUTHORS 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/AUTHORS 2011-05-06 12:20:16.000000000 +0000 @@ -13,6 +13,8 @@ - OpenBSD port maintainer Lee Dixon - Birthday field and opensync patch + Sujay D'Souza + - chat script for fido Paul Dugas - x86_64 build fix Brian Edginton @@ -31,13 +33,33 @@ Ron Gage - CVS testing - reverse engineering Service Book record + Dr. J A Gow + - recurring calendar item sync support + Toby Gray + - RAW channel support Andy Herkey - sample ppp chat script for Sprint - ipmodem password patches + - contrib/modemtest.rb + - general modem guru Jonathan Hudson - big endian testing and patches Simon Kenyon - ppp chat scripts for O2 Ireland + Josh Kropf + - bjavaloader command syntax changes + - dump eventlog and clear eventlog support + - logstacktraces support + - resettofactory support + - bjavaloader save module support + - forced erase and load while module in use + - packed module support in pkzip format + Ryan Li + - SMS record parsing + - China mobile chat script + - barrybackup GUI enhancements + - threaded multi-device support in barrybackup + - bash-completion scripts Duncan Mak - modern udev updates David Mansfield @@ -46,9 +68,14 @@ - autoconf patches Alan Miller - usb captures on Windows XP for password authentication + Andrew Nording (https://sourceforge.net/users/nording/) + - ppp chatscripts for KPN Nederland Martin Owens - integration with HAL, udev, opensync, and Conduit - low level USB testing + - hal FDI scripts and configuration + - documentation of Content Store and SMS Messages formats + - Barry logo Mick Reed - ppp chat scripts for T-Mobile US Simon Ruggier @@ -63,15 +90,43 @@ - debian packaging patches Michael L. Stokes - sample ppp files for Verizon devices + Adrian Taylor + - preliminary work on RAW channel support Jason Thomas - autoconf / build system patch - debian package patch - Ashley Willis - - btool null parser patch - - perlbarry contrib package + - ppp chatscripts for Optus and Vodafone AU + Nicolas VIVIEN + - bjavaloader support + - screenshot support + - zsh command completion scripts + - Blackberry Storm fixes + - opensync 0.4x plugin port + - photo sync support + - memo sync support + - task sync support + - call log parser + - ldif converter patches + - JVM Debug support, and bjdwp + - btardump & MIME vformat using + - bookmark parser + - Single & multiple ALX parser Niels de Vos - debian package patches - usb_storage unbind script + Ashley Willis + - btool null parser patch + - perlbarry contrib package + Robert Yaklin + - VSM file format documentation + + + +Hardware Contributions (Thanks!): +--------------------------------- + Eric Arseneau + - Blackberry 9530 + - Blackberry 9550 @@ -85,5 +140,30 @@ contacted there. Debian Jose Carlos Garcia Sogo - Mandriva Adam Williamson + Fedora Nathanael Noblet + + + +Deputies: +--------- + +See DEPUTY for more details on the various roles. + + Compile Checkers + + Devel Distro Testers + + Device Compatibility List Maintainer + + Documentation Page Maintainers + + Downstream Monitors + + External Link Maintainers + + Purity Advisors + + Tech Support Liaison Officers + + Windows World Spies diff -Nru barry-0.14/bash/bjavaloader barry-0.0.20110506/bash/bjavaloader --- barry-0.14/bash/bjavaloader 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/bash/bjavaloader 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,73 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh +# +# bjavaloader(1) completion by Ryan Li + +have bjavaloader && +_bjavaloader() +{ + local cur prev + local cmd + declare -i cmd + + COMREPLY=() + cur=`_get_cword` + prev=${COMP_WORDS[COMP_CWORD-1]} + + cmd=0 + + for (( i = 0; i < COMP_CWORD; ++i )); do + case ${COMP_WORDS[$i]} in + @(dir|deviceinfo|load|wipe|save|erase| \ + eventlog|cleareventlog|logstacktraces|screenshot|settime)) + cmd=1 + ;; + esac + done + + if [[ "$cur" == -* ]]; then + if [[ $cmd -eq 0 ]]; then + COMPREPLY=( $( compgen -W '-h -p -P -v' -- "$cur" ) ) + else + case "$prev" in + dir) + COMPREPLY=( $( compgen -W '-s' -- "$cur" ) ) + return 0 + ;; + wipe) + COMPREPLY=( $( compgen -W '-a -i' -- "$cur" ) ) + return 0 + ;; + erase) + COMPREPLY=( $( compgen -W '-f' -- "$cur" ) ) + return 0 + ;; + *) + ;; + esac + fi + elif [[ $cmd -eq 0 ]]; then + COMPREPLY=( $( compgen -W 'dir deviceinfo \ + load wipe save erase eventlog cleareventlog \ + logstacktraces screenshot settime' -- "$cur" ) ) + fi + case "$prev" in + -p) + COMPREPLY=( $( compgen -W \ + '$( bidentify 2>&- | sed -e "s/,.*$//" )' \ + -- "$cur" ) ) + return 0 + ;; + load) + _filedir cod + return 0 + ;; + screenshot) + _filedir bmp + return 0 + ;; + *) + ;; + esac +} && +complete -F _bjavaloader bjavaloader diff -Nru barry-0.14/bash/btool barry-0.0.20110506/bash/btool --- barry-0.14/bash/btool 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/bash/btool 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,41 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh +# +# btool(1) completion by Ryan Li + +have btool && +_btool() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + + if [[ COMP_CWORD -eq 1 || "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-B -N -a -c -C -d -e -h -i -l -L + -m -M -n -p -P -s -S -t -T -v -X -z -Z' -- "$cur" ) ) + else + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "$prev" in + -f) + _filedir + return 0 + ;; + -i) + COMPREPLY=( $( compgen -W \ + '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) ) + return 0 + ;; + -p) + COMPREPLY=( $( compgen -W \ + '$( bidentify | sed -e "s/,.*$//" )' \ + -- "$cur" ) ) + return 0 + ;; + *) + ;; + esac + fi +} && +complete -F _btool btool diff -Nru barry-0.14/bash/README barry-0.0.20110506/bash/README --- barry-0.14/bash/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/bash/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,14 @@ +Barry bash autocompletion +======================== + +The scripts in this directory are programmable +completion functions for barry utils used in bash. +To use them, simply copy the files in this directory +except this README file to: + /etc/bash_completion.d/ + +And to load manually, run the following command: + $ . /etc/bash_completion + +Programmable completion is for bash 3+ but is backwards +compatiable with bash 2.05b. diff -Nru barry-0.14/buildgen.sh barry-0.0.20110506/buildgen.sh --- barry-0.14/buildgen.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/buildgen.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,13 +1,59 @@ #!/bin/sh +libtoolit() { + # Different name on the Mac + libtoolize --force --copy || glibtoolize --force --copy +} + doconf() { aclocal -I $1 && \ - libtoolize --force --copy && \ autoheader && \ automake --add-missing --copy --foreign && \ autoconf } +cleangettext() { + rm -f ABOUT-NLS \ + m4/codeset.m4 \ + m4/gettext.m4 \ + m4/glibc2.m4 \ + m4/glibc21.m4 \ + m4/iconv.m4 \ + m4/intdiv0.m4 \ + m4/intl.m4 \ + m4/intldir.m4 \ + m4/intlmacosx.m4 \ + m4/intmax.m4 \ + m4/inttypes-pri.m4 \ + m4/inttypes_h.m4 \ + m4/lcmessage.m4 \ + m4/lib-ld.m4 \ + m4/lib-link.m4 \ + m4/lib-prefix.m4 \ + m4/lock.m4 \ + m4/longlong.m4 \ + m4/nls.m4 \ + m4/po.m4 \ + m4/printf-posix.m4 \ + m4/progtest.m4 \ + m4/size_max.m4 \ + m4/stdint_h.m4 \ + m4/uintmax_t.m4 \ + m4/visibility.m4 \ + m4/wchar_t.m4 \ + m4/wint_t.m4 \ + m4/xsize.m4 \ + m4/libtool.m4 \ + m4/ltoptions.m4 \ + m4/ltsugar.m4 \ + m4/ltversion.m4 \ + m4/lt~obsolete.m4 \ + po/Makefile.in.in \ + po/Makevars.template \ + po/fr.gmo \ + po/stamp-po +} + # # Generates the build system. # @@ -15,16 +61,22 @@ if [ "$1" = "cleanall" ] ; then make distclean (cd gui && make distclean) + (cd desktop && make distclean) (cd opensync-plugin && make distclean) + (cd opensync-plugin-0.4x && make distclean) ./buildgen.sh clean (cd gui && ./buildgen.sh clean) + (cd desktop && ./buildgen.sh clean) (cd opensync-plugin && ./buildgen.sh clean) + (cd opensync-plugin-0.4x && ./buildgen.sh clean) + cleangettext + (cd gui && cleangettext) elif [ "$1" = "clean" ] ; then rm -rf autom4te.cache rm -f Makefile.in aclocal.m4 config.guess config.h.in config.sub \ configure depcomp install-sh ltmain.sh missing \ src/Makefile.in tools/Makefile.in examples/Makefile.in \ - man/Makefile.in INSTALL config.h.in~ + man/Makefile.in test/Makefile.in INSTALL config.h.in~ compile # clean up Debian build trails rm -rf debian/barry rm -f build-arch-stamp build-indep-stamp configure-stamp \ @@ -32,32 +84,77 @@ tools/bcharge # clean up ctags trails rm -f src/tags tools/tags examples/tags \ - gui/src/tags opensync-plugin/src/tags + gui/src/tags \ + desktop/src/tags \ + opensync-plugin/src/tags \ + opensync-plugin-0.4x/src/tags elif [ "$1" = "ctags" ] ; then echo "Building ctags..." (cd src && ctags -R) (cd tools && ctags -R) (cd examples && ctags -R) (cd gui/src && ctags -R) - (cd opensync-plugin/src && ctags -R) + (cd desktop/src && ctags -R) + if [ "$2" = "0.22" ] ; then + (cd opensync-plugin/src && ctags -R) + fi + if [ "$2" = "0.4x" ] ; then + (cd opensync-plugin-0.4x/src && ctags -R) + fi # and one with everything ctags -R -f ~/tags-barry --tag-relative=yes - # add opensync library as well (yes, I know this only works for my - # setup... sorry) :-) - #OS_DIR=~/software/opensync/svn - OS_DIR=~/software/opensync/0.22 - if [ -d $OS_DIR ] ; then - echo "Detected opensync source tree, building ctags on it..." - (cd $OS_DIR && ctags -R -a -f ~/tags-barry --tag-relative=yes) + + if [ "$2" = "0.22" ] ; then + # add opensync library as well (yes, I know this only works for my + # setup... sorry) :-) + #OS_DIR=~/software/opensync/svn + OS_DIR=~/software/opensync/0.22 + if [ -d $OS_DIR ] ; then + echo "Detected 0.22 opensync source tree, building ctags on it..." + (cd $OS_DIR && ctags -R -a -f ~/tags-barry --tag-relative=yes) + fi + fi + + if [ "$2" = "0.4x" ] ; then + OS_DIR=~/software/opensync/git + if [ -d $OS_DIR ] ; then + echo "Detected 0.4x opensync source tree, building ctags on it..." + (cd $OS_DIR && ctags -R -a -f ~/tags-barry --tag-relative=yes) + fi fi else #autoreconf -if --include=config #autoreconf -ifv --include=config - # autoreconf doesn't seem to support custom .m4 files in config/ (???) - # so... do it ourselves + # Autogenerate the gettext PO support files + # Do this for ./ and gui/ + autopoint + (cd gui && autopoint) + + # If we let autoreconf do this, it will run libtoolize after + # creating some or all of the configure files. For example, + # it might copy files into ../m4 again while processing the + # opensync-plugin/ directory, making those files newer than + # the gui/configure file. This will cause configure to + # be regenerated (incorrectly) during the make step on some + # systems (Fedora 11). + # + # So... we do the libtool stuff all at once at the beginning, + # then the rest. + libtoolit m4 + (cd gui && libtoolit m4) + # note that gui gets its own m4 via autopoint, while + # desktop does not use it + (cd desktop && libtoolit ../m4) + # the plugins always have their own m4's + (cd opensync-plugin && libtoolit m4) + (cd opensync-plugin-0.4x && libtoolit m4) + + # Now for aclocal, autoheader, automake, and autoconf doconf m4 - (cd gui && doconf ../m4) - (cd opensync-plugin && doconf ../m4) + (cd gui && doconf m4) + (cd desktop && doconf ../m4) + (cd opensync-plugin && doconf m4) + (cd opensync-plugin-0.4x && doconf m4) fi diff -Nru barry-0.14/ChangeLog barry-0.0.20110506/ChangeLog --- barry-0.14/ChangeLog 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ChangeLog 2011-05-06 12:20:16.000000000 +0000 @@ -1,3 +1,1485 @@ + Note: As of version 0.18.0, all change history is now in git. + Please see the git repository and commit history for details + about what changed and who changed it. + + +Release: version 0.17.0 - 2011/02/10 +------------------------------------------------------------------------------ +2011/02/08 + - lib: added Connector base class and DesktopConnector class + These classes manage connecting and reconnecting to a device. + Too much technical knowledge was required in the application + in order to successfully connect and reconnect on all devices, + such as in the plugins when refreshing the dirty flags. + Pauses and rescans were needed in some cases. This knowledge + belongs in the library, not the application. +2011/02/07 + - lib: fixed bug in Contact parser that caused old RecordIDs / UniqueID + to be stored in the Unknowns list, which when copied + and added to the device again, would build up and potentially + cause conflicts. + In some cases, when adding a record with multiple + RecordIDs, and if one of the IDs already existed in the + BlackBerry device, then the device would get into an + inconsistent state and end up with an un-deletable record, + and every attempt to edit it would give the message: + "Address updated externally. Changes will be lost and the + viewer closed" + This would also cause an inconsistency in the Record State + Table record count and the actual count retrieved during a + database backup. + The only way to recover would be to restore from a known + good backup, which will erase the existing database and + start fresh. +2011/01/21 + - build: added Debian Lenny's copy of pkg.m4 + New versions of pkg-config's autoconf m4 files set the + variables PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR as + precious... which means that configure caches the original + values and our subdir overrides are lost. This copy of + pkg.m4 overrides whatever is on the system, and avoids + such preciousness. +2011/01/20 + - doc: updated doc/www website docs in preparation for release + - updated copyright dates for 2011 + - lib: fixed bug in MIME parsing with more than 2 BEGIN levels + Some events have an ALARM as well, which makes 3 BEGIN + levels, which broke the parsing that assumed only 2. + - lib: added date-only parsing to TzWrapper + - lib: added all-day event support to MIME vEvents + This allows all-day event syncing as well, in both plugins. +2011/01/18 + - ppp: applied Jason Thomas's ppp chatscripts for Optus and Vodafone AU +2011/01/18 + - udev: added ENV{ID_PDA}="1" to 69-blackberry.rules for Fedora 14 + Thanks to Nathanael Noblet for tracking this down. +2011/01/14 + - lib: fixed bug in vformat.c _fold_lines() when QUOTED-PRINTABLE + is in use +2011/01/07 + - merged zsh completion scripts (btool,btardump) from Nicolas Vivien +2010/12/31 + - merged translation and general bug fixes from Nicolas Vivien + - lib: merged Nicolas Vivien's BlackBerry.alx parser + - lib: changed pointer handling in src/a_*.h to use shared_ptr<> + - ppp: added barry-minimal, which may help in the case of + "Could not determine local IP address" errors +2010/12/24 + - lib: cleaned up Clear() functions in all record classes + Primarily fixed some missing variables. + - lib: added record parser for the Content Store database + - tools: added simple output mode to bio for Content Store + This supports extracting files and photos from Content Store. + - lib: fixed display bug in Date's operator<< + - lib: added HomeFax, MobilePhone2, and Nickname fields to Contact + - lib: tweaked tarfile.cc so it skips all directory names instead + of throwing exceptions... this allows reading of tarball + backups that may have been created by tar or perlbarry's + ipd2tgz tool +2010/12/21 + - tools: added bio command line tool, Barry Input / Output + Supports IO for devices, tar backups, boost, ldif streams, + mime streams, hex and human dumps, and sha1 output +2010/12/19 + - lib: fixed capitalization API consistency in pin.h +2010/12/13 + - tools: fixed StartParser/EndParser bug in brecsum and bfuse + These calls are not used or called by the library anymore. + - lib: added DBDataBuilder class, to make it easy to wrap a DBData + object in a builder for APIs that need it + - lib: added DeviceParser class, which behaves like a parser + in that it accepts incoming DBData blocks, but instead + of parsing them, writes them to the device. + Therefore to copy: DeviceBuilder -> Pipe -> DeviceParser +2010/12/07 + - tools: added -i charset support to btardump +2010/12/04 + - lib: add ALX parser by Nicolas VIVIEN + - lib: add browser bookmarks parser by Nicolas VIVIEN + - tools: added -V option to btardump by Nicolas VIVIEN, to output in the new + MIME vformat mode for records that are supported +2010/12/02 + - doc: clarified btardump help, and added btardump.1 manpage +2010/11/30 + - lib: fixed but in Messages parser, which used CheckSize() + inappropriately + - lib: added Data version of TarFile::ReadNextFile() (optimization) + - lib: allow Packet class to override receive buffer on the fly + - lib: added Data::Append() + - lib: substantial cleanup of the Builder API, removing the + Retrieve() and BuildDone() steps, and using just + BuildRecord() and FetchRecord(), depending on whether + the caller needs offset support or not. + In this change, the TarFile Data optimization is used. + - lib: another API change, for Parser, removing StartParser() + and EndParser() + - lib: optimized Mode::DBLoader to allow application level data buffers + - lib: added DeviceBuilder class, which gives a Builder interface + to reading records directly from a device + - lib: added a swath of new parser assistant classes: HexDumpParser, + RecordParserBase, NullStore<>, DumpStore<>, MultiRecordParser, + AllRecordStore, AllRecordDumpStore, AllRecordParser, + and TeeParser + - examples: added pipedump.cc to demo how to use some of the new + builders, parsers, and pipe class + - tools: added btardump for parsing backup files from command line +2010/11/16 + - doc: clarified btool -X in its man page +2010/11/09 + - doc: updated Fedora's RPM git repo URL +2010/11/02 + - added library dependency info to pkg-config .pc files + - cleaned up constructor and initialization order and pointer + issues found by the automatic API tester at: + http://linuxtesting.org/upstream-tracker/versions/barry.html +2010/11/01 + - lib: fixed header bugs + - maint: added abi checker scripts and config +2010/10/28 + - changed the versioning sheme for Barry, updating doc/VersionNotes, + src/Makefile.am, and ChangeLog + - updated maintainer scripts to support 3-number versions +2010/10/20 + - lib: simplified parser and builder API, using the new DBData class + This also updates the DBData class to support copy-on-write + in construction, to avoid copies wherever possible. + Also, this patch affects a lot of code, and it is all + updated at once. +2010/10/18 + - lib: removed needless data copy in Socket::Packet() + - lib: moved command/response buffers into Desktop class itself + - lib: added DBData and DBLoader... these classes make it possible + for the programmer to control the database record loading + process, instead of using the parser callback mechanism... + this is the beginning stage of adding generic data flow + channels to Barry, to hopefully make it easy to pass + data from backup files to devices, from device to device, + from backup to backup, and more +2010/10/14 + - lib: fixed timeout mismatch behaviour between USB and Router + The default timeout (-1) for usbwrap is about 30 seconds, + while the default timeout (-1) for the DataQueues used + by the Router is forever. The router now accepts a default + read timeout of its own, and defaults to the same 30 + seconds as usbwrap. +2010/10/13 + - a number of build tweaks for compiling command line tools + on Windows +2010/10/07 + - made bcharge more flexible... Dual mode is not the default anymore, + since newer devices seem to present themselves in a sane + manner via USB. Instead -o and -d only happen if specified. + This patch also adds a new option, -g, which will set dual + mode only if Interface Class 255 (database) is not found. + Also updated the udev rules to use -d and -g as appropriate. + - reverted commit c7685942140b123bf110e755ce11a97c3c6372f7 (the + UnrouteableReadError patch) since it was discovered that + usb bulk reads of 0 bytes are possible and valid +2010/10/05 + - doc: added note about --with-libintl-prefix=/opt/local/ on Mac OSX + Thanks to Toby Gray for reporting this. +2010/10/04 + - merged from Toby Gray: + - missing header in builder.h + - added try/catch in SimpleReadThread() + - added fallback to set_altinterface() in probe + - added gettext.h convenience header to support --disable-nls + Toby Gray discovered that when --disable-nls is used or + on systems that do not support well, it + is recommended to use the gettext.h header as specified + in the gettext documentation: + http://www.gnu.org/software/gettext/manual/gettext.html#lib_002fgettext_002eh + This commit adds gettext.h to both tools/ and the gui/ + - lib: added Builder::BuildDone() to make the multiple-call + possibility of Retrieve() more explicit + - lib: added Pipe class to join builders and parsers together +2010/10/02 + - lib: added start of libbarrybackup, and copied tarfile support + from gui + - lib: added DBName support to parsers and builders + - lib: added BackupError and RestoreError exceptions + - lib: removed the dbId from Builder::Retrieve() + - tools: changed parser/builder auto_ptr to shared_ptr + - added libbarrybackup*.pc file to install target + - lib: added EndOfFile() to Builder + - lib: added Backup parser and Restore builder classes + These classes are based on the backup and restore logic of + the GUI's DeviceIface.cc code, but made general. + - tools: added tar backup option to btool (!) +2010/10/01 + - lib: cleaned up missing BXEXPORT / BXLOCAL flags for exceptions + http://gcc.gnu.org/wiki/Visibility + - lib: fixed build bug where GCC visibility flags were missing from + the libbarrysync library + - merged clear halt fixes from Toby Gray, which should make it + possible to use Barry and usb-storage at the same time +2010/09/30 + - merged build fixes from Toby Gray + - merged UnroutableReadError exception patch from Toby Gray + - moved platform specific detail into tools/platform.h +2010/09/21 + - merged constant and timeout fixes from Toby Gray + - lib: added belt-and-suspenders fix to usb Read functions + This is to avoid the possibility of inappropriate asserts +2010/09/20 + - removed ppa_build.sh per request by Martin Owens + - debian: added autopoint to build deps + The new Debian Squeeze and Ubuntu Maverick have split out + the autopoint script from the gettext package. On systems + with gettext 0.18 or newer, we require autopoint, and hope + that autopoint depends on gettext. +2010/09/19 + - further split up the m4 directories to make the submodules + yet more independent + - debian: added back the autoreconf targets, but not cleanup targets +2010/09/18 + - debian: remove all autoreconf and cleanup targets + Having the debian/rules files try to manage their own + autoreconf is too much of a headache. Binary packages + should start with a valid autoconf and gettext / autopoint + system already in place. + This patch removes any temptation to believe otherwise. + If you have been building source packages from git + already, just add a call to "./buildgen.sh" before your + debian binary build. + - maint: overhaul of release / test build scripts + Made scripts configurable by user, in case others have + chroot build systems of their own. +2010/09/16 + - debian: updated rules to allow for building with an external debian/ + - applied Martin Owens' patch to add a debian directory to + the opensync-plugin-0.4x plugin + - debian: moved 0.22 plugin packaging to its own directory +2010/09/15 + - set AC_CONFIG_AUX_DIR to [.] instead of parent directory, to make + the submodules more independent + - lib: fixed Makefile.am to install semaphore.h and scoped_lock.h + This is needed for the raw channel code. +2010/09/11 + - added -A option to bjavaloader save +2010/09/07 + - added hardware contribution section to AUTHORS +2010/09/03 + - merged Toby Gray's and Adrian Taylor's RAW channel support code + - updated debian binary package with brawchannel and examples and + ppp chat scripts as docs + - updated rpm barry.spec with brawchannel and ppp README +2010/08/31 + - os4x: optimized dirty flag clearing + Clearing the dirty flags on newly updated records requires + a reconnect, but it only requires one reconnect, and no + reconnect it needed if nothing is written to the device, + so skip the reconnect whenever possible, which makes syncing + much faster +2010/08/30 + - lib: use thread-safe getpwuid_r() in config file code +2010/08/18 + - fixed build bug, where libbarrysync was still used even if glib2 + was not found on the system. Thanks to Eric Arseneau + for finding this during his Mac build testing. + - added LTLIBINTL and LTLIBICONV to tools/Makefile.am for systems + that have separate libraries for these features, such as + the Mac + - buildgen.sh calls libtoolize and glibtoolize now (Mac support) +2010/08/15 + - lib: fixed bug in ISO timezone detection... must be in [-+]HH[:]MM + format, with 2 digits for the hours and minutes +2010/08/12 + - lib: added better ISO timestamp support... Now handles timestamps + with dashes and colons, including timestamps with their + own timezone offsets + - lib: fixed vsnprintf() error check bug in log.cc... and added + code to allocate memory if message is too long for + static buffer +2010/07/29 + - applied patch from Martin Owens fixing version dependencies in + debian binary packages +2010/07/22 + - gettext: removed autogenerated files and generate them in buildgen.sh + Not sure if the version will matter, but since gettext 0.17 + is the only gettext version in common use (Ubuntu 10.04 + doesn't even have 0.18 yet) we'll stick with it for now. + Hopefully 0.18's autopoint is smart enough to update things + automatically. I don't have 0.18 to test with. +2010/07/21 + - applied Nicolas Vivien's compile fix and French translation patches +2010/07/20 + - sync: added 1 second wait during Reconnect() to let firmware settle + This seems to help prevent the firmware hang fixed yesterday, + which ultimately speeds up the whole sync + - os4x: reverted run-as-process undo commit... now runs as process + again... I believe the timeout was the firmware issue, not + an opensync issue +2010/07/19 + - lib: added ability to do a USB ClearHalt() from socket level + - lib: added ability to override USB default timeout from controller + - sync: added workarounds for firmware hang issue + This workaround overrides the timeout due to a firmware + issue: sometimes the firmware will hang during a plugin + Reconnect(), during the shutdown stage when the plugin + attempts to update the device's dirty flags. When the + device hangs like this, it fails to respond to a + Desktop::Open(). To work around this, we set the default + timeout to 15 seconds so that we find this failure early + enough to fix it within opensync's 30 second timeout. + Then if we get such a timeout, we do the Reconnect again and + hope for the best... this often fixes it. +2010/07/17 + - lib: added tm_to_iso() to tzwrapper functions + - lib: vbase now has default implementation of vTimeConverter (was + vTimeZone) with a simpler API, based on TzWrapper underneath + - lib: pulled in os4x vbase code, so both plugins are using one + set of vformat code + - lib: added vtodo and vjournal vformat support from os4x plugin + - deb: added new libbarrysync library to debian binary package + - tools: added -V option to btool, to output in the new MIME vformat + mode for records that are supported +2010/07/16 + - lib: added BARRY_GCC_FORMAT_CHECK() for printf() style arg checking + - lib: added C-style BarryLogf() function for internal use + - libsync: moved vformat-related code from os22 to library + - lib: included tzwrapper in Barry and Barrified the namespace +2010/07/13 + - os4x: undo run-as-process setting, since some tests indicate that + sync will timeout +2010/07/10 + - ppp: copied barry-sprint to barry-telus, which also works + Thanks to Matt McGirr who confirmed it works with Telus + - os4x: run plugin as process... other opensync plugins seem to run + better with this, and it seems like a good idea to isolate + plugins as much as possible +2010/07/08 + - fixed bug in both opensync plugins where they would attempt to + access a database, even if it was disabled in the config. + Thanks to R. Brent Clements for reporting this bug. +2010/06/26 + - added Pete Zaitcev's usbmon-6, with some minor changes to + remove root requirements and pretty up the hex dump format +2010/06/12 + - applied chat scripts for Orange Spain from Adrian Gibanel + - updated debian and rpm packages with new chatscripts +2010/06/04 + - os22: ported Nicolas Vivien's multi-calendar patch to 0.22 plugin + From commit: eb4d68df8d06f734e79e13ea05f7755aa5b0a5f3 + This patch is untested with multiple calendars as I don't + have a device for such testing, but is identical to + the 0.4x plugin code. +2010/06/03 + - doc: added wireshark USB capture method to USB-capture.txt + - lib: added GetStore() access function to RecordParser template class + - lib: Improved the record class operator<() member functions, basing + the sort order on multiple fields in many cases. This should + produce a fairly stable sort for a given data set, regardless + of RecordId. This should be useful for scripted tests. + - tools: Added -I command line option to make use of new sort order + - man: Updated btool manpage +2010/05/29 + - applied 3 patches from Nicolas Vivien that add: + - Calendar - All parser + - special handling for syncing of multiple calendars + - compiler fixes + - lib: updated src/s11n-boost.h with new CalendarID and CalendarAll + - lib: refactored Calendar*::Dump() functions + note: this introduces a change in my earlier policy that + avoided virtual functions in the record classes... + the duplicate code overhead is just too heavy, and + I think I was wrong to be afraid of virtual functions + in containers anyway... vive la virtual! :-) +2010/05/28 + - rpm: added Fedora 13 support, and cleaned up conditionals + - udev: fixed permissions issue, so device shows up in lsusb + output even for users not in plugdev + - applied two patches from Nicolas Vivien, one fixing a precision + bug in BuildField() and another adding a 64bit BuildField() +2010/05/13 + - lib: fixed compile error in j_message.h + Thanks to Raymond Blostein for the bug report and the + link to the explanation of the C++ standard change: + https://bugs.launchpad.net/inkscape/+bug/522327/comments/1 +2010/05/11 + - ppp: cleaned up ppp options files and put notes in README + Thanks to feedback from Matt Machado for Rogers specific + notes, and for recommendation to have one copy of + comments for the PPP options. +2010/04/19 + - lib: added LDIF mapping support for Contact::Image fields + - lib: fixed signed extension bug in base64 encoder + - sync: ported Photo support from 0.4x plugin to 0.22 plugin +2010/03/30 + - updated Fedora and Mandriva maintainer info +2010/03/18 + - added chat script for FIDO from Sujay D'Souza +2010/03/11 + - added Probe::Find(), for simple searching of probe results +2010/02/09 + - added message during restore, to let user know that the erased + database was restored (requested by Pierre Pietri) +2010/01/29 + - added product ID 8001 (Pearl Flip) to udev rules +2010/01/26 + - examples: added dbdump.cc example for extracting database data + - bumped the copyright dates for 2010 + - added F12 build target to maintainer scripts + - added missing BXEXPORT to src/configfile.h that shows up + on ubuntu 7.10 + - added headers to sources list in src/Makefile.am, since header + changes didn't always cause a library rebuild +2010/01/15 + - updated barry.spec to install 69-blackberry.rules on Fedora 12 + note that this further breaks the opensuse build, but + that is not currently supported anyway, due to lack of time + - doc: added notes on tools to use for building RPMs in homedir +2010/01/04 + - udev: added 69-blackberry.rules for Fedora 12 systems. Thanks + to Nathanael Noblet (list email dated 2009/12/30) + for hunting this down! +2009/12/15 + - lib: added operator==() to ProbeResult, and operator!= to Pin + - os22: fixed bug while loading opensync config file (may not load + the pin number correctly, or may rely on luck) + - added 'addmemo' example, to test newline behaviour + - lib: Memo::Dump() now translates \r chars into prettier output + Requested by Michael Brown + - doc: added some notes on how to tether via Bluetooth +2009/12/04 + - tools: added libbarry to bdptest build (needed on opensuse?) +2009/12/03 + - lib: added GetKey/SetKey support in GlobalConfigFile +2009/12/02 + - gettextize BarryBackup by Nicolas VIVIEN + - lib: added support for a global config file + Barry::ConfigFile now supports a per-device configuration (as + usual) as well as a global config file. Both are loaded + by default, but they can be saved and loaded separately. + This new global config file is for global defaults, + preferences, etc. + - lib: added IsVerbose() API call + - lib: added VerboseLogging setting to global config + - lib: made Probe results more storage friendly +2009/11/27 + - made Barry::Init() safe to be called multiple times + - added Barry::Verbose() for controlling debug output on the fly +2009/11/26 + - moved the Pin and ConfigFile classes from gui/ to the library + - Probe now loads ConfigFile's device name if available +2009/11/24 + - added '-P' password option to upldif tool, and updated manpage + including applying Nicolas Vivien's bugfix patch + - applied Nicolas Vivien's "NOT_ENOUGH_MEMORY" javaloader patch + - added gettext support to RPM and DEB packages +2009/11/19 + - gettextize by Nicolas VIVIEN +2009/10/02 + - doc: added list of reasons why to submit patches, and notes + on how to create a forked tree on repo.or.cz +2009/10/01 + - removed redundant library dependencies from autoconf build + - version bump: + - configure.ac + - src/Makefile.am + - src/version.cc + - gui/src/BackupWindow.cc + - Doxyfile + - rpm/barry.spec + - debian/changelog + - opensync-plugin/src/barry_sync.cc + - opensync-plugin-0.4x/src/barry_sync.cc + +Release: version 0.16 - 2009/10/01 +------------------------------------------------------------------------------ +2009/09/30 + - added PNG generated icon based on SVG source files + - added barry logo to barrybackup-gui Debian and RPM packages + - applied new barry logo and icon from Martin Owens + - gui: use short barry URL in About box + - gui: fixed bug where actual finished records were overwritten + with the starting total... don't overwrite the actual + with the estimated + - gui: added thread state, to determine what operation finished + Also improved status message, specifying exact operation + - gui: added code to check that actual # of backed up records + matches the total number reported by the device, and + display a warning to the user if they don't match + - www: added known issue about international chars and protocol change +2009/09/29 + - os4x plugin: updated for the pkgconfig libopensync -> libopensync1 + rename + - added bjdwp.1 manpage + - added bjdwp and manpage to rpm and debian packages + - added bash and zsh completion scripts to debian & rpm packages +2009/09/26 + - gui: fixed status text during restore (said "Backup" instead + of "Restore") +2009/09/24 + - updated various URLs to point to netdirect.ca + - lib: moved vSmartPtr<> from opensync plugin code to main library + - lib: fixed memory leaks in vSmartPtr (doh!) + - lib: added vLateSmartPtr<> for setting of FreeFunc after construction +2009/09/18 + - updated opensync 0.4x plugin to compile against latest SVN + - removed unneeded osync_error_unref() from get_sync_info() + - updated plugin to support the new OSyncError** arguments + scattered all over the code +2009/09/17 + - added IRC info to contact www doc page +2009/09/16 + - changed all the ancient SYSFS{} keynames into ATTRS{} keynames + in all udev rules files + - added udev rule for BB Tour Product ID 8007 + Thanks to Theodore Charles III for testing and suggested + rules. + - removed obsolete duplicate SUBSYSTEM keynames from udev rules + - created new cross-distro udev rules set, with documentation + in udev/README + - updated deb and rpm package rules with new udev rules set + note: opensuse needs work +2009/09/15 + - merged Josh Kropf's brimtrans fix: 59abfa6959eb350221fa56a03ba5816 + - applied bash-completion scripts by Ryan Li +2009/09/14 + - merged Josh Kropf's compile fixes + - applied zsh missing bracket patch from Ryan Li +2009/09/11 + - merged Nicolas Vivien's debug parser lib updates + with change: + - fixed API spelling typo and capitalization + - added firmware upgrade to TODO list + - added checks for pthread function errors in Thread class + - moved #defines out of public dp_codinfo.h into dp_codinfo.cc + Applications probably don't care about these. + - changed string arguments to const references + - added STL-style typedefs to list classes to make looping easier + and easier to change types if needed + - added libbarrydp as dependency for libbarryjdwp + - replaced direct cout usage with dout() in dp_codinfo.cc + - added Barry::Init to bdptest.cc, defaulting to verbose + mode, to keep the same behaviour as expected + - use more generic std::istream in dp_codinfo, instead of ifstream + - use references with iterator looping to avoid copies, and + use const where appropriate + - added typedef for j_server.cc's ConsoleCallbackType + - tightened up member variable init and cleanup in JDWServer class + - added exceptions in JDWServer class where marked TODO + - made setup sequence dependent on previous steps, in acceptThread, + so that the logic doesn't assume success where it could + have failed +2009/09/10 + - added copyright notices to all source files in bjdwp/ + This is based on the initial README included in + the patches from Nicolas Vivien stating that bjdwp + was under the GPL. + - added GPL license as file bjdwp/COPYING, since bjdwp is + somewhat standalone, like the plugins and the gui + - bjdwp: removed jdwplog() in favour of identical barryverbose() + - bjdwp: moved into main tree from bjdwp/ and created two new + libraries: libbarrydp and libbarryjdwp +2009/09/09 + - fixed potential loss of serial data during PPP init + when seding the AT test, usually the OK response is + sent to the callback, but if the expected non-serial + response doesn't appear, the OK is lost... this fix + passes the OK to the callback, which fixes some chatscript + behaviour + - gui: updated web documentation and screenshots +2009/09/08 + - changed wording on GUI reload button to clarify what it does + - added documentation on how to change the theme for GTK+ apps + when not using the Gnome desktop environment + - fixed broken links in web doc generation +2009/09/05 + - applied backup GUI patches from Ryan Li: + - resolved crash while disconnecting from no devices + - added confirmation dialog before quitting + - gui: handled case where the user exits via window manager Close + button + - also refactored 'working' confirmation logic +2009/09/04 + - fixed socket RawReceive verbose log message + when reading from the default queue, the queue knows the + endpoint, not the socket object +2009/09/03 + - added version output when -v is used in pppob +2009/09/02 + - fixed syncing of 8 contact phone numbers. Reported by + Ian B. MacDonald, 2009/08/22 + - ported above syncing fix to opensync 0.4x plugin + - applied Martin Owens' Barry logos 'patch' +2009/09/01 + - applied chatscript patch from Andrew Nording + Sourceforge tracker #2848549 + - added KPN chatscripts to DEB and RPM binary packages + - added KPN to script list in doc/www/modem.php + - pulled from Nicolas Vivien: a909925ef6bf3d75b1597a9ddd16f52201690cbb + Fixes for library and bjdwp documentation + - moved bjdwp/doc/* to doc/bjdwp/ to keep docs in one spot +2009/08/31 + - pulled from Nicolas Vivien's repo.or.cz repo: bjvmdebug support + With rebase changes and fixes to library. + Fixes to library: + - fixed buffer size checks in m_jvmdebug.cc + - used #defines instead of hard coded numbers where possible + - added FIXME to tidy up the Unknowns in the API + - commented out Mode::Close(): not convinced that applications + should have to worry about socket-level details + - added #define for JVM STOP command + - removed unused Socket::PacketJVM() functions + - made sizeof check in JVMPacket::Size() more specific + Rebase changes: + - removed executable chmod bits from BarryDemo java samples + - removed copyrighted Sun documentation from bjdwp/doc/ + - fixed longstanding buffer size check bug in CheckSize() + - updated AUTHORS + - applied Ryan Li's latest threaded GUI patch (2009/08/25 email) + - gui: added a wrapper around pStatusbar->push() to avoid + the never ending push syndrome + - gui: added PIN to the "please name new device" dialog + - gui: added statusbar workaround: normally the statusbar shows + Ready after initialization, but since the initial Scan() + happens right away, and the statusbar doesn't seem to + update the screen until the handler is finished, + we update the status bar during init instead +2009/08/30 + - applied Martin Owens' ppa_build.sh patch + - added version output when -v is used in btool + - changed USB verbose bus tree dump (i.e. btool -v) so the + hex/decimal values look more like lsusb -v output, + for ease of debugging +2009/08/29 + - version bump: + - configure.ac + - src/Makefile.am + - src/version.cc + - gui/src/BackupWindow.cc + - Doxyfile + - rpm/barry.spec + - debian/changelog + - opensync-plugin/src/barry_sync.cc + - opensync-plugin-0.4x/src/barry_sync.cc + +Release: version 0.15 - 2009/08/28 +------------------------------------------------------------------------------ +2009/08/28 + - added binary build for Ubuntu 9.04 to maintainer scripts +2009/08/27 + - added binary build for Fedora 11 to maintainer scripts +2009/08/21 + - updated www documentation for upcoming release + - applied Nicolas Vivien's phone duplication patch (opensync 0.4x) + - fixed missing conflict check in vcard code in opensync 0.4x plugin + - backported new TYPE parsing code from opensync-0.4x plugin to + old opensync 0.22 plugin + - added X-EVOLUTION-UI-SLOT support in both sync plugins to retain + phone number order +2009/08/17 + - added pin and password command line support to bfuse + - updated bfuse man page +2009/07/29 + - added border to barrybackup doc images +2009/07/28 + - updated license and URL in barry.spec + - updated barrybackup Credits dialog to reference AUTHORS file + - updated barrybackup.1 man page + - updated doc/www scripts to generate more dynamic pages, + so subheaders are not hard coded... this helps support + updating the new NetDirect website + - commented out out-of-date docs in hacking.php + - marked milestone 4 complete (javaloader) + - linked device compatibility list from index.php +2009/07/10 + - changed pppob to report if Serial was fallback or command line + - started device compatibility list in web docs +2009/07/07 + - applied Ryan Li's GUI enhancement patches, which let the user + switch devices without restarting, with fixes: + - reorganized BackupWindow.glade for better spacing + - fixed width issue (main window was set to 275 + width, which made things too narrow on Debian + Lenny + - moved buttons beside the drop down box, to + mimic old GUI behaviour + - added space around the middle controls, but + not around the menu bar or status bar, which + should be right against the outer window. + - renamed m_device_num to m_device_count for clarity + - changed m_device_count to unsigned int to fix compiler + warnings + - removed gtkmm call to unset_model() + The function unset_model() is only available in gtkmm + 2.16, and Debian Lenny only has 2.12, and won't compile. + Since set_model() automatically does the unset for us, + just reorganize the calls so Lenny is supported. +2009/07/06 + - applied Ryan Li's SMS clarification patch +2009/07/02 + - added Martin Owens' new Ubuntu PPA link to docs + - added DEPUTY documentation and updated AUTHORS +2009/06/30 + - documentation updates + - added SMS to list of parsers in documentation + - updated sync notes for Fedora 9 and 10 in documentation + - removed Martin Owens' PPA binary package link, since + I can't find the binaries anymore + - reverted commit 2d0e60d1: put hal fdi files back + - updated HAL FDI files for Fedora 11 + - duplicated directory hierarchy under hal + - added 19-blackberry-acl.fdi to add the access_control + capability to blackberry devices when they are + plugged in. As long as this file is under + the 10osvendor directory, then + 20-acl-management.fdi runs after it, adding + the hal-acl-tool callout, which does the low + level getfacl/setfacl work on the /dev/bus/usb/*/* + device file. + related thread: + http://lists.freedesktop.org/archives/devkit-devel/2009-June/000247.html + - changed hal fdi policy to use "pda" instead of "scanner" + - applied Ryan Li's 7-bit GSM conversion patch for SMS records + - applied Ryan Li's barrybackup patch: can now select backup path +2009/06/26 + - fixed install location of hal fdi files in debian and rpm + HAL reserves /usr/share/hal/fdi/information/10freedesktop + for files that the project itself distributes, so + we get to use 20thirdparty. +2009/06/24 + - cleaning up autoconf warnings on Fedora 11 + - changed buildgen.sh to run libtoolize first for all subprojects, + otherwise, a later project's run may copy files into ../m4 + after having created configure for a previous project. + This would cause a makefile discrepency during the build + on some systems (Fedora 11), and cause configure to be + incorrectly regenerated mid-build, due to timestamps. +2009/06/21 + - updated dependencies documentation page +2009/06/20 + - added BadPacket exception, for socket errors that need to meddle + with the response code + - added special case for JavaLoader's Goodbye packet + On older devices, such as the 7750 and 7130, they respond + with a NOT_SUPPORTED error instead of an ACK, for Goodbye + packet commands. This is seen in Windows traffic as well, + so should not be considered an error. Thanks to Josh Kropf + for confirming this protocol behaviour. + - updated socket.cc to use new BadPacket exception where appropriate + - pulled from Josh Kropf: 0f1cca2fa69d0810d439ade4fb3dd0dfa15c89a6 + - fixed size issue with deviceinfo command on 7130 devices +2009/06/19 + - reworked autoconf rules to handle every kind of Boost dependency: + - let user enable/disable from configure, default to + disable, but error if enabled and not available + - let user specify separate include and lib paths, since + some Boost installations have an additional + boost-1.34.1 style directory in them + - default to no path overrides, using system defaults + - let user specify name of serialization library, since + the name of the library can change whether you're + building from source or not + - default to searching for boost_serialization or + boost_serialization-mt, and error if not found + - New configure switches are: + --enable-boost Handles enable/disable + --with-boost-include=path Override the include path + --with-boost-lib=path Override the lib path + --with-boost-serialization=name Override the name of + serialization library + to link with + - updated documentation, build test, and binary packages to use + new switches +2009/06/18 + - added non-backward-compatibility note to man/btool.1 + - applied Nicolas Vivien's LDIF patches, clarifying split + between work and home addresses, and adding support + for the homePostalAddress LDAP field + - fixed missing #includes for Fedora 11. Thanks to + Nathanael Noblet for reporting this. + - applied Ryan Li's PPP chat script for China Mobile + - added barry-chinamobile chat script to RPM and Debian packages + - renamed blacklist-berry_charge to blacklist-berry_charge.conf + for Debian sid and Fedora 11. Thanks to Rodrigo Linfati + for reporting. + - applied Nicolas Vivien's autoconf patch to automatically + search for boost_serialization or boost_serialization-mt +2009/05/12 + - applied Dr. J A Gow's category patches (task + memo) + - fixed compile error when using Boost + - cleaned up Categories handling: + - s11n-boost.h + - Dump() should be consistent across Calendar, Memo, Task + - fixed i18n support to category names + - cleaned up code formatting to match surrounding code + - moved CategoryList to its own class, and removed duplicated + string conversion code + - removed protocol-specific MemoType and TaskType fields from + their corresponding record classes +2009/05/09 + - applied Nicolas Vivien's Task builder patch for the Storm + and Bookmark documentation patch +2009/05/08 + - applied most of Dr. J A Gow's recurring iCal sync patch + - did not include the pure upper case changes, since + it is an RFC bug in SynCE + see http://www.mail-archive.com/barry-devel@lists.sourceforge.net/msg01109.html + - added starttime to RecurToBarryCal() args, to make the + prerequisites clear (StartTime must be determined before + recurrence is parsed) + - added check that COUNT is not zero (RFC requirement) + - fixed timezone drift: using gmtime() + mktime() uses two + different timezones... use localtime() + mktime() instead + - comment resizing + - reformatted if/else FREQ tests into a more readable + sequence, and fixed a logic error in the yearly count + advance, which should only happen when FREQ == YEARLY + - updated AUTHORS +2009/05/06 + - going through www documentation, updating for 0.15 + - updated man/btool.1 with new -a option + - updated TODO list with new reality + - applied Nicolas Vivien's phone call log parser patches + - added CallLog to s11n-boost.h + - added size checks to parser + - removed CallLogType, since it is protocol specific + - added and tidied comments + - made CallLog::Clear() match the class declaration order, + fixed missing member, and used enum names to set + enum defaults +2009/05/05 + - applied Nicolas Vivien's task sync patches, with btool updates + - fixed "VTOTO" typo + - now that there's a Desktop::ClearDatabase() call, + use it in SaveDatabase() to reduce code duplication + - use separate vector<> clearDbNames in btool + to eliminate chance of mixing -d and -a argument + types and losing data + - reverted VNOTE change in vformat.c + - added VFORMAT_JOURNAL support to vformat.c based on + r2795 of the opensync vformat plugin + - fixed some TimeZoneValid flag mistakes in Task and Calendar + - display DueDateFlag in src/r_task.cc + - changed vtodo.cc so DTSTART is only set if available in BB data +2009/05/01 + - applied Nicolas Vivien's zsh patch + - applied Nicolas Vivien's memo sync patch + - added MEMO_TYPE 'm' to built memo record + - updated btool to include new Memo builder + - updated config.rpath to latest from Debian stable +2009/04/27 + - removed free() in tarfile.cc, since some distros have bugs in + th_get_pathname() that doesn't return a freeable string +2009/04/22 + - fixed some missing headers as reported by Christopher Stover + - applied Ryan Li's SMS body null terminator strip patch + - fixed code formatting issues + - added comment on why we're stripping out nulls + - fixed potential single byte buffer overflow + - pulled from Josh Kropf: 8266c95a94 + added "reset to factory" command to bjavaloader + - split creation of deb src tarballs into separate script + instead of tar-create.sh + - added more statements for the m4/ directory in configure.ac + and Makefile.am, attempting to eliminate build warnings + on FC10, as reported by Christopher Stover +2009/04/14 + - applied Nicolas Vivien's sscanf patch (opensync-0.4x) + - wrapped OSyncList in vSmartPtr<> to automatically handle + all calls to new osync_list_free() API + - applied Ryan Li's updated SMS parser patch + - moved SMS metadata structure into its own struct + in protostructs.h + - fixed some endian conversion errors + - added strnlen() call to avoid null terminators in + the Addresses strings +2009/04/10 + - added brimtrans to rpm spec file and debian install +2009/04/09 + - fixed OSyncList* leak in 0.4x plugin from call to + osync_plugin_info_get_objtype_sinks() +2009/04/08 + - added IConvHandle, making it possible to support more than one + charset in Blackberry data + - removed patches from opensync-plugin-0.4x 'make dist' target + - updated buildtest.sh for opensync 0.4x +2009/04/06 + - updated man/bjavaloader.1 +2009/04/04 + - added Product ID 8001 for the Pearl Flip. Thanks to John Ladan + for reporting the new ID. +2009/04/03 + - removed 0.22 opensync patches from 0.4x tree + - applied opensync Photo support patches from Nicolas Vivien + - renamed SequencePacket() to HideSequencePacket() for clarity + This is a temporary measure... this sequence packet + code needs to be cleaned up. + - added Photo support to examples/addcontact.cc + - removed try/catch from vcard/vevent, pending feedback from Nicolas + - applied Ryan Li's SMS record parsing patch + - changed capitalization to match other code + - added Sms to s11n-boost.h and required operator + - added Sms to btool.cc, record.h, and Makefile.am + - added size checks to the parser code + - cleaned up brackets and casting + - made dump output prettier (at least to me) :-) + - added "unknown" state for MessageStatus, as default + - cleaned up whitespace + - updated AUTHORS + - added endpoint override to Probe class while testing the 7130 + When using btool's -e option, the Probe class still + attempted to probe endpoints as it saw fit. +2009/04/02 + - fixed double-free bug in opensync 0.4x plugin + Can only report error or success once in a change. + - updated buildgen.sh to handle ctags for multiple opensyncs + - fixed inverted logic when doing a hashtable slowsync (opensync 0.4x) + - fixed uninitialized osync_trace args in both vformat.c files +2009/04/01 + - opensync 0.4x changes due to upstream API updates + - removed idmap and cache code, in favour of opensync's + uid mapping and hashtables respectively +2009/03/31 + - opensync 0.4x changes due to upstream API updates + - removed deprecated opensync header + - updated 0.4x plugin to use new slow-sync API + - updated 0.4x plugin to use new function registration and + user data API + - updated 0.4x plugin to use new sink list (API change) +2009/03/27 + - changed PIN format from decimal to hex in opensync-0.4x plugin + config + - added special case so photo data does not print raw in btool dumps + - fixed call to trace.logf() in plugin code... should never call + a printf-like function unless you use a constant "%s" + - made opensync-0.4x:vformat.c's base64 routines const-correct + - fixed free()-crash bug in both vformat.c files + When generating the resulting VCARD data, vformat.c assigned + static strings to a dynamic heap list pointer, and the + later free always failed. + - merged some changes from Jose Sogo's Debian package work + - menu changes to conform with policy + - renamed opensync plugin package name to match Debian + - added Nicolas Vivien and Josh Kropf to debian/copyright + - fixed uninitialized variable in SocketZero + - fixed memory leak in tarfile.cc + - fixed uninitialized time struct in bjavaloader.cc (valgrind error) +2009/03/24 + - fixed typo in zsh/_bjavaloader thanks to feedback from Nicolas V. + - pulled from Josh Kropf: 75b1a89e8b1eb9d89bcd8b5ecbed9a47af5a8930 + added logstacktraces support to bjavaloader + - updated TODO list with "- All" database parsing +2009/03/13 + - added git tag signing to maintainer scripts + - added signed tagging to release checklist doc +2009/03/11 + - updated opensync-plugin-0.4x/README with build help +2009/03/10 + - pulled from Josh Kropf: d6c3173ccd87c6223647950963da79331a68d712 + added deviceinfo support to bjavaloader + - pulled from Josh Kropf: 272f371e8bb95b6c41a8293de657da45a782736f + new tool: brimtrans for dealing with RIM USB logs + - pulled from Josh Kropf: 7ed1df560ea7cc6a2205d8f8627c00c7aaed2294 + added wipe support to bjavaloader + - added confirmation step to bjavaloader wipe, so it is harder to + accidentally wipe your device + - applied zsh patch from Nicolas Vivien for bjavaloader wipe +2009/03 + - changes inspired from Rick Scott's XmBlackberry + - event log timestamp is a time_t in milliseconds +2009/03/07 + - added Mode base class for common mode class code +2009/03/06 + - reorganized external links by date and topic, and added link + to Nicolas Vivien's Blackberry on Linux documentation +2009/03/05 + - pulled from Josh Kropf: b3d3a6f48fe008e8842c057df4a653a04b9c56ce + - compile fix when using __DEBUG_MODE__ + - fixed timeout when calling JavaLoader::GetDir on device + with zero modules +2009/03/04 + - fixed embarrassing incorrect exception messages in usbwrap.cc + Fortunately, these didn't affect my timeout testing. + - added Data::QuickZap(), so that usb read errors don't + return old data + - inlined Data::QuickZap() + - added usb_set_altinterface() call to Interface class + This should hopefully workaround the change in 2.6.28 + kernels where set_interface is not called by the kernel + automatically anymore. +2009/03/03 + - applied Nicolas Vivien's opensync-0.4x API patch +2009/02/28 + - applied Nicolas Vivien's zsh patches +2009/02/26 + - added opensync-0.4x to tar-prepare.sh maintainer script +2009/02/24 + - added note about novj option issue in barry-att_cingular + - added gettext to documentation dependency list (for iconv.m4) +2009/02/20 + - clarified bjavaloader save behaviour + - updated bjavaloader man page + - added maintainer/build as exception for test/buildtest.sh + - merge opensync-0.4x branch into master: + 2009/02/20 + - removed nested m4 in preparation for merge into + main Barry tree + 2009/02/18 + - applied Nicolas Vivien's opensync-0.4x + Calendar+Contact patch + 2009/02/01 + - applied Nicolas Vivien's opensync-0.4x + porting update patch + - removed unneeded ChangeLog.osync + - added opensync-plugin-0.4x to top level configure, but not to + binary packages + - added old emails from Ron Gage from 2006 regarding Autotext + and Service Book parsing +2009/02/19 + - pulled from Josh Kropf: 9b63a99867b3314b8d42212cac05a6f28860d37b + - saving large modules in pkzip format + - cleaned up StartStream function; use JLPacket instance + - refactored SendStream; use JLPacket instance and use simple + function for seeking to next cod file in input stream + - made following changes to Josh Kropf's patches + - Added CODFILE_TYPE_SIMPLE check back in + - Minor change of c_str() to data() where a null terminator + is not needed + - Fixed unlikely buffer overflow in m_javaloader.cc + Goal: never trust outside sources of + information (including that from the device) when + managing our own buffers. + - Removed CodFile forward declaration, since class does not + exist anymore + - Fixed typo in configure.ac, and made missing zlib warning + more emphatic + - Added clarifying comment to CodFileBuilder + - Fixed potential reference bug in CodFileBuilder constructor + It is possible that the const std::string& passed + into the constructor is a temporary, so make a copy + of it instead of just holding a reference. + - Removed multi-unget call in cod.cc -- only one unget() is + guaranteed in C++. It appears that the unget is + unnecessary, since the following code seeks to end + and back to beginning anyway. + - Added copyright line for Josh Kropf in cod.cc and + cod-internal.h + - Fixed incorrect zlib check, since zlib doesn't support + pkg-config on most systems yet. Changed it to + use AC_CHECK_LIB, and added a --with-zlib configure + option which will cause configure to halt if + zlib is not available. Added --with-zlib to + binary package builds, and to build test script. + - added zlib to rpm and deb build requirements list +2009/02/18 + - updated USB capture logs archive page with new logs from Josh Kropf + - applied as patch Josh Kropf's annotated javaloader-reset.txt log + - added note about windows registry keys to USB-capture.txt +2009/02/17 + - applied Josh Kropf's patch adding support for forced erase and + load while module in use, properly handling when the + device requests a reset +2009/02/15 + - applied Nicolas Vivien's RecordId patch for Contact class... + this updates Barry to deal with the new record ID behaviour + on the Storm +2009/02/13 + - removed unneeded call to .c_str() in EmailAddress stream operator + - added support for Calendar fields: Organizer, Accepted, Invited + - reorganized the udev/ script directory, based on distro, + and added a specific rules file for openSUSE 11.1 + - updated Debian and RPM binary scripts to point to correct udev files +2009/02/07 + - applied Nicolas Vivien's patch to fix the timeout issue on the + Blackberry Storm +2009/02/04 + - applied Josh Kropf's save module patch + - minor whitespace fixes + - removed unneeded exception (fstream closes files + automatically on exit of scope, or exception) + - fixed compile error with variable sized array... + replaced with std::vector<> instead of memcpy, + in JavaLoader::SaveData() + - commented out an unused variable +2009/02/03 + - commented out AT+CREG? in barry-rogers.chat, since it causes some + Blackberry devices to reboot + - applied Josh Kropf's eventlog and clear eventlog patches + - capitalized JLEventlogEntry fields, to match other + record classes + - use constant when parsing entry + - renamed a define + - sweeping cleanup of record classes and clarified all constant + conversions i.e. whenever converting between a protocol + constant and an API constant, do it through a function, + in case the constants change on the Blackberry side +2009/01/31 + - applied patch of binary VSM file from Robert Yaklin +2009/01/30 + - moved Nicolas Vivien's codfile code into library class API + - this change avoids having packed structs exposed in + installable header files, and gives the library + user an easy way to work with COD files + - added CodFile class + - added JavaLoader::LoadApp(CodFile&) + - cleaned up bjavaloader to use new API + - moved codfile_*_t structs to internal header + - also fixed command line status output when exceptions + are caught (unrelated fix) + - added / updated manpages: bfuse, bjavaloader, btool + - added fuse to build dependencies for rpm and deb packages + - updated web docs, adding libfuse to dependencies page + - added libiconv as well +2009/01/29 + - applied screenshot and zsh patch from Nicolas Vivien + His git log, as posted to the mailing list, was: + Remove bscreenshot binary + Add screenshot option to bjavaloader binary + Add comments in the code + Use defines beside of integer constant + Use b2hons to be compliant with evrywhat host + ZSH scripts completion + Use BMP structs beside of unreadable buffer ! + His changelog notes: + - add command GetScreenShot to JLPacket class + - add JLScreenInfo to protocol structures + - updated AUTHORS + - minor tweaks to Nicolas's screenshot+zsh patch: + - renamed DIR_ENTRY and SS_ENTRY to DATA_ENTRY constant + as suggested by comments + - fixed some packet size checks + - whitespace fixes + - removed unneeded packet.GetReceive(), since response + buffer is the same as what GetReceive() returns + - used AutoClose for fopen() calls in bjavaloader.cc + for exception safety + - removed manual buffer handling in favour of Data object + in JavaLoader::GetScreenshot() + - removed "unknown packet" exception from Socket::PacketData() + I think it is probably better to handle javaloader-level + errors and codes in the JavaLoader class, not the low- + level Socket class. + - added erase and force erase support to bjavaloader, library, and zsh + - force erase is experimental + - applied documentation patch from Robert Yaklin on VSM file format + - did slight formatting changes before applying, for 80 + columns, and set file to unix format instead of DOS + - added links to new USB capture logs from Robert Yaklin to + logs.php doc page + - cleaned up src/Makefile.am, regarding non-install headers + - moved Nicolas Vivien's bitmap conversion code into library API + - added bmp.h api, and moved internal structs to bmp-internal.h + - added size checks and endian conversion to bitmap + conversion code, so this code should run anywhere +2009/01/27 + - added link Josh Kropf's 'Blackberry development in linux' blog + post to doc/www/index.php + - added USB capture log archive page to www docs + - added config.rpath, needed by new AM_ICONV check + Thanks to Bill Paul for debugging this. + - applied Nicolas Vivien's opensync plugin 0.4x patch +2009/01/26 + - added template wrapper for iconv() due to casting differences on + various platforms... thanks to Bill Paul for FreeBSD testing + - added AM_ICONV automake/autoconf check to configure.ac + This should take care of checking for libc or library + iconv installs, and checking the iconv() prototype for whether + const is needed or not. This removes the need for the + template added earlier. +2009/01/25 + - applied patch from Josh Kropf making bjavaloader's syntax more + compatible with the windows version, to make cross + platform build scripts possible + - applied Josh Kropf's settime syntax patch + - clarified timezone behaviour in javaloader settime + - added flag to JavaLoader mode class, so StopStream() is called + automatically in the destructor if not called manually +2009/01/24 + - added another ctor to BadSize exception class + - fixed bug in SocketZero where it checked sequence on packets + from non-zero sockets + - javaloader list mode updates: + - added Dump() code to directory classes + - fixed size issue with JLDirEntry header size define + - fixed size checks in entry parser + - fixed copy before in JLDirectory, now uses vector + - moved bjavaloader's Start/StopStream calls to main() +2009/01/23 + - removed default argument to CheckSize() so all code specifies + the size it really needs + - fixed bug in ParseData() that didn't copy data to receive arg + - adding additional javaloader commands and refactoring + this is a work in progress: + - added JLPacket class, encapsulating javaloader protocol + - added new defines for more JL commands + - refactored socket class, using PacketData() + for JL, and Packet() for Desktop (still needs + some work to be really clean) + - began implementing new commands (SetTime()) + - thanks to Rick Scott for his reverse engineering effort + in XmBlackBerry, which inspired this code + - refactored packet.cc to make JLPacket even tighter + - updated doc/USB-capture.txt with link to vusb-analyzer + Thanks to Martin Owens for the link. + - added a set of be_*() endian swap functions, for big endian data + JavaLoader code seems to use big endian a lot. + - simplified bjavaloader.cc's command line args to make room for more + - cleaned up big endian code to use new be_* swap macros + - added protocol and packet code for directory / subdir commands + - added preliminary directory support to JavaLoader class +2009/01/22 + - reverted experimental handshaking in IpModem, since the session_key + patch fixed Bill Paul's issue + - finished adding IConverter support to r_task and r_timezone + - removed r_message_base.h from doxygen RecordParserClasses group + - removed unused ClassType variable from Task record class + - refactored Calendar and Task record classes, creating new + RecurBase to handle recurrence data + - removed FIXME in Socket::Packet(), since socket is set in Send() + - cleaned up socket handling and comments in packet.cc +2009/01/20 + - applied Nicolas Vivien's javaloader patch, fixing constant defines + and other small fixes + - minor whitespace and spelling fixes to above patch + - changed m_ipmodem.cc to send the session key even without password + which should help reduce the "special packets" coming from + the device. + Thanks to Rick Scott and Andy Herkey. +2009/01/17 + - refactored pthread timeout creation into ThreadTimeout() function + - added experimental handshaking to IpModem. This is in response + to Bill Paul's email regarding what he was seeing in the + logs with the special code packets which we dropped + on the floor. This code is to test whether this handshaking + theory is true. +2009/01/16 + - made maintainer script make-deb-local.sh more robust + - added list of target binary packages in ReleaseChecklist.txt + - changed to more general Fedora link to Chris Stover's packages +2009/01/15 + - applied Andy Herkey's ipmodem password patch for the Bold + - minor fixes to above patch, and in addition to above patch: + - use sizeof(seed), instead of type, in case of future changes + - removed commented out code + - added the null password check back to SendPassword(), + for historical reasons + - removed the null and zero default arguments to + SendPassword(), since they make no sense + - added define for session key size, and added size check + - added missing string.h header to src/m_javaloader.cc + - updated Debian and RPM packages to include bjavaloader +2009/01/14 + - applied Nicolas Vivien's bjavaloader patch + - small fixups to above patch: + - moved cod.h from installable headers to internal headers + - whitespace edits + - copyright statement tweaks + - added blog URLs to copyright list in cod.h where parts + of the structs appear to come from + - removed unused variables to compile with strict settings + - changed char to unsigned char to fix strict compiler + warnings + - removed duplicated a/b from Socket messages, and moved + read/write text to front, in socket.cc + - added NetDirect copyright notice to bjavaloader.cc, since + it is based on btool.cc + - removed unused boost-specific code from bjavaloader.cc + - more fixes to above patch: (bjavaloader.cc specifically) + - moved cod.h back to installable headers, since tools/ + programs depend on it... this should be fixed + or put in the library as a COD-reading API + so that applications don't need to worry about + packed files, etc. + - fixed potential buffer overflow: removed buffer read used + to skip ahead in file, and replaced with fseek() + - changed SendAppFile() to report errors by exception + instead of by return value, which wasn't checked + anyway... and C++'d the file handle closing + - removed unused StateTableCommand, leftover from btool + - added check for unlikely case of COD file being larger + than size_t, breaking the fread() assumption + for the type == 0xC0DE case + - added checks for fread() failures + - fixed compiler warnings when comparing signed/unsigned, + and changed file operation types from plain int + to size_t/off_t + - changes to src/m_javaloader.cc: + - fixed comments to remove Desktop-oriented notes + - moved variables closer to their use point + - removed the duplicated response Data objects in favour + of just one (each default Data object uses 0x4000 + bytes of heap) + - removed manual endian swap in favour of htobl() + - oops... this size field is actually big endian. + Since all Barry code assumes that Blackberry + protocol traffic is little endian, a special + case needs to be added in m_javaloader.cc for + this field. The special case uses autoconf's + endian define. + - fixed long long problem in endian.h (ISO C++ + compilers don't support long long) and made + the bswap() functions always available + - removed unused CommandType and m_commandTable members + - fixed exception error messages to indicate command # + instead of Desktop message + - changed Packet() call to PacketData() when sending + file size, since there is no command + - added eout() data dump to socket::Packet() unknown send error + - fixed my incorrect off_t/size_t check in bjavaloader.cc + - removed the '0' JL_UNKNOWN4 command from src/protocol.h, + since the PacketData() change above now handles that, + and I don't think that byte is actually a command, but + really part of the uint32_t size + - Also fixed one remaining 0 command, to use PacketData() +2009/01/09 + - added AT+CLAC note to contrib/modemtest.rb, recording tidbit + from mailing list + - updated copyright dates for 2009 +2008/12/11 + - fixed missing slash in config sample in doc/www/sync.php + Thanks to sourceforge tracker #2413683 for reporting +2008/12/01 + - added more notes to doc/USB-capture.txt, documenting my kernel + setup for capturing USB traffic, and added size-limiting + kernel patch + - added TODO list item for the Blackberry Storm +2008/11/30 + - moved Product ID constants into a single place (src/common.h) + and updated bcharge + - added Product ID 8007 for the Blackberry Storm... needs testing +2008/11/27 + - applied ppp chat script patch for AT&T Cingular from + Richard Esplin + - added new chat scripts to debian and rpm packages + - added known sources of additional Barry binary packages to index.php + - turned on call/caller graph support in Doxygen output +2008/11/23 + - applied 'patch' of Martin Owens' Content Store documentation + - updated AUTHORS +2008/11/22 + - large refactoring of all message/email record classes, and more + There is now a MessageBase base class, which combines + common email record parsing code in one class. This base + class is reused by all the specific messages record classes. + This commit also includes support for multiple email + addresses per email, as well as giving IConverter support + to all message classes. + - deleted empty *.cc files from project + - updated TODO file, removing opensync i18n bug + - added TODO item for password support in Opensync... try to avoid + storing the password in the sync config in plain text + - fixed dll export bug on ErrnoError exception class + - added BadPackedFormat exception for internal use + - ServiceBook: added IConverter support, and general cleanup + Refactored ServiceBook class and added some experimental + template functions to generalize the FieldLink table + processing. If possible, this needs to be expanded + to the general record classes, to reduce the amount of + code duplication during processing of FieldLinks and + CommonField structures. + Also, ServiceBook deals with packed fields, which should + also be extrapolated for general use, and reused if + possible for the new "Calendar - All" Blackberry databases + that are coming out on the new devices and firmare. +2008/11/21 + - updated man/btool.1 with new -i option + - fixed bug where opensync plugin didn't pass IConverter to Desktop + - added IConverter support to r_calendar.cc + - renamed utf8Needed to iconvNeeded, for consistency + - added IConverter support to r_folder.cc + - added IConverter support to r_memo.cc + - added IConverter support to r_message.cc + - added EmailAddressList, in preparation for multi-address email +2008/11/20 + - changed Parser base class to pure abstract... this is so that + future API changes to the Parse base class will be + detected by the compiler as errors + - added NullParser class, which performs the old Parser function + - changed all FieldLink arrays to static + - added new IConverter class to support converting the Blackberry's + WINDOWS-1252 charset to/from UTF-8 and more + - fixed bug in IConverter that saved end of string instead of + beginning + - reorganized barry.h app header and record.h header, so that + internal builds have fewer dependencies + - large parser/builder API change, adding IConverter support + This change starts at the top (Mode::Desktop) which + takes an optional IConverter object for parsing and + building conversions. The Desktop class passes + this IConverter object to Packet, Parser, and Builder (and + thereby, the corresponding Record classes) as needed. + This adds an extra pointer to a fair number of calls + in the stack, but maintains flexibility without putting + too much of a burden on Parser writers, which could be + application writers. + The primary use of this architecture is to pass in an + IConverter configured to convert to UTF-8... this is + basically the only useful conversion method, but others + are possible if you want to play. + - first record class to support string conversions: Contact + - reverted the barry.h and record.h reorganization, since + the gui depends on it + - reorganized barry.h and record.h again, making inclusion of + the record headers dependent on whether it is a library + build or not + - updated the gui with the parser/builder API change + - added IConverter to opensync plugin, set to UTF-8 +2008/11/13 + - added comment to src/r_contact.h deprecating the Phone field + - updated Doxyfile to 1.5.1 + - added Christopher D. Stover to AUTHORS file as Fedora contact +2008/11/03 + - forgot #include for memcpy/memset in tools/bfuse.cc + - moved bfuse install point from /usr/sbin to /usr/bin +2008/11/01 + - added FUSE filesystem "driver" +2008/10/31 + - commented out the info.subsystem match level in HAL FDI file... + this should let the FDI work on old and new systems. + HAL version 0.5.8 (used by Debian Etch) has the deprecated + info.bus property, and doesn't have info.subsystem yet. + - added HAL FDI scripts to rpm/barry.spec + - fixed tools/Makefile.plain +2008/10/30 + - added support for multiple work/home phone numbers to the + opensync plugin. + - Thanks to Richard Esplin for his test data. + - This fix has a conflict when a cell phone number is + marked as the preferred contact as well. + See http://sourceforge.net/mailarchive/message.php?msg_name=20081030231045.GA28989%40foursquare.net + for the full details. + - This fix also changes the VCARD output... pager phone + numbers are given the TYPE code of "pager" + instead of "msg". + - Added OtherPhone field as well +2008/10/22 + - applied HAL FDI scripts and configuration from Martin Owens + - updated AUTHORS file + - added HAL FDI and python script to Debian package install +2008/10/18 + - updated copyright notice and help text in contrib/modemtest.rb + - changed barry-verizon.chat script according to Andy Herkey's + recommendation... this worked much better for Michael L. + Stokes, since his provider was getting stuck on the ATZ +2008/10/16 + - applied Andy Herkey's modemtest.rb ruby script to contrib/ + from his Aug 9, 2008 email to the mailing list + - applied Andy Herkey's new modemtest.rb script to contrib/ + from his Oct 8, 2008 email to the mailing list + - added password pass-through code for pppob -s mode + - clarified front page www doc, adding date of last release + and license + - cherry-picked changes from Jose Carlos Garcia Sogo's debian git repo + - debian/rules was stripping wrong library names + - FSF address was incorrect (also updated other source + files throughout the tree myself) + - more complete debian/copyright file +2008/09/24 + - version bump: + - configure.ac + - src/Makefile.am + - src/version.cc + - gui/src/BackupWindow.cc + - Doxyfile + - rpm/barry.spec + - debian/changelog + - opensync-plugin/src/barry_sync.cc + - added link to doxygen documentation to www index.php + Release: version 0.14 - 2008/09/24 ------------------------------------------------------------------------------ 2008/09/24 @@ -170,7 +1652,7 @@ - added "known issues" section to main www doc page - fixed virtual function mis-name bug in btool's null parser - added -i option to brecsum, to include record IDs in the sums - - applied Ashley Willis's btool 0.12 null parser patch to CVS, which + - applied Ashley Willis's btool 0.12 null parser patch to CVS, which required some manual porting changes... - removed bool reference argument in GetParser() - updated AUTHORS @@ -1485,7 +2967,7 @@ ------------------------------------------------------------------------------ 2007/01/26 - added missing errno.h header to gui/src/util.cc - - lots more endian fixes after testing on iMac + - lots more endian fixes after testing on iMac - iostream output size fixes - added option to btool to reset the device via software - beefed up exception handling in barrybackup @@ -1914,7 +3396,7 @@ 2005/12/07 - added -fno-strict-aliasing to compiler flags so gcc-4.0.x won't optimize away protocol struct casts - see: + see: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25235 http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html http://groups.google.ca/group/comp.lang.c++.moderated/ \ diff -Nru barry-0.14/config.guess barry-0.0.20110506/config.guess --- barry-0.14/config.guess 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1500 +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 Free Software Foundation, -# Inc. - -timestamp='2006-07-02' - -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# 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 to . Submit a context -# diff and a properly formatted 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. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -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 -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 tupples: *-*-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 ;; - *) 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 __ELF__ >/dev/null - 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'` - exit ;; - 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 ;; - 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:SunOS:5.*:*) - echo i386-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:*:[45]) - 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 __LP64__ >/dev/null - 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:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - x86:Interix*:[3456]*) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T:Interix*:[3456]*) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-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 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - 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:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-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 ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-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 ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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.0*:*) - 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 i386. - echo i386-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; } ;; - 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.0*:*) - 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 ;; - 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 ;; - 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 - 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 ;; - 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 ;; -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 barry-0.14/config.h.in barry-0.0.20110506/config.h.in --- barry-0.14/config.h.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if a working strnlen exists, 0 if not. */ -#undef HAVE_WORKING_STRNLEN - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to the type of arg 1 for `select'. */ -#undef SELECT_TYPE_ARG1 - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#undef SELECT_TYPE_ARG234 - -/* Define to the type of arg 5 for `select'. */ -#undef SELECT_TYPE_ARG5 - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Enable extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif diff -Nru barry-0.14/config.rpath barry-0.0.20110506/config.rpath --- barry-0.14/config.rpath 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/config.rpath 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,666 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2007 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# 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. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + darwin*) + case $cc_basename in + xlc*) + wl='-Wl,' + ;; + esac + ;; + mingw* | cygwin* | pw32* | os2*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + newsos6) + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + wl='-Wl,' + ;; + pgcc | pgf77 | pgf90) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + wl='-Wl,' + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32*) + # 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 + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # 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. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we cannot use + # them. + ld_shlibs=no + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + 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 + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix4* | aix5*) + 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 + else + 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].*|aix5*) + 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 + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + 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 + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32*) + # 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. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if test "$GCC" = yes ; then + : + else + case $cc_basename in + xlc*) + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd1*) + ld_shlibs=no + ;; + freebsd2.2*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + freebsd2*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + 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 + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + 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 + fi + ;; + hpux11*) + 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_direct=yes + # 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*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + 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 + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix4* | aix5*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + library_names_spec='$libname.a' + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd1*) + ;; + freebsd* | dragonfly*) + case "$host_os" in + freebsd[123]*) + library_names_spec='$libname$shrext$versuffix' ;; + *) + library_names_spec='$libname$shrext' ;; + esac + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + nto-qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. Submit a context -# diff and a properly formatted 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. - -# 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 -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-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - 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) - os= - basic_machine=$1 - ;; - -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*) - 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 \ - | 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 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-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-* \ - | 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-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | 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-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # 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 - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - 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 - ;; - cr16c) - basic_machine=cr16c-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 - ;; - 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'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - 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 - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - 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-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - 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 - ;; - 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 - ;; - 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) basic_machine=powerpc-unknown - ;; - ppc-*) 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 - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - 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 - ;; - 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 - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - 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 - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-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[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. - -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* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -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* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -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*) - # 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 - ;; - -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 - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - 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 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - 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 - ;; - -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 barry-0.14/configure barry-0.0.20110506/configure --- barry-0.14/configure 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,23993 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for barry 0.14. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -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 - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -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 - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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'" - - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, 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= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='barry' -PACKAGE_TARNAME='barry' -PACKAGE_VERSION='0.14' -PACKAGE_STRING='barry 0.14' -PACKAGE_BUGREPORT='barry-devel@lists.sourceforge.net' - -ac_unique_file="src/barry.h" -# 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='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -CPP -GREP -EGREP -CXX -CXXFLAGS -ac_ct_CXX -CXXDEPMODE -am__fastdepCXX_TRUE -am__fastdepCXX_FALSE -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -LN_S -ECHO -AR -RANLIB -CXXCPP -F77 -FFLAGS -ac_ct_F77 -LIBTOOL -SED -WITH_GCCVISIBILITY_TRUE -WITH_GCCVISIBILITY_FALSE -PKG_CONFIG -LIBUSB_CFLAGS -LIBUSB_LIBS -pkgconfigdir -BOOST_LIB_PATH -BOOST_INC_PATH -WITH_BOOST_TRUE -WITH_BOOST_FALSE -WITH_BOOST_PATHS_TRUE -WITH_BOOST_PATHS_FALSE -LIBOBJS -subdirs -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC -CXXCPP -F77 -FFLAGS -PKG_CONFIG -LIBUSB_CFLAGS -LIBUSB_LIBS' -ac_subdirs_all='gui -opensync-plugin' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=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 ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - 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'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -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 - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -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 - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -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 .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - 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 .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - 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 barry 0.14 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/barry] - --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 barry 0.14:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-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) - --enable-gui build the gui - --enable-opensync-plugin - build the opensync plugin - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] include additional configurations [automatic] - --with-libusb= root path of libusb installation - --with-boost=path root path of boost installation (no arg defaults to - 'yes' and uses system paths) - -Some influential environment variables: - 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 C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - PKG_CONFIG path to pkg-config utility - LIBUSB_CFLAGS - C compiler flags for LIBUSB, overriding pkg-config - LIBUSB_LIBS linker flags for LIBUSB, overriding pkg-config - -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" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 - 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 -barry configure 0.14 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 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 -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 barry $as_me 0.14, which was -generated by GNU Autoconf 2.61. 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=. - 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - 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'; { (exit 1); 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 - -# 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 - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - 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. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -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,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -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 - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -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 - - -#AM_CONFIG_HEADER(config.h) - -ac_config_headers="$ac_config_headers config.h:config.h.in" - -am__api_version="1.9" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -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. - - -# 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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -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 -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$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' - -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# 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". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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 $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 - -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -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='barry' - VERSION='0.14' - - -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"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - - -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_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='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out 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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.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 - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - - -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 -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f 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 -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_GREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_EGREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef _AIX - yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -if test "${ac_cv_header_minix_config_h+set}" = set; then - { echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for minix/config.h" >&5 -echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } - -fi -if test $ac_cv_header_minix_config_h = yes; then - MINIX=yes -else - MINIX= -fi - - -if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - -fi - - - - - - - - - - - - { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_safe_to_define___extensions__=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 -_ACEOF - - - -# -# Checks for programs. -# -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -# 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 --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 - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$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 - 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 - -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -aix4* | aix5*) - 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'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - 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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -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 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 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:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 6347 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - 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 -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_F77" && break -done - - if test "x$ac_ct_F77" = x; then - F77="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - F77=$ac_ct_F77 - fi -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_prog_f77_g=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } -else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_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 -f 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 - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi - -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no - -# 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 - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -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;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:8132: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8136: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$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= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - 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*) - # 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' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - interix3*) - # 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 - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - hpux*) - # 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='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - 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 - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # 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' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - 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 - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$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:8400: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8404: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } - -if test x"$lt_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 -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 - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:8504: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:8508: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$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 - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # 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_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = 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>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - 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 - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - - 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - 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 - ;; - - interix3*) - 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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs=no - 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 $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' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - 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 - ;; - - 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 - - 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 - ;; - - aix4* | aix5*) - 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 - 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")) && (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].*|aix5*) - 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_libdir_separator=':' - link_all_deplibs=yes - - 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 - hardcode_direct=yes - 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 - 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 - - # 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 echo "${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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - 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*) - 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 - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - 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 `echo "$deplibs" | $SED -e '\''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' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${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 - 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 -a "$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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${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' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - 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_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - 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 - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - 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 - ;; - - 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - 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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - 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' - 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 linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - 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*) - 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -# -# 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 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:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant 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_AC_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 -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } - -if test "$hardcode_action" = relink; 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 - -striplib= -old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac -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*) - 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 - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; 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 - - ;; - - *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* 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 (); -/* 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_shl_load || defined __stub___shl_load -choke me -#endif - -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* 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 (); -/* 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_dlopen || defined __stub___dlopen -choke me -#endif - -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_svld_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_dld_link=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -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" - - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$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\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$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 - - -# Report which library types will actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# 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 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# 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 and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# 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 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 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# 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 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_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 - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi - - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - 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 - 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].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = 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 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=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_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_CXX=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_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-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_CXX='-Bstatic' - fi - ;; - amigaos*) - # 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_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:13237: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:13241: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:13341: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:13345: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# 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_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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 -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-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_F77='-Bstatic' - fi - ;; - - amigaos*) - # 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_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - interix3*) - # 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_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # 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_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-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_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # 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:14902: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14906: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:15006: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:15010: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # 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_F77="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = 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_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$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_F77='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_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${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_F77='$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_F77='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_F77=no - else - ld_shlibs_F77=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $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_F77=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$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_F77=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_F77=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$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].*|aix5*) - 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_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - 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 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=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_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_F77=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_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$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. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$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*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$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_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } - -if test "$hardcode_action_F77" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# 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_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - -old_archive_cmds_GCJ=$old_archive_cmds - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:17193: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17197: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic' - fi - ;; - - amigaos*) - # 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_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - interix3*) - # 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_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # 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_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # 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:17461: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17465: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:17565: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:17569: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # 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_GCJ="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = 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_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$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_GCJ='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_GCJ=no - fi - ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_GCJ=no - else - ld_shlibs_GCJ=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$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].*|aix5*) - 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_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - 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 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=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_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_GCJ=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_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$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*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$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_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - -if test "$hardcode_action_GCJ" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# 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_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - RC) - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# 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_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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" | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - # Extract the first word of "sed gsed" to use in msg output -if test -z "$SED"; then -set dummy sed gsed; ac_prog_name=$2 -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_SED" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -SED="$ac_cv_path_SED" -if test -z "$SED"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_SED=$SED -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 -echo "${ECHO_T}$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - - - - - flag=`echo "-fvisibility=hidden" | $SED 'y% .=/+-(){}<>:*,%_______________%'` - - { echo "$as_me:$LINENO: checking whether the C compiler accepts the -fvisibility=hidden flag" >&5 -echo $ECHO_N "checking whether the C compiler accepts the -fvisibility=hidden flag... $ECHO_C" >&6; } -if { as_var=ax_cv_c_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - - - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} - -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - eval "ax_cv_c_check_flag_$flag=yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - eval "ax_cv_c_check_flag_$flag=no" - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - CFLAGS="$save_CFLAGS" - - 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 -ac_res=`eval echo '${'ax_cv_c_check_flag_$flag'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - - if eval "test \"`echo '$ax_cv_c_check_flag_'$flag`\" = yes"; then - - : - HAVE_C_GCCVISIBILITY=1 - -else - - : - HAVE_C_GCCVISIBILITY=0 - -fi - - - - - - - - flag=`echo "-fvisibility=hidden" | $SED 'y% .=/+-(){}<>:*,%_______________%'` - - { echo "$as_me:$LINENO: checking whether the C++ compiler accepts the -fvisibility=hidden flag" >&5 -echo $ECHO_N "checking whether the C++ compiler accepts the -fvisibility=hidden flag... $ECHO_C" >&6; } -if { as_var=ax_cv_cxx_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} - -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - eval "ax_cv_cxx_check_flag_$flag=yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - eval "ax_cv_cxx_check_flag_$flag=no" - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - CXXFLAGS="$save_CXXFLAGS" - - 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 -ac_res=`eval echo '${'ax_cv_cxx_check_flag_$flag'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - - if eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"; then - - : - HAVE_CXX_GCCVISIBILITY=1 - -else - - : - HAVE_CXX_GCCVISIBILITY=0 - -fi - - - - -if test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"; then - WITH_GCCVISIBILITY_TRUE= - WITH_GCCVISIBILITY_FALSE='#' -else - WITH_GCCVISIBILITY_TRUE='#' - WITH_GCCVISIBILITY_FALSE= -fi - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -# -# Checks for libraries. -# - -# generates LIBUSB_CFLAGS and LIBUSB_LIBS for us - - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi - -fi - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for LIBUSB" >&5 -echo $ECHO_N "checking for LIBUSB... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$LIBUSB_CFLAGS"; then - pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_LIBUSB_CFLAGS=`$PKG_CONFIG --cflags "libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$LIBUSB_LIBS"; then - pkg_cv_LIBUSB_LIBS="$LIBUSB_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_LIBUSB_LIBS=`$PKG_CONFIG --libs "libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -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 - LIBUSB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libusb"` - else - LIBUSB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libusb"` - fi - # Put the nasty error message in config.log where it belongs - echo "$LIBUSB_PKG_ERRORS" >&5 - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - echo "ERROR: Libusb not found automatically... build may fail if you don't specify --with-libusb";LIBUSB_CFLAGS="-I/usr/include" LIBUSB_LIBS="-lusb" -elif test $pkg_failed = untried; then - echo "ERROR: Libusb not found automatically... build may fail if you don't specify --with-libusb";LIBUSB_CFLAGS="-I/usr/include" LIBUSB_LIBS="-lusb" -else - LIBUSB_CFLAGS=$pkg_cv_LIBUSB_CFLAGS - LIBUSB_LIBS=$pkg_cv_LIBUSB_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi - - -# Check whether --with-libusb was given. -if test "${with_libusb+set}" = set; then - withval=$with_libusb; LIBUSB_CFLAGS="-I$with_libusb/include" - LIBUSB_LIBS="-L$with_libusb/lib -lusb" -fi - - - -# Check whether --with-boost was given. -if test "${with_boost+set}" = set; then - withval=$with_boost; use_boost=$withval -else - use_boost=no -fi - - -if test x"$use_boost" != "xyes" ; then - if test x"$use_boost" != "xno" ; then - BOOST_LIB_PATH=$use_boost/lib - BOOST_INC_PATH=$use_boost/include - BOOST_ENABLED="true" - fi -else - BOOST_LIB_PATH="" - BOOST_INC_PATH="" - BOOST_ENABLED="true" -fi - -#PKG_CHECK_MODULES([OPENSSL], [openssl]) - -pkgconfigdir=${libdir}/pkgconfig - - - - - - - - - -if test "$BOOST_ENABLED" = "true"; then - WITH_BOOST_TRUE= - WITH_BOOST_FALSE='#' -else - WITH_BOOST_TRUE='#' - WITH_BOOST_FALSE= -fi - - - -if test -n "$BOOST_LIB_PATH"; then - WITH_BOOST_PATHS_TRUE= - WITH_BOOST_PATHS_FALSE='#' -else - WITH_BOOST_PATHS_TRUE='#' - WITH_BOOST_PATHS_FALSE= -fi - - -#AC_CHECK_LIB([IOKit], [main]) - -{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5 -echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; } -if test "${ac_cv_lib_pthread_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_pthread_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_main=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; } -if test $ac_cv_lib_pthread_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - -#AC_CHECK_LIB([libusb], [libusb_init]) - - -# -# Checks for header files. -# - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `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 - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$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 - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$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 - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - - -for ac_header in assert.h stdint.h time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# -# Checks for typedefs, structures, and compiler characteristics. -# -#AC_TYPE_SIZE_T -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } -if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_struct_tm=time.h -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_tm=sys/time.h -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - - -# -# Checks for library functions. -# - -# checks that are buggy and need a C compiler only -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_FUNC_STRNLEN changes linker options for us, and depends on a src/strnlen.c -{ echo "$as_me:$LINENO: checking for working strnlen" >&5 -echo $ECHO_N "checking for working strnlen... $ECHO_C" >&6; } -if test "${ac_cv_func_strnlen_working+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_strnlen_working=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - -#define S "foobar" -#define S_LEN (sizeof S - 1) - - /* At least one implementation is buggy: that of AIX 4.3 would - give strnlen (S, 1) == 3. */ - - int i; - for (i = 0; i < S_LEN + 1; ++i) - { - int expected = i <= S_LEN ? i : S_LEN; - if (strnlen (S, i) != expected) - return 1; - } - return 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_strnlen_working=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_strnlen_working=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 -echo "${ECHO_T}$ac_cv_func_strnlen_working" >&6; } -test $ac_cv_func_strnlen_working = no && case " $LIBOBJS " in - *" strnlen.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" - ;; -esac - - -if test $ac_cv_func_strnlen_working = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WORKING_STRNLEN 1 -_ACEOF - -fi -if test $ac_cv_func_strnlen_working = no ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_WORKING_STRNLEN 0 -_ACEOF - -fi - -# checks that work with C++ -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -return closedir (opendir (".")) != 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - -if test $ac_cv_c_compiler_gnu = yes; then - { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - -#AC_FUNC_MALLOC -#AC_FUNC_MKTIME -#AC_FUNC_REALLOC - - -for ac_header in sys/select.h sys/socket.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 -echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } -if test "${ac_cv_func_select_args+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_arg234 in 'fd_set *' 'int *' 'void *'; do - for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do - for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif - -int -main () -{ -extern int select ($ac_arg1, - $ac_arg234, $ac_arg234, $ac_arg234, - $ac_arg5); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done -done -# Provide a safe default value. -: ${ac_cv_func_select_args='int,int *,struct timeval *'} - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 -echo "${ECHO_T}$ac_cv_func_select_args" >&6; } -ac_save_IFS=$IFS; IFS=',' -set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` -IFS=$ac_save_IFS -shift - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG1 $1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG234 ($2) -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG5 ($3) -_ACEOF - -rm -f conftest* - -#AC_FUNC_STAT - - - - - - - - - - -for ac_func in bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - -ac_config_files="$ac_config_files Makefile src/Makefile tools/Makefile examples/Makefile man/Makefile libbarry-0.pc" - - -# -# nested packages -# -# Check whether --enable-gui was given. -if test "${enable_gui+set}" = set; then - enableval=$enable_gui; -fi - -if test "$enable_gui" = yes; then - subdirs="$subdirs gui" - -fi -# Check whether --enable-opensync-plugin was given. -if test "${enable_opensync_plugin+set}" = set; then - enableval=$enable_opensync_plugin; -fi - -if test "$enable_opensync_plugin" = yes; then - subdirs="$subdirs opensync-plugin" - -fi -if test "$enable_gui" = yes || test "$enable_opensync_plugin" = yes; then - export TREE_BUILD_CXXFLAGS="-I`pwd`" - export TREE_BUILD_LDFLAGS="-L`pwd`/src" - export PKG_CONFIG_PATH="`pwd`:$PKG_CONFIG_PATH" -fi - -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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -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= -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=`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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${WITH_GCCVISIBILITY_TRUE}" && test -z "${WITH_GCCVISIBILITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WITH_GCCVISIBILITY\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WITH_GCCVISIBILITY\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${WITH_BOOST_TRUE}" && test -z "${WITH_BOOST_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WITH_BOOST\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WITH_BOOST\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${WITH_BOOST_PATHS_TRUE}" && test -z "${WITH_BOOST_PATHS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WITH_BOOST_PATHS\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WITH_BOOST_PATHS\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 - -# 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 barry $as_me 0.14, which was -generated by GNU Autoconf 2.61. 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 - -cat >>$CONFIG_STATUS <<_ACEOF -# 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_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet 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_cs_version="\\ -barry config.status 0.14 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 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' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$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 ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - 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. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# 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:config.h.in" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "libbarry-0.pc") CONFIG_FILES="$CONFIG_FILES libbarry-0.pc" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$ac_delim -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -SED!$SED$ac_delim -WITH_GCCVISIBILITY_TRUE!$WITH_GCCVISIBILITY_TRUE$ac_delim -WITH_GCCVISIBILITY_FALSE!$WITH_GCCVISIBILITY_FALSE$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -LIBUSB_CFLAGS!$LIBUSB_CFLAGS$ac_delim -LIBUSB_LIBS!$LIBUSB_LIBS$ac_delim -pkgconfigdir!$pkgconfigdir$ac_delim -BOOST_LIB_PATH!$BOOST_LIB_PATH$ac_delim -BOOST_INC_PATH!$BOOST_INC_PATH$ac_delim -WITH_BOOST_TRUE!$WITH_BOOST_TRUE$ac_delim -WITH_BOOST_FALSE!$WITH_BOOST_FALSE$ac_delim -WITH_BOOST_PATHS_TRUE!$WITH_BOOST_PATHS_TRUE$ac_delim -WITH_BOOST_PATHS_FALSE!$WITH_BOOST_PATHS_FALSE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -subdirs!$subdirs$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[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="$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 || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - 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 || -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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# 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= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - 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 - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;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 -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then 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. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $ac_file | $ac_file:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $ac_file" >`$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 || -echo X$ac_file | - 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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 || -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 || -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 - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -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=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" - - # Pass --silent - if test "$silent" = yes; then - ac_sub_configure_args="--silent $ac_sub_configure_args" - fi - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - echo "$as_me:$LINENO: $ac_msg" >&5 - echo "$ac_msg" >&6 - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 -echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac - - { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 -echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} - { (exit 1); exit 1; }; } - fi - - cd "$ac_popdir" - done -fi - - diff -Nru barry-0.14/configure.ac barry-0.0.20110506/configure.ac --- barry-0.14/configure.ac 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/configure.ac 2011-05-06 12:20:16.000000000 +0000 @@ -2,14 +2,19 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([barry], [0.14], [barry-devel@lists.sourceforge.net]) +AC_INIT([barry], [0.18.0], [barry-devel@lists.sourceforge.net]) #AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR([src/barry.h]) AC_CONFIG_HEADERS([config.h:config.h.in]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([dist-bzip2]) AC_USE_SYSTEM_EXTENSIONS +AM_GNU_GETTEXT([external]) +# this is the verion of gettext, not barry +AM_GNU_GETTEXT_VERSION([0.17]) + # # Checks for programs. # @@ -32,6 +37,42 @@ # Checks for libraries. # +# If we are using configure, then we always are using LIBUSB. +# This only gets set to 0 if compiling for some other USB related driver. +USE_LIBUSB=1 +AC_SUBST([USE_LIBUSB]) + +# libtar and libz don't have pkg-config files on many systems. +# libz we can assume, but libtar we need to test for +AC_ARG_WITH(libtar, + [ --with-libtar= root path of libtar install], + [LIBTAR_CFLAGS="-I$with_libtar/include" + LIBTAR_LIBS="-L$with_libtar/lib -ltar"], + [echo "Guessing libtar location... may not compile..."; + LIBTAR_CFLAGS="" + LIBTAR_LIBS="-ltar"]) +AC_SUBST(LIBTAR_CFLAGS) +AC_SUBST(LIBTAR_LIBS) + +AC_CHECK_LIB([tar], [tar_open], + [LIBTAR_FOUND=1 + AC_MSG_NOTICE([Found libtar, enabling libbarrybackup]) ], + [LIBTAR_FOUND=0 + AC_MSG_NOTICE([Libtar NOT found, disabling libbarrybackup])], + [$LIBTAR_CFLAGS $LIBTAR_LIBS]) + +AC_ARG_WITH(libz, + [ --with-zlib= root path of zlib install], + [LIBZ_CFLAGS="-I$with_libtar/include" + LIBZ_LIBS="-L$with_libtar/lib -ltar"], + [echo "Guessing zlib location... may not compile..."; + LIBZ_CFLAGS="" + LIBZ_LIBS="-lz"]) +AC_SUBST(LIBZ_CFLAGS) +AC_SUBST(LIBZ_LIBS) + +AM_CONDITIONAL([WITH_BACKUP], [test "$LIBTAR_FOUND" = "1"]) + # generates LIBUSB_CFLAGS and LIBUSB_LIBS for us PKG_CHECK_MODULES([LIBUSB], [libusb], [], @@ -43,39 +84,171 @@ LIBUSB_LIBS="-L$with_libusb/lib -lusb"], []) -AC_ARG_WITH(boost, - AC_HELP_STRING(--with-boost[=path], - [root path of boost installation (no arg defaults to 'yes' and uses system paths)]), - use_boost=$withval, use_boost=no ) - -if test x"$use_boost" != "xyes" ; then - if test x"$use_boost" != "xno" ; then - BOOST_LIB_PATH=$use_boost/lib - BOOST_INC_PATH=$use_boost/include - BOOST_ENABLED="true" +# +# Allow user to disable libbarrysync, since it depends on glib-2.0 which +# may not be possible to cross-compile. +# +AC_ARG_ENABLE([sync], + AC_HELP_STRING([--disable-sync], [disable Barry sync library]), + [ + if test x"$enableval" = "xno" ; then + SYNC_ENABLED=no + else + SYNC_ENABLED=yes fi -else - BOOST_LIB_PATH="" - BOOST_INC_PATH="" - BOOST_ENABLED="true" + ], + [SYNC_ENABLED=yes]) + +# +# Boost library configuration +# +# Ok, the requirements: +# +# - let the user enable/disable Boost support from configure +# - default to disabled +# - if enabled, and not available, error +# +# - let user specify include path, and lib path, separately, +# since some Boost installations have an additional boost-1.34.1 +# style directory in them +# - default to using no path overrides, assuming everything +# that is needed is in default distro locations +# +# - let user specify the name of the serialization library, since +# the name of the library can change whether you're building +# from source or not +# - default to searching for boost_serialization or +# boost_serialization-mt, and error if not found +# +# Therefore: +# +# --enable-boost Handles enable/disable +# --with-boost-include=path Override the include path +# --with-boost-lib=path Override the lib path +# --with-boost-serialization=name Override the name of serialization +# library to link with +# + +AC_ARG_ENABLE([boost], + AC_HELP_STRING([--enable-boost], [enable Boost support]), + [ + if test x"$enableval" = "xno" ; then + BOOST_ENABLED=no + else + BOOST_ENABLED=yes + fi + ], + [BOOST_ENABLED=no]) + +AC_ARG_WITH([boost-include], + AC_HELP_STRING(--with-boost-include=path, + [path to Boost include directory in order to make include valid (defaults to system paths)]), + BOOST_INC_PATH="-I$withval", BOOST_INC_PATH="" ) + +AC_ARG_WITH([boost-lib], + AC_HELP_STRING(--with-boost-lib=path, + [path to Boost library directory (defaults to system paths)]), + BOOST_LIB_PATH="-L$withval", BOOST_LIB_PATH="" ) + +AC_ARG_WITH(boost-serialization, + AC_HELP_STRING(--with-boost-serialization=name, + [name of serialization library to use with compiler's -l option (defaults to boost_serialization or boost_serialization-mt.)]), + boost_serialization_name=$withval, boost_serialization_name="boost_serialization") + +AC_MSG_NOTICE([using BOOST library... $BOOST_ENABLED]) +if test x"$BOOST_INC_PATH$BOOST_LIB_PATH" != x ; then + AC_MSG_NOTICE([BOOST include options: $BOOST_INC_PATH]) + AC_MSG_NOTICE([BOOST library options: $BOOST_LIB_PATH]) fi +if test x"$BOOST_ENABLED" = "xyes" ; then + # Only $BOOST_LIB_PATH is given for this check, since no + # headers are included in the autoconf main() test snippet. + AC_CHECK_LIB($boost_serialization_name, main, + [BOOST_LDADD="-l$boost_serialization_name"], + [ + AC_CHECK_LIB(boost_serialization-mt, main, + [BOOST_LDADD="-lboost_serialization-mt"], + [AC_MSG_ERROR(boost_serialization not found)], + [$BOOST_LIB_PATH] + ) + ], + [$BOOST_LIB_PATH]) + + if test x"$BOOST_LDADD" != x ; then + AC_MSG_NOTICE([BOOST library name: $BOOST_LDADD]) + else + AC_MSG_ERROR([boost_serialization library not found]) + fi +fi + +AC_SUBST(BOOST_LIB_PATH) +AC_SUBST(BOOST_INC_PATH) +AC_SUBST(BOOST_LDADD) +AM_CONDITIONAL([WITH_BOOST], [test "$BOOST_ENABLED" = "yes"]) + + #PKG_CHECK_MODULES([OPENSSL], [openssl]) +PKG_CHECK_MODULES([FUSE], [fuse >= 2.5], + [FUSE_FOUND=1], + [echo "FUSE library not found, skipping fuse module."; FUSE_FOUND=0] + ) + +PKG_CHECK_MODULES([GLIB2], [glib-2.0], + [GLIB2_FOUND=1], + [echo "GLIB 2.0 not found, skipping sync library."; GLIB2_FOUND=0] + ) + pkgconfigdir=${libdir}/pkgconfig AC_SUBST(pkgconfigdir) -AC_SUBST(BOOST_LIB_PATH) -AC_SUBST(BOOST_INC_PATH) AC_SUBST(LIBUSB_CFLAGS) AC_SUBST(LIBUSB_LIBS) -AM_CONDITIONAL([WITH_BOOST], [test "$BOOST_ENABLED" = "true"]) -AM_CONDITIONAL([WITH_BOOST_PATHS], [test -n "$BOOST_LIB_PATH"]) +AM_CONDITIONAL([WITH_FUSE], [test "$FUSE_FOUND" = "1"]) +AM_CONDITIONAL([WITH_SYNC], [test "$GLIB2_FOUND" = "1" -a "$SYNC_ENABLED" = "yes"]) #AC_CHECK_LIB([IOKit], [main]) -AC_CHECK_LIB([pthread], [main]) #AC_CHECK_LIB([libusb], [libusb_init]) +AC_CHECK_LIB([pthread], [main]) + +AC_ARG_WITH(zlib, + AC_HELP_STRING(--with-zlib, [force usage of zlib, and halt if not available]), + force_zlib=$withval, force_zlib=no ) + +AC_CHECK_LIB([z], [crc32], + [ + AC_DEFINE([HAVE_ZLIB], [1], [Use crc32 when generating packed .cod files]) + AC_ARG_VAR([ZLIB_LIBS], [Linker options for zlib]) + ZLIB_LIBS="-lz" + ], + [ + echo "*****************************************************************" + echo "WARNING: zlib not found... packed .cod files will fail crc checks" + echo "*****************************************************************" + AC_ARG_VAR([ZLIB_LIBS], [Linker options for zlib]) + ZLIB_LIBS="" + if test "x$force_zlib" != xno ; then + AC_MSG_FAILURE([--with-zlib specified, but zlib not found]) + fi + ] + ) + +PKG_CHECK_MODULES([LIBXMLXX], [libxml++-2.6], + [LIBXMLXX_FOUND=1], + [ + echo "*****************************************************************" + echo "WARNING: libxml++ not found... ALX parser not included" + echo "*****************************************************************" + LIBXMLXX_FOUND=0 + ] + ) + +AM_CONDITIONAL([WITH_ALX], [test "$LIBXMLXX_FOUND" = "1"]) + + +AM_ICONV # @@ -122,29 +295,51 @@ AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul]) AC_C_BIGENDIAN -AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile + src/publiccfg.h tools/Makefile examples/Makefile man/Makefile - libbarry-0.pc]) + test/Makefile + libbarry-0.pc + libbarrydp-0.pc + libbarryjdwp-0.pc + libbarrysync-0.pc + libbarrybackup-0.pc + libbarryalx-0.pc]) # # nested packages # AC_ARG_ENABLE([gui], [AC_HELP_STRING([--enable-gui], [build the gui])]) +AC_ARG_ENABLE([opensync-plugin], [AC_HELP_STRING([--enable-opensync-plugin], [build the opensync plugin])]) +AC_ARG_ENABLE([opensync-plugin-4x], [AC_HELP_STRING([--enable-opensync-plugin-4x], [build the opensync 0.4x plugin])]) +AC_ARG_ENABLE([desktop], [AC_HELP_STRING([--enable-desktop], [build the desktop control panel])]) + +# make sure that the environment is setup before anything else +if test "$enable_gui" = yes || test "$enable_opensync_plugin" = yes || test "$enable_opensync_plugin_4x" = yes || test "$enable_desktop" = yes; then + export TREE_BUILD_CXXFLAGS="-I`pwd`" + export TREE_BUILD_LDFLAGS="-L`pwd`/src" + export PKG_CONFIG_PATH="`pwd`:$PKG_CONFIG_PATH" +fi + +# conditionally enable the subdirectory packages if test "$enable_gui" = yes; then AC_CONFIG_SUBDIRS([gui]) fi -AC_ARG_ENABLE([opensync-plugin], [AC_HELP_STRING([--enable-opensync-plugin], [build the opensync plugin])]) if test "$enable_opensync_plugin" = yes; then AC_CONFIG_SUBDIRS([opensync-plugin]) fi -if test "$enable_gui" = yes || test "$enable_opensync_plugin" = yes; then - export TREE_BUILD_CXXFLAGS="-I`pwd`" - export TREE_BUILD_LDFLAGS="-L`pwd`/src" - export PKG_CONFIG_PATH="`pwd`:$PKG_CONFIG_PATH" +if test "$enable_opensync_plugin_4x" = yes; then + AC_CONFIG_SUBDIRS([opensync-plugin-0.4x]) +fi +if test "$enable_desktop" = yes; then + AC_CONFIG_SUBDIRS([desktop]) fi +# +# Generate the scripts! +# AC_OUTPUT diff -Nru barry-0.14/contrib/modemtest.rb barry-0.0.20110506/contrib/modemtest.rb --- barry-0.14/contrib/modemtest.rb 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/contrib/modemtest.rb 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,122 @@ +#!/usr/bin/env ruby + +# +# Copyright (C) 2008, Andy Herkey +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 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 in the COPYING file at the +# root directory of this project for more details. +# +# + +# +# The purpose of this script is to try a large batch of known AT +# commands, and report which ones work with your Blackberry +# modem / provider. There will be output written to stdout +# as well as a file created in /tmp/modemtest.log which holds +# the raw pppob traffic log. +# + +#Change the $PPP variable to point to where pppob is installed. +$PPP="/usr/local/sbin/pppob -vP xxxxx -l /tmp/modemtest.log" + +class IPmodem + + def initialize + @connecting = true + @connectionHandle = IO.popen( $PPP,"w+" ) + sleep 2 + authAtempts = 0 + timeout = 0 + end + + def write( data ) + @connectionHandle.write( data ) + end + + def read() + timeout = 0 + return nil if @connectionHandle.closed? + @ioBuffer = "" + while input = IO.select([@connectionHandle],nil,nil,1) + c = @connectionHandle.getc + @ioBuffer << c if c != nil + return if ! @connecting + if c == nil + timeout+=1 + break if timeout >= 9000 + else + timeout = 0 + end + end + return @ioBuffer + end +end + +# +# Note: AT+CLAC should list all available commands +# +commands = [ + "+++AT", + "AT", + "AT&F", + "ATZ", + "ATS0=0", + "ATE0", + "ATE0V1", + "ATE0V1Q0X4", + "AT+CRC=1", + "AT+SPSERVICE", + "AT+SPSERVICE", + "AT$QCMIPP?", + "AT$QCMIPP=?", + "AT+CSQ", + "AT+CSQ?", + "AT+CSQ=?", + "AT+CSS", + "AT+CSS?", + "AT+CSS=?", + "ATI1", + "ATI2", + "ATI3", + "AT+CAD?", + "AT+CIMI", + "AT+CGMI", + "AT+CGMR", + "AT+CGDCONT?", + "AT+GMI", + "AT+GMM", + "AT+GMR", + "AT+GSN", + "AT+CBC", + "AT+CBIP", + "AT+CCED?", + "AT+ESR", + "AT+CIND=?", + "AT+FCLASS=?", + "AT+GCAP=?", + "AT$SPMDN?", + "AT$QCMIPGETP=1", + "AT&V", + "ATH" +] + +modem = IPmodem.new +puts("Testing the Blackberry Modem by sending AT commands through pppob.") +printf("Starting %s: %s",$PPP,modem.read()) +puts("--------------------------------------------") + +commands.each {|c| + modem.write(c+"\r") + printf("Command: %s \nResult: %s",c,modem.read()) + puts("--------------------------------------------") + + } Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/barrybkup and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/barrybkup differ Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/bimages and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/bimages differ Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/ipd2tgz and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/ipd2tgz differ diff -Nru barry-0.14/contrib/perlbarry/misc/backup barry-0.0.20110506/contrib/perlbarry/misc/backup --- barry-0.14/contrib/perlbarry/misc/backup 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/contrib/perlbarry/misc/backup 2011-05-06 12:20:16.000000000 +0000 @@ -8,11 +8,11 @@ # 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 in the COPYING file at the # root directory of this project for more details. @@ -53,7 +53,7 @@ #print "### DONE ###\n"; $i++; } - + } print "count=$i\n"; diff -Nru barry-0.14/contrib/perlbarry/misc/convert-dumps barry-0.0.20110506/contrib/perlbarry/misc/convert-dumps --- barry-0.14/contrib/perlbarry/misc/convert-dumps 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/contrib/perlbarry/misc/convert-dumps 2011-05-06 12:20:16.000000000 +0000 @@ -8,11 +8,11 @@ # 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 in the COPYING file at the # root directory of this project for more details. Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/misc/deipd and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/misc/deipd differ diff -Nru barry-0.14/contrib/perlbarry/misc/dump-simple barry-0.0.20110506/contrib/perlbarry/misc/dump-simple --- barry-0.14/contrib/perlbarry/misc/dump-simple 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/contrib/perlbarry/misc/dump-simple 2011-05-06 12:20:16.000000000 +0000 @@ -8,11 +8,11 @@ # 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 in the COPYING file at the # root directory of this project for more details. Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/misc/reipd and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/misc/reipd differ Binary files /tmp/hrabAk_zAl/barry-0.14/contrib/perlbarry/misc/split-jpeg and /tmp/ehd5lCCenv/barry-0.0.20110506/contrib/perlbarry/misc/split-jpeg differ diff -Nru barry-0.14/contrib/perlbarry/README barry-0.0.20110506/contrib/perlbarry/README --- barry-0.14/contrib/perlbarry/README 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/contrib/perlbarry/README 2011-05-06 12:20:16.000000000 +0000 @@ -16,5 +16,5 @@ TODO: get list from ~/.barry/backup//config bimages: downloads all JPEG files in 'Content Store' to current - directory. + directory. TODO: option to delete images from phone after downloading. diff -Nru barry-0.14/.cvsignore barry-0.0.20110506/.cvsignore --- barry-0.14/.cvsignore 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/.cvsignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -*.swp - diff -Nru barry-0.14/debian/barrybackup-gui.menu barry-0.0.20110506/debian/barrybackup-gui.menu --- barry-0.14/debian/barrybackup-gui.menu 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/barrybackup-gui.menu 2011-05-06 12:36:18.000000000 +0000 @@ -4,6 +4,5 @@ title="Barry Backup"\ command="/usr/bin/barrybackup"\ hints="Blackberry Backup Utility"\ - -# icon="/usr/share/pixmaps/xzgv.xpm" + icon="/usr/share/pixmaps/barry_logo_icon.png" diff -Nru barry-0.14/debian/barrydesktop-dbg.install barry-0.0.20110506/debian/barrydesktop-dbg.install --- barry-0.14/debian/barrydesktop-dbg.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/debian/barrydesktop-dbg.install 2011-05-06 12:36:18.000000000 +0000 @@ -0,0 +1,2 @@ +barrydesktop-dbg/usr/lib/debug/* + diff -Nru barry-0.14/debian/barrydesktop.install barry-0.0.20110506/debian/barrydesktop.install --- barry-0.14/debian/barrydesktop.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/debian/barrydesktop.install 2011-05-06 12:36:18.000000000 +0000 @@ -0,0 +1,11 @@ +debian/tmp/usr/bin/barrydesktop +debian/tmp/usr/share/barry/desktop/0.22/* +debian/tmp/usr/share/barry/desktop/0.40/* +debian/tmp/usr/share/barry/desktop/images/* +debian/tmp/usr/share/man/man1/barrydesktop.1 +debian/tmp/usr/lib/libosyncwrap.so.* +debian/tmp/usr/lib/libosyncwrap.a +debian/tmp/usr/lib/libosyncwrap.la +debian/tmp/usr/lib/libosyncwrap.so +debian/tmp/usr/include/barry/osyncwrap/* + diff -Nru barry-0.14/debian/barrydesktop.menu barry-0.0.20110506/debian/barrydesktop.menu --- barry-0.14/debian/barrydesktop.menu 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/debian/barrydesktop.menu 2011-05-06 12:36:18.000000000 +0000 @@ -0,0 +1,8 @@ +?package(barrydesktop-gui):\ + needs="X11"\ + section="Applications/Mobile Devices"\ + title="Barry Desktop Panel"\ + command="/usr/bin/barrydesktop"\ + hints="Blackberry Management GUI"\ + icon="/usr/share/pixmaps/barry_desktop_icon.png" + diff -Nru barry-0.14/debian/barry-util.docs barry-0.0.20110506/debian/barry-util.docs --- barry-0.14/debian/barry-util.docs 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/debian/barry-util.docs 2011-05-06 12:36:18.000000000 +0000 @@ -0,0 +1,6 @@ +deb_srcdir/NEWS +deb_srcdir/README +deb_srcdir/AUTHORS +deb_srcdir/zsh/ +deb_srcdir/ppp/ + diff -Nru barry-0.14/debian/barry-util.install barry-0.0.20110506/debian/barry-util.install --- barry-0.14/debian/barry-util.install 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/barry-util.install 2011-05-06 12:36:18.000000000 +0000 @@ -1,10 +1,18 @@ debian/tmp/usr/bin/btool +debian/tmp/usr/bin/bio +debian/tmp/usr/bin/btardump +debian/tmp/usr/bin/bfuse +debian/tmp/usr/bin/bjavaloader +debian/tmp/usr/bin/balxparse +debian/tmp/usr/bin/bjdwp +debian/tmp/usr/bin/brawchannel debian/tmp/usr/bin/bs11nread debian/tmp/usr/bin/bidentify debian/tmp/usr/bin/brecsum debian/tmp/usr/bin/bktrans debian/tmp/usr/bin/upldif debian/tmp/usr/bin/btranslate +debian/tmp/usr/bin/brimtrans debian/tmp/usr/sbin/breset debian/tmp/usr/sbin/bcharge debian/tmp/usr/sbin/pppob @@ -14,6 +22,14 @@ debian/tmp/usr/share/man/man1/breset.1 debian/tmp/usr/share/man/man1/bs11nread.1 debian/tmp/usr/share/man/man1/btool.1 +debian/tmp/usr/share/man/man1/bio.1 +debian/tmp/usr/share/man/man1/btardump.1 +debian/tmp/usr/share/man/man1/bfuse.1 +debian/tmp/usr/share/man/man1/bjavaloader.1 +debian/tmp/usr/share/man/man1/balxparse.1 +debian/tmp/usr/share/man/man1/bjdwp.1 debian/tmp/usr/share/man/man1/pppob.1 debian/tmp/usr/share/man/man1/upldif.1 +debian/tmp/usr/share/man/man1/brawchannel.1 +debian/tmp/usr/share/locale/* diff -Nru barry-0.14/debian/barry-util.postinst barry-0.0.20110506/debian/barry-util.postinst --- barry-0.14/debian/barry-util.postinst 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/barry-util.postinst 2011-05-06 12:36:18.000000000 +0000 @@ -18,14 +18,6 @@ case "$1" in configure) everything - - if [ -e "/etc/modprobe.d/blacklist-berry_charge" ]; then - echo "Preserving user changes to /etc/modprobe.d/blacklist-berry_charge.conf ..." - if [ -e "/etc/modprobe.d/blacklist-berry_charge.conf" ]; then - mv -f "/etc/modprobe.d/blacklist-berry_charge.conf" "/etc/modprobe.d/blacklist-berry_charge.conf.dpkg-new" - fi - mv -f "/etc/modprobe.d/blacklist-berry_charge" "/etc/modprobe.d/blacklist-berry_charge.conf" - fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff -Nru barry-0.14/debian/barry-util.preinst barry-0.0.20110506/debian/barry-util.preinst --- barry-0.14/debian/barry-util.preinst 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/barry-util.preinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$1" = install ] || [ "$1" = upgrade ]; then - if [ -e "/etc/udev/rules.d/10-blackberry.rules" ]; then - if [ "`md5sum \"/etc/udev/rules.d/10-blackberry.rules\" | sed -e \"s/ .*//\"`" = \ - "`dpkg-query -W -f='${Conffiles}' barry-util | sed -n -e \"\\\\' /etc/udev/rules.d/10-blackberry.rules's/.* //p\"`" ] - then - rm -f "/etc/udev/rules.d/10-blackberry.rules" - fi - fi -fi - -if [ "$1" = install ] || [ "$1" = upgrade ]; then - if [ -e "/etc/modprobe.d/blacklist-berry_charge" ]; then - if [ "`md5sum \"/etc/modprobe.d/blacklist-berry_charge\" | sed -e \"s/ .*//\"`" = \ - "`dpkg-query -W -f='${Conffiles}' barry-util | sed -n -e \"\\\\' /etc/modprobe.d/blacklist-berry_charge's/.* //p\"`" ] - then - rm -f "/etc/modprobe.d/blacklist-berry_charge" - fi - fi -fi - -#DEBHELPER# diff -Nru barry-0.14/debian/changelog barry-0.0.20110506/debian/changelog --- barry-0.14/debian/changelog 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/changelog 2011-05-06 12:36:18.000000000 +0000 @@ -1,68 +1,17 @@ -barry (0.14-2.1ubuntu1) karmic; urgency=low +barry (0.0.20110506-0ubuntu0~rzr0+karmic0) karmic; urgency=low - * Merge from debian unstable, remaining changes: LP: #401296 - - debian/rules: - + Install udev rules into /lib/udev/rules.d now - + Install modprobe file as blacklist-berry_charge.conf - - debian/barry-util.preinst: - + Remove old rules,path if unmodified - - debian/barry-util.postinst: - + Otherwise move to new path - - debian/control: - + Update udev dependency + * WIP: http://rzr.online.fr/q/snapshot#progweb - -- Bhavani Shankar Sun, 19 Jul 2009 12:21:14 +0530 + -- Philippe Coval Fri, 06 May 2011 14:20:22 +0200 -barry (0.14-2.1) unstable; urgency=medium +barry (0.18.0-0) unstable; urgency=low - * Non-maintainer upload. - * Fix FTBFS with new boost (>= 1.37.0) by using the “-mt” suffix for - boost libraries since starting with this version, only this variant - is available (Closes: #529722). Add the following patch: - - fix-ftbfs-with-new-boost.diff (thanks to Steve M. Robbins) - * Fix FTBFS with gcc-4.4 (Closes: #505342): - - fix-ftbfs-with-gcc-4.4.diff (thanks to Martin Michlmayr) - * debian/rules: Add the simple-patchsys.mk include to get both patches - applied. - * Set urgency to “medium”, both bugs affect testing too. - * Add ${misc:Depends} to all Depends fields. - - -- Cyril Brulebois Sat, 18 Jul 2009 12:54:03 +0200 - -barry (0.14-2ubuntu2) jaunty; urgency=low - - * debian/rules: install modprobe file as blacklist-berry_charge.conf - * debian/barry-util.preinst: Remove old path if unmodified - * debian/barry-util.postinst: Otherwise move to new path - - -- Scott James Remnant Thu, 05 Mar 2009 20:14:50 +0000 - -barry (0.14-2ubuntu1) jaunty; urgency=low - - * debian/rules: Install udev rules into /lib/udev/rules.d now - * debian/barry-util.preinst: Remove old rules if unmodified - * debian/control: Update udev dependency. - - -- Scott James Remnant Mon, 12 Jan 2009 18:09:36 +0000 - -barry (0.14-2) unstable; urgency=low - - * debian/rules: Fix libbarry-dbg name - * debian/: some debhelper control files were missing in latest release, - making binary packages almost empty. Thanks to Michael Banck for pointing it. - * debian/control: change opensync plugin package name to match naming scheme - for other opensync plugins. Thanks to Michael Banck. - * debian/compat: force level 4 to make easier building of -dbg package - - -- Jose Carlos Garcia Sogo Tue, 21 Oct 2008 23:28:05 +0200 - -barry (0.14-1) unstable; urgency=low + * version bump + * moved opensync-plugin into its own build - * New upstream release. + -- Chris Frey Thu, 10 Feb 2011 03:20:18 -0400 - -- Jose Carlos Garcia Sogo Sun, 28 Sep 2008 16:43:58 +0200 - -barry (0.13-1) unstable; urgency=low +barry (0.13-1.2) unstable; urgency=low [ Jose Carlos Garcia Sogo ] * Upload to Debian (Closes: #450504) @@ -78,9 +27,8 @@ * debian/changelog: + Merge different versions in 0.13-* packages in a new 0.13-1 one, so it can be uploaded into Debian - * debian/rules: no need to call autotools * barrybackup-gui.menu: use Applications/Mobile Devices menu, as per Policy - + [ Chris Frey ] * From 0.13-1.1 upstream package * added brecsum @@ -89,10 +37,23 @@ [ Jason Thomas ] * Makefile.am and opensync-plugin/Makefile: add ACLOCAL_FLAGS for autoreconf - * debian/control: add build-depends: libglib2.0-dev - * debian/control: change build-depends: libopensync0 to libopensync0-dev + * debian/control: add build-depends: autoconf, automake, libtool, + libglib2.0-dev + * debian/control: change build-depends: libopensync0 to libopensync0-dev + + -- Jose Carlos Garcia Sogo Sun, 10 Aug 2008 20:17:34 +0200 + +barry (0.13-1.1) unstable; urgency=low + + * Non-maintainer upload. + + -- Jason Thomas Tue, 29 Apr 2008 17:28:34 +1000 + +barry (0.13-1) unstable; urgency=low + + * version bump - -- Jose Carlos Garcia Sogo Sun, 21 Sep 2008 18:59:37 +0200 + -- Chris Frey Fri, 21 Mar 2008 21:38:11 -0400 barry (0.12-1) unstable; urgency=low @@ -133,7 +94,7 @@ barry (0.6-1) unstable; urgency=low - * adapted for Debian Etch. has a newer version of udev, and plugdev + * adapted for Debian Etch. has a newer version of udev, and plugdev available. Also added btool in addition to only bcharge available -- Peter Silva Fri, 06 Apr 2007 00:00:01 -0500 diff -Nru barry-0.14/debian/control barry-0.0.20110506/debian/control --- barry-0.14/debian/control 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/control 2011-05-06 12:36:18.000000000 +0000 @@ -1,15 +1,14 @@ Source: barry Section: misc Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Jose Carlos Garcia Sogo -Build-Depends: debhelper (>= 4.0.0), g++ (>= 4.1), cdbs, autoconf, automake, libtool, pkg-config, libusb-dev, libboost-serialization-dev, libtar-dev, libgtkmm-2.4-dev, libglademm-2.4-dev, libopensync0-dev (>= 0.22), libopensync0-dev (<< 0.30) +Maintainer: Chris Frey +Build-Depends: debhelper (>= 4.0.0), g++ (>= 4.1), cdbs, autoconf, automake, libtool, pkg-config, libusb-dev, libboost-serialization-dev, libxml++2.6-dev, libfuse-dev (>= 2.5), zlib1g-dev, libtar-dev, libglib2.0-dev, libgtkmm-2.4-dev, libglademm-2.4-dev, gettext (<< 0.18) | autopoint, libgcal-dev, wx-common, libwxgtk2.8-dev Standards-Version: 3.8.0 Package: libbarry0 Section: libs Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends} Description: Library for using the BlackBerry handheld on Linux Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . @@ -19,7 +18,7 @@ Section: libs Priority: extra Architecture: any -Depends: libbarry0 (= ${binary:Version}), ${misc:Depends} +Depends: libbarry0 (= ${binary:Version}) Description: Library for using the BlackBerry handheld on Linux Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . @@ -28,7 +27,7 @@ Package: libbarry-dev Section: libdevel Architecture: any -Depends: libbarry0 (= ${binary:Version}), libusb-dev, ${misc:Depends} +Depends: libbarry0 (= ${binary:Version}), libusb-dev Description: Development files for libbarry Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . @@ -38,19 +37,19 @@ Package: barry-util Section: utils Architecture: any -Depends: udev (>= 136-1), ${shlibs:Depends}, ${misc:Depends} +Depends: libbarry0 (>= 0.18), libbarry0 (<< 0.19), udev (>= 0.056), ${shlibs:Depends} Suggests: ppp Description: Command line utilities for working with the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . This package contains command line utilities, such as bcharge, btool, - breset, etc. + breset, bio, etc. Package: barry-util-dbg Section: utils Priority: extra Architecture: any -Depends: barry-util (= ${binary:Version}), ${misc:Depends} +Depends: barry-util (= ${binary:Version}) Description: Command line utilities for working with the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . @@ -59,7 +58,7 @@ Package: barrybackup-gui Section: utils Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: libbarry0 (>= 0.18), libbarry0 (<< 0.19), ${shlibs:Depends} Description: GTK+ based GUI for backing up the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . @@ -69,30 +68,30 @@ Section: utils Priority: extra Architecture: any -Depends: barrybackup-gui (= ${binary:Version}), ${misc:Depends} +Depends: barrybackup-gui (= ${binary:Version}) Description: GTK+ based GUI for backing up the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . This package contains the debug version of the backup GUI. -Package: opensync-plugin-barry -Section: libs +Package: barrydesktop +Section: utils Architecture: any -Depends: libopensync0 (>= 0.22), libopensync0 (<< 0.30), ${shlibs:Depends}, ${misc:Depends} -Description: Opensync Blackberry plugin, based on the Barry project +Depends: libbarry0 (>= 0.18), libbarry0 (<< 0.19), libgcal0 (>= 0.9.6), ${shlibs:Depends} +Description: Desktop Panel GUI for the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . - This package contains an opensync plugin for use with libopensync 0.22. + This package contains a GUI management application for backups, syncing, etc. -Package: opensync-plugin-barry-dbg -Section: libs +Package: barrydesktop-dbg +Section: utils Priority: extra Architecture: any -Depends: libopensync0 (>= 0.22), libopensync0 (<< 0.30), opensync-plugin-barry (= ${binary:Version}), ${misc:Depends} -Description: Opensync Blackberry plugin, based on the Barry project +Depends: barrydesktop (= ${binary:Version}) +Description: Desktop Panel GUI for the RIM BlackBerry Handheld Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. . - This package contains the debug version of the Barry opensync plugin. + This package contains the debug files for the Barry desktop. #Package: barry-doc #Architecture: all @@ -102,3 +101,14 @@ # backups. The goal of this project is to create a fully functional syncing # mechanism on Linux. + +Package: progweb-snapshot +Architecture: all +Section: sound +Depends: progweb (= ${source:Version}), +Suggests: rzr +Priority: extra +Description: unreleased snapshot version + TODO: Remove on issue and upgrade progweb + http://rzr.online.fr/q/snapshot#progweb Feedback welcome + diff -Nru barry-0.14/debian/copyright barry-0.0.20110506/debian/copyright --- barry-0.14/debian/copyright 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/copyright 2011-05-06 12:36:18.000000000 +0000 @@ -8,11 +8,14 @@ Copyright: - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) - Copyright (C) 2007-2008, Chris Frey + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Chris Frey Copyright (C) 2008, Brian Edginton (edge@edginton.net) Copyright (C) 1995-9 by Cryptography Research, Inc. Copyright (C) 2003 Ximian, Inc. 2005 Armin Bauer + Copyright (C) 2008-2011, Nicolas VIVIEN + Copyright (C) 2009, Josh Kropf + Copyright (C) 2010, RealVNC Ltd., Toby Gray For scripts in contrib/ directory: Copyright (C) 2008 Niels de Vos Copyright (C) 2008, ashley willis @@ -41,12 +44,12 @@ 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff -Nru barry-0.14/debian/libbarry0.docs barry-0.0.20110506/debian/libbarry0.docs --- barry-0.14/debian/libbarry0.docs 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/libbarry0.docs 2011-05-06 12:36:18.000000000 +0000 @@ -1,4 +1,4 @@ -README -NEWS -AUTHORS +deb_srcdir/README +deb_srcdir/NEWS +deb_srcdir/AUTHORS diff -Nru barry-0.14/debian/libbarry0.install barry-0.0.20110506/debian/libbarry0.install --- barry-0.14/debian/libbarry0.install 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/libbarry0.install 2011-05-06 12:36:18.000000000 +0000 @@ -1,2 +1,7 @@ debian/tmp/usr/lib/libbarry.so.* +debian/tmp/usr/lib/libbarrydp.so.* +debian/tmp/usr/lib/libbarryjdwp.so.* +debian/tmp/usr/lib/libbarrysync.so.* +debian/tmp/usr/lib/libbarrybackup.so.* +debian/tmp/usr/lib/libbarryalx.so.* diff -Nru barry-0.14/debian/libbarry-dev.docs barry-0.0.20110506/debian/libbarry-dev.docs --- barry-0.14/debian/libbarry-dev.docs 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/libbarry-dev.docs 2011-05-06 12:36:18.000000000 +0000 @@ -1,12 +1,11 @@ -README -NEWS -TODO -AUTHORS -ChangeLog -doc/Exceptions -doc/Hacking -doc/TimeZones.txt -doc/USB-capture.txt -doc/VersionNotes -doc/bb_task_format.txt -examples/addcontact.cc +deb_srcdir/README +deb_srcdir/NEWS +deb_srcdir/TODO +deb_srcdir/AUTHORS +deb_srcdir/ChangeLog +deb_srcdir/doc/Exceptions +deb_srcdir/doc/Hacking +deb_srcdir/doc/TimeZones.txt +deb_srcdir/doc/USB-capture.txt +deb_srcdir/doc/VersionNotes +deb_srcdir/doc/bb_task_format.txt diff -Nru barry-0.14/debian/libbarry-dev.install barry-0.0.20110506/debian/libbarry-dev.install --- barry-0.14/debian/libbarry-dev.install 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/libbarry-dev.install 2011-05-06 12:36:18.000000000 +0000 @@ -1,6 +1,21 @@ debian/tmp/usr/lib/libbarry.a debian/tmp/usr/lib/libbarry.la debian/tmp/usr/lib/libbarry.so +debian/tmp/usr/lib/libbarrydp.a +debian/tmp/usr/lib/libbarrydp.la +debian/tmp/usr/lib/libbarrydp.so +debian/tmp/usr/lib/libbarryjdwp.a +debian/tmp/usr/lib/libbarryjdwp.la +debian/tmp/usr/lib/libbarryjdwp.so +debian/tmp/usr/lib/libbarrysync.a +debian/tmp/usr/lib/libbarrysync.la +debian/tmp/usr/lib/libbarrysync.so +debian/tmp/usr/lib/libbarrybackup.a +debian/tmp/usr/lib/libbarrybackup.la +debian/tmp/usr/lib/libbarrybackup.so +debian/tmp/usr/lib/libbarryalx.a +debian/tmp/usr/lib/libbarryalx.la +debian/tmp/usr/lib/libbarryalx.so debian/tmp/usr/include/barry/* debian/tmp/usr/lib/pkgconfig/* diff -Nru barry-0.14/debian/manpages barry-0.0.20110506/debian/manpages --- barry-0.14/debian/manpages 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/debian/manpages 2011-05-06 12:36:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru barry-0.14/debian/opensync-plugin-barry-dbg.install barry-0.0.20110506/debian/opensync-plugin-barry-dbg.install --- barry-0.14/debian/opensync-plugin-barry-dbg.install 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/opensync-plugin-barry-dbg.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -opensync-plugin-barry-dbg/usr/lib/debug/* - diff -Nru barry-0.14/debian/opensync-plugin-barry.install barry-0.0.20110506/debian/opensync-plugin-barry.install --- barry-0.14/debian/opensync-plugin-barry.install 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/opensync-plugin-barry.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -debian/tmp/usr/lib/opensync/* -debian/tmp/usr/share/opensync/defaults/barry-sync - diff -Nru barry-0.14/debian/patches/fix-ftbfs-with-gcc-4.4.diff barry-0.0.20110506/debian/patches/fix-ftbfs-with-gcc-4.4.diff --- barry-0.14/debian/patches/fix-ftbfs-with-gcc-4.4.diff 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/patches/fix-ftbfs-with-gcc-4.4.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ ---- a/opensync-plugin/src/trace.h -+++ b/opensync-plugin/src/trace.h -@@ -24,6 +24,7 @@ - - #include - #include -+#include - - class Trace - { ---- a/src/base64.cc -+++ b/src/base64.cc -@@ -11,6 +11,7 @@ - */ - - #include "base64.h" -+#include - #include - #include - ---- a/src/record.cc -+++ b/src/record.cc -@@ -32,6 +32,7 @@ - #include "time.h" - #include "error.h" - #include "endian.h" -+#include - #include - #include - #include diff -Nru barry-0.14/debian/patches/fix-ftbfs-with-new-boost.diff barry-0.0.20110506/debian/patches/fix-ftbfs-with-new-boost.diff --- barry-0.14/debian/patches/fix-ftbfs-with-new-boost.diff 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/patches/fix-ftbfs-with-new-boost.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ ---- a/tools/Makefile.am -+++ b/tools/Makefile.am -@@ -20,7 +20,7 @@ btool_LDFLAGS = -L@BOOST_LIB_PATH@ - else - btool_CXXFLAGS = -D__BARRY_BOOST_MODE__ -D_REENTRANT $(AM_CXXFLAGS) - endif --btool_LDADD += -lboost_serialization -+btool_LDADD += -lboost_serialization-mt - endif - - if WITH_BOOST -@@ -32,7 +32,7 @@ bs11nread_LDFLAGS = -L@BOOST_LIB_PATH@ - else - bs11nread_CXXFLAGS = -D_REENTRANT $(AM_CXXFLAGS) - endif --bs11nread_LDADD += -lboost_serialization -+bs11nread_LDADD += -lboost_serialization-mt - endif - - bidentify_SOURCES = bidentify.cc ---- a/tools/Makefile.in -+++ b/tools/Makefile.in -@@ -41,7 +41,7 @@ bin_PROGRAMS = btool$(EXEEXT) bidentify$ - $(am__EXEEXT_1) - @WITH_BOOST_TRUE@am__append_1 = bs11nread - sbin_PROGRAMS = bcharge$(EXEEXT) breset$(EXEEXT) pppob$(EXEEXT) --@WITH_BOOST_TRUE@am__append_2 = -lboost_serialization -+@WITH_BOOST_TRUE@am__append_2 = -lboost_serialization-mt - subdir = tools - DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -@@ -243,7 +243,7 @@ btool_LDADD = ../src/libbarry.la $(LIBUS - @WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@btool_LDFLAGS = -L@BOOST_LIB_PATH@ - @WITH_BOOST_TRUE@bs11nread_SOURCES = bs11nread.cc - @WITH_BOOST_TRUE@bs11nread_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) \ --@WITH_BOOST_TRUE@ -lpthread -lboost_serialization -+@WITH_BOOST_TRUE@ -lpthread -lboost_serialization-mt - @WITH_BOOST_PATHS_FALSE@@WITH_BOOST_TRUE@bs11nread_CXXFLAGS = -D_REENTRANT $(AM_CXXFLAGS) - @WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@bs11nread_CXXFLAGS = -D_REENTRANT -I@BOOST_INC_PATH@ $(AM_CXXFLAGS) - @WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@bs11nread_LDFLAGS = -L@BOOST_LIB_PATH@ diff -Nru barry-0.14/debian/rules barry-0.0.20110506/debian/rules --- barry-0.14/debian/rules 2011-05-06 12:36:18.000000000 +0000 +++ barry-0.0.20110506/debian/rules 2011-05-06 12:36:18.000000000 +0000 @@ -5,7 +5,6 @@ # This file is public domain software, originally written by Joey Hess. #export DH_VERBOSE=1 -include /usr/share/cdbs/1/rules/simple-patchsys.mk include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk #include /usr/share/cdbs/1/rules/simple-patchsys.mk @@ -17,22 +16,128 @@ # in which directory to install the sofware DEB_DESTDIR = $(CURDIR)/debian/tmp #To register a debug library package libfoo-dbg for libfoo (which needs unstripped '.so') in compat mode 4: -DEB_DH_STRIP_ARGS := --dbg-package=libbarry0 --dbg-package=libbarry-dev --dbg-package=barry-util --dbg-package=barrybackup-gui --dbg-package=opensync-plugin-barry -#CDBS automatically handles common flags to pass to the configure script, -#but it is possible to give some extra parameters : -DEB_CONFIGURE_EXTRA_FLAGS := --with-boost=/usr --enable-gui --enable-opensync-plugin +DEB_DH_STRIP_ARGS := --dbg-package=libbarry0 --dbg-package=libbarry-dev --dbg-package=barry-util --dbg-package=barrybackup-gui --dbg-package=barrydesktop +#CDBS automatically handles common flags to pass to the configure script, +#but it is possible to give some extra parameters : +DEB_CONFIGURE_EXTRA_FLAGS := --enable-boost --enable-nls --with-zlib --enable-gui --enable-desktop $(BARRY_CONFIGURE_OPTS) COMMON_CONFIGURE_FLAGS := --prefix=/usr DEB_INSTALL_DOCS_ALL = install/barry-util:: # Install udev rules for the barry-util package - install -d $(CURDIR)/debian/barry-util/lib/udev/rules.d - install -m 0644 $(CURDIR)/udev/10-blackberry.rules.Debian $(CURDIR)/debian/barry-util/lib/udev/rules.d/10-blackberry.rules + install -d $(CURDIR)/debian/barry-util/etc/udev/rules.d + install -m 0644 \ + $(DEB_SRCDIR)/udev/10-blackberry.rules \ + $(DEB_SRCDIR)/udev/99-blackberry-perms.rules \ + $(CURDIR)/debian/barry-util/etc/udev/rules.d # Install modprobe blacklist file for bcharge, into barry-util package install -d $(CURDIR)/debian/barry-util/etc/modprobe.d - install -m 0644 $(CURDIR)/modprobe/blacklist-berry_charge $(CURDIR)/debian/barry-util/etc/modprobe.d/blacklist-berry_charge.conf + install -m 0644 $(DEB_SRCDIR)/modprobe/blacklist-berry_charge.conf $(CURDIR)/debian/barry-util/etc/modprobe.d/blacklist-berry_charge.conf # Install default ppp options and chat scripts install -d $(CURDIR)/debian/barry-util/etc/ppp/peers - install -m 0644 $(CURDIR)/ppp/barry-rogers $(CURDIR)/ppp/barry-verizon $(CURDIR)/ppp/barry-sprint $(CURDIR)/ppp/barry-o2ireland $(CURDIR)/debian/barry-util/etc/ppp/peers + install -m 0644 \ + $(DEB_SRCDIR)/ppp/barry-rogers \ + $(DEB_SRCDIR)/ppp/barry-minimal \ + $(DEB_SRCDIR)/ppp/barry-verizon \ + $(DEB_SRCDIR)/ppp/barry-sprint \ + $(DEB_SRCDIR)/ppp/barry-telus \ + $(DEB_SRCDIR)/ppp/barry-o2ireland \ + $(DEB_SRCDIR)/ppp/barry-tmobileus \ + $(DEB_SRCDIR)/ppp/barry-att_cingular \ + $(DEB_SRCDIR)/ppp/barry-chinamobile \ + $(DEB_SRCDIR)/ppp/barry-kpn \ + $(DEB_SRCDIR)/ppp/barry-orange-spain \ + $(DEB_SRCDIR)/ppp/barry-optus-au \ + $(DEB_SRCDIR)/ppp/barry-vodafone-au \ + $(CURDIR)/debian/barry-util/etc/ppp/peers install -d $(CURDIR)/debian/barry-util/etc/chatscripts - install -m 0640 $(CURDIR)/ppp/barry-rogers.chat $(CURDIR)/ppp/barry-verizon.chat $(CURDIR)/ppp/barry-sprint.chat $(CURDIR)/ppp/barry-o2ireland.chat $(CURDIR)/debian/barry-util/etc/chatscripts + install -m 0640 \ + $(DEB_SRCDIR)/ppp/barry-rogers.chat \ + $(DEB_SRCDIR)/ppp/barry-minimal.chat \ + $(DEB_SRCDIR)/ppp/barry-verizon.chat \ + $(DEB_SRCDIR)/ppp/barry-sprint.chat \ + $(DEB_SRCDIR)/ppp/barry-telus.chat \ + $(DEB_SRCDIR)/ppp/barry-o2ireland.chat \ + $(DEB_SRCDIR)/ppp/barry-tmobileus.chat \ + $(DEB_SRCDIR)/ppp/barry-att_cingular.chat \ + $(DEB_SRCDIR)/ppp/barry-chinamobile.chat \ + $(DEB_SRCDIR)/ppp/barry-kpn.chat \ + $(DEB_SRCDIR)/ppp/barry-orange-spain.chat \ + $(DEB_SRCDIR)/ppp/barry-optus-au.chat \ + $(DEB_SRCDIR)/ppp/barry-vodafone-au.chat \ + $(CURDIR)/debian/barry-util/etc/chatscripts + # Install hal fdi configs + install -d $(CURDIR)/debian/barry-util/usr/share/hal/fdi/information/10freedesktop + install -d $(CURDIR)/debian/barry-util/usr/share/hal/fdi/policy/10osvendor + install -m 0644 $(DEB_SRCDIR)/hal/fdi/information/10freedesktop/10-blackberry.fdi $(CURDIR)/debian/barry-util/usr/share/hal/fdi/information/10freedesktop + install -m 0644 $(DEB_SRCDIR)/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi $(CURDIR)/debian/barry-util/usr/share/hal/fdi/policy/10osvendor + # Install hal support script + install -d $(CURDIR)/debian/barry-util/usr/bin + install -m 0755 $(DEB_SRCDIR)/hal/hal-blackberry $(CURDIR)/debian/barry-util/usr/bin + # Install bash and zsh completion scripts + install -d $(CURDIR)/debian/barry-util/etc/bash_completion.d + install -m 0644 \ + $(DEB_SRCDIR)/bash/bjavaloader \ + $(DEB_SRCDIR)/bash/btool \ + $(CURDIR)/debian/barry-util/etc/bash_completion.d + # Install examples/ into libbarry-dev + install -d $(CURDIR)/debian/libbarry-dev/usr/share/doc/libbarry-dev/examples + install -m 0644 $(DEB_SRCDIR)/examples/*.cc \ + $(CURDIR)/debian/libbarry-dev/usr/share/doc/libbarry-dev/examples + +install/barrybackup-gui:: + # Install barry icon + install -d $(CURDIR)/debian/barrybackup-gui/usr/share/pixmaps + install -m 0644 $(DEB_SRCDIR)/logo/barry_logo_icon.png $(CURDIR)/debian/barrybackup-gui/usr/share/pixmaps + # Install Gnome .desktop file + install -d $(CURDIR)/debian/barrybackup-gui/usr/share/applications + install -m 0644 $(DEB_SRCDIR)/menu/barrybackup.desktop $(CURDIR)/debian/barrybackup-gui/usr/share/applications + +install/barrydesktop:: + # Install barry icon + install -d $(CURDIR)/debian/barrydesktop/usr/share/pixmaps + install -m 0644 $(DEB_SRCDIR)/logo/barry_logo_icon.png $(CURDIR)/debian/barrydesktop/usr/share/pixmaps/barry_desktop_icon.png + # Install Gnome .desktop file + install -d $(CURDIR)/debian/barrydesktop/usr/share/applications + install -m 0644 $(DEB_SRCDIR)/menu/barrydesktop.desktop $(CURDIR)/debian/barrydesktop/usr/share/applications + +post-patches:: + @rm -f $(CURDIR)/deb_srcdir + @ln -s $(DEB_SRCDIR) $(CURDIR)/deb_srcdir + @test -x $(DEB_SRCDIR)/configure && echo "allready autoreconf" || (cd $(DEB_SRCDIR) && autoreconf -i) + +os22-binary:: binary + # DEB_SRCDIR can be relative, so change into directory to use pwd. + # + # Note: that the compiler flags below depend on opensync-plugin's + # debian/rules having a DESTDIR target of opensync-plugin/debian/tmp + (cd $(DEB_SRCDIR) && \ + export TREE_BUILD_CXXFLAGS="-I`pwd`/opensync-plugin/debian/tmp/usr/include" && \ + export TREE_BUILD_LDFLAGS="-L`pwd`/opensync-plugin/debian/tmp/usr/lib" && \ + export PKG_CONFIG_PATH="`pwd`:$(PKG_CONFIG_PATH)" && \ + export LD_LIBRARY_PATH="`pwd`/opensync-plugin/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)" && \ + cd opensync-plugin && \ + debian/rules TREE_BUILD_DIR="`pwd`/.." binary) + +os22-clean:: + (cd $(DEB_SRCDIR)/opensync-plugin && debian/rules clean) + +os4x-binary:: binary + # DEB_SRCDIR can be relative, so change into directory to use pwd. + # + # Note: that the compiler flags below depend on opensync-plugin-0.4x's + # debian/rules having a DESTDIR target of opensync-plugin-0.4x/debian/tmp + (cd $(DEB_SRCDIR) && \ + export TREE_BUILD_CXXFLAGS="-I`pwd`/opensync-plugin-0.4x/debian/tmp/usr/include" && \ + export TREE_BUILD_LDFLAGS="-L`pwd`/opensync-plugin-0.4x/debian/tmp/usr/lib" && \ + export PKG_CONFIG_PATH="`pwd`:$(PKG_CONFIG_PATH)" && \ + export LD_LIBRARY_PATH="`pwd`/opensync-plugin-0.4x/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)" && \ + cd opensync-plugin-0.4x && \ + debian/rules TREE_BUILD_DIR="`pwd`/.." binary) + +os4x-clean:: + (cd $(DEB_SRCDIR)/opensync-plugin-0.4x && debian/rules clean) + +clean:: + -@rm -f $(CURDIR)/deb_srcdir + diff -Nru barry-0.14/depcomp barry-0.0.20110506/depcomp --- barry-0.14/depcomp 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/depcomp 1970-01-01 00:00:00.000000000 +0000 @@ -1,530 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-07-09.11 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# 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 Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# 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 -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## 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). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - 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. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## 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" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - 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" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$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" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - 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 \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -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 mecanism 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 in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - 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" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru barry-0.14/DEPUTY barry-0.0.20110506/DEPUTY --- barry-0.14/DEPUTY 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/DEPUTY 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,147 @@ +From: Chris Frey +Date: Thu, 2 Jul 2009 18:18:32 -0400 +To: barry-devel@lists.sourceforge.net +Subject: Be a Barry Deputy (or, How to volunteer) + +Hi folks, + +I know there are people who want to volunteer, but sometimes don't know +exactly what to do. Sometimes, they know what to do, but they have to +wait on me for some critical architecture. And other times, they do +something, I see their efforts, and then I forget their names in the +future when similar tasks arise. I do my best, but sometimes it is easy +to overlook some facts or details, and it is not meant to be taken +personally. + +As project lead, it is my duty to make volunteering as easy and clear +as possible. And volunteers should be recognized for their work. + +I've come up with a list of roles that people can volunteer for. The idea +behind these roles is that a number of volunteers can be my eyes and +ears in areas that I don't have the time to monitor consistently. +Also, to support the notion that "with many eyes, all bugs are shallow." + +These roles will be added to the end of the AUTHORS file. Each role +can be filled with one or more people, working as a team. They then +report to the mailing list, to keep me up to speed, or to feed patches +or testing data to me. + +I'll add people's names to the AUTHORS file the first time they report +on one of these roles and request to be added to the list. Being on +the list means you intend to continue volunteering for that role. + +Suggestions are welcome. + +- Chris + + + +The List: + +Devel Distro Testers +-------------------- + Some distros release very early, and it is possible to follow + along their development cycle. These distros include Fedora, + Ubuntu, and Debian. There have already been some people reporting + bugs on pre-release versions of distros, and that has been very + helpful in ironing out kernel bugs, etc. I'd like to make this + a formal role for those who already live on the bleeding edge. + + These deputies would test the latest stable version and the + git version of Barry on pre-released distros and report any + bugs they find to the mailing list, along with patches if + available, and links to documentation if something new is being + introduced in that distro. + + +Compile Checkers +---------------- + These deputies would simply checkout the latest git tree and + compile everything, on as many machines as they have, and + report any compile errors to the list. This could be + automated as well. + + +Documentation Page Maintainer +----------------------------- + These deputies would claim one page from the web docs or + one man page, and keep it up to date with any changes in + the related program. Sometimes new features in command line + tools such as btool, bjavaloader, etc. get lost in the + cracks, and don't get documented right away in the man page. + These deputies would watch for changes in the program options, + and either submit a patch to the docs, or just a reminder + that we've forgotten something. + + +Downstream Monitors +------------------- + These deputies would watch the downstream distro packager repos + and report any relevant patch and send it to the list. + This is to avoid bugs being fixed in a distro package + but not upstream. + + Not all patches are suitable upstream, but I can easily decide + that if I know about the patches. + + They could also report relevant bugs they see in downstream + bug trackers, and report them to the mailing list. + + And finally, on distros such as Debian stable (when it becomes an + issue), they can submit small maintenance patches for fixes in + upstream that can be used downstream. Examples of such changes + are ppp modem fixes, new chatscripts, or new Product IDs. + + +Windows World Spies +------------------- + These deputies would test every feature on new Blackberry models + and desktop software, and report what can be done with them + that you can't do on the previous model. + + There should be a document listing all these features so + we know what to test against. + + +Tech Support Liaison Officers +----------------------------- + These deputies would camp out on their favourite web forum + (sourceforge tracker included) answering questions, and + repost them on the mailing list if they don't have an answer + themselves. + + +Purity Advisors +--------------- + These deputies would watch for the latest developments in distros + and report if Barry's binary packaging is doing something + that is out of date or deprecated, and how it should be + done better. For example, they could run lintian on Ubuntu, + or report RPM build errors on strict OpenSUSE builds, or + report general directions such as the recent deprecation of HAL. + + +External Link Maintainer +------------------------ + These deputies would maintain a web doc page of external links + of documentation, reverse engineering blogs, and anything + technical related to the Blackberry... and encourage + such links to be posted to the mailing list. If others shared + such links on the mailing list, they would pick them up and + update the documentation. + + +Device Compatibility List +------------------------- + This deputy would maintain a list of Blackberry devies known + to work or not work with Barry. Reports from testers would + be incorporated into a single page summary that would include: + - device model + - version of firmware + - version of Barry + - distro + - what databases are reliable for backup and restore + - what devices charge well + - name of tester, and link to their original mailing list + report + diff -Nru barry-0.14/desktop/AUTHORS barry-0.0.20110506/desktop/AUTHORS --- barry-0.14/desktop/AUTHORS 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/AUTHORS 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,4 @@ +Chris Frey + +See ../AUTHORS file. + diff -Nru barry-0.14/desktop/buildgen.sh barry-0.0.20110506/desktop/buildgen.sh --- barry-0.14/desktop/buildgen.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/buildgen.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh + +# +# Generates the build system. +# + +if [ "$1" = "clean" ] ; then + rm -rf autom4te.cache + rm -f Makefile.in aclocal.m4 config.guess config.h.in config.sub \ + configure depcomp install-sh ltmain.sh missing \ + images/Makefile.in \ + man/Makefile.in \ + src/Makefile.in src/*.bak \ + src/0.22/Makefile.in \ + src/0.40/Makefile.in \ + INSTALL \ + config.h.in~ +else + autoreconf -if + #autoreconf -ifv +fi + diff -Nru barry-0.14/desktop/ChangeLog barry-0.0.20110506/desktop/ChangeLog --- barry-0.14/desktop/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/ChangeLog 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ + - See git history for details + diff -Nru barry-0.14/desktop/configure.ac barry-0.0.20110506/desktop/configure.ac --- barry-0.14/desktop/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/configure.ac 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,115 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. +# +# Parts taken from the pkg.m4 file from pkg-config +# Copyright 2004 Scott James Remnant +# + +AC_PREREQ(2.61) +AC_INIT([barrydesktop], [0.1], [barry-devel@lists.sourceforge.net]) +#AM_CONFIG_HEADER(config.h) +AC_CONFIG_SRCDIR([src/barrydesktop.cc]) +AC_CONFIG_HEADERS([config.h:config.h.in]) +AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_MACRO_DIR([../m4]) +AM_INIT_AUTOMAKE + +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +AC_LANG([C++]) + +PKG_CHECK_MODULES([BARRY], [libbarry-0 libbarrysync-0]) +PKG_CHECK_MODULES([GLIB2], [glib-2.0]) +PKG_CHECK_MODULES([LIBXMLPP], [libxml++-2.6]) +PKG_CHECK_MODULES([LIBGCAL], [libgcal >= 0.9.6]) +PKG_CHECK_MODULES([OPENSYNC22], [opensync-1.0], [], [OS22NOTFOUND=yes]) +PKG_CHECK_MODULES([OPENSYNC40], [libopensync1], [], [OS40NOTFOUND=yes]) + +if test "$OS22NOTFOUND" = "yes" -a "$OS40NOTFOUND" = "yes" ; then + AC_MSG_ERROR(dnl +[ +Unable to find development libraries for either opensync 0.22 or 0.4x. + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables: + + OPENSYNC22_CFLAGS and OPENSYNC22_LIBS +or + OPENSYNC40_CFLAGS and OPENSYNC40_LIBS + +to avoid the need to call pkg-config. + +See the pkg-config man page for more details. +]) +fi + +AM_CONDITIONAL([WITH_OPENSYNC22], [test "$OS22NOTFOUND" != "yes"]) +AM_CONDITIONAL([WITH_OPENSYNC40], [test "$OS40NOTFOUND" != "yes"]) + +# Carry the special tree build environment variables from parent configure, +# just in case user is doing a complete tree build with --enable-desktop +AC_SUBST(TREE_BUILD_CXXFLAGS) +AC_SUBST(TREE_BUILD_LDFLAGS) + +# Check for wxWidgets libraries +AM_OPTIONS_WXCONFIG +AM_PATH_WXCONFIG([2.8.0], [], [ + AC_MSG_ERROR([ + wxWidgets is required to build the Barry desktop, + but the wx-config script could not be found. + + Please check that wx-config is in your path, that the directory + where wxWidgets libraries are installed (returned by the + 'wx-config --libs' command) is in LD_LIBRARY_PATH, and that + wxWidgets is version 2.3.4 or above. + ]) + ]) + +# Setup system directories, so src/Makefile.am can use them for the compile +# and for the image/data file installations. (image_DATA) +basedatadir="$datadir/barry/desktop/" +imagedir="$datadir/barry/desktop/images/" +xmlmap22dir="$datadir/barry/desktop/0.22/" +xmlmap40dir="$datadir/barry/desktop/0.40/" +AC_SUBST(basedatadir) +AC_SUBST(imagedir) +AC_SUBST(xmlmap22dir) +AC_SUBST(xmlmap40dir) + +# Checks for libraries. +AC_CHECK_LIB([pthread], [main]) + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([assert.h stdint.h time.h]) + +# Checks for typedefs, structures, and compiler characteristics. +#AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_STRUCT_TM + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MKTIME +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STAT +AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul]) + +AC_CONFIG_FILES([Makefile + images/Makefile + src/Makefile + src/0.22/Makefile + src/0.40/Makefile + man/Makefile]) +AC_OUTPUT + diff -Nru barry-0.14/desktop/COPYING barry-0.0.20110506/desktop/COPYING --- barry-0.14/desktop/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/COPYING 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -Nru barry-0.14/desktop/doc/apple-darwin9.txt barry-0.0.20110506/desktop/doc/apple-darwin9.txt --- barry-0.14/desktop/doc/apple-darwin9.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/doc/apple-darwin9.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,232 @@ +Downloaded from: +http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt + +Cross-Compiling on Linux for +Mac OS X 10.3 - 10.5 (PPC and Intel) +==================================== +Last Updated: 2009-03-29 + +It often is wroten down as impossible, but it can be done (and our nightlies + are the living proof of that). You can make OSX binaries on a Linux based + system. But, the process is not easy. Even worse, in the years we are + supplying this, we had to change this documentation more often than any other + target. This is mostly because you can't use a mainstream GCC, but you need + the one from Apple. When you figured this out, and where to get the + binutils tools, it in fact is very straight forward. + +Requirements: + - Mac OS X SDK Framework 10.4u. + - 7zip 4.61+ to extract DMG files. + - A fast computer, or a lots of time. + - A working 32bit linux compiler (on 64bit, use -m32 ;)). + - Bison installed (else it configures, but compile fails). + +You get: + - A i686-apple-darwin9 compiler (gcc and g++) + For Mac OS X 10.4 - 10.5 Intel + - A powerpc-apple-darwin9 compiler (gcc and g++) + For Mac OS X 10.3 - 10.5 PPC + - A x86_64-apple-darwin9 compiler (gcc and g++) + For Mac OS X 10.5 Intel (64bit) + +Notes: + - Even on 64bit systems, compile 32bit binaries. It avoids a lot of errors. + +Warning: + - I can't guarantee you this will work, nor that it won't break your system. + - Please, don't complain to me or ask me about this documentation. It is + more meant as internal reference for when ever I want to reinstall the + system. If it doesn't work for you, too bad, nothing to see here, find + some other source. + +Ps: + - Yes, this also works with Mac OS X 10.5 Intel. + - Yes, you can also make a x86_64 compiler. + + +The Start +--------- + +Pick which compiler you want to compile. Either one should do: + - i686-apple-darwin9 + - powerpc-apple-darwin9 + - x86_64-apple-darwin9 + +Now put that in a variable: + + export TARGET=i686-apple-darwin9 + +We will use this a lot later on, to simplify this documentation, and show you + it works for any target you pick. + + +CCTools +------- + +To start, you need tools like 'ld', 'ar', ... this you can find in the package + named 'odcctools'. I used various of sources over the years, the last one + which seems to produce valid linux binaries, is located here: + + http://iphone-dev.googlecode.com/svn/ + +A bit good comes of the iPhone development after all ;) To install it, you + need some minor modifications. Also, I used the 'branches' version, which + has 9.2 ld version (well, I thought the name was just more cool!) + +The current odcctools (r280) seems to contain a bug in the 'as'. It registers + 'word' twice, which gives an error. Sadly enough, both definitions are + different. But, this patch fixes the problem by commenting one out, hoping + the value of the other (older) one is correct. The odcctools also contain a + few other bugs and problems. So load all the patches. After that, it seems to + compile just fine. + +# svn checkout http://iphone-dev.googlecode.com/svn/branches/odcctools-9.2-ld/ +# cd odcctools-9.2-ld + +# wget http://devs.openttd.org/~truebrain/compile-farm/odcctools_as.patch +# patch -p0 < odcctools_as.patch + +# wget http://devs.openttd.org/~truebrain/compile-farm/odcctools_qsort.patch +# patch -p0 < odcctools_qsort.patch + +# wget http://devs.openttd.org/~truebrain/compile-farm/odcctools_lipo.patch +# patch -p0 < odcctools_lipo.patch + +# wget http://devs.openttd.org/~truebrain/compile-farm/odcctools_ld64.patch +# patch -p0 < odcctools_ld64.patch + +# ./configure --prefix=/usr/$TARGET --target=$TARGET --with-sysroot=/usr/$TARGET --enable-ld64 + +In case you run x86_64-pc-linux-gnu, you might want to consider running this instead: + +# LDFLAGS="-m32" CFLAGS="-m32" ./configure --prefix=/usr/$TARGET --target=$TARGET --with-sysroot=/usr/$TARGET --enable-ld64 + +Next: + +# vi Makefile + +On the line 'COMPONENTS = ', remove 'otool'. If you want this tool, make sure + you have a objc++ compiler .. I don't, and I don't care about this tool. + +# make +# make install + +Now you should have a few useful tools in /usr/$TARGET/bin directory. If not, + take a step back, and try again. + + +Mac OS X SDK +------------ + +Nowedays 7zip support .dmg files too (4.61+ I believe; I used 4.65). So now you + can extract the files without access to a Mac. First, download xcode 3.1.2 + from the Apple website (you need an account!). Feel free to use any other + version. The newer the better I guess. + +For most targets, you want to extract the 10.4u SDK. This allows your binary + to run from 10.3 to 10.5. But if you want to go for the x86_64 compiler, you + need to go for the 10.5 SDK. As 10.4 can't run 64bit code anyway, it shouldn't + be a real problem. + +After downloading, you can extract it with (a long tree of compressed objects + in other compressed objects): +# mkdir xcode +# cd xcode +# 7z x ../xcode312_2621_developerdvd.dmg +# 7z x 5.hfs +# 7z x Xcode\ Tools/Packages/MacOSX10.4.Universal.pkg +# 7z x Payload +# cpio -i < Payload~ +# cp -R SDKs/MacOSX10.4u.sdk/* /usr/$TARGET/ +# ln -sf /usr/$TARGET/System/Library/Frameworks /usr/$TARGET/Library/Frameworks + +This should give you enough files to continue the compile. You need to use + 'cpio' on the last step, as 7z eats symlinks. + +GCC +--- + +Now the most important part: GCC, your compiler. + +Download the latest GCC From the Apple website. I used: + + http://www.opensource.apple.com/darwinsource/tarballs/other/gcc-5490.tar.gz + +Feel free to use any newer. Extract the file somewhere. + +# cd /var/tmp +# tar zxvf gcc-5490.tar.gz + +gcc works nicely out-of-the-box, but Apple introduced one stupid thing: they + use 'lipo' to check if the host is 32bit or 64bit. Of course it should be + checking against the target. So we need a patch to force either 32bit + (which also happens when you don't patch) or 64bit (which you need if you + want to use x86_64-apple-darwin9). So apply either of those patches: + +# cd gcc-5490 +# wget http://devs.openttd.org/~truebrain/compile-farm/gcc-32bit.patch +# wget http://devs.openttd.org/~truebrain/compile-farm/gcc-64bit.patch +# patch -p0 < gcc-??bit.patch + +Also apply this patch, to avoid some weirdness with CFLAGS: + +# wget http://devs.openttd.org/~truebrain/compile-farm/gcc-cflags.patch +# patch -p0 < gcc-cflags.patch + +Apply this patch if you don't want /usr/$TARGET/$TARGET dir (it annoys me .. + it is nothing really ground-breaking or code-changing): + +# wget http://devs.openttd.org/~truebrain/compile-farm/gcc-tooldir.patch +# patch -p0 < gcc-tooldir.patch +# cd .. + +Now you can compile, like: + +# mkdir gcc-build +# cd gcc-build +# export PATH=$PATH:/usr/$TARGET/bin +# ../gcc-5490/configure --prefix=/usr/$TARGET --disable-checking --enable-languages=c,objc,c++,obj-c++ --with-as=/usr/$TARGET/bin/$TARGET-as --with-ld=/usr/$TARGET/bin/$TARGET-ld --target=$TARGET --with-sysroot=/usr/$TARGET --enable-static --enable-shared --disable-nls --disable-multilib + +If you are on a 64bit system, you can run the following (avoids -lm errors): + +# CFLAGS="-m32" LDFLAGS="-m32" ../gcc-5490/configure --prefix=/usr/$TARGET --disable-checking --enable-languages=c,objc,c++,obj-c++ --with-as=/usr/$TARGET/bin/${TARGET}-as --with-ld=/usr/$TARGET/bin/${TARGET}-ld --target=$TARGET --with-sysroot=/usr/$TARGET --enable-static --enable-shared --disable-nls --disable-multilib + +If you are compiling x86_64-apple-darwin9, make sure to replace 'ld' with + 'ld64' in the above configure. It isn't doing this on its own. Also, it looks + like if you want to use 10.5 SDK for any other target, you need to use 'ld64' + too. It seems 'ld' is slightly too old to understand a certain section in a + library of the 10.5 SDK. + +Now just compile: + +# make +# make install + +On a 32bit system, you most likely run into a problem with libstdc++v3. It + tries to compile something while it is not allowed, or so it tells. I have + yet no idea why this happens, I just know on a 64bit system this problem + does not exist. If you solve it, please email me, and I will add your + addition here. + +Now you should have a working gcc and g++ binary in your + /usr/$TARGET/bin directory. As I said, it is very simple if you + know which tools to use and what to use for configure flags. + + +Other libs +---------- + +If you need libraries like libpng or libz, please start up your Mac OS X, and + just copy them from there. Make sure that you use the right versions, and if + possible universal build versions (those with multiple versions in them). It + is almost impossible to compile such libraries yourself on your + cross-compiler, and I would advise against it. Copying from a real Mac OS X + is much easier, and shows much better results. But that is just my advise ;) + + +Conclusion +---------- + +There is not really much more to it. If this worked for you, and you want to + thank me, please donate some money to OpenTTD. It is always very welcome. + diff -Nru barry-0.14/desktop/doc/DesktopPlan.txt barry-0.0.20110506/desktop/doc/DesktopPlan.txt --- barry-0.14/desktop/doc/DesktopPlan.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/doc/DesktopPlan.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,198 @@ +Requirements: +============= + +Main overriding design goal: make it easy to use... sacrifice functionality + if you can't make it easy... add it later, but do the user-friendly + stuff now. + +- one front panel screen to manage your blackberries, with all + available main options as buttons on that front panel + including: + + - easily readable header: "Barry Desktop Control Panel" + + - backup and restore + - device switcher utility (basically an automated backup/restore?) + - javaloader (manage programs, as well as the extra javaloader commands) + - sync, with pre-defined list of applications: + - Evolution + - Sunbird + - Kontact + - for each supported application, automate the configuration + process as much as possible... make the user pick + the bare minimum! + for example, Evolution has a file:///... path in its + configuration in opensync 0.22 that can be auto-detected + and configured automatically + + - media management (grab photos, etc) (will take longer + than the rest, since low level USB is needed) + + - FUSE file browser via GUI + + - button to launch browser to jump to netdirect.ca/barry ? + +- system tray status icon, with access to desktop app +- show Barry logo +- cross platform + - Linux, multi-distro + - BSD? + - Mac OS X + - look into how OpenOffice/NeoOffice works and how + Firefox manages cross-platform support +- support both opensync versions: 0.22 and 0.4x + + +Mainscreen Buttons: +=================== + + Backup & Restore + + Sync + + Modem (configuration and going online/offline) + + Javaloader (loading and saving applications) + + Device Switch (a clone of a full backup and restore from one + device to another) + + Browse Databases (browse database data like a filesystem hierarchy) + + Media Management (access photos, music, etc. via three methods: + + - MTP (Storm only) + - Mass Storage: the SD card filesystem + - proprietary USB protocol to access on-device + memory storing pictures, sounds, etc (this is + not yet implemented or reverse engineered) + + Miscellaneous + + - view device's event log + - clear device's event log + - take device screenshot + - set the device's time + + +API for supporting both opensync versions: +========================================== + +Wait, can we load libopensync libraries themselves with dlopen? + +Create a plugin system, loaded with dlopen(), with a similar API in each +plugin. + +Common Functions: + - list available opensync plugins (this is a function at the + highest app level... since we are in charge of these + API plugin wrappers) + - list groups + - list plugins + - list objects + - add group / del group + - add member / del member (is del member available in 0.22?) + - configure member + - sync group + - logging output to a common directory (and zapping that log + directory before every sync) + +Possible Errors: + - conflicts during sync + - can't autodetect applications to sync with + - need for slow-sync? + - complete mess up + - this usually initiates a desire to redo an entire sync + from scratch, blowing one side away and syncing completely + from one direction + +FIXME - finish adding to these above lists after analyzing osynctool's source + +For 0.22, base functionality off msynctool code: + + + + +Sync screen mock up: +==================== + + +------------------------------------------------------------------------+ + | Barry Sync | + | | + | [ Sync Now ] | + | Available Devices: | + | | + | +==================================================================+ | + | |Sync | PIN | Name |Connected| Sync With | Engine | | + | +-----+----------+----------------+---------+-----------+----------+ | + | | [X] | 3009efe3 | Old Faithful | Yes | Evolution | 0.40 | | + | | [ ] | 20634523 | Borrowed 8120 | No | Sunbird | 0.22 | | + | | [ ] | 10235478 | | Yes | ... | ... | | + | | | | | | | | | + | | | | | | | | | + | | | | | | | | | + | | | | | | | | | + | | | | | | | | | + | | + +------------------------------------------------------------------------+ + + - syncable devices can be skipped by unchecking in Sync column + - unconnected or unconfigured devices have Sync checkbox greyed out + - double click to configure a device + - should be possible in theory to add as many Apps to the Sync With + field as needed... it is all the same opensync group anyway + +Sync Now button: + - for each device: + - halt the App (can evolution --force-shutdown be used safetly + at any time?) + - run the engine's sync + - may be able to thread non-conflicting devices + - don't sync devices at the same time with the same apps + in their Sync With list + +Sync Recovery Options: + - start fresh: this keeps App's data and blanks the device + - be sure to warn the user his device will be blanked! + - when starting fresh, the desktop should remember the configs + on both sides and reconfigure automatically after + the zap + +Sync Config Constraints: + - a device can only be used in one opensync config + - an App can be used in multiple opensync configs + - each specific engine plugin will have an App config class for it + i.e. 0.22 barry-sync config class + 0.40 evo-sync config class + 0.22 evo-sync config class + +Sync Lists: + - List of devices, includes: + - all configured devices, from both engines, whether + plugged in or not + - all plugged devices + - get names for each device from barrybackup config data + + - List of Apps + - depends on what is supported by barry desktop + + and depends on what plugins are installed for each engine + + and depends on what Apps are actually installed + (does the list of available plugins provide this info?) + + - List of engines + - desktop should remember what engines it knows about + so that if an engine disappears for some reason, + it can warn the user (but don't ever abort) + - if a known engine appears and then disappears, but + no devices were actually configured to use it, + don't warn so heavily +Sync Config Storage: + - sync config (groups, members, plugins) only stored in opensync + - known engines stored in desktop cfg + - known plugins for each engine too + - but only remember the plugins and engines we actually use, + so the user isn't bothered needlessly + - desktop should remember which configs were unchecked, in the + Sync column above, so a user can easily stop syncing a + given device without having to delete the config + Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/apploader-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/apploader-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/apploader-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/apploader-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/apploader-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/apploader-pushed.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/background.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/background.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/backuprestore-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/backuprestore-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/backuprestore-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/backuprestore-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/backuprestore-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/backuprestore-pushed.png differ diff -Nru barry-0.14/desktop/images/barry_logo_icon.xpm barry-0.0.20110506/desktop/images/barry_logo_icon.xpm --- barry-0.14/desktop/images/barry_logo_icon.xpm 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/images/barry_logo_icon.xpm 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,366 @@ +/* XPM */ +static const char * barry_logo_icon_xpm[] = { +"32 32 331 2", +" c None", +". c #168711", +"+ c #4C9249", +"@ c #089404", +"# c #198E14", +"$ c #077B06", +"% c #479043", +"& c #11A70B", +"* c #089304", +"= c #283E84", +"- c #2E4581", +"; c #1133A0", +"> c #001761", +", c #011F26", +"' c #088D16", +") c #013346", +"! c #001A42", +"~ c #0A7D14", +"{ c #027B00", +"] c #048E01", +"^ c #12971D", +"/ c #1F44AD", +"( c #0044EB", +"_ c #003DDB", +": c #02186E", +"< c #0043E9", +"[ c #0041E4", +"} c #002EB6", +"| c #06195B", +"1 c #0141E3", +"2 c #003FDF", +"3 c #04156B", +"4 c #002367", +"5 c #00429D", +"6 c #0439B0", +"7 c #2C3B70", +"8 c #1540B4", +"9 c #1B45B3", +"0 c #0B38B8", +"a c #003AD6", +"b c #001570", +"c c #0043E7", +"d c #0035CD", +"e c #01177A", +"f c #0044EA", +"g c #002FBF", +"h c #001669", +"i c #0042E8", +"j c #00157A", +"k c #0032C5", +"l c #253F97", +"m c #143AA6", +"n c #003CDB", +"o c #0031C4", +"p c #000B57", +"q c #001666", +"r c #0029B3", +"s c #02176B", +"t c #030A3A", +"u c #001E8F", +"v c #0030C2", +"w c #00116B", +"x c #00083A", +"y c #002DB6", +"z c #001B8F", +"A c #010733", +"B c #0025AA", +"C c #003AD7", +"D c #2A3985", +"E c #354784", +"F c #071959", +"G c #001075", +"H c #020B57", +"I c #0226A3", +"J c #0038D3", +"K c #050E4B", +"L c #0238CE", +"M c #0025AB", +"N c #000C57", +"O c #0039D3", +"P c #003DDC", +"Q c #001B7D", +"R c #001681", +"S c #0041E6", +"T c #02116D", +"U c #040A40", +"V c #0141E2", +"W c #0040E2", +"X c #0028AA", +"Y c #020D4C", +"Z c #00177A", +"` c #002EBC", +" . c #001A87", +".. c #003DDD", +"+. c #000F65", +"@. c #0032C3", +"#. c #000F7C", +"$. c #063CCB", +"%. c #000F68", +"&. c #0033C9", +"*. c #00177E", +"=. c #002AB6", +"-. c #001783", +";. c #0030BC", +">. c #0030BF", +",. c #0030C3", +"'. c #000663", +"). c #002BB6", +"!. c #0026A5", +"~. c #001177", +"{. c #003BDB", +"]. c #29396B", +"^. c #052AAB", +"/. c #002CB8", +"(. c #03104A", +"_. c #0129AF", +":. c #002CB9", +"<. c #00136B", +"[. c #001C96", +"}. c #00053D", +"|. c #001C91", +"1. c #001886", +"2. c #000B69", +"3. c #050737", +"4. c #020B6B", +"5. c #030A3E", +"6. c #001F8B", +"7. c #052597", +"8. c #0C1D5B", +"9. c #000B67", +"0. c #000749", +"a. c #01105F", +"b. c #00136E", +"c. c #00105B", +"d. c #01073A", +"e. c #011573", +"f. c #0038D5", +"g. c #001479", +"h. c #02218B", +"i. c #012AB2", +"j. c #00177F", +"k. c #0041E5", +"l. c #0138D2", +"m. c #010B44", +"n. c #081B5D", +"o. c #003EE0", +"p. c #001D8E", +"q. c #002DAE", +"r. c #0040E3", +"s. c #003AD5", +"t. c #001178", +"u. c #00198C", +"v. c #0033C7", +"w. c #003EDF", +"x. c #000F58", +"y. c #003CDC", +"z. c #0042E6", +"A. c #001478", +"B. c #002DB9", +"C. c #092797", +"D. c #0042E5", +"E. c #0028A3", +"F. c #00249D", +"G. c #001372", +"H. c #0025A8", +"I. c #002195", +"J. c #0044E9", +"K. c #003FE0", +"L. c #002BB8", +"M. c #00105A", +"N. c #003BD7", +"O. c #0034CA", +"P. c #000D60", +"Q. c #0028AB", +"R. c #081E7E", +"S. c #102D86", +"T. c #0032C8", +"U. c #0026AC", +"V. c #000E60", +"W. c #001A8F", +"X. c #001990", +"Y. c #040939", +"Z. c #0133BF", +"`. c #0032C7", +" + c #010C5F", +".+ c #012093", +"++ c #001F9C", +"@+ c #000B55", +"#+ c #000639", +"$+ c #001271", +"%+ c #000D4E", +"&+ c #00032B", +"*+ c #030E4F", +"=+ c #192552", +"-+ c #001261", +";+ c #00156C", +">+ c #040B60", +",+ c #091970", +"'+ c #000B6A", +")+ c #011A7B", +"!+ c #02166E", +"~+ c #011052", +"{+ c #051C64", +"]+ c #01104A", +"^+ c #001F96", +"/+ c #002BB4", +"(+ c #000C6F", +"_+ c #0040E4", +":+ c #182F7F", +"<+ c #1B45B1", +"[+ c #003FE1", +"}+ c #00137F", +"|+ c #0043E8", +"1+ c #0035CB", +"2+ c #02196C", +"3+ c #031F72", +"4+ c #003CDA", +"5+ c #0034C6", +"6+ c #00106B", +"7+ c #0040E7", +"8+ c #002EBE", +"9+ c #000760", +"0+ c #0042E7", +"a+ c #04188E", +"b+ c #39539F", +"c+ c #003FE2", +"d+ c #001077", +"e+ c #002294", +"f+ c #002DAC", +"g+ c #000E57", +"h+ c #0033C8", +"i+ c #00106C", +"j+ c #000E6C", +"k+ c #041F8E", +"l+ c #363E62", +"m+ c #1D2F70", +"n+ c #07185C", +"o+ c #00043B", +"p+ c #002193", +"q+ c #0037D1", +"r+ c #0030C0", +"s+ c #011369", +"t+ c #011878", +"u+ c #0041E8", +"v+ c #000838", +"w+ c #010F4D", +"x+ c #020E3C", +"y+ c #000C68", +"z+ c #000C6C", +"A+ c #262663", +"B+ c #1A3FA7", +"C+ c #003EDE", +"D+ c #002093", +"E+ c #020535", +"F+ c #011150", +"G+ c #00218D", +"H+ c #001266", +"I+ c #010C6B", +"J+ c #001678", +"K+ c #020738", +"L+ c #0027A0", +"M+ c #002196", +"N+ c #183696", +"O+ c #1643B7", +"P+ c #010B76", +"Q+ c #0132C6", +"R+ c #00137A", +"S+ c #002EB2", +"T+ c #002DAA", +"U+ c #022186", +"V+ c #0032C0", +"W+ c #002AB4", +"X+ c #001061", +"Y+ c #0029B2", +"Z+ c #072CA1", +"`+ c #011C84", +" @ c #040647", +".@ c #041F79", +"+@ c #0124A2", +"@@ c #010A53", +"#@ c #01228E", +"$@ c #011667", +"%@ c #011876", +"&@ c #000F5B", +"*@ c #00156B", +"=@ c #04135A", +"-@ c #051D77", +";@ c #010F5D", +">@ c #011176", +",@ c #010954", +"'@ c #01229D", +")@ c #002BB5", +"!@ c #020C58", +"~@ c #011F87", +"{@ c #011C71", +"]@ c #001A85", +"^@ c #002CBB", +"/@ c #0734BA", +"(@ c #0039D4", +"_@ c #000E72", +":@ c #001A8A", +"<@ c #001773", +"[@ c #021865", +"}@ c #051759", +"|@ c #010756", +"1@ c #102D8C", +"2@ c #1F2B73", +"3@ c #0021A4", +"4@ c #020A41", +"5@ c #0031C1", +"6@ c #001060", +"7@ c #02074C", +"8@ c #00115F", +"9@ c #012190", +"0@ c #2B2B30", +"a@ c #00176C", +"b@ c #000A62", +"c@ c #001581", +"d@ c #001A7A", +"e@ c #020C5D", +"f@ c #0229AA", +"g@ c #27272B", +"h@ c #000858", +"i@ c #001D83", +"j@ c #141B42", +"k@ c #1E2A56", +"l@ c #1C1C33", +"m@ c #16163F", +"n@ c #202020", +"o@ c #252525", +"p@ c #2D2D2D", +" ", +" . + ", +" @ # ", +" $ % & * ", +" = - ; > , ' ) ! ~ { ] ^ ", +" / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 ", +" 0 ( a b c ( d e f f g h < i j k ( l ", +" m n o p q r s t u v w x y z A B C D ", +" E F G H I J K L f M N O P Q R S T U ", +" V W X Y ( J Z ( ( ` .( ( ..+.n @.#.$. ", +" ( ( _ %.( &.*.( ( =.-.;.>.,.'.).!.~.{.]. ", +" ^.d /.(._.:.<.` *.[.}.|.1.2.3.4.5.6.7. ", +" 8.9.0.a.b.c.d.e.f.g.h.( ( i.j.k.l.m.n. ", +" o.O p.q.r.s.t.J ( u.v.( ( w.x.y.z.A.B.C. ", +" D.( E.F.S C G.[ ( H.I.J.K.L.M.N.O.P.Q.R. ", +" S.T.U.V.W.X.Y.Z.< `. +.+++@+#+$+%+&+*+ ", +" =+-+;+>+,+y '+)+!+~+{+]+^+s.>./+(+_+:+ ", +" <+[+i }+O |+1+2+3+4+( 5+6+7+( 8+9+0+a+ ", +" b+c+K.d+a ( < e+f+( ( C g+1+h+i+j+k+l+ ", +" m+n+o+p+q+r+s+t+u+n B v+w+x+y+z+A+ ", +" B+C+D+E+F+G+H+I+J+K+L+S ++M+S N+ ", +" O+( r.P+Q+[ R+S+T+U+V+D.W+X+Y+ ", +" Z+`+ @.@+@@@( i #@$@%@&@*@=@ ", +" -@W+;@>@,@'@)@!@~@{@]@S ^@ ", +" /@(@_@< :@<@[@}@n X |@1@ ", +" 2@3@4@5@6@f f 7@8@V.9@ ", +" 0@*.a@b@c@d@e@s.f@ ", +" g@7+K.h@i@=.j@k@ ", +" l@m@n@o@p@ ", +" ", +" ", +" "}; Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/browsedatabases-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/browsedatabases-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/browsedatabases-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/browsedatabases-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/browsedatabases-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/browsedatabases-pushed.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/deviceswitch-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/deviceswitch-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/deviceswitch-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/deviceswitch-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/deviceswitch-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/deviceswitch-pushed.png differ diff -Nru barry-0.14/desktop/images/logo_NetDirect.xpm barry-0.0.20110506/desktop/images/logo_NetDirect.xpm --- barry-0.14/desktop/images/logo_NetDirect.xpm 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/images/logo_NetDirect.xpm 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,1133 @@ +/* XPM */ +static const char * logo_NetDirect_xpm[] = { +"91 34 1096 2", +" c None", +". c #9CBEDB", +"+ c #9BBEDB", +"@ c #9CBDDB", +"# c #9BBDDB", +"$ c #9BBDDA", +"% c #A1BEDB", +"& c #A6BFDC", +"* c #AAC0DC", +"= c #AFC0DD", +"- c #B0C0DD", +"; c #AEBFDC", +"> c #ABBFDC", +", c #A8BFDC", +"' c #A4BEDB", +") c #A1BDDB", +"! c #9CBDDA", +"~ c #A2BEDB", +"{ c #AABFDC", +"] c #B1C0DD", +"^ c #B8C2DE", +"/ c #BEC2DF", +"( c #BDC2DE", +"_ c #BAC2DE", +": c #B4C1DE", +"< c #ABC0DC", +"[ c #A5BFDC", +"} c #9EBEDB", +"| c #9FBEDB", +"1 c #A8BEDC", +"2 c #B9C2DE", +"3 c #C1C3DF", +"4 c #C7C4E0", +"5 c #B7C1DE", +"6 c #ADC0DC", +"7 c #9CBFDB", +"8 c #9CBFDC", +"9 c #9CBEDC", +"0 c #9DBEDB", +"a c #9DBEDC", +"b c #9DBFDB", +"c c #9DBFDC", +"d c #9BBEDA", +"e c #9EBFDC", +"f c #A7C0DC", +"g c #B1C1DD", +"h c #BBC2DF", +"i c #C5C4E0", +"j c #CAC4E0", +"k c #C4C4E0", +"l c #BAC2DF", +"m c #B0C1DD", +"n c #9EC0DB", +"o c #9EC0DC", +"p c #9FC0DC", +"q c #9EC0DD", +"r c #9FC0DD", +"s c #9FC1DD", +"t c #A0C0DD", +"u c #A0C1DC", +"v c #A0C0DC", +"w c #A0C1DD", +"x c #A1C1DD", +"y c #A1C2DD", +"z c #A1C2DC", +"A c #A1C2DE", +"B c #A2C2DD", +"C c #9EBFDB", +"D c #9FC1DC", +"E c #A1C1DC", +"F c #A3C1DD", +"G c #ADC2DD", +"H c #B8C2DF", +"I c #C1C4E0", +"J c #C3C4E0", +"K c #B9C3DF", +"L c #AEC1DD", +"M c #A5C2DD", +"N c #A2C2DE", +"O c #A3C2DD", +"P c #A3C2DE", +"Q c #A3C2DC", +"R c #A4C2DD", +"S c #A6C2DE", +"T c #A7C2DD", +"U c #A8C2DE", +"V c #A9C2DE", +"W c #A8C2DD", +"X c #A4C1DD", +"Y c #A4C3DE", +"Z c #A3C3DE", +"` c #A4C3DF", +" . c #A4C4DE", +".. c #A5C4DF", +"+. c #A4C4DF", +"@. c #A5C4DE", +"#. c #A5C5DF", +"$. c #A2C3DE", +"%. c #A6C3DE", +"&. c #B0C4DE", +"*. c #BAC4DF", +"=. c #CAC5E0", +"-. c #CBC5E1", +";. c #C6C4E0", +">. c #BBC4DF", +",. c #B1C4DE", +"'. c #A7C4DF", +"). c #A6C5DE", +"!. c #A6C4DF", +"~. c #A6C5DF", +"{. c #A7C5DF", +"]. c #A7C4DE", +"^. c #A9C4DE", +"/. c #ACC4DF", +"(. c #AEC5DF", +"_. c #B0C4DF", +":. c #B4C5DF", +"<. c #B9C4E0", +"[. c #BFC5E0", +"}. c #C8C5E0", +"|. c #C9C5E0", +"1. c #C6C5E0", +"2. c #C1C5E0", +"3. c #BAC4E0", +"4. c #B1C5E0", +"5. c #A8C5DE", +"6. c #A8C6E0", +"7. c #A8C6DF", +"8. c #A9C6DF", +"9. c #A8C7E0", +"0. c #A9C6E0", +"a. c #A9C7E0", +"b. c #AAC7E0", +"c. c #AAC7E1", +"d. c #A7C5E0", +"e. c #A7C6DF", +"f. c #A8C5DF", +"g. c #A9C7DF", +"h. c #A9C5DE", +"i. c #AFC5E0", +"j. c #B9C5DF", +"k. c #C3C5E0", +"l. c #B6C5E0", +"m. c #AEC6DF", +"n. c #A9C8E0", +"o. c #AAC8E0", +"p. c #ABC7E0", +"q. c #ABC8E1", +"r. c #AAC8E1", +"s. c #ABC8E0", +"t. c #ACC8E1", +"u. c #B3C7E0", +"v. c #C0C5E1", +"w. c #C8C5E1", +"x. c #B9C6E0", +"y. c #ACC8E0", +"z. c #ACC9E1", +"A. c #ADC9E2", +"B. c #ADC9E1", +"C. c #ADCAE1", +"D. c #AECAE2", +"E. c #AEC9E1", +"F. c #AECAE1", +"G. c #ACC9E2", +"H. c #ADC8E0", +"I. c #B6C7E0", +"J. c #BFC5E1", +"K. c #BFC6E1", +"L. c #B5C7E0", +"M. c #AFCBE1", +"N. c #AECBE2", +"O. c #AFCBE2", +"P. c #AFCAE2", +"Q. c #B0CBE2", +"R. c #B0CBE3", +"S. c #BAC8E1", +"T. c #BEC7E1", +"U. c #B1CCE3", +"V. c #B1CCE2", +"W. c #B2CCE3", +"X. c #B2CDE3", +"Y. c #B2CCE4", +"Z. c #AFCBE3", +"`. c #B0CCE2", +" + c #B0CCE3", +".+ c #B1CBE2", +"++ c #B2CAE2", +"@+ c #BAC9E1", +"#+ c #C2C7E1", +"$+ c #C9C5E1", +"%+ c #BFC7E1", +"&+ c #B7CAE2", +"*+ c #B1CDE3", +"=+ c #A3B7D7", +"-+ c #A0B2D5", +";+ c #B3CDE3", +">+ c #4A9BCE", +",+ c #067BC0", +"'+ c #0A7DC1", +")+ c #B4CEE4", +"!+ c #1481C3", +"~+ c #3E95CB", +"{+ c #B4CDE4", +"]+ c #B3CEE4", +"^+ c #B3CDE4", +"/+ c #B5CEE4", +"(+ c #C7C6E1", +"_+ c #B5CFE4", +":+ c #B5CFE5", +"<+ c #B5CEE5", +"[+ c #B6CFE4", +"}+ c #B6CFE5", +"|+ c #A7C8E2", +"1+ c #92BEDD", +"2+ c #B7D0E5", +"3+ c #B4CDE3", +"4+ c #B3CEE3", +"5+ c #B4CFE4", +"6+ c #B5CEE3", +"7+ c #BCCAE2", +"8+ c #C4C7E1", +"9+ c #CAC5E1", +"0+ c #C2C7E2", +"a+ c #BACCE2", +"b+ c #B7D0E4", +"c+ c #6A5EAA", +"d+ c #5A479E", +"e+ c #B6D0E4", +"f+ c #B7CFE4", +"g+ c #B7CFE5", +"h+ c #479ACE", +"i+ c #0078BF", +"j+ c #047ABF", +"k+ c #0F7FC2", +"l+ c #3B94CB", +"m+ c #B8D0E5", +"n+ c #B8D0E6", +"o+ c #B8D1E6", +"p+ c #B8D1E5", +"q+ c #B9D1E5", +"r+ c #B9D1E6", +"s+ c #C8C6E1", +"t+ c #C7C7E1", +"u+ c #B9D2E6", +"v+ c #BAD1E5", +"w+ c #BAD2E6", +"x+ c #BAD1E6", +"y+ c #BAD2E7", +"z+ c #70AED6", +"A+ c #97C1DE", +"B+ c #BAD3E6", +"C+ c #BBD3E6", +"D+ c #BBD2E7", +"E+ c #B9D0E5", +"F+ c #BDCDE4", +"G+ c #C4C9E2", +"H+ c #C5C8E2", +"I+ c #BECDE4", +"J+ c #6B5FAA", +"K+ c #BBD2E6", +"L+ c #BBD3E7", +"M+ c #BCD3E7", +"N+ c #489BCE", +"O+ c #9FC5E0", +"P+ c #9DC4E0", +"Q+ c #A7C9E2", +"R+ c #BCD4E7", +"S+ c #BDD3E6", +"T+ c #BDD4E7", +"U+ c #C0CFE5", +"V+ c #C1CFE5", +"W+ c #BED4E7", +"X+ c #BDD5E7", +"Y+ c #BED5E7", +"Z+ c #BED4E8", +"`+ c #BED5E8", +" @ c #BFD5E8", +".@ c #72B0D7", +"+@ c #9BC3E0", +"@@ c #BCD3E6", +"#@ c #BDD2E6", +"$@ c #C3CBE4", +"%@ c #C9C6E1", +"&@ c #B8AFD5", +"*@ c #9A8CC3", +"=@ c #C5C2DF", +"-@ c #A9A6D0", +";@ c #8079B8", +">@ c #7A74B5", +",@ c #8F91C4", +"'@ c #B8CDE4", +")@ c #B6C9E2", +"!@ c #8E90C4", +"~@ c #807DBA", +"{@ c #A3AED3", +"]@ c #9296C7", +"^@ c #5F4DA1", +"/@ c #543E9A", +"(@ c #9396C7", +"_@ c #9FA8D0", +":@ c #C0D5E8", +"<@ c #A9CAE3", +"[@ c #61A7D3", +"}@ c #499BCE", +"|@ c #5FA6D3", +"1@ c #4A9CCF", +"2@ c #C0D6E8", +"3@ c #7EB5D9", +"4@ c #78B3D8", +"5@ c #8FBEDE", +"6@ c #B2CFE5", +"7@ c #78B3D9", +"8@ c #ADCCE4", +"9@ c #A9CBE3", +"0@ c #5DA6D2", +"a@ c #5AA4D2", +"b@ c #C2D3E6", +"c@ c #99B2D9", +"d@ c #5D9BCF", +"e@ c #4C95CC", +"f@ c #629DCF", +"g@ c #A6B7DB", +"h@ c #C4CEE5", +"i@ c #C1D7E8", +"j@ c #C2D7E9", +"k@ c #C2D7E8", +"l@ c #C1D6E8", +"m@ c #8BBCDD", +"n@ c #57A3D1", +"o@ c #5BA5D2", +"p@ c #92C0DE", +"q@ c #7CB5DA", +"r@ c #499CCF", +"s@ c #62A8D4", +"t@ c #79B3D9", +"u@ c #BDD4E8", +"v@ c #C3D8E9", +"w@ c #BFD6E8", +"x@ c #C0D6E9", +"y@ c #C1D6E9", +"z@ c #C2D1E6", +"A@ c #C7CAE3", +"B@ c #968BC2", +"C@ c #492F92", +"D@ c #8480BC", +"E@ c #4B3193", +"F@ c #5F4EA2", +"G@ c #6454A5", +"H@ c #C0D5E7", +"I@ c #A9B5D7", +"J@ c #543E99", +"K@ c #4E3595", +"L@ c #6252A4", +"M@ c #533E9A", +"N@ c #807BB9", +"O@ c #9EA4CE", +"P@ c #493092", +"Q@ c #6C5EAA", +"R@ c #C4D7E9", +"S@ c #90BFDE", +"T@ c #087CC0", +"U@ c #2A8CC8", +"V@ c #C4D9EA", +"W@ c #107FC2", +"X@ c #3F96CC", +"Y@ c #9CC5E1", +"Z@ c #6AACD6", +"`@ c #0B7DC1", +" # c #1983C3", +".# c #C5C5E1", +"+# c #4592CB", +"@# c #0178BF", +"## c #68ABD5", +"$# c #C5DAEB", +"%# c #C6D9EA", +"&# c #BDD5E8", +"*# c #3793CB", +"=# c #4299CD", +"-# c #B5D1E7", +";# c #C7DAEA", +"># c #C3D9E9", +",# c #C4D8E9", +"'# c #C4D8EA", +")# c #C5D8EA", +"!# c #C5D9EA", +"~# c #C5D8E9", +"{# c #C6D1E6", +"]# c #C9C8E2", +"^# c #C9CBE3", +"/# c #C6D4E7", +"(# c #9596C7", +"_# c #59459D", +":# c #B4C1DD", +"<# c #C6D9EB", +"[# c #847FBB", +"}# c #A6AED4", +"|# c #C0D1E5", +"1# c #56419B", +"2# c #6554A5", +"3# c #BDCCE3", +"4# c #C7DAEB", +"5# c #837EBB", +"6# c #A1A7CF", +"7# c #6E60AB", +"8# c #5C499F", +"9# c #BED5E9", +"0# c #1281C3", +"a# c #6BADD6", +"b# c #83B9DC", +"c# c #047AC0", +"d# c #C8DBEB", +"e# c #1080C2", +"f# c #4097CD", +"g# c #A0C7E2", +"h# c #087BC0", +"i# c #2586C5", +"j# c #3C8FC9", +"k# c #599ACE", +"l# c #077AC0", +"m# c #669FD0", +"n# c #86AED7", +"o# c #489BCF", +"p# c #91C0DF", +"q# c #CBDDEC", +"r# c #4F9FD0", +"s# c #57A3D2", +"t# c #87BADD", +"u# c #4B9DCF", +"v# c #6BADD7", +"w# c #85BADC", +"x# c #4E9FD0", +"y# c #69ACD6", +"z# c #82B9DC", +"A# c #CBDDED", +"B# c #C8DCEB", +"C# c #C9DCEB", +"D# c #C9DBEB", +"E# c #C7DBEA", +"F# c #C9D2E7", +"G# c #CAC8E2", +"H# c #CACCE4", +"I# c #CAD7E9", +"J# c #C9DCEC", +"K# c #CADCEC", +"L# c #9899C8", +"M# c #9A9CCA", +"N# c #CADDEC", +"O# c #B5C0DD", +"P# c #9797C7", +"Q# c #9797C8", +"R# c #B3BCDB", +"S# c #CADBEB", +"T# c #5D499F", +"U# c #7062AC", +"V# c #CCDDEC", +"W# c #CCDDED", +"X# c #82B9DB", +"Y# c #82B8DB", +"Z# c #CCDEED", +"`# c #CCDEEC", +" $ c #1B85C5", +".$ c #4199CD", +"+$ c #A3C9E3", +"@$ c #0B7CC1", +"#$ c #A3B9DB", +"$$ c #BDBFDF", +"%$ c #057AC0", +"&$ c #6EA1D1", +"*$ c #CCD1E6", +"=$ c #CDDEED", +"-$ c #CDDEEC", +";$ c #288CC8", +">$ c #3994CB", +",$ c #BCD6E9", +"'$ c #0379BF", +")$ c #CFE0EE", +"!$ c #CFE0ED", +"~$ c #CEDEED", +"{$ c #3190CA", +"]$ c #0C7EC1", +"^$ c #3693CB", +"/$ c #7DB6DB", +"($ c #A7CCE5", +"_$ c #D0E0EE", +":$ c #CCDDEB", +"<$ c #CCD5E8", +"[$ c #CBC8E2", +"}$ c #CBCBE3", +"|$ c #CCD8EA", +"1$ c #CDDFED", +"2$ c #CEDFED", +"3$ c #CDDFEE", +"4$ c #9A9ACA", +"5$ c #B6BFDC", +"6$ c #CEDFEE", +"7$ c #BBC6E1", +"8$ c #9796C8", +"9$ c #7B72B4", +"0$ c #4A3092", +"a$ c #8179B8", +"b$ c #817AB9", +"c$ c #817AB8", +"d$ c #5C489E", +"e$ c #523A97", +"f$ c #D0E0ED", +"g$ c #7163AD", +"h$ c #5BA6D3", +"i$ c #C4DBEB", +"j$ c #D1E0EE", +"k$ c #D1E1EE", +"l$ c #56A3D2", +"m$ c #1180C2", +"n$ c #4399CE", +"o$ c #A7CBE5", +"p$ c #5799CE", +"q$ c #90AFD7", +"r$ c #308FC9", +"s$ c #4199CE", +"t$ c #4299CE", +"u$ c #1A85C4", +"v$ c #087CC1", +"w$ c #92C1E0", +"x$ c #94C3E1", +"y$ c #D3E3EF", +"z$ c #D3E2EF", +"A$ c #D3E2F0", +"B$ c #D4E2EF", +"C$ c #80B8DB", +"D$ c #ABCEE6", +"E$ c #D4E2F0", +"F$ c #D4E3EF", +"G$ c #D0E1EE", +"H$ c #CFDBEB", +"I$ c #CCCBE4", +"J$ c #CBC7E2", +"K$ c #CED7E9", +"L$ c #D1E0ED", +"M$ c #D2E2EE", +"N$ c #D1E1EF", +"O$ c #D2E1EF", +"P$ c #D2E2EF", +"Q$ c #9C9CCA", +"R$ c #C0C9E2", +"S$ c #9A98C8", +"T$ c #766AB0", +"U$ c #6553A5", +"V$ c #D2E1ED", +"W$ c #7264AD", +"X$ c #5E4A9F", +"Y$ c #D4E3F0", +"Z$ c #0179BF", +"`$ c #D5E3EF", +" % c #D5E3F0", +".% c #63AAD6", +"+% c #459ACE", +"@% c #A7C5E2", +"#% c #79A6D3", +"$% c #85AED6", +"%% c #7FB7DC", +"&% c #A6CCE4", +"*% c #D7E5F0", +"=% c #D7E5F1", +"-% c #D8E5F1", +";% c #D8E6F1", +">% c #81BADC", +",% c #AED1E7", +"'% c #D4E4F0", +")% c #CFD4E8", +"!% c #CECEE5", +"~% c #D4E1EE", +"{% c #D6E4F0", +"]% c #D5E4F0", +"^% c #D7E4F1", +"/% c #9F9DCB", +"(% c #BEC6E0", +"_% c #D7E4F0", +":% c #D6E5F0", +"<% c #C2CBE2", +"[% c #9C9AC9", +"}% c #8880BC", +"|% c #4B3192", +"1% c #D3E0EE", +"2% c #D8E5F0", +"3% c #7364AD", +"4% c #5E4AA0", +"5% c #D9E5F0", +"6% c #D9E5F1", +"7% c #6EB0D8", +"8% c #B8D5E9", +"9% c #D9E6F1", +"0% c #D9E6F2", +"a% c #4B9ED0", +"b% c #D9E7F1", +"c% c #1181C3", +"d% c #4191CA", +"e% c #A2B5DA", +"f% c #7BA6D3", +"g% c #D0CFE6", +"h% c #D6E0EE", +"i% c #A4CBE5", +"j% c #99C6E2", +"k% c #DBE7F1", +"l% c #DBE7F2", +"m% c #DBE8F2", +"n% c #9EC8E4", +"o% c #8DC0E0", +"p% c #DCE8F2", +"q% c #DCE7F2", +"r% c #8BBEDF", +"s% c #5EA8D5", +"t% c #6FB0D9", +"u% c #DCE8F3", +"v% c #84BBDE", +"w% c #B2D2E8", +"x% c #DCE9F3", +"y% c #DDE8F3", +"z% c #D8E2F0", +"A% c #CECCE5", +"B% c #D1D6E9", +"C% c #DAE7F1", +"D% c #DAE6F2", +"E% c #DAE7F2", +"F% c #A29FCC", +"G% c #C2C8E1", +"H% c #C6CDE4", +"I% c #9E9BCA", +"J% c #B1B2D7", +"K% c #A8A6D0", +"L% c #DBE6F2", +"M% c #6855A6", +"N% c #7566AF", +"O% c #7465AE", +"P% c #5F4AA0", +"Q% c #ACD0E7", +"R% c #51A1D1", +"S% c #DDE9F2", +"T% c #BED8EB", +"U% c #097DC1", +"V% c #D4D7EA", +"W% c #4291CA", +"X% c #87BCDE", +"Y% c #DEEAF3", +"Z% c #1080C3", +"`% c #439ACF", +" & c #DFEAF4", +".& c #57A5D3", +"+& c #1C86C6", +"@& c #57A5D4", +"#& c #0D7EC1", +"$& c #3191CB", +"%& c #D9E8F2", +"&& c #E0EBF4", +"*& c #CBE0EE", +"=& c #1381C4", +"-& c #4C9FD0", +";& c #87BDDF", +">& c #A3CBE5", +",& c #E1EBF4", +"'& c #DDE9F3", +")& c #DAE4F0", +"!& c #CDC9E3", +"~& c #D5DAEB", +"{& c #DEE9F3", +"]& c #DEEAF4", +"^& c #A4A0CD", +"/& c #C5CAE2", +"(& c #CAD0E5", +"_& c #A19DCB", +":& c #DEE8F3", +"<& c #6C5AA8", +"[& c #513896", +"}& c #A19DCA", +"|& c #C5C9E2", +"1& c #8276B6", +"2& c #B3B2D6", +"3& c #E0EBF3", +"4& c #7B6DB2", +"5& c #503896", +"6& c #A8A4CF", +"7& c #BCBDDC", +"8& c #3E98CD", +"9& c #298DC8", +"0& c #479CCF", +"a& c #0D7FC1", +"b& c #107EC2", +"c& c #4494CC", +"d& c #ACC6E2", +"e& c #89BEDF", +"f& c #E3EDF5", +"g& c #E3EDF4", +"h& c #2189C7", +"i& c #4A9ED0", +"j& c #2088C7", +"k& c #0479BF", +"l& c #B3D4E9", +"m& c #82BBDE", +"n& c #499DD0", +"o& c #067AC0", +"p& c #B9D7EB", +"q& c #E4EEF6", +"r& c #9AC7E4", +"s& c #057BC0", +"t& c #1482C4", +"u& c #D1E3F0", +"v& c #E5EEF6", +"w& c #E1ECF4", +"x& c #E0EAF3", +"y& c #CECBE4", +"z& c #D4D4E9", +"A& c #E2ECF5", +"B& c #E2ECF4", +"C& c #E3ECF4", +"D& c #E2EDF5", +"E& c #E3ECF5", +"F& c #A7A2CE", +"G& c #C9CDE4", +"H& c #E4EDF5", +"I& c #CED2E8", +"J& c #A39ECC", +"K& c #E4EDF6", +"L& c #D8DEED", +"M& c #7969B0", +"N& c #523A98", +"O& c #A5A0CD", +"P& c #E5EEF5", +"Q& c #B5B4D7", +"R& c #523B98", +"S& c #7463AD", +"T& c #D5E6F2", +"U& c #429ACF", +"V& c #2887C6", +"W& c #5698CD", +"X& c #CDC8E2", +"Y& c #B7D6EB", +"Z& c #8CC0E0", +"`& c #E6EFF6", +" * c #E7F0F6", +".* c #E7EFF6", +"+* c #E7EFF7", +"@* c #8CC1E0", +"#* c #1985C4", +"$* c #A3CCE5", +"%* c #E8F0F6", +"&* c #88BEDF", +"** c #1180C3", +"=* c #1E87C6", +"-* c #AACFE7", +";* c #E9F1F7", +">* c #E8F0F7", +",* c #E1EDF5", +"'* c #459BCF", +")* c #D4E5F1", +"!* c #D9DBEC", +"~* c #E3EAF3", +"{* c #E6EEF6", +"]* c #E8EFF7", +"^* c #E5EDF5", +"/* c #E1E8F2", +"(* c #E7EFF5", +"_* c #E1E8F3", +":* c #E5ECF5", +"<* c #D9DDEC", +"[* c #C1C0DE", +"}* c #E3E9F3", +"|* c #E9F0F7", +"1* c #E4E9F3", +"2* c #E4EBF3", +"3* c #E9F1F8", +"4* c #E7EEF6", +"5* c #DFE2EF", +"6* c #B3C2E0", +"7* c #91AFD7", +"8* c #A3B6DA", +"9* c #CDD1E7", +"0* c #D8E0EF", +"a* c #E0EDF4", +"b* c #E4EEF5", +"c* c #E9F0F6", +"d* c #E7F0F7", +"e* c #EBF2F8", +"f* c #EBF2F7", +"g* c #B9D8EB", +"h* c #A7CEE7", +"i* c #BBD9EC", +"j* c #E8F1F7", +"k* c #ECF3F9", +"l* c #ECF2F8", +"m* c #ECF2F9", +"n* c #ECF3F8", +"o* c #B8D7EB", +"p* c #A8CFE7", +"q* c #C0DCED", +"r* c #EAF1F8", +"s* c #EDF4F8", +"t* c #EDF3F8", +"u* c #DDEBF4", +"v* c #C9E1EF", +"w* c #D0E5F1", +"x* c #EEF4F9", +"y* c #EAF1F7", +"z* c #D5D4E8", +"A* c #E9EFF6", +"B* c #EBF1F7", +"C* c #EBF3F8", +"D* c #EDF3F9", +"E* c #EDF4F9", +"F* c #EDF2F7", +"G* c #E2E5F1", +"H* c #D8D6E9", +"I* c #CDC7E2", +"J* c #CCC7E2", +"K* c #D6D4E8", +"L* c #E2E4F0", +"M* c #ECF2F7", +"N* c #EFF4F9", +"O* c #EFF5F9", +"P* c #EEF4FA", +"Q* c #EEF5F9", +"R* c #EFF4FA", +"S* c #EFF5FA", +"T* c #F0F5F9", +"U* c #F0F5FA", +"V* c #F0F6FA", +"W* c #F1F5FA", +"X* c #F1F6FA", +"Y* c #F2F6FA", +"Z* c #F2F7FB", +"`* c #F2F7FA", +" = c #EEF3F9", +".= c #E0E1EE", +"+= c #DEDDED", +"@= c #F0F6F9", +"#= c #EFF4F8", +"$= c #E4E5F1", +"%= c #D8D5EA", +"&= c #CEC9E3", +"*= c #DAD8EA", +"== c #E5E7F2", +"-= c #F3F6FB", +";= c #F3F7FB", +">= c #F3F7FA", +",= c #F4F8FB", +"'= c #F3F8FB", +")= c #F4F7FB", +"!= c #F4F8FC", +"~= c #B6AED5", +"{= c #E0E0EE", +"]= c #F5F8FC", +"^= c #F5F9FB", +"/= c #D2D0E6", +"(= c #E6E6F1", +"_= c #A297C9", +":= c #F5F9FC", +"<= c #F6F8FC", +"[= c #F6F9FC", +"}= c #F6F9FB", +"|= c #F3F6FA", +"1= c #E1E1EF", +"2= c #D9D7EA", +"3= c #EDEEF5", +"4= c #F4F7FA", +"5= c #F5F8FB", +"6= c #F4F9FB", +"7= c #EEF1F7", +"8= c #E2E2EF", +"9= c #D6D3E8", +"0= c #CCC6E1", +"a= c #D4D0E6", +"b= c #E0DFEE", +"c= c #ECEDF6", +"d= c #F7F9FC", +"e= c #F7FAFC", +"f= c #F6FAFC", +"g= c #D0CCE4", +"h= c #A397C8", +"i= c #D8D5E9", +"j= c #BDB6D8", +"k= c #A69BCA", +"l= c #E8E8F2", +"m= c #E7E7F2", +"n= c #A59BCA", +"o= c #CCC8E2", +"p= c #DCDAEB", +"q= c #C2BDDC", +"r= c #E9EAF4", +"s= c #F8FAFD", +"t= c #F0F1F7", +"u= c #ACA2CE", +"v= c #B1A8D1", +"w= c #F6F8FA", +"x= c #C8C3DE", +"y= c #A599C9", +"z= c #E1E0EE", +"A= c #978BC2", +"B= c #D2CEE4", +"C= c #F5F6F9", +"D= c #C3BDDC", +"E= c #7B69B0", +"F= c #A297C8", +"G= c #C0B9DA", +"H= c #F7F9FB", +"I= c #B6ACD3", +"J= c #ACA1CD", +"K= c #C7C0DE", +"L= c #B5ACD3", +"M= c #BDB7D9", +"N= c #EFF0F7", +"O= c #B4ABD2", +"P= c #F8F9FB", +"Q= c #FBFCFD", +"R= c #E7E6F2", +"S= c #DBD8EB", +"T= c #D2CEE5", +"U= c #DDDBEC", +"V= c #E5E4F0", +"W= c #ECECF5", +"X= c #F1F2F7", +"Y= c #F4F6FA", +"Z= c #F7FAFB", +"`= c #F8FBFD", +" - c #F8FAFC", +".- c #F9FBFD", +"+- c #F8FBFC", +"@- c #F5F7FB", +"#- c #EAE9F3", +"$- c #DEDBEC", +"%- c #D1CCE4", +"&- c #D1CCE5", +"*- c #DDDAEC", +"=- c #EAE8F3", +"-- c #F6F7FA", +";- c #FAFCFD", +">- c #FAFCFE", +",- c #FBFCFE", +"'- c #EBEBF4", +")- c #7A68AF", +"!- c #E4E2F0", +"~- c #7461AB", +"{- c #A89DCB", +"]- c #9F92C5", +"^- c #D5CFE5", +"/- c #8574B6", +"(- c #8271B4", +"_- c #7F6DB2", +":- c #A396C8", +"<- c #9C8EC3", +"[- c #BAB1D5", +"}- c #A69ACA", +"|- c #FCFDFE", +"1- c #BBB3D6", +"2- c #9283BD", +"3- c #B9AFD5", +"4- c #C3BCDB", +"5- c #8877B7", +"6- c #E2DEEE", +"7- c #7664AD", +"8- c #9A8BC2", +"9- c #B8AED4", +"0- c #9D91C5", +"a- c #F3F2F8", +"b- c #816FB3", +"c- c #9586BF", +"d- c #C5BEDC", +"e- c #B3AAD1", +"f- c #ADA2CE", +"g- c #9081BC", +"h- c #715DA9", +"i- c #DEDAEB", +"j- c #7662AC", +"k- c #9788C1", +"l- c #B8AFD4", +"m- c #E7E4F1", +"n- c #FFFEFF", +"o- c #FBFDFE", +"p- c #FBFDFD", +"q- c #FCFCFD", +"r- c #FAFBFC", +"s- c #F7F6FB", +"t- c #F1F2F8", +"u- c #EFEEF6", +"v- c #ECEBF5", +"w- c #ECEAF4", +"x- c #EDECF5", +"y- c #EEEDF5", +"z- c #EFEFF6", +"A- c #F7F6FA", +"B- c #F9FAFC", +"C- c #FDFEFE", +"D- c #FDFDFE", +"E- c #F9FAFD", +"F- c #E1DEEE", +"G- c #D5D0E7", +"H- c #D3CDE5", +"I- c #DFDAEC", +"J- c #F8F7FB", +"K- c #FDFFFE", +"L- c #FEFEFF", +"M- c #FEFFFF", +"N- c #FEFEFE", +"O- c #FEFFFE", +"P- c #FFFFFF", +"Q- c #DFDBEC", +"R- c #9687C0", +"S- c #8473B5", +"T- c #A194C6", +"U- c #C5BCDC", +"V- c #FDFCFD", +"W- c #7966AE", +"X- c #6E59A8", +"Y- c #B2A8D1", +"Z- c #A395C7", +"`- c #A194C7", +" ; c #BFB6D8", +".; c #D6D0E6", +"+; c #A396C7", +"@; c #EAE7F2", +"#; c #B2A7D0", +"$; c #7F6EB2", +"%; c #AB9FCC", +"&; c #7663AD", +"*; c #BAB0D5", +"=; c #9D90C4", +"-; c #F3F1F8", +";; c #8270B4", +">; c #D7D1E7", +",; c #7B68B0", +"'; c #A092C5", +"); c #D5D0E6", +"!; c #F8F7FA", +"~; c #7D6BB1", +"{; c #8776B7", +"]; c #DAD5E8", +"^; c #CEC7E1", +"/; c #E1DCED", +"(; c #D8D4E8", +"_; c #E3DFEF", +":; c #FAFAFC", +"<; c #9080BC", +"[; c #8F80BC", +"}; c #9B8CC2", +"|; c #AFA4CF", +"1; c #806EB3", +"2; c #8574B5", +"3; c #BBB2D6", +"4; c #B5AAD2", +"5; c #8D7DBB", +"6; c #8C7CBA", +"7; c #BDB4D7", +"8; c #C8C0DE", +"9; c #DBD6E9", +"0; c #AEA3CE", +"a; c #D7D1E6", +"b; c #8270B3", +"c; c #8676B6", +"d; c #D3CDE4", +"e; c #AA9ECB", +"f; c #A79BCA", +"g; c #D8D2E7", +"h; c #7866AE", +"i; c #9B8DC3", +"j; c #9383BE", +"k; c #9485BE", +"l; c #E4E0EE", +"m; c #CCC5E0", +"n; c #8B7BB9", +"o; c #9688C0", +"p; c #C6BEDD", +"q; c #8675B6", +"r; c #DDD8EA", +"s; c #F9F8FB", +"t; c #E4E1EF", +"u; c #DAD6E9", +"v; c #CFCAE3", +"w; c #D8D3E8", +"x; c #EBE9F3", +"y; c #F6F5FA", +"z; c #C9C2DF", +"A; c #FBFAFC", +"B; c #F2F1F7", +"C; c #E1DDEE", +"D; c #D3CEE6", +"E; c #D7D3E8", +"F; c #F0EEF6", +"G; c #FCFBFD", +"H; c #F6F6FA", +"I; c #F1EFF6", +"J; c #E9E6F2", +"K; c #E6E3F0", +"L; c #E3E0EF", +"M; c #E1DEED", +"N; c #E2DFEE", +"O; c #E8E6F2", +"P; c #EEECF5", +"Q; c #F5F4F9", +"R; c #FBFBFC", +"S; c #F8F8FB", +". . + + @ # # . . . . . . . + + # + + + . . + + + + # . . # . + + @ . . . @ . + + + . . + . + . + + # . . . + + @ . + . + . . # . @ # + + + + + . + # + . + + + + . + . + + . . . + # ", +". # . + + + + + . . @ + . + + + # + . . @ + . + . + + + + . + + . + @ @ + . . . . @ . + . # . + + . . . + . # . . . + $ % & * = - ; > , ' ) ! . . . . . . . + . + . . . @ + + . . + + ", +". + + + @ + + + + . . . + + @ . + + . + + + . + . . + . + . + . . # . + . + # + + + + + . + . . + + . + ! ~ { ] ^ / ( _ : < [ } . + + + + . + @ @ + . + . + . . @ . + + + + + + @ . . ", +"# @ . . @ + . + + . . + + + # . + . + + . + + + . . . . . . . + . . + + . . + . . + @ @ + . @ | 1 - 2 3 4 3 5 6 [ @ . . + . . . . . . . + + + + . @ + + 7 7 7 8 9 7 9 0 . 8 a b b c b ", +"+ # # . + + + # . + + + + d + + . + . . + + . + + + + . + 7 . . . 0 9 9 b a b a c b e f g h i j k l m & e e n e o o p p p p q r r s t p u v v w w t t t w x x w y x x w z x x x A B B ", +"e c c C o b o e o o o p e p p p p p r r D v s r u w w w v v u x w u w x E x F G H I j j J K L M B N N O N B P Q R S T U V V W U X B Y Y Y Z Y Y Z ` . .Y ...Y +...@.@.@.@.......#.#.", +"B N B B B B B $.Z N $.O P N O Z Z Z Y Z Z Z Z Z .Y Y .@.Y .Y ....%.&.*.k =.-.;.>.,.'.).!.~...~.~.'.).~.{.].^./.(._.:.<.[.}.-.-.|.1.2.3.4.5.6.6.7.8.9.6.7.8.0.0.a.a.b.b.a.a.b.b.b.c.", +"~.).~.~.{.~.~.{.~.{.~.{.{.d.{.e.6.e.f.f.7.6.6.6.7.9.8.7.7.g.h.i.j.k.=.-.|.2.l.m.n.b.b.a.b.o.b.b.p.q.r.p.s.q.s.s.q.q.q.q.t.t.s.u.v.-.-.-.-.-.w.x.y.z.A.A.z.A.B.B.C.B.A.B.B.C.D.D.D.E.F.", +"p.b.b.b.q.q.o.s.q.s.s.q.s.z.t.q.q.y.t.z.z.z.t.z.z.B.G.H.I.J.w.-.-.w.K.L.E.A.D.F.D.F.D.D.D.D.D.F.D.M.N.O.O.O.O.P.O.Q.O.Q.Q.O.R.Q.Q.S.-.-.-.-.-.-.T.U.V.U.U.V.W.U.U.U.U.W.X.W.Y.W.W.X.X.", +"P.D.P.P.O.O.P.O.O.O.Q.Z.O.Q.Q.Q.`.Q.Q. +`..+U. +++@+#+$+-.-.w.%+&+.+X.*+W.Y.W.=+-+X.X.Y.;+X.W.;+;+;+>+,+'+)+!+,+~+{+]+^+)+)+{+/+)+)+(+-.-.-.-.-.$+/+_+:+_+<+/+[+:+:+:+}+|+1+1+Z.}+[+2+", +";+;+X.^+;+)+^+^+3+4+]+{+)+)+]+)+)+)+)+)+5+6+7+8+9+-.-.$+0+a+6+}+:+}+:+}+[+}+b+c+d+e+f+}+}+b+b+g+2+2+h+i+j+2+k+i+l+m+n+o+m+p+p+q+r+r+s+-.-.-.-.-.t+u+v+u+w+w+x+w+w+y+w+w+z+i+i+A+B+C+D+", +"2+2+2+2+2+2+m+2+n+p+m+m+m+o+m+n+r+m+E+F+G+9+-.-.9+H+I+q+x+u+w+w+u+w+w+w+w+y+w+J+d+K+D+C+y+D+L+M+L+K+N+i+j+M+O+P+Q+M+R+M+S+M+M+T+M+U+-.-.-.-.-.9+V+W+T+T+T+X+X+Y+Z+`+Y+ @.@i+i++@ @ @ @", +"L+C+D+L+M+M+M+L+C+@@M+@@M+@@M+R+#@$@%@-.&@*@=@-@;@>@,@'@W+W+`+)@!@>@~@{@ @m ]@^@/@(@_@ @:@<@[@}@|@<@1@i+j+2@3@4@5@6@4@7@8@9@0@a@b@%@c@d@e@f@g@h@i@j@k@l@m@n@N+o@p@j@j@q@r@i+i+s@t@u@v@", +"w@:@:@:@2@2@x@2@x@x@x@2@x@y@z@A@9+-.-.-.B@C@D@E@F@d+C@G@H@j@I@J@K@L@M@C@N@O@P@C@C@P@Q@R@S@T@i+i+i+'+U@i+j+V@W@i+X@Y@i+i+Z@`@i+ #.#+#i+i+i+i+@###$#%#&#*#i+i+i+i+i+=#v@T@i+i+i+i+i+-#;#", +">#V@,#v@,#,#'#)#)#!#V@~#{#]#-.-.-.9+^#/#(#C@_#:#<#%#[#C@}#|#1#2#3#4#R@5#C@6#%#7#8#;#%#9#0#i+`@a#b#*#i+i+c#d#e#i+f#g#i+i+h#@#i#j#k#i+l#m#n#o#i+i+p#q#r#i+i+s#t#u#i+i+v#w#x#i+i+y#z#V@A#", +"d#d#d#d#d#B#C#D#d#E#F#G#-.-.-.9+H#I#J#K#L#C@M#K#N#N#O#C@P#Q#C@R#A#q#q#S#T#7#q#U#T#V#W#X#i+i+Y#Z#`#B# $i+c#Z#e#i+.$+$i+i+@$#$-.$$%$i+&$*$=$-$;$i+>$,$'$i+x#)$!$~${$]$^$)$/$i+i+($_$_$_$", +"`#Z#W#=$Z#-$Z#:$<$[$-.-.-.-.}$|$1$2$2$3$4$C@5$2$2$6$7$C@8$9$0$a$b$c$b$b$d$e$f$g$T#_$_$h$i+i+i$j$k$_$l$i+c#j$m$i+n$o$i+i+p$-.-.q$i+i+r$s$t$s$u$i+v$w$i+i+x$y$z$A$z$B$B$z$C$i+i+D$E$F$F$", +"G$j$k$G$k$j$H$I$-.-.-.-.J$K$L$M$N$O$P$P$Q$C@>.P$P$P$R$C@S$T$0$U$U$U$U$U$U$U$V$W$X$F$Y$l$i+Z$M$`$ % %.%i+%$`$m$i++%@%i+i+#%-.-.$%i+i+,+T@T@T@T@T@T@%%i+i+&%*%*%=%-%=%-%;%>%i+i+,%-%;%-%", +"'%Y$`$ %B$)%-.-.-.-.-.!%~%{%]%{%{%{%{%^%/%C@(%_%_%:%<%C@[%}%|%1%*%-%=%2%=%-%;%3%4%5%6%7%i+i+8%9%9%0%a%i+%$b%c%i+d%e%i+i+f%g%h%i%i+i+j%k%l%m%l%l%l%n%i+i+o%p%q%l%r%s%t%u%v%i+i+w%p%x%y%", +"9%9%9%z%A%-.-.-.-.-.B%6%b%C%D%E%C%C%E%l%F%C@G%l%l%m%H%C@I%J%C@K%p%m%m%L%M%N%p%O%P%x%p%Q%i+i+R%l%S%T%U%i+j+V%W@i+W%e%i+i+X%Y%Y%=%Z%i+`%m% &u%.&+&@&'%#&i+$&%&&&*&=&i+-&&&;&i+i+>&,&&&,&", +"'&'&)&!&-.-.-.-.-.~&{&{&Y%{&Y% &Y%Y%]&]&^&C@/& & & &(&C@_&:&<&[&}&(&|&1&C@2&3&4&5&6&7&,&8&i+i+9&0&a&'$i+%$-.b&i+c&d&i+i+e&f&f&g&e&i+i+h&i&j&i+k&l&f&m&i+i+h&n&0#i+o&p&q&r&i+i+s&t&u&v&", +"w&x&y&-.-.-.-.-.z&A&B&A&C&C&f&D&f&f&A&E&F&C@G&f&f&H&I&C@J&K&L&M&C@C@C@N&O&P&H&Q&R&C@S&v&T&U&i+i+i+V&W&i+%$X&W@i+i&Y&i+i+Z&`& *.*+*@*=&i+i+i+#*$*%*.*%*&***i+i+i+=*-*;*>*,*'*i+i+i+)*;*", +"v&!*-.-.-.-.-.-.~*{*.*`&`&.*+* *.* *+*]*^*/*^*+*%*>*(*_*:*%*>*>*<*[*t+}*>*>*;*|*%*1*2*3*4*5*6*7*8*9+w.9*0*;*D&a*b*c*,*,*d*e*f*e*e*e*`&g*h*i*j*k*l*m*n*l*`&o*p*q*r*n*n*s*t*s*u*v*w*e*x*", +"y*z*-.-.-.-.-.-.A*f*B*e*e*B*f*f*e*C*e*e*l*l*C*n*e*l*n*m*n*t*k*l*D*t*s*s*t*s*t*D*E*F*G*H*I*-.-.J*K*L*M*x*x*N*O*P*Q*N*O*O*N*R*O*S*T*T*T*O*U*T*U*T*U*T*V*U*W*V*V*X*W*X*X*X*X*X*Y*X*Z*Y*`*", +" =.=-.-.-.-.-.-.+=P*O*N*N*R*R*O*N*T*O*O*T*U*U*@=V*U*T*T*V*X*X*X*W*X*X*Y*Y*X*#=$=%=I*-.-.&=*===T*-=;=Z*;=`*-=;=>=>=;=;=;=,=,=;=,='='=)=,=,=,=!=~={=]=^=,=/=(=_=:=]=^=^=^=:=<=:=[=}=[=[=", +"|=`*1=X&-.-.-.-.-.2=3=>=4='=)='='=)=,=;=,=,=,=,=,=5=5=5=6=5=]=5=:=5=]=7=8=9=0=-.-.a=b=c=^=d=e=f=f=g=h=i=H*j=k=l=m=n=o=p=q=n=r=s=t=u=v=w=x=y=z=A=-.B=C=D=E=F=G=H=I=J=t=K=L=M=N=u=O=P=Q=", +"[=f=e=4=R=S=T=0=-.-.-.T=U=V=W=X=Y=Z=`=`=`= -`=.-.-.-+-.-.-.-.-@-#-$-%--.-.&-*-=---;->-;-;-Q=Q=,-'-)-!-~-{-]-^-/-(-a=_-:-<-[-}-|-1-2-3-4-5-6-7-8-9-0-a-b-c-d-)-e-f-I*g-h-i-j-f-k-l-m-n-", +">-,-o-,-p-p-q-r-s-t-u-v-'-w-x-y-z-a-A-B-|-C-C-|-C-C-D-E-y-F-G--.-.H-I-#-J-K-L-M-N-L-n-O-P-P-P-P-Q-R-P-S-T-U-V-W-X-Y-Z-`- ;.;+;P-@;#;$;R-%;P-&;8-*;=;-;;;`->;,;';);!;~;,;P-{;];#;~;^;P-", +"n-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-!;w-/;a=-.X&(;_;y-:;P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-D-<;[;};|;1;2;3;4;5;6;7;8;9;0;P-a;b;c;d;5-5;e;f;g;h;i;j;7;k;6;l;(-2;m;n;P-o;p;(-q;r;P-", +"P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-s;y-t;u;v;&=w;6-x;y;N-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-|;z;P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-", +"P-P-P-P-P-P-P-P-P-P-P-P-A;B;@;C;(;D;E;Q-m-F;s;P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-J-:;P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-", +"P-P-P-P-G;H;I;w-J;K;L;M;N;O;P;Q;G;P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-", +"P-P-P-R;S;:;V-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-", +"P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-P-"}; diff -Nru barry-0.14/desktop/images/Makefile.am barry-0.0.20110506/desktop/images/Makefile.am --- barry-0.14/desktop/images/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/images/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,36 @@ +dist_image_DATA = \ + background.png \ + scanning.png \ + apploader-focus.png \ + apploader-normal.png \ + apploader-pushed.png \ + backuprestore-focus.png \ + backuprestore-normal.png \ + backuprestore-pushed.png \ + browsedatabases-focus.png \ + browsedatabases-normal.png \ + browsedatabases-pushed.png \ + deviceswitch-focus.png \ + deviceswitch-normal.png \ + deviceswitch-pushed.png \ + media-focus.png \ + media-normal.png \ + media-pushed.png \ + misc-focus.png \ + misc-normal.png \ + misc-pushed.png \ + modem-focus.png \ + modem-normal.png \ + modem-pushed.png \ + sync-focus.png \ + sync-normal.png \ + sync-pushed.png + +EXTRA_DIST = \ + MainButtons.xcf \ + Makefile.am \ + README \ + background.xcf \ + barry_logo_icon.xpm \ + logo_NetDirect.xpm + Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/media-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/media-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/media-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/media-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/media-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/media-pushed.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/misc-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/misc-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/misc-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/misc-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/misc-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/misc-pushed.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/modem-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/modem-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/modem-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/modem-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/modem-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/modem-pushed.png differ diff -Nru barry-0.14/desktop/images/README barry-0.0.20110506/desktop/images/README --- barry-0.14/desktop/images/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/images/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,5 @@ +The icons come from the Tango Desktop Project: +http://tango.freedesktop.org/Tango_Desktop_Project + +A special thanks to them for their work! + Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/scanning.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/scanning.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/sync-focus.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/sync-focus.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/sync-normal.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/sync-normal.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/desktop/images/sync-pushed.png and /tmp/ehd5lCCenv/barry-0.0.20110506/desktop/images/sync-pushed.png differ diff -Nru barry-0.14/desktop/Makefile.am barry-0.0.20110506/desktop/Makefile.am --- barry-0.14/desktop/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,7 @@ +ACLOCAL_FLAGS = -I ../m4 + +EXTRA_DIST = COPYING ChangeLog README buildgen.sh \ + doc + +SUBDIRS = . images src man + diff -Nru barry-0.14/desktop/man/barrydesktop.1 barry-0.0.20110506/desktop/man/barrydesktop.1 --- barry-0.14/desktop/man/barrydesktop.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/man/barrydesktop.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,40 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BARRYDESKTOP 1 "September 24, 2009" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B barrydesktop +\- Barry Project's control panel for the BlackBerry(R) handheld +.SH SYNOPSIS +.B barrydesktop +[-?][-d] +.SH DESCRIPTION +.PP +.B barrydesktop +is a GUI application which provides general control of your Blackberry(R) +handheld devices. + +This application is still in development. + +.SH AUTHOR +.nh +.B barrydesktop +is part of the Barry project. +This manual page was written by Chris Frey. +.SH SEE ALSO +.PP +http://www.netdirect.ca/software/packages/barry + diff -Nru barry-0.14/desktop/man/Makefile.am barry-0.0.20110506/desktop/man/Makefile.am --- barry-0.14/desktop/man/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/man/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ +dist_man_MANS = barrydesktop.1 + diff -Nru barry-0.14/desktop/NEWS barry-0.0.20110506/desktop/NEWS --- barry-0.14/desktop/NEWS 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/NEWS 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,3 @@ + +See http://www.netdirect.ca/software/packages/barry for the latest news. + diff -Nru barry-0.14/desktop/README barry-0.0.20110506/desktop/README --- barry-0.14/desktop/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,9 @@ + +This is the Desktop sub-project of the Barry project. You will need the +Barry library compiled and installed to use this. This directory +contains a fully standalone build tree, but can optionally be built +automatically when you build Barry if you use the --enable-desktop +configure option. + +See doc/www/index.html for more documentation. + diff -Nru barry-0.14/desktop/src/0.22/Makefile.am barry-0.0.20110506/desktop/src/0.22/Makefile.am --- barry-0.14/desktop/src/0.22/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/0.22/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,6 @@ +dist_xmlmap22_DATA = \ + xmlmap + +EXTRA_DIST = \ + Makefile.am + diff -Nru barry-0.14/desktop/src/0.22/xmlmap barry-0.0.20110506/desktop/src/0.22/xmlmap --- barry-0.14/desktop/src/0.22/xmlmap 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/0.22/xmlmap 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,135 @@ +# The order listed in this file is the order that the fields will be +# stored when parsed into friendly lists. +# +# +# Note: Type may be included in any of these: +# +# $ = use first value found +# % = generate comma separated list of all values of that name +# , = add comma after value if non-zero length +# ( = enclose next variable or list in parentheses +# +Contact /contact/Name 0 $Prefix $FirstName $Additional $LastName $Suffix + FirstName + LastName + Additional + Prefix + Suffix +#Contact /contact/FormattedName 0 $Content +# Content +Contact /contact/Organization 0 $Name + Name + Department + Unit +# Type not included in compare list, since it varies... +Contact /contact/Telephone 0 $Content (%Type + Content +Contact /contact/EMail 0 $Content (%Type + Content + Type +Contact /contact/Categories 1 %Category + Category +Contact /contact/Address 1 (%Type $PostalBox $Street, $City, $Region, $Country, $PostalCode + PostalBox + Street + City + Region + Country + PostalCode + ExtendedAddress + Type +#Contact /contact/AddressLabel 1 $Content +# Content +# Type +Contact /contact/Title 1 $Content + Content +Contact /contact/Nickname 1 $Content + Content +Contact /contact/Birthday 1 $Content + Content +Contact /contact/Note 1 $Content + Content +Contact /contact/Photo 1 Image Data + Content +Contact /contact/Url 1 $Content + Content +Contact /contact/Agent 1 $Content + Content +Contact /contact/Mailer 1 $Content + Content +Contact /contact/Timezone 1 $Content + Content +Contact /contact/Location 1 $Latitude / $Longitude + Latitude + Longitude +Contact /contact/Role 1 $Content + Content +Contact /contact/Logo 1 Logo Data + Content +Contact /contact/Class 1 $Content + Content + + +# key event data: summary, dates, location, description +Calendar /vcal/Event/Summary 0 $Content + Content +Calendar /vcal/Event/Description 0 $Content + Content +Calendar /vcal/Event/Location 0 $Content + Content +Calendar /vcal/Event/DateCreated 1 Created: $Content + Content[timestamp] +Calendar /vcal/Event/DateStarted 1 Started: $Content + Content[timestamp] +Calendar /vcal/Event/DateDue 1 Due: $Content + Content[timestamp] +Calendar /vcal/Event/Duration 1 Duration: $Content + Content +Calendar /vcal/Event/DateEnd 1 End: $Content + Content[timestamp] +Calendar /vcal/Event/Organizer 1 Organizer: $Content + Content +Calendar /vcal/Event/Attendee 1 Attendee: $Content + Content +Calendar /vcal/Event/Contact 1 Contact: $Content + Content +Calendar /vcal/Event/Completed 1 $Content + Content +Calendar /vcal/Event/Categories 1 %Category + Category +Calendar /vcal/Event/Method 1 $Content + Content +#Calendar /vcal/Event/DateCalendarCreated 1 CalCreated: $Content +# Content +#Calendar /vcal/Event/PercentComplete 1 $Content +# Content +#Calendar /vcal/RecurrenceRule 1 %Rule +# Rule +#Calendar /vcal/Event/Transparency 1 $Content +# Content +# FIXME - Alarm needs testing: +Calendar /vcal/Event/Alarm 1 $AlarmDescription + AlarmAction + AlarmDescription + AlarmTrigger +Calendar /vcal/Event/Class 1 $Content + Content +Calendar /vcal/Event/Url 1 $Content + Content +Calendar /vcal/Event/Priority 1 $Content + Content +#Calendar /vcal/Event/Sequence 1 $Content +# Content +#Calendar /vcal/RecurrenceDate 1 $Content +# Content +Calendar /vcal/Event/Geo 1 $Latitude / $Longitude + Latitude + Longitude +Calendar /vcal/Event/Status 1 $Content + Content +Calendar /vcal/Event/Attach 1 Attach Data + Content +#Calendar /vcal/ExclusionDate 1 $Content +# Content +# Value + diff -Nru barry-0.14/desktop/src/0.40/Makefile.am barry-0.0.20110506/desktop/src/0.40/Makefile.am --- barry-0.14/desktop/src/0.40/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/0.40/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,6 @@ +dist_xmlmap40_DATA = \ + xmlmap + +EXTRA_DIST = \ + Makefile.am + diff -Nru barry-0.14/desktop/src/0.40/xmlmap barry-0.0.20110506/desktop/src/0.40/xmlmap --- barry-0.14/desktop/src/0.40/xmlmap 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/0.40/xmlmap 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ +# Not yet implemented + diff -Nru barry-0.14/desktop/src/barrydesktop.cc barry-0.0.20110506/desktop/src/barrydesktop.cc --- barry-0.14/desktop/src/barrydesktop.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/barrydesktop.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,189 @@ +/// +/// \file barrydesktop.cc +/// Program entry point for the desktop GUI +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "barrydesktop.h" +#include "util.h" +#include "osbase.h" +#include "BaseFrame.h" +#include +#include +#include + +using namespace std; + +UsbScanSplash::UsbScanSplash() +{ + wxImage scanpng(GetImageFilename(_T("scanning.png"))); + wxBitmap scanning(scanpng); + std::auto_ptr splash( new wxSplashScreen( + scanning, wxSPLASH_CENTRE_ON_SCREEN, 0, + NULL, -1, wxDefaultPosition, wxDefaultSize, + wxSIMPLE_BORDER) ); + splash->Show(true); + wxGetApp().Yield(); + wxGetApp().Yield(); +} + +UsbScanSplash::~UsbScanSplash() +{ +} + +////////////////////////////////////////////////////////////////////////////// +// BarryDesktopApp + +BarryDesktopApp::BarryDesktopApp() + : m_global_config("BarryDesktop") + , m_set( new OpenSync::APISet ) +{ +} + +void BarryDesktopApp::Probe() +{ + // start fresh + m_results.clear(); + + try { + // This can throw Usb::Error exceptions + Barry::Probe probe; + m_results = probe.GetResults(); + } + catch( Usb::Error &e ) { + wxString msg = _T("A serious error occurred while probing the USB subsystem for BlackBerry(R) devices: "); + msg += wxString(e.what(), wxConvUTF8); + wxMessageBox(msg, _T("USB Error"), wxOK | wxICON_ERROR); + } +} + +wxBitmap BarryDesktopApp::GetScreenshot(const Barry::ProbeResult &device) const +{ + // FIXME - will need to eventually move the controller object + // into the main app, I think, and maybe the modes too, so + // that multiple menu commands can work simultaneously + + Barry::Controller con(device); + Barry::Mode::JavaLoader javaloader(con); + + javaloader.Open(); + javaloader.StartStream(); + + Barry::JLScreenInfo info; + Barry::Data image; + javaloader.GetScreenshot(info, image); + + // Convert to BMP format + Barry::Data bitmap(-1, GetTotalBitmapSize(info)); + Barry::ScreenshotToBitmap(info, image, bitmap); + + // Load as wxImage (sigh) + wxMemoryInputStream stream(bitmap.GetData(), bitmap.GetSize()); + wxImage bmp(stream, wxBITMAP_TYPE_BMP); + bmp.Rescale(180, 100, wxIMAGE_QUALITY_HIGH); + return wxBitmap(bmp); +} + +void BarryDesktopApp::SetDeviceName(Barry::Pin pin, const std::string &name) +{ + if( !pin.Valid() ) + return; + + // load device config + Barry::ConfigFile cfg(pin); + + // re-save device config + cfg.SetDeviceName(name); + cfg.Save(); + + // update our results if this device exists in our list + int index = Barry::Probe::Find(m_results, pin); + if( index != -1 ) { + m_results[index].m_cfgDeviceName = name; + } +} + +std::string BarryDesktopApp::GetDeviceName(Barry::Pin pin) const +{ + string name; + int index = Barry::Probe::Find(m_results, pin); + if( index != -1 ) + name = m_results[index].m_cfgDeviceName; + return name; +} + +void BarryDesktopApp::ShowMissingOpenSyncMessage() +{ + wxMessageBox(_T("No OpenSync libraries were found. Sync will be unavailable until you install OpenSync version 0.22 or version 0.4x on your system, along with the needed plugins."), _T("OpenSync Not Found"), wxOK | wxICON_INFORMATION); +} + +bool BarryDesktopApp::OnInit() +{ + // Add a PNG handler for loading buttons and backgrounds + wxImage::AddHandler( new wxPNGHandler ); + + // Add handlers for loading Contact Photos + wxImage::AddHandler( new wxJPEGHandler ); + wxImage::AddHandler( new wxTIFFHandler ); + wxImage::AddHandler( new wxXPMHandler ); + + std::auto_ptr splash( new UsbScanSplash ); + + // Initialize Barry and USB + Barry::Init(m_global_config.VerboseLogging()); + + // Scan bus at the beginning so we know what devices we've got + Probe(); + + // Search for available OpenSync libraries + if( m_set->OpenAvailable() == 0 ) { + ShowMissingOpenSyncMessage(); + } + + // Create the main frame window where all the action happens + wxImage back(GetImageFilename(_T("background.png"))); + if( !back.IsOk() ) { + Yield(); + return false; + } + BaseFrame *frame = new BaseFrame(back); + + // Clean up the splash screen, and init the main frame + splash.reset(); + SetTopWindow(frame); + frame->Show(true); + + return true; +} + +int BarryDesktopApp::OnExit() +{ + try { + m_global_config.Save(); + } + catch( std::exception &e ) { + cerr << "Exception caught while saving config: " + << e.what() << endl; + } + + return 0; +} + +// This takes care of main() and wxGetApp() for us. +IMPLEMENT_APP(BarryDesktopApp) + diff -Nru barry-0.14/desktop/src/barrydesktop.h barry-0.0.20110506/desktop/src/barrydesktop.h --- barry-0.14/desktop/src/barrydesktop.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/barrydesktop.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,90 @@ +/// +/// \file barrydesktop.h +/// Program entry point for the desktop GUI +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_BARRYDESKTOP_H__ +#define __BARRYDESKTOP_BARRYDESKTOP_H__ + +#include +#include +#include + +class wxSplashScreen; +namespace OpenSync { + class APISet; +} + +class UsbScanSplash +{ + std::auto_ptr m_splash; +public: + UsbScanSplash(); + ~UsbScanSplash(); +}; + +class BarryDesktopApp : public wxApp +{ +private: + Barry::GlobalConfigFile m_global_config; + Barry::Probe::Results m_results; + std::auto_ptr m_set; + +public: + BarryDesktopApp(); + + // + // data access + // + Barry::GlobalConfigFile& GetGlobalConfig() { return m_global_config; } + const Barry::Probe::Results& GetResults() const { return m_results; } + OpenSync::APISet& GetOpenSync() { return *m_set; } + + // + // operations + // + + void ShowMissingOpenSyncMessage(); + + /// Fills m_results with new data after a brand new scan. + /// Does not catch exceptions. + void Probe(); + + /// Grabs a screenshot of the given device. + /// Can throw exceptions on error. + wxBitmap GetScreenshot(const Barry::ProbeResult &device) const; + + /// Sets the device name for the given device PIN. + /// If the PIN exists in m_results, the associated + /// m_results entry will be updated with the new device name, + /// so the next GetResults() will contain the new name. + void SetDeviceName(Barry::Pin pin, const std::string &name); + std::string GetDeviceName(Barry::Pin pin) const; + + // + // overrides + // + virtual bool OnInit(); + virtual int OnExit(); +}; + +DECLARE_APP(BarryDesktopApp) + +#endif + diff -Nru barry-0.14/desktop/src/BaseButtons.cc barry-0.0.20110506/desktop/src/BaseButtons.cc --- barry-0.14/desktop/src/BaseButtons.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/BaseButtons.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,135 @@ +/// +/// \file BaseButtons.cc +/// Support class for BaseFrame +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "BaseButtons.h" +#include "BaseFrame.h" +#include "PNGButton.h" +#include "windowids.h" +#include "util.h" +#include +#include + +using namespace std; + +////////////////////////////////////////////////////////////////////////////// +// BaseButtons + +BaseButtons::BaseButtons(wxWindow *parent) + : m_current(0) +{ + // first, discover the size of the average button + wxString file = GetButtonFilename(MainMenu_BackupAndRestore, + BUTTON_STATE_NORMAL); + wxImage sizer(file); + m_buttonWidth = sizer.GetWidth(); + m_buttonHeight = sizer.GetHeight(); + + for( int i = MainMenu_FirstButton; i <= MainMenu_LastButton; i++ ) { + int row = (i - MainMenu_FirstButton) / 3; + int col = (i - MainMenu_FirstButton) % 3; + int y_offset = MAIN_HEADER_OFFSET; // skip the header + + PNGButton *button = new PNGButton(parent, i, + col * m_buttonWidth, + row * m_buttonHeight + y_offset, + IsButtonEnabled(i)); + + m_buttons.push_back(button); + } +} + +BaseButtons::~BaseButtons() +{ + vector::iterator b = m_buttons.begin(); + for( ; b != m_buttons.end(); ++b ) { + delete *b; + } + m_buttons.clear(); +} + +PNGButton* BaseButtons::CalculateHit(int x, int y) +{ + int col = x / m_buttonWidth; + if( x < 0 || col < 0 || col > 2 ) + return 0; + + int y_offset = MAIN_HEADER_OFFSET; // graphic header size + + int row = (y - y_offset) / m_buttonHeight; + if( y < y_offset || row < 0 || row > 2 ) + return 0; + + unsigned int index = col + row * 3; + if( index >= m_buttons.size() ) + return 0; + + return m_buttons[index]; +} + +void BaseButtons::InitAll(wxDC &dc) +{ + vector::iterator b = m_buttons.begin(); + for( ; b != m_buttons.end(); ++b ) { + (*b)->Init(dc); + } +} + +void BaseButtons::DrawAll(wxDC &dc) +{ + vector::iterator b = m_buttons.begin(); + for( ; b != m_buttons.end(); ++b ) { + (*b)->Draw(dc); + } +} + +void BaseButtons::HandleMotion(wxDC &dc, int x, int y) +{ + PNGButton *hit = CalculateHit(x, y); + if( hit != m_current ) { + // clean up old hit + if( m_current ) { + m_current->Normal(dc); + } + + m_current = hit; + + // draw the new state + if( m_current ) + m_current->Focus(dc); + } +} + +void BaseButtons::HandleDown(wxDC &dc, int x, int y) +{ + HandleMotion(dc, x, y); + if( m_current ) { + m_current->Push(dc); + } +} + +void BaseButtons::HandleUp(wxDC &dc, int x, int y) +{ + HandleMotion(dc, x, y); + if( m_current && m_current->IsPushed() ) { + m_current->Click(dc); + } +} + diff -Nru barry-0.14/desktop/src/BaseButtons.h barry-0.0.20110506/desktop/src/BaseButtons.h --- barry-0.14/desktop/src/BaseButtons.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/BaseButtons.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,53 @@ +/// +/// \file BaseButtons.h +/// Support class for BaseFrame +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_BASEBUTTONS_H__ +#define __BARRYDESKTOP_BASEBUTTONS_H__ + +#include + +class PNGButton; +class wxDC; +class wxWindow; + +class BaseButtons +{ +private: + std::vector m_buttons; + PNGButton *m_current; + int m_buttonWidth, m_buttonHeight; + +protected: + PNGButton* CalculateHit(int x, int y); + +public: + BaseButtons(wxWindow *parent); + ~BaseButtons(); + + void InitAll(wxDC &dc); + void DrawAll(wxDC &dc); + void HandleMotion(wxDC &dc, int x, int y); + void HandleDown(wxDC &dc, int x, int y); + void HandleUp(wxDC &dc, int x, int y); +}; + +#endif + diff -Nru barry-0.14/desktop/src/BaseFrame.cc barry-0.0.20110506/desktop/src/BaseFrame.cc --- barry-0.14/desktop/src/BaseFrame.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/BaseFrame.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,837 @@ +/// +/// \file BaseFrame.cc +/// Class for the fixed-size frame that holds the main app +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "BaseFrame.h" +#include "Mode_MainMenu.h" +#include "Mode_Sync.h" +#include "Mode_Browse.h" +#include "ClickImage.h" +#include "barrydesktop.h" +#include "windowids.h" +#include +#include +#include + +// include icons and logos +#include "../images/barry_logo_icon.xpm" +#include "../images/logo_NetDirect.xpm" + +using namespace std; + +BEGIN_EVENT_TABLE(BaseFrame, wxFrame) + EVT_SIZE (BaseFrame::OnSize) + EVT_PAINT (BaseFrame::OnPaint) + EVT_MOTION (BaseFrame::OnMouseMotion) + EVT_LEFT_DOWN (BaseFrame::OnLeftDown) + EVT_LEFT_UP (BaseFrame::OnLeftUp) + EVT_BUTTON (MainMenu_BackupAndRestore, BaseFrame::OnBackupRestore) + EVT_BUTTON (MainMenu_Sync, BaseFrame::OnSync) + EVT_BUTTON (MainMenu_Modem, BaseFrame::OnModem) + EVT_BUTTON (MainMenu_AppLoader, BaseFrame::OnAppLoader) + EVT_BUTTON (MainMenu_DeviceSwitch, BaseFrame::OnDeviceSwitch) + EVT_BUTTON (MainMenu_BrowseDatabases, BaseFrame::OnBrowseDatabases) + EVT_BUTTON (MainMenu_MediaManagement, BaseFrame::OnMediaManagement) + EVT_BUTTON (MainMenu_Misc, BaseFrame::OnMisc) + EVT_BUTTON (MainMenu_BackButton, BaseFrame::OnBackButton) + EVT_BUTTON (HotImage_BarryLogo, BaseFrame::OnBarryLogoClicked) + EVT_BUTTON (HotImage_NetDirectLogo, BaseFrame::OnNetDirectLogoClicked) + EVT_TEXT (Ctrl_DeviceCombo, BaseFrame::OnDeviceComboChange) + EVT_MENU (SysMenu_VerboseLogging, BaseFrame::OnVerboseLogging) + EVT_MENU (SysMenu_RenameDevice, BaseFrame::OnRenameDevice) + EVT_MENU (SysMenu_ResetDevice, BaseFrame::OnResetDevice) + EVT_MENU (SysMenu_RescanUsb, BaseFrame::OnRescanUsb) + EVT_MENU (SysMenu_About, BaseFrame::OnAbout) + EVT_MENU (SysMenu_Exit, BaseFrame::OnExit) + EVT_END_PROCESS (Process_BackupAndRestore, BaseFrame::OnTermBackupAndRestore) +END_EVENT_TABLE() + +////////////////////////////////////////////////////////////////////////////// +// BaseFrame + +BaseFrame::BaseFrame(const wxImage &background) + : wxFrame(NULL, wxID_ANY, _T("Barry Desktop Control Panel"), + wxPoint(50, 50), + wxSize(background.GetWidth(), background.GetHeight()), + wxMINIMIZE_BOX | wxCAPTION | wxCLOSE_BOX | wxSYSTEM_MENU | + wxCLIP_CHILDREN) + , TermCatcher(this, Process_BackupAndRestore) + , m_width(background.GetWidth()) + , m_height(background.GetHeight()) + , m_current_mode(0) + , m_backup_process(this) +{ + // This is a workaround for different size behaviour + // in the GTK version of wxWidgets 2.9 + SetClientSize(wxSize(background.GetWidth(), background.GetHeight())); + + // load base bitmaps + m_background.reset( new wxBitmap(background) ); + + // the main menu mode always exists, but may not always be current + m_main_menu_mode.reset( new MainMenuMode(this) ); + m_current_mode = m_main_menu_mode.get(); + + m_barry_logo.reset( new ClickableImage(this, + wxBitmap(barry_logo_icon_xpm), HotImage_BarryLogo, + 4, 4, false) ); + wxBitmap nd_logo(logo_NetDirect_xpm); + m_netdirect_logo.reset( new ClickableImage(this, + nd_logo, HotImage_NetDirectLogo, + m_width - 3 - nd_logo.GetWidth(), + (MAIN_HEADER_OFFSET - nd_logo.GetHeight()) / 2, true, + wxNullCursor)); + + // Create the Barry Logo popup system menu + m_sysmenu.reset( new wxMenu ); + m_sysmenu->Append( new wxMenuItem(m_sysmenu.get(), + SysMenu_VerboseLogging, _T("&Verbose Logging"), + _T("Enable low level USB debug output"), wxITEM_CHECK, NULL) ); + m_sysmenu->Append(SysMenu_RenameDevice, _T("Re&name Device...")); + m_sysmenu->Append(SysMenu_ResetDevice, _T("Re&set Device")); + m_sysmenu->Append(SysMenu_RescanUsb, _T("&Rescan USB")); + m_sysmenu->AppendSeparator(); + m_sysmenu->Append(SysMenu_About, _T("&About...")); + m_sysmenu->AppendSeparator(); + m_sysmenu->Append(wxID_EXIT, _T("E&xit")); + + UpdateMenuState(); + CreateDeviceCombo(wxGetApp().GetGlobalConfig().GetLastDevice()); +} + +void BaseFrame::UpdateMenuState() +{ + if( !m_sysmenu.get() ) + return; + + wxMenuItemList &list = m_sysmenu->GetMenuItems(); + wxMenuItemList::iterator b = list.begin(); + for( ; b != list.end(); ++b ) { + wxMenuItem *item = *b; + + switch( item->GetId() ) + { + case SysMenu_VerboseLogging: + item->Check(Barry::IsVerbose()); + break; + } + } +} + +void BaseFrame::CreateDeviceCombo(Barry::Pin pin) +{ + const Barry::Probe::Results &results = wxGetApp().GetResults(); + + // default to: + // no device selected, if multiple available and no default given + // no devices available, if nothing there + // the first device, if only one exists + int selected = 0; + + // create a list of selections + wxArrayString devices; + + // if there's more than one device, let the user pick "none" + if( results.size() > 1 ) { + devices.Add(_T("No device selected")); + } + + // add one entry for each device + for( Barry::Probe::Results::const_iterator i = results.begin(); + i != results.end(); ++i ) { + std::ostringstream oss; + oss << i->m_pin.Str(); + if( i->m_cfgDeviceName.size() ) { + oss << " (" << i->m_cfgDeviceName << ")"; + } + + // if this is the desired item, remember this selection + if( pin.Valid() && i->m_pin == pin ) { + selected = devices.GetCount(); + } + + devices.Add(wxString(oss.str().c_str(), wxConvUTF8)); + } + + // if nothing is there, be descriptive + if( devices.GetCount() == 0 ) { + devices.Add(_T("No devices available")); + } + + // create the combobox + int x = m_width - 300; + int y = m_height - (MAIN_HEADER_OFFSET - 5); + m_device_combo.reset( new wxComboBox(this, Ctrl_DeviceCombo, _T(""), + wxPoint(x, y), wxSize(290, -1), devices, wxCB_READONLY) ); + + // select the desired entry + m_device_combo->SetValue(devices[selected]); + + // update the screenshot + m_main_menu_mode->UpdateScreenshot(GetCurrentComboPin()); +} + +Barry::Pin BaseFrame::GetCurrentComboPin() +{ + // fetch newly selected device + wxString value = m_device_combo->GetValue(); + istringstream iss(string(value.utf8_str()).substr(0,8)); + Barry::Pin pin; + iss >> pin; + return pin; +} + +void BaseFrame::EnableBackButton(Mode *new_mode) +{ + // create the button - this goes in the bottom FOOTER area + // so the height must be fixed to MAIN_HEADER_OFFSET + // minus a border of 5px top and bottom + wxPoint pos(10, m_height - (MAIN_HEADER_OFFSET - 5)); + wxSize size(-1, MAIN_HEADER_OFFSET - 5 - 5); + + m_back_button.reset( new wxButton(this, MainMenu_BackButton, + _T("Main Menu"), pos, size) ); + + // set the new mode + m_current_mode = new_mode; + + // destroy the device switcher combo box + m_device_combo.reset(); + + // without the device combo, there is no concept of a + // "current device" so temporarily disable the USB options + m_sysmenu->Enable(SysMenu_RenameDevice, false); + m_sysmenu->Enable(SysMenu_ResetDevice, false); + m_sysmenu->Enable(SysMenu_RescanUsb, false); + + // repaint! + Refresh(false); +} + +void BaseFrame::DisableBackButton() +{ + // destroy the back button + m_back_button.reset(); + + // delete all modes + m_sync_mode.reset(); + m_browse_mode.reset(); + + // create the device switcher combo again + CreateDeviceCombo(wxGetApp().GetGlobalConfig().GetLastDevice()); + + // enable the USB menu options + Barry::Pin pin = GetCurrentComboPin(); + m_sysmenu->Enable(SysMenu_RenameDevice, pin.Valid()); + m_sysmenu->Enable(SysMenu_ResetDevice, true); + m_sysmenu->Enable(SysMenu_RescanUsb, true); + + // reset the current mode to main menu and repaint + m_current_mode = m_main_menu_mode.get(); + Refresh(false); +} + +void BaseFrame::OnSize(wxSizeEvent &event) +{ +} + +void BaseFrame::OnPaint(wxPaintEvent &event) +{ + wxPaintDC dc(this); + dc.SetMapMode(wxMM_TEXT); + + // paint the background image + dc.DrawBitmap(*m_background, 0, 0); + + // paint the header: Barry logo + m_barry_logo->Draw(dc); + + // paint the header: NetDirect logo +// m_netdirect_logo->Draw(dc); + + // paint the header: text + auto_ptr font( wxFont::New(14, + wxFONTFAMILY_SWISS, wxFONTFLAG_ANTIALIASED, + _T("Luxi Sans")) ); + dc.SetFont( *font ); + dc.SetTextForeground( wxColour(0xd2, 0xaf, 0x0b) ); + dc.SetTextBackground( wxColour(0, 0, 0, wxALPHA_TRANSPARENT) ); + + long width, height, descent; + wxString header = _T("Barry Desktop Control Panel"); + if( m_current_mode ) + header = m_current_mode->GetTitleText(); + dc.GetTextExtent(header, &width, &height, &descent); + int x = (m_width - width) / 2; + int y = (MAIN_HEADER_OFFSET - height) / 2; + dc.DrawText(header, x, y); + + // let the mode do its thing + if( m_current_mode ) + m_current_mode->OnPaint(dc); +} + +void BaseFrame::OnMouseMotion(wxMouseEvent &event) +{ + wxClientDC dc(this); + m_barry_logo->HandleMotion(dc, event.m_x, event.m_y); +// m_netdirect_logo->HandleMotion(dc, event.m_x, event.m_y); + + // the mode + if( m_current_mode ) + m_current_mode->OnMouseMotion(dc, event.m_x, event.m_y); +} + +void BaseFrame::OnLeftDown(wxMouseEvent &event) +{ + wxClientDC dc(this); + m_barry_logo->HandleDown(dc, event.m_x, event.m_y); +// m_netdirect_logo->HandleDown(dc, event.m_x, event.m_y); + event.Skip(); + + // the mode + if( m_current_mode ) + m_current_mode->OnLeftDown(dc, event.m_x, event.m_y); +} + +void BaseFrame::OnLeftUp(wxMouseEvent &event) +{ + wxClientDC dc(this); + m_barry_logo->HandleUp(dc, event.m_x, event.m_y); +// m_netdirect_logo->HandleUp(dc, event.m_x, event.m_y); + + // the mode + if( m_current_mode ) + m_current_mode->OnLeftUp(dc, event.m_x, event.m_y); +} + +void BaseFrame::OnBackupRestore(wxCommandEvent &event) +{ + if( m_backup_process.IsAppRunning() ) { + wxMessageBox(_T("The Backup program is already running!"), + _T("Backup and Restore"), wxOK | wxICON_INFORMATION); + return; + } + + if( !m_backup_process.Run(this, "Backup and Restore", _T("barrybackup")) ) + return; +} + +void BaseFrame::OnSync(wxCommandEvent &event) +{ + if( wxGetApp().GetOpenSync().GetAvailable() == 0 ) { + wxGetApp().ShowMissingOpenSyncMessage(); + return; + } + + try { + m_sync_mode.reset( new SyncMode(this) ); + } + catch( std::exception &e ) { + wxString msg(_T( + "An error occurred that prevented the loading of Sync\n" + "mode. This is most likely because a critical piece\n" + "of OpenSync is missing. Check that all required\n" + "plugins are installed, and that tools like 'bidentify'\n" + "can find your BlackBerry(R) successfully.\n\n" + "Error: ")); + msg += wxString(e.what(), wxConvUTF8); + wxMessageBox(msg, _T("Sync Mode"), wxOK | wxICON_ERROR); + return; + } + + EnableBackButton(m_sync_mode.get()); +} + +//#include "ConflictDlg.h" +void BaseFrame::OnModem(wxCommandEvent &event) +{ +/* + OpenSync::SyncChange change; + change.id = 1; + change.member_id = 1; + change.plugin_name = "barry-sync"; + change.uid = "12341524235234"; + change.printable_data = +"\n" +" \n" +" PRODID\n" +" -//OpenSync//NONSGML Barry Contact Record//EN\n" +" \n" +" \n" +" Adame Brandee\n" +" \n" +" \n" +" Brandee\n" +" Adame\n" +" \n" +" \n" +" 71 Long St.\n" +"Toronto ON Canada\n" +"N0N 0N0\n" +" home\n" +" \n" +"
\n" +" 71 Long St.\n" +" Toronto\n" +" ON\n" +" N0N 0N0\n" +" Canada\n" +" home\n" +"
\n" +" \n" +" +1 (416) 555-7711\n" +" voice\n" +" home\n" +" \n" +" \n" +" +1 (416) 955-7117\n" +" msg\n" +" cell\n" +" \n" +" \n" +" abrandee@sympatico.ca\n" +" internet\n" +" pref\n" +" \n" +" \n" +" Personal\n" +" \n" +" \n" +" Interweb salesman... 24/7\n" +" \n" +"
"; + + std::vector changes; + changes.push_back(change); + + change.id = 2; + change.member_id = 2; + change.plugin_name = "evo2-sync"; + change.uid = "asdfioausdf_1235234as_asdf12341524235234"; + change.printable_data = +"\n" +" \n" +" +1 (416) 955-7117\n" +" CELL\n" +" 2\n" +" \n" +" \n" +" +1 (416) 555-7711\n" +" HOME\n" +" VOICE\n" +" 1\n" +" \n" +" \n" +" abrandee@sympatico.ca\n" +" OTHER\n" +" 1\n" +" \n" +" \n" +" FALSE\n" +" \n" +" \n" +" 20100322T225303Z\n" +" \n" +" \n" +" PRODID\n" +" -//OpenSync//NONSGML Barry Contact Record//EN\n" +" \n" +" \n" +" Adam Brandeee\n" +" \n" +" \n" +" Brandeee\n" +" Adam\n" +" \n" +" \n" +" 71 Long St.\n" +"Toronto, ON\n" +"N0N 0N1\n" +"Canada\n" +" home\n" +" \n" +"
\n" +" 71 Long St.\n" +" Toronto\n" +" ON\n" +" N0N 0N1\n" +" Canada\n" +" home\n" +"
\n" +" \n" +" Personal\n" +" \n" +" \n" +" Brandeee, Adam\n" +" \n" +"
"; + + changes.push_back(change); + + { + ConflictDlg::AlwaysMemoryBlock always; + ConflictDlg dlg(this, *wxGetApp().GetOpenSync().os22(), + "SDAIN", changes, always); + dlg.ShowModal(); + wxString msg(dlg.GetCommand().c_str(), wxConvUTF8); + msg += _T(" "); + msg += always.m_always ? _T("always") : _T("not always"); + wxMessageBox(msg); + } +*/ +} + +void BaseFrame::OnAppLoader(wxCommandEvent &event) +{ +/* + OpenSync::SyncChange change; + change.id = 1; + change.member_id = 1; + change.plugin_name = "barry-sync"; + change.uid = "12341524235234"; + change.printable_data = +"\n" +" \n" +" \n" +" 0\n" +" \n" +" \n" +" Subject\n" +" \n" +" \n" +" Bring burnt offering\n" +" \n" +" \n" +" Tent\n" +" \n" +" \n" +" 20100506T040000Z\n" +" \n" +" \n" +" 20100507T040000Z\n" +" \n" +" \n" +" AUDIO\n" +" \n" +" 20100506T034500Z\n" +" DATE-TIME\n" +" \n" +" \n" +" \n" +"\n"; + + std::vector changes; + changes.push_back(change); + + change.id = 2; + change.member_id = 2; + change.plugin_name = "evo2-sync"; + change.uid = "asdfioausdf_1235234as_asdf12341524235234"; + change.printable_data = +"\n" +" \n" +" PUBLISH\n" +" \n" +" \n" +" /softwarestudio.org/Tzfile/America/Thunder_Bay\n" +" America/Thunder_Bay\n" +" \n" +" EST\n" +" 19701107T010000\n" +" \n" +" FREQ=YEARLY\n" +" INTERVAL=1\n" +" BYDAY=2SU\n" +" BYMONTH=11\n" +" \n" +" -0400\n" +" -0500\n" +" \n" +" \n" +" EDT\n" +" 19700313T030000\n" +" \n" +" FREQ=YEARLY\n" +" INTERVAL=1\n" +" BYDAY=2SU\n" +" BYMONTH=3\n" +" \n" +" -0500\n" +" -0400\n" +" \n" +" \n" +" \n" +" \n" +" 1\n" +" \n" +" \n" +" Celebration day\n" +" \n" +" \n" +" Tent of\n" +" \n" +" \n" +" 20100506T000000\n" +" /softwarestudio.org/Tzfile/America/Thunder_Bay\n" +" \n" +" \n" +" 20100507T000000\n" +" /softwarestudio.org/Tzfile/America/Thunder_Bay\n" +" \n" +" \n" +" 20100430T214736Z\n" +" \n" +" \n" +" 20100430T214736\n" +" \n" +" \n" +" 20100430T214927\n" +" \n" +" \n" +" Bring burnt offering\n" +" \n" +" \n" +" PUBLIC\n" +" \n" +" \n" +" OPAQUE\n" +" \n" +" \n" +" AUDIO\n" +" \n" +" 20100506T034500Z\n" +" DATE-TIME\n" +" \n" +" \n" +" \n" +"\n"; + + + changes.push_back(change); + + { + ConflictDlg::AlwaysMemoryBlock always; + ConflictDlg dlg(this, *wxGetApp().GetOpenSync().os22(), + "SDAIN", changes, always); + dlg.ShowModal(); + wxString msg(dlg.GetCommand().c_str(), wxConvUTF8); + msg += _T(" "); + msg += always.m_always ? _T("always") : _T("not always"); + wxMessageBox(msg); + } +*/ +} + +void BaseFrame::OnDeviceSwitch(wxCommandEvent &event) +{ +} + +void BaseFrame::OnBrowseDatabases(wxCommandEvent &event) +{ + int i = Barry::Probe::Find(wxGetApp().GetResults(), GetCurrentComboPin()); + if( i == -1 ) { + wxMessageBox(_T("There is no device selected in the device list. Please select a device to browse."), + _T("Database Browser Mode"), wxOK | wxICON_ERROR); + return; + } + + try { + m_browse_mode.reset( new BrowseMode(this, + wxGetApp().GetResults()[i]) ); + } + catch( std::exception &e ) { + wxString msg(_T( + "An error occurred that prevented the loading of Database\n" + "Browse mode. This could be due to a low level USB\n" + "issue. Please make sure your device is plugged in\n" + "and not in Desktop Mode. If it is, try replugging\n" + "the device, and rescanning the USB bus from the menu.\n" + "\n" + "Error: ")); + msg += wxString(e.what(), wxConvUTF8); + wxMessageBox(msg, _T("Database Browser Mode"), wxOK | wxICON_ERROR); + return; + } + + EnableBackButton(m_browse_mode.get()); +} + +void BaseFrame::OnMediaManagement(wxCommandEvent &event) +{ +} + +void BaseFrame::OnMisc(wxCommandEvent &event) +{ +} + +void BaseFrame::OnBackButton(wxCommandEvent &event) +{ + DisableBackButton(); +} + +void BaseFrame::OnTermBackupAndRestore(wxProcessEvent &event) +{ + barryverbose("OnTermBackupAndRestore(): done = " + << (!m_backup_process.IsAppRunning() ? "true" : "false") + << ", status = " << m_backup_process.GetAppStatus()); + if( !m_backup_process.IsAppRunning() && + m_backup_process.GetAppStatus() ) + { + wxMessageBox(_T("Unable to run barrybackup, or it returned an error. Please make sure it is installed and in your PATH."), + _T("Backup and Restore"), wxOK | wxICON_ERROR); + } +} + +void BaseFrame::OnBarryLogoClicked(wxCommandEvent &event) +{ + PopupMenu(m_sysmenu.get(), 20, 20); +} + +void BaseFrame::OnNetDirectLogoClicked(wxCommandEvent &event) +{ + // fire up a browser to point to the Barry documentation + wxBusyCursor wait; + ::wxLaunchDefaultBrowser(_T("http://netdirect.ca/barry")); +} + +void BaseFrame::OnDeviceComboChange(wxCommandEvent &event) +{ + Barry::Pin pin = GetCurrentComboPin(); + + // any change? + if( pin == wxGetApp().GetGlobalConfig().GetLastDevice() ) + return; // nope + + // save + wxGetApp().GetGlobalConfig().SetLastDevice(pin); + + // update sys menu + m_sysmenu->Enable(SysMenu_RenameDevice, false); + + // update the main mode's screenshot + m_main_menu_mode->UpdateScreenshot(pin); + if( m_current_mode == m_main_menu_mode.get() ) + Refresh(false); + + // FIXME - if inside a sub menu mode, we need to destroy the mode + // class and start fresh +} + +void BaseFrame::OnVerboseLogging(wxCommandEvent &event) +{ + Barry::Verbose( !Barry::IsVerbose() ); + wxGetApp().GetGlobalConfig().SetVerboseLogging( Barry::IsVerbose() ); + UpdateMenuState(); +} + +void BaseFrame::OnRenameDevice(wxCommandEvent &event) +{ + Barry::Pin pin = GetCurrentComboPin(); + if( !pin.Valid() ) + return; + + // grab the current known name of the device + const Barry::Probe::Results &results = wxGetApp().GetResults(); + int index = Barry::Probe::Find(results, pin); + if( index == -1 ) + return; + + wxString current_name(results[index].m_cfgDeviceName.c_str(), wxConvUTF8); + wxTextEntryDialog dlg(this, + _T("Please enter a name for the current device:"), + _T("Rename Device"), + current_name, wxTextEntryDialogStyle); + + if( dlg.ShowModal() != wxID_OK ) + return; // nothing to do + wxString name = dlg.GetValue(); + if( name == current_name ) + return; // nothing to do + + wxGetApp().SetDeviceName(pin, string(name.utf8_str())); + + // refill combo box + CreateDeviceCombo(wxGetApp().GetGlobalConfig().GetLastDevice()); +} + +void BaseFrame::OnResetDevice(wxCommandEvent &event) +{ + int i = Barry::Probe::Find(wxGetApp().GetResults(), GetCurrentComboPin()); + if( i != -1 ) { + Usb::Device dev(wxGetApp().GetResults()[i].m_dev); + dev.Reset(); + wxBusyCursor wait; + wxSleep(4); + OnRescanUsb(event); + } +} + +void BaseFrame::OnRescanUsb(wxCommandEvent &event) +{ + if( m_current_mode == m_main_menu_mode.get() ) { + std::auto_ptr splash( new UsbScanSplash ); + wxGetApp().Probe(); + CreateDeviceCombo(wxGetApp().GetGlobalConfig().GetLastDevice()); + } + else { + // FIXME - tell the user we didn't do anything? + // or perhaps just disable rescan while in a mode + } +} + +void BaseFrame::OnAbout(wxCommandEvent &event) +{ + wxAboutDialogInfo info; + info.SetName(_T("Barry Desktop Control Panel")); + info.SetVersion(_T("0.18.0")); + info.SetDescription(_T("A Free Software graphical user interface for working with the BlackBerry® smartphone.")); + info.SetCopyright(_T("Copyright © 2009-2011, Net Direct Inc.")); + info.SetWebSite(_T("http://netdirect.ca/barry")); + info.SetLicense(_T( +" This program is free software; you can redistribute it and/or modify\n" +" it under the terms of the GNU General Public License as published by\n" +" the Free Software Foundation; either version 2 of the License, or\n" +" (at your option) any later version.\n" +"\n" +" This program is distributed in the hope that it will be useful,\n" +" but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" +"\n" +" See the GNU General Public License in the COPYING file at the\n" +" root directory of this project for more details.\n")); + + info.AddDeveloper(_T("Net Direct Inc.")); +// info.AddDeveloper(_T("Chris Frey ")); +// info.AddDeveloper(_T("See AUTHORS file for detailed")); +// info.AddDeveloper(_T("contribution information.")); + + info.AddArtist(_T("Chris Frey - GUI interface")); + info.AddArtist(_T("Martin Owens - Barry logo")); + info.AddArtist(_T("Tango Desktop Project - Public domain icons")); + + wxAboutBox(info); +} + +void BaseFrame::OnExit(wxCommandEvent &event) +{ + Close(true); +} + diff -Nru barry-0.14/desktop/src/BaseFrame.h barry-0.0.20110506/desktop/src/BaseFrame.h --- barry-0.14/desktop/src/BaseFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/BaseFrame.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,100 @@ +/// +/// \file BaseFrame.h +/// Class for the fixed-size frame that holds the main app +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_BASEFRAME_H__ +#define __BARRYDESKTOP_BASEFRAME_H__ + +#include +#include +#include +#include +#include "exechelper.h" + +#define MAIN_HEADER_OFFSET 40 + +class MainMenuMode; +class SyncMode; +class BrowseMode; +class ClickableImage; +class Mode; + +class BaseFrame : public wxFrame, public TermCatcher +{ +private: + DECLARE_EVENT_TABLE() + +private: + std::auto_ptr m_background; + std::auto_ptr m_main_menu_mode;// only this mode is + // never reset() + std::auto_ptr m_sync_mode; + std::auto_ptr m_browse_mode; + std::auto_ptr m_barry_logo, m_netdirect_logo; + std::auto_ptr m_sysmenu; + std::auto_ptr m_device_combo; + std::auto_ptr m_back_button; + int m_width, m_height; + + Mode *m_current_mode; + + ExecHelper m_backup_process; + +public: + BaseFrame(const wxImage &background); + + // utility functions + void UpdateMenuState(); + void CreateDeviceCombo(Barry::Pin pin = Barry::Pin()); + Barry::Pin GetCurrentComboPin(); + void EnableBackButton(Mode *new_mode); + void DisableBackButton(); // also returns to the main menu + + // events + void OnSize(wxSizeEvent &event); + void OnPaint(wxPaintEvent &event); + void OnMouseMotion(wxMouseEvent &event); + void OnLeftDown(wxMouseEvent &event); + void OnLeftUp(wxMouseEvent &event); + void OnBackupRestore(wxCommandEvent &event); + void OnSync(wxCommandEvent &event); + void OnModem(wxCommandEvent &event); + void OnAppLoader(wxCommandEvent &event); + void OnDeviceSwitch(wxCommandEvent &event); + void OnBrowseDatabases(wxCommandEvent &event); + void OnMediaManagement(wxCommandEvent &event); + void OnMisc(wxCommandEvent &event); + void OnBackButton(wxCommandEvent &event); + void OnTermBackupAndRestore(wxProcessEvent &event); + void OnBarryLogoClicked(wxCommandEvent &event); + void OnNetDirectLogoClicked(wxCommandEvent &event); + void OnDeviceComboChange(wxCommandEvent &event); + + // sys menu (triggered by the Barry logo) + void OnVerboseLogging(wxCommandEvent &event); + void OnRenameDevice(wxCommandEvent &event); + void OnResetDevice(wxCommandEvent &event); + void OnRescanUsb(wxCommandEvent &event); + void OnAbout(wxCommandEvent &event); + void OnExit(wxCommandEvent &event); +}; + +#endif + diff -Nru barry-0.14/desktop/src/bsynccl.cc barry-0.0.20110506/desktop/src/bsynccl.cc --- barry-0.14/desktop/src/bsynccl.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/bsynccl.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,147 @@ +/// +/// \file bsyncjail.cc +/// Helper program to isolate the actual syncing into its +/// own process. Communicates with the main barrydesktop +/// via wxWidgets IPC communication. This belongs in its +/// own process since the sync can hang, and may need to +/// be killed from the GUI. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include "os22.h" +#include "os40.h" +#include "tempdir.h" + +using namespace std; + +// command line arguments +string g_argv_version, g_argv_group_name; + +class BarrySyncJail : public OpenSync::SyncStatus +{ +private: + TempDir m_temp; + std::auto_ptr m_engine; + + // communication variables + int m_sequenceID; +public: + BarrySyncJail(); + ~BarrySyncJail(); + + // + // overrides + // + virtual bool OnInit(); + virtual int OnExit(); + + // + // OpenSync::SyncStatus virtual overrides + // +// virtual void CheckSummary(OpenSync::SyncSummary &summary); +}; + +////////////////////////////////////////////////////////////////////////////// +// BarrySyncJail + +BarrySyncJail::BarrySyncJail() + : m_temp("bsyncjail") +{ + OnInit(); +} + +BarrySyncJail::~BarrySyncJail() +{ +} + +bool BarrySyncJail::OnInit() +{ + cerr << "OnInit()" << endl; + + // load opensync engine + try { + if( g_argv_version == "0.22" ) + m_engine.reset( new OpenSync::OpenSync22 ); + else { + m_engine.reset( new OpenSync::OpenSync40 ); + } + } + catch( std::exception &e ) { + cerr << e.what() << endl; + return false; + } + + if( !m_engine.get() ) { + cerr << "Unknown engine number: " << g_argv_version << endl; + return false; + } + + // start the sync + try { + m_engine->Discover(g_argv_group_name); + m_engine->Sync(g_argv_group_name, *this); + } + catch( std::exception &e ) { + cerr << e.what() << endl; + return true; + } + + return true; +} + +int BarrySyncJail::OnExit() +{ + cerr << "OnExit()" << endl; + + return 0; +} + +// +// OpenSync::SyncStatus virtual overrides +// + +/* +void BarrySyncJail::CheckSummary(OpenSync::SyncSummary &summary) +{ + cerr << "CheckSummary" << endl; + // FIXME: not currently supported... abort every time +// cerr << "FIXME: CheckSummary() not implemented, aborting" << endl; +// summary.Abort(); + summary.Continue(); +} +*/ + +int main(int argc, char *argv[]) +{ + cerr << "bsyncjail startup" << endl; + + if( argc != 3 ) { + cerr << "This is a helper program for barrydesktop, and\n" + "not intended to be called directly.\n" << endl; + return 1; + } + + g_argv_version = argv[1]; + g_argv_group_name = argv[2]; + + BarrySyncJail app; + return app.OnExit(); +} + diff -Nru barry-0.14/desktop/src/bsyncjail.cc barry-0.0.20110506/desktop/src/bsyncjail.cc --- barry-0.14/desktop/src/bsyncjail.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/bsyncjail.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,356 @@ +/// +/// \file bsyncjail.cc +/// Helper program to isolate the actual syncing into its +/// own process. Communicates with the main barrydesktop +/// via wxWidgets IPC communication. This belongs in its +/// own process since the sync can hang, and may need to +/// be killed from the GUI. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include "ipc.h" +#include "os22.h" +#include "os40.h" +#include "tempdir.h" + +using namespace std; + +// command line arguments +string g_argv_version, g_argv_group_name; +SillyBuffer sb; + +class ClientConnection : public wxConnection +{ +public: + ClientConnection() {} +}; + +class Client : public wxClient +{ +public: + Client() {} + ClientConnection* OnMakeConnection() + { + return new ClientConnection; + } +}; + +class BarrySyncJail : public OpenSync::SyncStatus +{ +private: + TempDir m_temp; + std::auto_ptr m_engine; + std::auto_ptr m_client; + wxConnectionBase *m_status_con, *m_conflict_con; + + // communication variables + int m_sequenceID; +public: + BarrySyncJail(); + ~BarrySyncJail(); + + // + // overrides + // + virtual bool OnInit(); + virtual int OnExit(); + + // + // OpenSync::SyncStatus virtual overrides + // + virtual void HandleConflict(OpenSync::SyncConflict &conflict); + virtual void EntryStatus(const std::string &msg, bool error); + virtual void MappingStatus(const std::string &msg, bool error); + virtual void EngineStatus(const std::string &msg, bool error, + bool slowsync); + virtual void MemberStatus(long member_id, + const std::string &plugin_name, + const std::string &msg, bool error); + virtual void CheckSummary(OpenSync::SyncSummary &summary); + virtual void ReportError(const std::string &msg); +}; + +DECLARE_APP(BarrySyncJail) + +////////////////////////////////////////////////////////////////////////////// +// BarrySyncJail + +BarrySyncJail::BarrySyncJail() + : m_temp("bsyncjail") + , m_status_con(0) + , m_conflict_con(0) + , m_sequenceID(0) +{ + OnInit(); +} + +BarrySyncJail::~BarrySyncJail() +{ +} + +bool BarrySyncJail::OnInit() +{ + cerr << "OnInit()" << endl; + + // connect to parent app + m_client.reset( new Client ); + m_status_con = m_client->MakeConnection(_T("localhost"), + SERVER_SERVICE_NAME, TOPIC_STATUS); + m_conflict_con = m_client->MakeConnection(_T("localhost"), + SERVER_SERVICE_NAME, TOPIC_CONFLICT); + if( !m_status_con || !m_conflict_con ) { + cerr << "Unable to connect to server." << endl; + return false; + } + + // load opensync engine + try { + if( g_argv_version == "0.22" ) + m_engine.reset( new OpenSync::OpenSync22 ); + else { + m_engine.reset( new OpenSync::OpenSync40 ); + if( g_argv_version != m_engine->GetVersion() ) + throw std::runtime_error("Can't find matching engine for: " + g_argv_version); + } + } + catch( std::exception &e ) { + m_status_con->Poke(STATUS_ITEM_ERROR, sb.buf(e.what())); + cerr << e.what() << endl; + return false; + } + + if( !m_engine.get() ) { + m_status_con->Poke(STATUS_ITEM_ERROR, sb.buf(string("Unknown engine number: ") + g_argv_version)); + return false; + } + + // start the sync + try { + m_engine->Discover(g_argv_group_name); + m_engine->Sync(g_argv_group_name, *this); + } + catch( std::exception &e ) { + m_status_con->Poke(STATUS_ITEM_ERROR, sb.buf(e.what())); + cerr << e.what() << endl; + return true; + } + + return true; +} + +int BarrySyncJail::OnExit() +{ + cerr << "OnExit()" << endl; + + // clean up the client connection... do this early, so that + // TempDir can clean up the files if necessary + m_client.reset(); + + return 0; +} + +// +// OpenSync::SyncStatus virtual overrides +// + +void BarrySyncJail::HandleConflict(OpenSync::SyncConflict &conflict) +{ + OpenSync::SyncConflict::iterator i; + int size = 0; + wxChar *buf = 0; + + // start with a new sequence ID + m_sequenceID++; + int offset = 0; + + // msg 1: sequence ID, offset 0 + // send available menu / functions possible, and number of + // changes that conflict + + ostringstream oss; + oss << m_sequenceID << " " << offset << " " << conflict.size() + << " " << "SD"; + if( conflict.IsAbortSupported() ) + oss << "A"; + if( conflict.IsIgnoreSupported() ) + oss << "I"; + if( conflict.IsKeepNewerSupported() ) + oss << "N"; + + if( !m_conflict_con->Poke(CONFLICT_ITEM_START, sb.buf(oss.str())) ) + goto connection_lost; + + // all following messages contain the sequence ID, + // the change ID, and the change data + i = conflict.begin(); + for( ; i != conflict.end(); ++i ) { + oss.str(""); + offset++; + + oss << m_sequenceID << " " << offset << " " << i->id << " \n"; + oss << i->plugin_name << "\n"; + oss << i->uid << "\n"; + oss << i->printable_data; + + if( !m_conflict_con->Poke(CONFLICT_ITEM_CHANGE, sb.buf(oss.str())) ) + goto connection_lost; + } + + // then wait on the server to tell us what choice was made + buf = m_conflict_con->Request(CONFLICT_ITEM_ANSWER, &size); + if( buf ) { + wxString msg(buf); + istringstream iss(string(msg.utf8_str())); + int sequenceID = 0; + string command; + int id; + + iss >> sequenceID >> command; + if( !iss || sequenceID != m_sequenceID ) { + // invalid command from server, something is wrong + throw std::runtime_error("Invalid server response: " + string(msg.utf8_str())); + } + + switch( command[0] ) + { + case 'S': // Select + iss >> id; + if( !iss ) + throw std::runtime_error("Invalid Select command from server: " + string(msg.utf8_str())); + conflict.Select(id); + break; + + case 'D': // Duplicate + conflict.Duplicate(); + break; + + case 'A': // Abort + if( !conflict.IsAbortSupported() ) + throw std::runtime_error("Abort not supported, and server sent Abort command."); + conflict.Abort(); + break; + + case 'I': // Ignore + if( !conflict.IsIgnoreSupported() ) + throw std::runtime_error("Ignore not supported, and server sent Ignore command."); + conflict.Ignore(); + break; + + case 'N': // Keep Newer + if( !conflict.IsKeepNewerSupported() ) + throw std::runtime_error("Keep Newer not supported, and server sent Keep Newer command."); + conflict.KeepNewer(); + break; + + default: + throw std::runtime_error("Invalid command from server: " + string(msg.utf8_str())); + } + + // all done! + return; + } + +connection_lost: + if( conflict.IsAbortSupported() ) + conflict.Abort(); + else + throw std::runtime_error("Lost connection with server"); +} + +void BarrySyncJail::EntryStatus(const std::string &msg, bool error) +{ + if( error ) + ReportError(msg); + else + m_status_con->Poke(STATUS_ITEM_ENTRY, sb.buf(msg)); +} + +void BarrySyncJail::MappingStatus(const std::string &msg, bool error) +{ + if( error ) + ReportError(msg); + else + m_status_con->Poke(STATUS_ITEM_MAPPING, sb.buf(msg)); +} + +void BarrySyncJail::EngineStatus(const std::string &msg, bool error, bool slowsync) +{ + if( error ) + ReportError(msg); + else + m_status_con->Poke(STATUS_ITEM_ENGINE, sb.buf(msg)); + + // slow sync on 0.22 is unreliable... send a special notice + // to the GUI + if( slowsync && !m_engine->IsSlowSyncSupported() ) + m_status_con->Poke(STATUS_ITEM_ENGINE, sb.buf(ENGINE_STATUS_SLOW_SYNC)); +} + +void BarrySyncJail::MemberStatus(long member_id, + const std::string &plugin_name, + const std::string &msg, bool error) +{ + if( error ) + ReportError(msg); + else + m_status_con->Poke(STATUS_ITEM_MEMBER, sb.buf(msg)); +} + +void BarrySyncJail::CheckSummary(OpenSync::SyncSummary &summary) +{ + // FIXME: not currently supported... abort every time +// cerr << "FIXME: CheckSummary() not implemented, aborting" << endl; +// summary.Abort(); + summary.Continue(); +} + +void BarrySyncJail::ReportError(const std::string &msg) +{ + m_status_con->Poke(STATUS_ITEM_ERROR, sb.buf(msg)); + cerr << "ReportError(): " << msg << endl; +} + + +int main(int argc, char *argv[]) +{ + wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "bsyncjail"); + + cerr << "bsyncjail startup" << endl; + + if( argc != 3 ) { + cerr << "This is a helper program for barrydesktop, and\n" + "not intended to be called directly.\n" << endl; + return 1; + } + + g_argv_version = argv[1]; + g_argv_group_name = argv[2]; + + wxInitializer initializer; + if( !initializer ) { + cerr << "Unable to initialize wxWidgets library, aborting." << endl; + return 1; + } + + BarrySyncJail app; + return app.OnExit(); +} + diff -Nru barry-0.14/desktop/src/ClickImage.cc barry-0.0.20110506/desktop/src/ClickImage.cc --- barry-0.14/desktop/src/ClickImage.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ClickImage.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,106 @@ +/// +/// \file ClickImage.cc +/// Clickable image class +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "ClickImage.h" + +////////////////////////////////////////////////////////////////////////////// +// ClickableImage + +ClickableImage::ClickableImage(wxWindow *parent, + const wxBitmap &image, + int ID, + int x, int y, + bool event_on_up, + const wxCursor &hover) + : m_parent(parent) + , m_id(ID) + , m_image(image) + , m_x(x) + , m_y(y) + , m_focus(false) + , m_event_on_up(event_on_up) + , m_hover_cursor(hover) +{ +} + +bool ClickableImage::CalculateHit(int x, int y) +{ + return ( x >= m_x && x < (m_x + m_image.GetWidth()) ) + && + ( y >= m_y && y < (m_y + m_image.GetHeight()) ); +} + +void ClickableImage::Draw(wxDC &dc) +{ + dc.DrawBitmap(m_image, m_x, m_y, true); +} + +void ClickableImage::HandleMotion(wxDC &dc, int x, int y) +{ + bool focus = CalculateHit(x, y); + + if( focus && !m_focus ) { + // newly in focus + m_parent->SetCursor(m_hover_cursor); + } + else if( m_focus && !focus ) { + // not in focus anymore + m_parent->SetCursor(wxNullCursor); + } + + // remember state + m_focus = focus; +} + +void ClickableImage::HandleDown(wxDC &dc, int x, int y) +{ + if( !m_event_on_up ) { + m_focus = CalculateHit(x, y); + + if( m_focus ) { + // replace the cursor + m_parent->SetCursor(wxNullCursor); + m_focus = false; + + // send the event + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,m_id); + m_parent->GetEventHandler()->ProcessEvent(event); + } + } +} + +void ClickableImage::HandleUp(wxDC &dc, int x, int y) +{ + if( m_event_on_up ) { + m_focus = CalculateHit(x, y); + + if( m_focus ) { + // replace the cursor + m_parent->SetCursor(wxNullCursor); + m_focus = false; + + // send the event + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,m_id); + m_parent->GetEventHandler()->ProcessEvent(event); + } + } +} + diff -Nru barry-0.14/desktop/src/ClickImage.h barry-0.0.20110506/desktop/src/ClickImage.h --- barry-0.14/desktop/src/ClickImage.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ClickImage.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,52 @@ +/// +/// \file ClickImage.h +/// Clickable image class +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_CLICKIMAGE_H__ +#define __BARRYDESKTOP_CLICKIMAGE_H__ + +#include + +class ClickableImage +{ + wxWindow *m_parent; + int m_id; + wxBitmap m_image; + int m_x, m_y; + bool m_focus; + bool m_event_on_up; + wxCursor m_hover_cursor; + +protected: + bool CalculateHit(int x, int y); + +public: + ClickableImage(wxWindow *parent, const wxBitmap &image, + int ID, int x, int y, bool event_on_up = true, + const wxCursor &hover = wxCursor(wxCURSOR_HAND)); + + void Draw(wxDC &dc); + void HandleMotion(wxDC &dc, int x, int y); + void HandleDown(wxDC &dc, int x, int y); + void HandleUp(wxDC &dc, int x, int y); +}; + +#endif + diff -Nru barry-0.14/desktop/src/configui.cc barry-0.0.20110506/desktop/src/configui.cc --- barry-0.14/desktop/src/configui.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/configui.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,53 @@ +/// +/// \file configui.cc +/// Base class for plugin config user interfaces +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "configui.h" +#include "osconfig.h" +#include "CUI_Evolution.h" +#include "CUI_Barry.h" + +// Static factory function +ConfigUI::configui_ptr ConfigUI::CreateConfigUI(const std::string &appname) +{ + ConfigUI::configui_ptr ui; + + if( appname == OpenSync::Config::Evolution::AppName() ) { + ui.reset( new AppConfig::Evolution ); + } + else if( appname == OpenSync::Config::Barry::AppName() ) { + ui.reset( new AppConfig::Barry ); + } + + return ui; +} + +////////////////////////////////////////////////////////////////////////////// +// ConfigUI class + +ConfigUI::ConfigUI() + : ExecHelper(0) +{ +} + +ConfigUI::~ConfigUI() +{ +} + diff -Nru barry-0.14/desktop/src/configui.h barry-0.0.20110506/desktop/src/configui.h --- barry-0.14/desktop/src/configui.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/configui.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,79 @@ +/// +/// \file configui.h +/// Base class for plugin config user interfaces +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CONFIGUI_H__ +#define __BARRY_CONFIGUI_H__ + +#include +#include +#include +#include +#include +#include "osconfig.h" +#include "exechelper.h" + +// +// ConfigUI +// +/// Base class for plugin config user interfaces +/// +/// To use, call the static factory function to create the config UI +/// object for a given App. Then call Configure(), which will block +/// and may do a number of configuration steps to let the user +/// configure the App. If Configure() returns true, then call +/// GetPlugin() to retrieve the fully configured plugin. +/// +class ConfigUI : public ExecHelper +{ +public: + typedef OpenSync::Config::Group::plugin_ptr plugin_ptr; + typedef std::auto_ptr configui_ptr; + typedef configui_ptr ptr; + +public: + ConfigUI(); + virtual ~ConfigUI(); + + /// Returns OpenSync::Config::*::AppName() for the specific app + virtual std::string AppName() const = 0; + /// Handles all the GUI work of configuring the App + /// old_plugin may contain null if this is a first-time config + virtual bool Configure(wxWindow *parent, plugin_ptr old_plugin) = 0; + /// Returns a configured plugin object (after a successful Configure()) + virtual plugin_ptr GetPlugin() = 0; + /// Runs the Application, if not already running.. parent may + /// be NULL if you don't want this class to pop up error messages + /// if unable to run the app + virtual bool RunApp(wxWindow *parent) = 0; + /// Performs any initialization steps that the App requires before + /// running the sync (for example, Evolution needs a --force-shutdown) + virtual void PreSyncAppInit() = 0; + /// Presents the user with the warning / instructions for zapping + /// the data on this plugin. Returns false if user aborted along + /// the way. + virtual bool ZapData(wxWindow *parent, plugin_ptr plugin, + OpenSync::API *engine) = 0; + + static configui_ptr CreateConfigUI(const std::string &appname); +}; + +#endif + diff -Nru barry-0.14/desktop/src/ConflictDlg.cc barry-0.0.20110506/desktop/src/ConflictDlg.cc --- barry-0.14/desktop/src/ConflictDlg.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ConflictDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,556 @@ +/// +/// \file ConflictDlg.cc +/// The dialog used during a sync, to display conflicting +/// changes, and let the user decide what to do. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "ConflictDlg.h" +#include "windowids.h" +#include "util.h" +#include +#include +#include +#include +using namespace std; + +////////////////////////////////////////////////////////////////////////////// +// ConflictDlg class + +BEGIN_EVENT_TABLE(ConflictDlg, wxDialog) + EVT_BUTTON (Dialog_Conflict_ShowButton1, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton2, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton3, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton4, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton5, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton6, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton7, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton8, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_ShowButton9, + ConflictDlg::OnShowButton) + EVT_BUTTON (Dialog_Conflict_SelectButton1, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton2, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton3, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton4, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton5, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton6, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton7, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton8, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_SelectButton9, + ConflictDlg::OnSelectButton) + EVT_BUTTON (Dialog_Conflict_DuplicateButton, + ConflictDlg::OnDuplicateButton) + EVT_BUTTON (Dialog_Conflict_AbortButton, + ConflictDlg::OnAbortButton) + EVT_BUTTON (Dialog_Conflict_IgnoreButton, + ConflictDlg::OnIgnoreButton) + EVT_BUTTON (Dialog_Conflict_KeepNewerButton, + ConflictDlg::OnKeepNewerButton) + EVT_BUTTON (Dialog_Conflict_KillSyncButton, + ConflictDlg::OnKillSyncButton) + EVT_CHECKBOX (Dialog_Conflict_AlwaysCheckbox, + ConflictDlg::OnAlwaysCheckbox) +END_EVENT_TABLE() + +ConflictDlg::ConflictDlg(wxWindow *parent, + const OpenSync::API &engine, + const std::string &supported_commands, + const std::vector &changes, + ConflictDlg::AlwaysMemoryBlock &always) + : wxDialog(parent, Dialog_Conflict, _T("Sync Conflict")) + , m_engine(engine) + , m_changes(changes) + , m_supported_commands(supported_commands) + , m_always(always) + , m_kill_sync(false) + , m_topsizer(0) +{ + // the max text width is the maximum width that any line of text + // in a conflict summary can use... it is calculated with + // (screen_width - window_border_width*2) / change_count + m_max_text_width = (wxSystemSettings::GetMetric(wxSYS_SCREEN_X) - + wxSystemSettings::GetMetric(wxSYS_BORDER_X) * 2 - + 10 * 2 - + 5 * 2 * m_changes.size()) + / m_changes.size(); + + // first, parse all change data + ParseChanges(); + + // create a global set of key names that contain differing data + // between changes + CreateDifferingKeyNameSet(); + + // setup the raw GUI + CreateLayout(); +} + +ConflictDlg::~ConflictDlg() +{ +} + +void ConflictDlg::ParseChanges() +{ + m_maps.clear(); + + // create an xmlmap to start with, so we only parse the + // map file once + ostringstream oss; + oss << m_engine.GetEngineName() << "/xmlmap"; + tr1::shared_ptr basemap; + try { + basemap.reset(new XmlNodeMap(GetBaseFilename(oss.str())) ); + } + catch( std::runtime_error &e ) { + basemap.reset(); + } + + for( size_t i = 0; i < m_changes.size(); i++ ) { + XmlPair xp; + xp.dom.reset( new xmlpp::DomParser ); + xp.dom->parse_memory_raw( + (const unsigned char*) m_changes[i].printable_data.data(), + m_changes[i].printable_data.size()); + + if( basemap.get() ) { + xp.map.reset( new XmlNodeMap(*basemap) ); + xp.map->ImportNodes(xp.dom->get_document()->get_root_node()); + xp.map->PurgeEmpties(); + xp.map->SortBySummary(); + } + + m_maps.push_back(xp); + } +} + +void ConflictDlg::CreateDifferingKeyNameSet() +{ + // start fresh + m_differing_keys.clear(); + + if( !m_maps.size() || !m_maps[0].map.get() ) + return; // nothing to do + + // find a list of all available key names + key_set all_keys; // set of all keys names from all xmlmaps + for( size_t i = 0; i < m_maps.size(); i++ ) { + XmlNodeMap::iterator mi = m_maps[i].map->begin(), + me = m_maps[i].map->end(); + + for( ; mi != me; ++mi ) { + all_keys.insert(mi->KeyName()); + } + + } + + // cycle through all keys and find ones that have changes + for( key_set::iterator i = all_keys.begin(); i!=all_keys.end(); ++i ) { + + // find the mapping from the first nodemap + XmlNodeMapping *first = m_maps[0].map->Find(*i); + if( !first ) { + // if a key does not exist in this map, then + // it does in another, and therefore is "differing" + m_differing_keys.insert(*i); + continue; + } + + // cycle through all remaining nodemaps, find the mapping that + // matches the keyname, and compare... if any do not + // exist, or do not match, add to the differing keys set + for( size_t j = 1; j < m_maps.size(); j++ ) { + XmlNodeMapping *next = m_maps[j].map->Find(*i); + + // compare! + if( !next || *first != *next ) { + m_differing_keys.insert(*i); + break; + } + } + } +} + +// +// +-barry-sync---------+ +-evo2-sync----------+ +-google-sync------+ +// | | | | | | +// | Adam Brandee | | Adam Brandee | | Adam Brandee | +// | IBM Canada | | | | IBM Canada | < red +// | 1-519-555-1212 | | 1-519-555-1212 | | 1-519-555-1111 | < red +// | abramble@ibm.com | | abramble@ibm.com | | abramble@ibm.com | +// | ---- | | ---- | | ---- | +// | 123 Big Street | | 123 Big Street | | 123 Long St. | < red +// | | | | | Canada | < red +// +--------------------+ +--------------------+ +------------------+ +// +// [See XML] [Select] [See XML] [Select] [See XML] [Select] +// +// +// At the bottom of the dialog, display the rest of the optional buttons, +// like Duplicate, Abort, etc. Also include a checkbox for "always"... +// figure out the best way to handle "always" selections... always +// change #1? +// +// If converting an XML change's data to a hash map throws an exception +// somewhere in the xmlpp::DomParser, then that change will have to +// be handled in a raw manner. I don't think any changes can be +// displayed in a table like above, but each should get a scrolling +// edit control with the raw data included. +// +// If possible, take the default table font and reduce it by 20% or +// something, because this table will likely hold a lot of data. +// +void ConflictDlg::CreateLayout() +{ + m_topsizer = new wxBoxSizer(wxVERTICAL); + CreateSummaries(m_topsizer); + CreateAlternateButtons(m_topsizer); + + SetSizer(m_topsizer); + m_topsizer->SetSizeHints(this); + m_topsizer->Layout(); +} + +void ConflictDlg::CreateSummaries(wxSizer *sizer) +{ + // this sizer is the horizontal box containing one + // "map summary" each + wxBoxSizer *box = new wxBoxSizer(wxHORIZONTAL); + + for( size_t i = 0; i < m_maps.size(); i++ ) { + CreateSummary(box, i); + } + + sizer->Add(box, 0, wxEXPAND | wxALL, 5); +} + +void ConflictDlg::CreateSummary(wxSizer *sizer, size_t change_index) +{ + // this sizer contains the summary box in the top and the + // buttons in the bottom + wxBoxSizer *box = new wxBoxSizer(wxVERTICAL); + + CreateSummaryGroup(box, change_index); + + sizer->Add(box, 1, wxEXPAND | wxLEFT | wxRIGHT, 5); +} + +void ConflictDlg::CreateSummaryGroup(wxSizer *sizer, size_t change_index) +{ + wxString name(m_changes[change_index].plugin_name.c_str(), wxConvUTF8); + wxStaticBoxSizer *box = new wxStaticBoxSizer(wxVERTICAL, this, name); + + XmlNodeMap *xml = m_maps[change_index].map.get(); + if( xml ) { + // add all priority 0 mappings + XmlNodeMap::iterator nmi = xml->begin(), nme = xml->priority_end(); + for( ; nmi != nme; ++nmi ) { + AddMapping(box, *nmi, IsDifferent(*nmi)); + } + + // add small separator (line?) + box->Add( new wxStaticLine(this), 0, wxEXPAND | wxALL, 5); + + // add all differing mappings, in the map order, to preserve + // the map file's user-friendly display order + nmi = nme; // start at priority_end() to skip priority 0 + nme = xml->end(); + for( ; nmi != nme; ++nmi ) { + if( !IsDifferent(*nmi) ) + continue; + + AddMapping(box, *nmi, true); + } + } + else { + AddEmptyNotice(box); + } + + box->Add(0, 10, 0); + box->Add(0, 0, 1); + CreateSummaryButtons(box, change_index); + + sizer->Add(box, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 0); +} + +void ConflictDlg::CreateSummaryButtons(wxSizer *sizer, size_t change_index) +{ + wxBoxSizer *box = new wxBoxSizer(wxHORIZONTAL); + + box->Add(0, 0, 1); + box->Add( new wxButton(this, + Dialog_Conflict_ShowButton1 + change_index, + _T("XML..."), + wxDefaultPosition, wxDefaultSize, + wxBU_EXACTFIT), + 0, wxTOP | wxLEFT | wxRIGHT, 3); + box->Add( new wxButton(this, + Dialog_Conflict_SelectButton1 + change_index, + _T("Select"), + wxDefaultPosition, wxDefaultSize, + wxBU_EXACTFIT), + 0, wxTOP | wxLEFT | wxRIGHT, 3); + + sizer->Add(box, 0, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 0); +} + +bool ConflictDlg::IsDifferent(const XmlNodeMapping &mapping) const +{ + return m_differing_keys.find(mapping.KeyName()) != m_differing_keys.end(); +} + +void ConflictDlg::AddEmptyNotice(wxSizer *sizer) +{ + wxFont font = GetFont(); + font.SetStyle( wxFONTSTYLE_ITALIC ); + + wxStaticText *text = new wxStaticText(this, wxID_ANY, + _T("No XML map found."), + wxDefaultPosition, wxDefaultSize, + wxALIGN_CENTRE | wxST_NO_AUTORESIZE); + text->SetFont(font); + sizer->Add( text, 0, wxEXPAND, 0); +} + +void ConflictDlg::AddMapping(wxSizer *sizer, + XmlNodeMapping &mapping, + bool differing) +{ +// display differing text in red? Not sure how to do that... using italic + + // use a big bold font for the high priority items + wxFont priority_font = GetFont(); + priority_font.SetWeight( wxFONTWEIGHT_BOLD ); + + // italic for changed items + wxFont priority_changed = priority_font; + priority_changed.SetStyle( wxFONTSTYLE_ITALIC ); + + wxFont changed = GetFont(); + changed.SetStyle( wxFONTSTYLE_ITALIC ); + + for( size_t i = 0; i < mapping.size(); i++ ) { + wxString data(mapping[i].Summary().raw().c_str(), wxConvUTF8); + + wxStaticText *text = new wxStaticText(this, wxID_ANY, data, + wxDefaultPosition, wxDefaultSize, + wxALIGN_CENTRE | wxST_NO_AUTORESIZE); + if( mapping.Priority() == 0 ) { + if( differing ) + text->SetFont(priority_changed); + else + text->SetFont(priority_font); + } + else { + if( differing ) + text->SetFont(changed); + } + text->Wrap(m_max_text_width); + + sizer->Add( text, 0, wxEXPAND, 0); + } +} + +void ConflictDlg::CreateAlternateButtons(wxSizer *sizer) +{ + wxBoxSizer *box = new wxBoxSizer(wxHORIZONTAL); + + box->Add( new wxCheckBox(this, Dialog_Conflict_AlwaysCheckbox, + _T("Always use this choice")), + 0, wxALIGN_CENTRE, 0); + box->Add( -1, -1, 1 ); + + if( m_supported_commands.find('D') != string::npos ) { + box->Add( new wxButton(this, Dialog_Conflict_DuplicateButton, + _T("Duplicate")), + 0, wxLEFT , 5); + } + + if( m_supported_commands.find('I') != string::npos ) { + box->Add( new wxButton(this, Dialog_Conflict_IgnoreButton, + _T("Ignore")), + 0, wxLEFT, 5); + } + + if( m_supported_commands.find('N') != string::npos ) { + box->Add( new wxButton(this, Dialog_Conflict_KeepNewerButton, + _T("Keep Newer")), + 0, wxLEFT, 5); + } + + if( m_supported_commands.find('A') != string::npos ) { + box->Add( new wxButton(this, Dialog_Conflict_AbortButton, + _T("Abort")), + 0, wxLEFT, 5); + } + else { + // no abort available, so add a Kill Sync button + box->Add( new wxButton(this, Dialog_Conflict_KillSyncButton, + _T("Kill Sync")), + 0, wxLEFT, 5); + } + + sizer->Add(box, 0, wxEXPAND | wxALL, 10); +} + + +////////////////////////////////////////////////////////////////////////////// +// public members + +void ConflictDlg::clear() +{ + m_command_string.clear(); + m_kill_sync = false; +} + +int ConflictDlg::ShowModal() +{ + int ret = 0; + + // start fresh + clear(); + + // is there a favoured plugin name? + if( m_always.m_favour_plugin_name.size() ) { + // find the matching plugin name + for( size_t i = 0; i < m_changes.size(); i++ ) { + if( m_changes[i].plugin_name == m_always.m_favour_plugin_name ) { + ostringstream oss; + oss << "S " << m_changes[i].id; + m_command_string = oss.str(); + return ret; + } + } + } + + // is there an "always" answer we can use? + if( m_always.m_always ) { + if( m_always.m_last_command == "S" ) { + // find the change that has a matching member_id + // and plugin_name + for( size_t i = 0; i < m_changes.size(); i++ ) { + if( m_changes[i].member_id == m_always.m_member_id && m_changes[i].plugin_name == m_always.m_plugin_name ) { + ostringstream oss; + oss << "S " << m_changes[i].id; + m_command_string = oss.str(); + return ret; + } + } + } + else { + m_command_string = m_always.m_last_command; + return ret; // done + } + } + + // ok, no "always" data that works, so ask the user + do { + ret = wxDialog::ShowModal(); + } while( m_command_string.size() == 0 && !m_kill_sync ); + + return ret; +} + +void ConflictDlg::OnShowButton(wxCommandEvent &event) +{ + int index = event.GetId() - Dialog_Conflict_ShowButton1; + wxString xmldata(m_changes[index].printable_data.c_str(), wxConvUTF8); + + // let's try this the quick manual way... + wxDialog dlg(this, wxID_ANY, _T("Raw Change Data")); + wxBoxSizer *box = new wxBoxSizer(wxVERTICAL); + box->Add( new wxTextCtrl(&dlg, wxID_ANY, xmldata, + wxDefaultPosition, wxSize(400, 400), + wxTE_MULTILINE | wxTE_READONLY), + 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 10); + box->Add( dlg.CreateButtonSizer(wxOK), 0, wxEXPAND | wxALL, 10 ); + dlg.SetSizer(box); + box->SetSizeHints(&dlg); + box->Layout(); + dlg.ShowModal(); +} + +void ConflictDlg::OnSelectButton(wxCommandEvent &event) +{ + int index = event.GetId() - Dialog_Conflict_SelectButton1; + + // store command in m_always + m_always.m_member_id = m_changes[index].member_id; + m_always.m_plugin_name = m_changes[index].plugin_name; + m_always.m_last_command = "S"; + + // build actual command + ostringstream oss; + oss << "S " << m_changes[index].id; + m_command_string = oss.str(); + + EndModal(event.GetId()); +} + +void ConflictDlg::OnDuplicateButton(wxCommandEvent &event) +{ + m_command_string = m_always.m_last_command = "D"; + EndModal(event.GetId()); +} + +void ConflictDlg::OnAbortButton(wxCommandEvent &event) +{ + m_command_string = m_always.m_last_command = "A"; + EndModal(event.GetId()); +} + +void ConflictDlg::OnIgnoreButton(wxCommandEvent &event) +{ + m_command_string = m_always.m_last_command = "I"; + EndModal(event.GetId()); +} + +void ConflictDlg::OnKeepNewerButton(wxCommandEvent &event) +{ + m_command_string = m_always.m_last_command = "N"; + EndModal(event.GetId()); +} + +void ConflictDlg::OnKillSyncButton(wxCommandEvent &event) +{ + m_command_string.clear(); + m_always.m_last_command.clear(); + m_kill_sync = true; + EndModal(event.GetId()); +} + +void ConflictDlg::OnAlwaysCheckbox(wxCommandEvent &event) +{ + m_always.m_always = event.IsChecked(); +} + diff -Nru barry-0.14/desktop/src/ConflictDlg.h barry-0.0.20110506/desktop/src/ConflictDlg.h --- barry-0.14/desktop/src/ConflictDlg.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ConflictDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,140 @@ +/// +/// \file ConflictDlg.h +/// The dialog used during a sync, to display conflicting +/// changes, and let the user decide what to do. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_CONFLICTDLG_H__ +#define __BARRYDESKTOP_CONFLICTDLG_H__ + +#include +#include +#include +#include "osbase.h" +#include "xmlmap.h" + +class ConflictDlg : public wxDialog +{ +public: + typedef std::tr1::shared_ptr map_ptr; + typedef std::tr1::shared_ptr dom_ptr; + + struct XmlPair + { + ConflictDlg::dom_ptr dom; // never null + ConflictDlg::map_ptr map; // can contain null! + }; + + typedef std::vector mapped_list; + typedef std::set key_set; + + // Stored by the caller to remember the "always" selection + // Pass it back into the dialog to have it automatically + // select for you. + struct AlwaysMemoryBlock + { + bool m_always; + long m_member_id; + std::string m_plugin_name; + std::string m_last_command; + std::string m_favour_plugin_name; + + void clear() + { + m_always = false; + m_member_id = -1; + m_plugin_name.clear(); + m_last_command.clear(); + m_favour_plugin_name.clear(); + } + + AlwaysMemoryBlock() + : m_always(false) + , m_member_id(-1) + { + } + }; + +private: + DECLARE_EVENT_TABLE() + + // external data sources + const OpenSync::API &m_engine; + const std::vector &m_changes; + std::string m_supported_commands; // a char string: "SDAIN" + AlwaysMemoryBlock &m_always; + + // mapped data + mapped_list m_maps; + key_set m_differing_keys; + + // results + bool m_kill_sync; + std::string m_command_string; // eg. "S 1" + + // dialog sizing + int m_max_text_width; + + // dialog controls + wxSizer *m_topsizer; + +protected: + void CreateLayout(); + void CreateSummaries(wxSizer *sizer); + void CreateSummary(wxSizer *sizer, size_t change_index); + void CreateSummaryGroup(wxSizer *sizer, size_t change_index); + void CreateSummaryButtons(wxSizer *sizer, size_t change_index); + bool IsDifferent(const XmlNodeMapping &mapping) const; + void AddEmptyNotice(wxSizer *sizer); + void AddMapping(wxSizer *sizer, XmlNodeMapping &mapping, + bool differing); + void CreateAlternateButtons(wxSizer *sizer); + + void ParseChanges(); + void CreateDifferingKeyNameSet(); + +public: + ConflictDlg(wxWindow *parent, const OpenSync::API &engine, + const std::string &supported_commands, + const std::vector &changes, + AlwaysMemoryBlock &always); + ~ConflictDlg(); + + // data access + const std::string& GetCommand() const { return m_command_string; } + bool IsKillSync() const { return m_kill_sync; } + void Clear() { clear(); } + void clear(); + + // override, in order to force an answer + int ShowModal(); + + // event handlers + void OnShowButton(wxCommandEvent &event); + void OnSelectButton(wxCommandEvent &event); + void OnDuplicateButton(wxCommandEvent &event); + void OnAbortButton(wxCommandEvent &event); + void OnIgnoreButton(wxCommandEvent &event); + void OnKeepNewerButton(wxCommandEvent &event); + void OnKillSyncButton(wxCommandEvent &event); + void OnAlwaysCheckbox(wxCommandEvent &event); +}; + +#endif + diff -Nru barry-0.14/desktop/src/ContactEditDlg.cc barry-0.0.20110506/desktop/src/ContactEditDlg.cc --- barry-0.14/desktop/src/ContactEditDlg.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ContactEditDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,387 @@ +/// +/// \file ContactEditDlg.cc +/// Dialog class to handle the editing of all Barry record classes +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "ContactEditDlg.h" +#include "ContactPhotoWidget.h" +#include "windowids.h" + +// begin wxGlade: ::extracode +// end wxGlade + + +////////////////////////////////////////////////////////////////////////////// +// ContactEditDlg class + +ContactEditDlg::ContactEditDlg(wxWindow *parent, + Barry::Contact &rec, + bool editable) + : wxDialog(parent, Dialog_ContactEdit, _T("Contact Record")) + , m_rec(rec) +{ + m_email_list = Barry::Contact::Email2CommaString(m_rec.EmailAddresses); + + if( editable ) { + bottom_buttons = CreateButtonSizer(wxOK | wxCANCEL); + } + else { + bottom_buttons = CreateButtonSizer(wxCANCEL); + } + + // begin wxGlade: ContactEditDlg::ContactEditDlg + sizer_5_staticbox = new wxStaticBox(this, -1, wxT("Home")); + sizer_6_staticbox = new wxStaticBox(this, -1, wxT("Work")); + sizer_2_staticbox = new wxStaticBox(this, -1, wxT("Misc")); + sizer_7_staticbox = new wxStaticBox(this, -1, wxT("Mobile")); + sizer_8_staticbox = new wxStaticBox(this, -1, wxT("Notes")); + sizer_9_staticbox = new wxStaticBox(this, -1, wxT("Name")); + m_photo = new ContactPhotoWidget(this, Dialog_ContactEdit_PhotoButton, m_rec); + label_13 = new wxStaticText(this, wxID_ANY, wxT("Title")); + Prefix = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + FirstNameStatic = new wxStaticText(this, wxID_ANY, wxT("First")); + FirstName = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + LastNameStatic = new wxStaticText(this, wxID_ANY, wxT("Last")); + LastName = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_14 = new wxStaticText(this, wxID_ANY, wxT("Company")); + Company = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_15 = new wxStaticText(this, wxID_ANY, wxT("Job Title")); + JobTitle = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_9 = new wxStaticText(this, wxID_ANY, wxT("Nickname")); + Nickname = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_1 = new wxStaticText(this, wxID_ANY, wxT("Address")); + HomeAddress1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + HomeAddress2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + HomeAddress3 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_2 = new wxStaticText(this, wxID_ANY, wxT("City")); + HomeCity = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_3 = new wxStaticText(this, wxID_ANY, wxT("Province")); + HomeProvince = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_4 = new wxStaticText(this, wxID_ANY, wxT("Postal Code")); + HomePostalCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_5 = new wxStaticText(this, wxID_ANY, wxT("Country")); + HomeCountry = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + static_line_1 = new wxStaticLine(this, wxID_ANY); + static_line_2 = new wxStaticLine(this, wxID_ANY); + label_6 = new wxStaticText(this, wxID_ANY, wxT("Phone")); + HomePhone = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_7 = new wxStaticText(this, wxID_ANY, wxT("Phone 2")); + HomePhone2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_8 = new wxStaticText(this, wxID_ANY, wxT("Fax")); + HomeFax = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_1_copy = new wxStaticText(this, wxID_ANY, wxT("Address")); + WorkAddress1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + WorkAddress2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + WorkAddress3 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_2_copy = new wxStaticText(this, wxID_ANY, wxT("City")); + WorkCity = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_3_copy = new wxStaticText(this, wxID_ANY, wxT("Province")); + WorkProvince = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_4_copy = new wxStaticText(this, wxID_ANY, wxT("Postal Code")); + WorkPostalCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_5_copy = new wxStaticText(this, wxID_ANY, wxT("Country")); + WorkCountry = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + static_line_1_copy = new wxStaticLine(this, wxID_ANY); + static_line_2_copy = new wxStaticLine(this, wxID_ANY); + label_6_copy = new wxStaticText(this, wxID_ANY, wxT("Phone")); + WorkPhone = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_7_copy = new wxStaticText(this, wxID_ANY, wxT("Phone 2")); + WorkPhone2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_8_copy = new wxStaticText(this, wxID_ANY, wxT("Fax")); + WorkFax = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_17 = new wxStaticText(this, wxID_ANY, wxT("Email")); + text_ctrl_9 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_18 = new wxStaticText(this, wxID_ANY, wxT("Other Phone")); + text_ctrl_1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_19 = new wxStaticText(this, wxID_ANY, wxT("Old Phone")); + text_ctrl_2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_20 = new wxStaticText(this, wxID_ANY, wxT("Radio")); + text_ctrl_3 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_21 = new wxStaticText(this, wxID_ANY, wxT("PIN")); + text_ctrl_4 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_22 = new wxStaticText(this, wxID_ANY, wxT("User1")); + text_ctrl_5 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_23 = new wxStaticText(this, wxID_ANY, wxT("User2")); + text_ctrl_6 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_24 = new wxStaticText(this, wxID_ANY, wxT("User3")); + text_ctrl_7 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_25 = new wxStaticText(this, wxID_ANY, wxT("User4")); + text_ctrl_8 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_10 = new wxStaticText(this, wxID_ANY, wxT("Cell")); + MobilePhone = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_11 = new wxStaticText(this, wxID_ANY, wxT("Cell 2")); + MobilePhone2 = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + label_12 = new wxStaticText(this, wxID_ANY, wxT("Pager")); + Pager = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + Notes = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_MULTILINE); + label_16 = new wxStaticText(this, wxID_ANY, wxT("URL")); + Url = new wxTextCtrl(this, wxID_ANY, wxEmptyString); + + set_properties(); + do_layout(); + // end wxGlade +} + +BEGIN_EVENT_TABLE(ContactEditDlg, wxDialog) + EVT_BUTTON (Dialog_ContactEdit_PhotoButton, + ContactEditDlg::OnPhotoButton) +END_EVENT_TABLE(); + +void ContactEditDlg::set_properties() +{ + // begin wxGlade: ContactEditDlg::set_properties + SetTitle(wxT("Contact")); + Prefix->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Prefix))); + FirstName->SetMinSize(wxSize(100, -1)); + FirstName->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.FirstName))); + LastName->SetMinSize(wxSize(100, -1)); + LastName->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.LastName))); + Company->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Company))); + JobTitle->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.JobTitle))); + Nickname->SetMinSize(wxSize(100, -1)); + Nickname->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Nickname))); + HomeAddress1->SetMinSize(wxSize(170, -1)); + HomeAddress1->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address1))); + HomeAddress2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address2))); + HomeAddress3->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address3))); + HomeCity->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.City))); + HomeProvince->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Province))); + HomePostalCode->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.PostalCode))); + HomeCountry->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Country))); + HomePhone->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomePhone))); + HomePhone2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomePhone2))); + HomeFax->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeFax))); + WorkAddress1->SetMinSize(wxSize(170, -1)); + WorkAddress1->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address1))); + WorkAddress2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address2))); + WorkAddress3->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address3))); + WorkCity->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.City))); + WorkProvince->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Province))); + WorkPostalCode->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.PostalCode))); + WorkCountry->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Country))); + WorkPhone->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkPhone))); + WorkPhone2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkPhone2))); + WorkFax->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Fax))); + text_ctrl_9->SetMinSize(wxSize(170, -1)); + text_ctrl_9->SetToolTip(wxT("Comma separated list of simple email addresses. Do not use <> characters.")); + text_ctrl_9->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_email_list))); + text_ctrl_1->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.OtherPhone))); + text_ctrl_2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Phone))); + text_ctrl_3->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Radio))); + text_ctrl_4->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.PIN))); + text_ctrl_5->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined1))); + text_ctrl_6->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined2))); + text_ctrl_7->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined3))); + text_ctrl_8->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined4))); + MobilePhone->SetMinSize(wxSize(100, -1)); + MobilePhone->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.MobilePhone))); + MobilePhone2->SetMinSize(wxSize(100, -1)); + MobilePhone2->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.MobilePhone2))); + Pager->SetMinSize(wxSize(100, -1)); + Pager->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Pager))); + Notes->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Notes))); + Url->SetValidator(wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.URL))); + // end wxGlade +} + + +void ContactEditDlg::do_layout() +{ + // begin wxGlade: ContactEditDlg::do_layout + wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); + wxStaticBoxSizer* sizer_8 = new wxStaticBoxSizer(sizer_8_staticbox, wxVERTICAL); + wxBoxSizer* sizer_10 = new wxBoxSizer(wxHORIZONTAL); + wxStaticBoxSizer* sizer_7 = new wxStaticBoxSizer(sizer_7_staticbox, wxHORIZONTAL); + wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL); + wxStaticBoxSizer* sizer_2 = new wxStaticBoxSizer(sizer_2_staticbox, wxHORIZONTAL); + wxFlexGridSizer* grid_sizer_3 = new wxFlexGridSizer(10, 2, 1, 3); + wxStaticBoxSizer* sizer_6 = new wxStaticBoxSizer(sizer_6_staticbox, wxHORIZONTAL); + wxFlexGridSizer* grid_sizer_1_copy = new wxFlexGridSizer(11, 2, 1, 3); + wxStaticBoxSizer* sizer_5 = new wxStaticBoxSizer(sizer_5_staticbox, wxHORIZONTAL); + wxFlexGridSizer* grid_sizer_1 = new wxFlexGridSizer(11, 2, 1, 3); + wxStaticBoxSizer* sizer_9 = new wxStaticBoxSizer(sizer_9_staticbox, wxHORIZONTAL); + wxFlexGridSizer* grid_sizer_2 = new wxFlexGridSizer(2, 6, 2, 3); + sizer_9->Add(m_photo, 0, wxRIGHT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 3); + grid_sizer_2->Add(label_13, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + grid_sizer_2->Add(Prefix, 0, wxEXPAND, 0); + grid_sizer_2->Add(FirstNameStatic, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 10); + grid_sizer_2->Add(FirstName, 1, wxEXPAND, 0); + grid_sizer_2->Add(LastNameStatic, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 10); + grid_sizer_2->Add(LastName, 1, wxEXPAND, 0); + grid_sizer_2->Add(label_14, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + grid_sizer_2->Add(Company, 0, wxEXPAND, 0); + grid_sizer_2->Add(label_15, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 10); + grid_sizer_2->Add(JobTitle, 0, wxEXPAND, 0); + grid_sizer_2->Add(label_9, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 10); + grid_sizer_2->Add(Nickname, 1, wxEXPAND, 0); + grid_sizer_2->AddGrowableCol(1); + grid_sizer_2->AddGrowableCol(3); + grid_sizer_2->AddGrowableCol(5); + sizer_9->Add(grid_sizer_2, 1, wxBOTTOM|wxEXPAND, 3); + sizer_1->Add(sizer_9, 0, wxALL|wxEXPAND, 5); + grid_sizer_1->Add(label_1, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomeAddress1, 0, 0, 0); + grid_sizer_1->Add(20, 20, 0, 0, 0); + grid_sizer_1->Add(HomeAddress2, 0, wxEXPAND, 0); + grid_sizer_1->Add(20, 20, 0, 0, 0); + grid_sizer_1->Add(HomeAddress3, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_2, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomeCity, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_3, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomeProvince, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_4, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomePostalCode, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_5, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomeCountry, 0, wxEXPAND, 0); + grid_sizer_1->Add(static_line_1, 0, wxEXPAND, 0); + grid_sizer_1->Add(static_line_2, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_6, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomePhone, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_7, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomePhone2, 0, wxEXPAND, 0); + grid_sizer_1->Add(label_8, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1->Add(HomeFax, 0, wxEXPAND, 0); + sizer_5->Add(grid_sizer_1, 1, wxEXPAND, 0); + sizer_4->Add(sizer_5, 1, wxLEFT|wxRIGHT|wxEXPAND, 2); + grid_sizer_1_copy->Add(label_1_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkAddress1, 0, 0, 0); + grid_sizer_1_copy->Add(20, 20, 0, 0, 0); + grid_sizer_1_copy->Add(WorkAddress2, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(20, 20, 0, 0, 0); + grid_sizer_1_copy->Add(WorkAddress3, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_2_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkCity, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_3_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkProvince, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_4_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkPostalCode, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_5_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkCountry, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(static_line_1_copy, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(static_line_2_copy, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_6_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkPhone, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_7_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkPhone2, 0, wxEXPAND, 0); + grid_sizer_1_copy->Add(label_8_copy, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_1_copy->Add(WorkFax, 0, wxEXPAND, 0); + sizer_6->Add(grid_sizer_1_copy, 1, wxEXPAND, 0); + sizer_4->Add(sizer_6, 1, wxLEFT|wxRIGHT|wxEXPAND, 2); + grid_sizer_3->Add(label_17, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_3->Add(text_ctrl_9, 0, 0, 0); + grid_sizer_3->Add(label_18, 0, wxALIGN_CENTER_VERTICAL, 0); + grid_sizer_3->Add(text_ctrl_1, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_19, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_2, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_20, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_3, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_21, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_4, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_22, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_5, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_23, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_6, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_24, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_7, 0, wxEXPAND, 0); + grid_sizer_3->Add(label_25, 0, 0, 0); + grid_sizer_3->Add(text_ctrl_8, 0, wxEXPAND, 0); + sizer_2->Add(grid_sizer_3, 1, wxEXPAND, 0); + sizer_4->Add(sizer_2, 1, wxEXPAND, 0); + sizer_1->Add(sizer_4, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5); + sizer_7->Add(label_10, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + sizer_7->Add(MobilePhone, 1, 0, 0); + sizer_7->Add(20, 20, 0, 0, 0); + sizer_7->Add(label_11, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + sizer_7->Add(MobilePhone2, 1, 0, 0); + sizer_7->Add(20, 20, 0, 0, 0); + sizer_7->Add(label_12, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + sizer_7->Add(Pager, 1, 0, 0); + sizer_1->Add(sizer_7, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5); + sizer_8->Add(Notes, 0, wxEXPAND, 0); + sizer_10->Add(label_16, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 1); + sizer_10->Add(Url, 1, wxALL, 2); + sizer_8->Add(sizer_10, 0, wxEXPAND, 0); + sizer_1->Add(sizer_8, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5); + // end wxGlade + + sizer_1->Add(bottom_buttons, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5); + + // NOTE: the code generator will generate these 3 calls above. + // They may be removed above, since it will probably slow + // down the GUI display. + SetSizer(sizer_1); + sizer_1->Fit(this); + Layout(); + +} + +int ContactEditDlg::ShowModal() +{ + int ret = wxDialog::ShowModal(); + m_strings.Sync(); + Barry::Contact::CommaString2Email(m_email_list, m_rec.EmailAddresses); + return ret; +} + +void ContactEditDlg::OnPhotoButton(wxCommandEvent &event) +{ + if( m_rec.Image.size() ) { + // an image exists, prompt user what to do + wxArrayString choices; + choices.Add( _T("Load new photo") ); + choices.Add( _T("Save current photo to disk") ); + choices.Add( _T("Delete current photo") ); + + int choice = wxGetSingleChoiceIndex( + _T("A photo currently exists. Would you like to:"), + _T("Photo Management"), + choices, this); + + switch( choice ) + { + case 0: // load new photo + if( m_photo->PromptAndLoad(this) ) { + Layout(); + } + break; + + case 1: // save photo + m_photo->PromptAndSave(this); + break; + + case 2: // delete photo + m_photo->DeletePhoto(); + Layout(); + break; + + default: + // do nothing! + break; + } + } + else { + // no image exists, assume he wants to load a new one + if( m_photo->PromptAndLoad(this) ) { + // FIXME - if the photo is wider than old button, + // this doesn't seem to work. Why? + Layout(); + } + } +} + diff -Nru barry-0.14/desktop/src/ContactEditDlg.h barry-0.0.20110506/desktop/src/ContactEditDlg.h --- barry-0.14/desktop/src/ContactEditDlg.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ContactEditDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,156 @@ +/// +/// \file ContactEditDlg.h +/// Dialog class to handle the editing of all Barry record classes +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_RECORD_EDIT_DLG_H__ +#define __BARRYDESKTOP_RECORD_EDIT_DLG_H__ + +#include "StringSync.h" +#include +#include +// begin wxGlade: ::dependencies +#include +// end wxGlade + +// begin wxGlade: ::extracode +// end wxGlade + +class ContactPhotoWidget; + +class ContactEditDlg : public wxDialog +{ +public: + // begin wxGlade: ContactEditDlg::ids + // end wxGlade + +private: + Barry::Contact &m_rec; + std::string m_email_list; + StringSync m_strings; + + // begin wxGlade: ContactEditDlg::methods + void set_properties(); + void do_layout(); + // end wxGlade + +protected: + // begin wxGlade: ContactEditDlg::attributes + wxStaticBox* sizer_8_staticbox; + wxStaticBox* sizer_7_staticbox; + wxStaticBox* sizer_2_staticbox; + wxStaticBox* sizer_6_staticbox; + wxStaticBox* sizer_5_staticbox; + wxStaticBox* sizer_9_staticbox; + ContactPhotoWidget* m_photo; + wxStaticText* label_13; + wxTextCtrl* Prefix; + wxStaticText* FirstNameStatic; + wxTextCtrl* FirstName; + wxStaticText* LastNameStatic; + wxTextCtrl* LastName; + wxStaticText* label_14; + wxTextCtrl* Company; + wxStaticText* label_15; + wxTextCtrl* JobTitle; + wxStaticText* label_9; + wxTextCtrl* Nickname; + wxStaticText* label_1; + wxTextCtrl* HomeAddress1; + wxTextCtrl* HomeAddress2; + wxTextCtrl* HomeAddress3; + wxStaticText* label_2; + wxTextCtrl* HomeCity; + wxStaticText* label_3; + wxTextCtrl* HomeProvince; + wxStaticText* label_4; + wxTextCtrl* HomePostalCode; + wxStaticText* label_5; + wxTextCtrl* HomeCountry; + wxStaticLine* static_line_1; + wxStaticLine* static_line_2; + wxStaticText* label_6; + wxTextCtrl* HomePhone; + wxStaticText* label_7; + wxTextCtrl* HomePhone2; + wxStaticText* label_8; + wxTextCtrl* HomeFax; + wxStaticText* label_1_copy; + wxTextCtrl* WorkAddress1; + wxTextCtrl* WorkAddress2; + wxTextCtrl* WorkAddress3; + wxStaticText* label_2_copy; + wxTextCtrl* WorkCity; + wxStaticText* label_3_copy; + wxTextCtrl* WorkProvince; + wxStaticText* label_4_copy; + wxTextCtrl* WorkPostalCode; + wxStaticText* label_5_copy; + wxTextCtrl* WorkCountry; + wxStaticLine* static_line_1_copy; + wxStaticLine* static_line_2_copy; + wxStaticText* label_6_copy; + wxTextCtrl* WorkPhone; + wxStaticText* label_7_copy; + wxTextCtrl* WorkPhone2; + wxStaticText* label_8_copy; + wxTextCtrl* WorkFax; + wxStaticText* label_17; + wxTextCtrl* text_ctrl_9; + wxStaticText* label_18; + wxTextCtrl* text_ctrl_1; + wxStaticText* label_19; + wxTextCtrl* text_ctrl_2; + wxStaticText* label_20; + wxTextCtrl* text_ctrl_3; + wxStaticText* label_21; + wxTextCtrl* text_ctrl_4; + wxStaticText* label_22; + wxTextCtrl* text_ctrl_5; + wxStaticText* label_23; + wxTextCtrl* text_ctrl_6; + wxStaticText* label_24; + wxTextCtrl* text_ctrl_7; + wxStaticText* label_25; + wxTextCtrl* text_ctrl_8; + wxStaticText* label_10; + wxTextCtrl* MobilePhone; + wxStaticText* label_11; + wxTextCtrl* MobilePhone2; + wxStaticText* label_12; + wxTextCtrl* Pager; + wxTextCtrl* Notes; + wxStaticText* label_16; + wxTextCtrl* Url; + // end wxGlade + + wxSizer *bottom_buttons; + + DECLARE_EVENT_TABLE(); + +public: + ContactEditDlg(wxWindow *parent, Barry::Contact &rec, bool editable); + int ShowModal(); + +public: + void OnPhotoButton(wxCommandEvent &event); +}; + +#endif + diff -Nru barry-0.14/desktop/src/ContactEditDlg.wxg barry-0.0.20110506/desktop/src/ContactEditDlg.wxg --- barry-0.14/desktop/src/ContactEditDlg.wxg 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ContactEditDlg.wxg 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,937 @@ + + + + + + + Contact + + wxVERTICAL + + wxALL|wxEXPAND + 5 + + + wxHORIZONTAL + + + wxRIGHT|wxEXPAND|wxALIGN_CENTER_VERTICAL + 3 + + + + $parent + $id + m_rec + + Dialog_ContactEdit_PhotoButton + + + + wxBOTTOM|wxEXPAND + 3 + + + 3 + 2 + 1,3,5 + 6 + 2 + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Prefix)) + + + + + wxLEFT|wxALIGN_CENTER_VERTICAL + 10 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.FirstName)) + + 100, -1 + + + + wxLEFT|wxALIGN_CENTER_VERTICAL + 10 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.LastName)) + + 100, -1 + + + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Company)) + + + + + wxLEFT|wxALIGN_CENTER_VERTICAL + 10 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.JobTitle)) + + + + + wxLEFT|wxALIGN_CENTER_VERTICAL + 10 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Nickname)) + + 100, -1 + + + + + + + + wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND + 5 + + + wxHORIZONTAL + + wxLEFT|wxRIGHT|wxEXPAND + 2 + + + wxHORIZONTAL + + + wxEXPAND + 0 + + + 3 + 11 + 2 + 1 + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address1)) + + 170, -1 + + + + 0 + + + 20 + 20 + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address2)) + + + + + 0 + + + 20 + 20 + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Address3)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.City)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Province)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.PostalCode)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeAddress.Country)) + + + + + wxEXPAND + 0 + + + + 1 + + + + wxEXPAND + 0 + + + + 1 + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomePhone)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomePhone2)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.HomeFax)) + + + + + + + + + wxLEFT|wxRIGHT|wxEXPAND + 2 + + + wxHORIZONTAL + + + wxEXPAND + 0 + + + 3 + 11 + 2 + 1 + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address1)) + + 170, -1 + + + + 0 + + + 20 + 20 + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address2)) + + + + + 0 + + + 20 + 20 + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Address3)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.City)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Province)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.PostalCode)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkAddress.Country)) + + + + + wxEXPAND + 0 + + + + 1 + + + + wxEXPAND + 0 + + + + 1 + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkPhone)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.WorkPhone2)) + + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Fax)) + + + + + + + + + wxEXPAND + 0 + + + wxHORIZONTAL + + + wxEXPAND + 0 + + + 3 + 10 + 2 + 1 + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + 0 + + + Comma separated list of simple email addresses. Do not use <> characters. + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_email_list)) + + 170, -1 + + + + wxALIGN_CENTER_VERTICAL + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.OtherPhone)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Phone)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Radio)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.PIN)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined1)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined2)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined3)) + + + + + 0 + + + 1 + + + + + wxEXPAND + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.UserDefined4)) + + + + + + + + + + + wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND + 5 + + + wxHORIZONTAL + + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.MobilePhone)) + + 100, -1 + + + + 0 + + + 20 + 20 + + + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.MobilePhone2)) + + 100, -1 + + + + 0 + + + 20 + 20 + + + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + 0 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Pager)) + + 100, -1 + + + + + + wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND + 5 + + + wxVERTICAL + + + wxEXPAND + 0 + + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.Notes)) + + + + + wxEXPAND + 0 + + + wxHORIZONTAL + + wxRIGHT|wxALIGN_CENTER_VERTICAL + 1 + + + 1 + + + + + wxALL + 2 + + + + wxTextValidator(wxFILTER_NONE, m_strings.Add(m_rec.URL)) + + + + + + + + + + diff -Nru barry-0.14/desktop/src/ContactPhotoWidget.cc barry-0.0.20110506/desktop/src/ContactPhotoWidget.cc --- barry-0.14/desktop/src/ContactPhotoWidget.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ContactPhotoWidget.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,195 @@ +/// +/// \file ContactPhotoWidget.cc +/// Bitmap button that shows a Contact::Image photo +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "ContactPhotoWidget.h" +#include "windowids.h" +#include +#include +#include +#include + +using namespace std; + +#define MAX_IMAGE_HEIGHT 60 +#define DEFAULT_IMAGE_WIDTH 50 + +ContactPhotoWidget::ContactPhotoWidget(wxWindow *parent, + wxWindowID id, + Barry::Contact &rec) + : m_rec(rec) + , m_file_filter(_T("Image files (*.bmp;*.jpg;*.png;*.xmp;*.tif)|*.bmp;*.jpg;*.png;*.xmp;*.tif;*.tiff|All files (*.*)|*.*")) +{ + // limit size of image to 60 px height + int max_height = MAX_IMAGE_HEIGHT, width = 0; + + if( m_rec.Image.size() ) { + width = LoadRecImage(max_height); + } + + // anything loaded? if not, load "empty" bitmap + if( !m_bitmap.get() ) { + width = DEFAULT_IMAGE_WIDTH; + max_height = MAX_IMAGE_HEIGHT; + m_bitmap.reset( new wxBitmap(width, max_height) ); + DrawNoPhoto(*m_bitmap, width, max_height); + } + + // have bitmap, create our bitmap button + Create(parent, id, *m_bitmap, wxDefaultPosition, + wxSize(width, max_height)); +} + +int ContactPhotoWidget::LoadRecImage(int max_height) +{ + // load m_rec.Image into a wxBitmap + wxMemoryInputStream stream(m_rec.Image.data(), m_rec.Image.size()); + wxImage jpeg(stream, wxBITMAP_TYPE_JPEG); + + float ratio = (float)max_height / jpeg.GetHeight(); + int width = jpeg.GetWidth() * ratio; + + jpeg.Rescale(width, max_height, wxIMAGE_QUALITY_HIGH); + m_bitmap.reset( new wxBitmap(jpeg) ); + return width; +} + +void ContactPhotoWidget::PromptAndSave(wxWindow *parent) +{ + if( !m_rec.Image.size() ) { + wxMessageBox(_T("There is no photo available to save."), + _T("No Photo"), + wxICON_INFORMATION | wxOK); + return; + } + + wxFileDialog dlg(parent, _T("Save Photo as JPEG..."), _T(""), _T(""), + _T("JPEG files (*.jpg)|*.jpg"), + wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxFD_PREVIEW); + if( dlg.ShowModal() == wxID_OK ) { + ofstream ofs(dlg.GetPath().utf8_str(), ios::binary); + ofs.write(m_rec.Image.data(), m_rec.Image.size()); + } +} + +/// Returns true if a new image has been loaded (may want to resize) +bool ContactPhotoWidget::PromptAndLoad(wxWindow *parent) +{ + wxFileDialog dlg(parent, _T("Load Photo..."), _T(""), _T(""), + m_file_filter, + wxFD_OPEN | wxFD_PREVIEW); + if( dlg.ShowModal() != wxID_OK ) + return false; + + // Load image in whatever format it's in + wxImage image; + if( !image.LoadFile(dlg.GetPath()) ) { + wxMessageBox(_T("Unable to load selected photo."), + _T("Photo Load Error"), + wxICON_ERROR | wxOK); + return false; + } + + // Save image to memory as a JPEG + wxMemoryOutputStream stream; + if( !image.SaveFile(stream, wxBITMAP_TYPE_JPEG) ) { + wxMessageBox(_T("Unable to convert image to JPEG."), + _T("Photo Convert"), + wxICON_ERROR | wxOK); + return false; + } + + // Store into Contact record + const char + *begin = (char*)stream.GetOutputStreamBuffer()->GetBufferStart(), + *end = (char*)stream.GetOutputStreamBuffer()->GetBufferEnd(); + int size = end - begin; + m_rec.Image.assign(begin, size); + + // Update our button + LoadRecImage(MAX_IMAGE_HEIGHT); + SetBitmapLabel(*m_bitmap); + SetSize(m_bitmap->GetWidth(), m_bitmap->GetHeight()); + return true; +} + +void ContactPhotoWidget::DeletePhoto() +{ + // zap the record + m_rec.Image.clear(); + + // replace with message + wxSize client = GetClientSize(); + int width = client.GetWidth(); + int height = client.GetHeight(); + m_bitmap.reset( new wxBitmap(width, height) ); + DrawNoPhoto(*m_bitmap, width, height); + SetBitmapLabel(*m_bitmap); +} + +void ContactPhotoWidget::DrawNoPhoto(wxBitmap &bm, int width, int height) +{ + wxMemoryDC dc; + dc.SelectObject(bm); + + // resources + wxColour textcolour(0xa9, 0xa5, 0xa2); + wxColour background(0xed, 0xec, 0xeb); + wxPen pen(background); + wxBrush brush(background); + wxString line1(_T("No")), line2(_T("Photo")); + int pointsize =wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) + .GetPointSize(); + wxFont font(pointsize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, + wxFONTWEIGHT_NORMAL); + + // trim fontsize so it fits + wxSize line1_extent, line2_extent; + do { + font.SetPointSize(pointsize--); + dc.SetFont(font); + line1_extent = dc.GetTextExtent(line1); + line2_extent = dc.GetTextExtent(line2); + } while( line1_extent.GetWidth() > width || + line2_extent.GetWidth() > width); + + // setup DC + dc.SetPen(pen); + dc.SetBrush(brush); + dc.SetTextForeground(textcolour); + dc.SetTextBackground(background); + + // calculate position + int total_height = line1_extent.GetHeight() + line2_extent.GetHeight(); + int y1_start = (height - total_height) / 2; + int y2_start = y1_start + line1_extent.GetHeight(); + int x1_start = (width - line1_extent.GetWidth()) / 2; + int x2_start = (width - line2_extent.GetWidth()) / 2; + + // draw + dc.DrawRectangle(0, 0, width, height); + dc.DrawText(line1, x1_start, y1_start); + dc.DrawText(line2, x2_start, y2_start); + + // cleanup + dc.SetPen(wxNullPen); + dc.SetBrush(wxNullBrush); +} + diff -Nru barry-0.14/desktop/src/ContactPhotoWidget.h barry-0.0.20110506/desktop/src/ContactPhotoWidget.h --- barry-0.14/desktop/src/ContactPhotoWidget.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ContactPhotoWidget.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,55 @@ +/// +/// \file ContactPhotoWidget.h +/// Bitmap button that shows a Contact::Image photo +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_CONTACT_PHOTO_WIDGET_H__ +#define __BARRYDESKTOP_CONTACT_PHOTO_WIDGET_H__ + +#include +#include + +namespace Barry { + class Contact; +} + +class ContactPhotoWidget : public wxBitmapButton +{ + Barry::Contact &m_rec; + std::auto_ptr m_bitmap; + wxString m_file_filter; + +protected: + int LoadRecImage(int max_height); + +public: + ContactPhotoWidget(wxWindow *parent, wxWindowID id, + Barry::Contact &rec); + + /// Lets user save current Photo to a JPG file + void PromptAndSave(wxWindow *parent); + /// Lets user replace current Photo with an image file + bool PromptAndLoad(wxWindow *parent); + void DeletePhoto(); + + static void DrawNoPhoto(wxBitmap &bm, int width, int height); +}; + +#endif + diff -Nru barry-0.14/desktop/src/CUI_Barry.cc barry-0.0.20110506/desktop/src/CUI_Barry.cc --- barry-0.14/desktop/src/CUI_Barry.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Barry.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,168 @@ +/// +/// \file CUI_Barry.cc +/// ConfigUI derived class to configure the Barry "App" +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "CUI_Barry.h" +#include "barrydesktop.h" +#include +#include + +using namespace std; + +namespace AppConfig { + +Barry::Barry() +{ +} + +std::string Barry::AppName() const +{ + return OpenSync::Config::Barry::AppName(); +} + +bool Barry::Configure(wxWindow *parent, plugin_ptr old_plugin) +{ + return false; +} + +ConfigUI::plugin_ptr Barry::GetPlugin() +{ + return m_container; +} + +bool Barry::RunApp(wxWindow *parent) +{ + return false; +} + +void Barry::PreSyncAppInit() +{ + // nothing to do +} + +bool Barry::ZapData(wxWindow *parent, + plugin_ptr plugin, + OpenSync::API *engine) +{ + try { + + m_parent = parent; + + // extract OpenSync::Config::Barry from plugin + // this *can* throw an exception if the wrong plugin is + // passed in, but we want this... such an exception would + // represent a bug in the app, not a runtime error + OpenSync::Config::Barry &barry = + dynamic_cast(*plugin); + + // build device name + string device_name = barry.GetPin().Str(); + const ::Barry::Probe::Results &results = wxGetApp().GetResults(); + int index = ::Barry::Probe::Find(results, barry.GetPin()); + if( index != -1 && results[index].m_cfgDeviceName.size() ) + device_name += " (" + results[index].m_cfgDeviceName + ")"; + + // build intro message + ostringstream oss; + oss << "Please select the databases you wish to erase\n" + "on device: " << device_name << "\n" + "\n" + "Note: all synced databases must be erased\n" + "to avoid a slow-sync."; + wxString msg(oss.str().c_str(), wxConvUTF8); + + // build list of databases (base on information from engine, if + // the pointer is valid) + wxArrayString dbs; + wxArrayInt selections; + if( !engine || engine->IsContactSyncSupported() ) { + dbs.Add( wxString(::Barry::Contact::GetDBName(), wxConvUTF8) ); + selections.Add(dbs.GetCount() - 1); + } + if( !engine || engine->IsCalendarSyncSupported() ) { + dbs.Add( wxString(::Barry::Calendar::GetDBName(), wxConvUTF8) ); + selections.Add(dbs.GetCount() - 1); + } + if( !engine || engine->IsMemoSyncSupported() ) { + dbs.Add( wxString(::Barry::Memo::GetDBName(), wxConvUTF8) ); + selections.Add(dbs.GetCount() - 1); + } + if( !engine || engine->IsTodoSyncSupported() ) { + dbs.Add( wxString(::Barry::Task::GetDBName(), wxConvUTF8) ); + selections.Add(dbs.GetCount() - 1); + } + + // present the list to the user + int count = wxGetMultipleChoices(selections, msg, + _T("Select Databases to Erase"), dbs, m_parent); + if( count <= 0 ) + return false; // nothing to do + + // display selections to the user for one final confirmation + oss.str(""); + oss << "You have selected the following databases to be completely " + "erased from device " << device_name << ":\n\n"; + for( size_t i = 0; i < selections.GetCount(); i++ ) { + oss << string(dbs[selections[i]].utf8_str()) << "\n"; + } + oss << "\nProceed with erase?"; + wxString confirm(oss.str().c_str(), wxConvUTF8); + int choice = wxMessageBox(confirm, _T("Erase Confirmation"), + wxYES_NO | wxICON_QUESTION, m_parent); + if( choice != wxYES ) + return false; // nothing to do + + // connect to the device and delete all selected databases + wxBusyCursor wait; + ::Barry::Controller con(results[index]); + ::Barry::Mode::Desktop desktop(con); + desktop.Open(); + const ::Barry::DatabaseDatabase &dbdb = desktop.GetDBDB(); + + for( size_t i = 0; i < selections.GetCount(); i++ ) { + + string dbname(dbs[selections[i]].utf8_str()); + + unsigned int dbid; + if( !dbdb.GetDBNumber(dbname, dbid) ) { + barryverbose("No database named '" << dbname << "' in device!"); + continue; + } + + barryverbose("Clearing db: " << dbname); + desktop.ClearDatabase(dbid); + } + + return true; + + } catch( ::Barry::Error &e ) { + ostringstream oss; + oss << "Barry exception: " << e.what() << "\n\n" + "You may need to do a USB reset and rescan from the " + "main menu."; + wxString msg(oss.str().c_str(), wxConvUTF8); + wxMessageBox(msg, _T("Barry Exception"), + wxOK | wxICON_ERROR, m_parent); + return false; + } +} + +} + diff -Nru barry-0.14/desktop/src/CUI_Barry.h barry-0.0.20110506/desktop/src/CUI_Barry.h --- barry-0.14/desktop/src/CUI_Barry.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Barry.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,56 @@ +/// +/// \file CUI_Barry.h +/// ConfigUI derived class to configure the Barry "App" +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CUI_BARRY_H__ +#define __BARRY_CUI_BARRY_H__ + +#include "configui.h" +#include "osconfig.h" +#include + +class wxWindow; + +namespace AppConfig { + +class Barry : public ConfigUI +{ + plugin_ptr m_container; + + // convenience pointers + wxWindow *m_parent; + +public: + Barry(); + + // virtual overrides (ConfigUI) + virtual std::string AppName() const; + virtual bool Configure(wxWindow *parent, plugin_ptr old_plugin); + virtual plugin_ptr GetPlugin(); + virtual bool RunApp(wxWindow *parent); + virtual void PreSyncAppInit(); + virtual bool ZapData(wxWindow *parent, plugin_ptr plugin, + OpenSync::API *engine); +}; + +} + +#endif + diff -Nru barry-0.14/desktop/src/CUI_Evolution.cc barry-0.0.20110506/desktop/src/CUI_Evolution.cc --- barry-0.14/desktop/src/CUI_Evolution.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Evolution.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,304 @@ +/// +/// \file CUI_Evolution.cc +/// ConfigUI derived class to configure the Evolution App +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "CUI_Evolution.h" +#include "os22.h" // only for the dynamic_cast +#include +#include + +namespace AppConfig { + +namespace { + class ExecCallback : public wxProcess + { + public: + wxDialog *m_waitdlg; + int m_pid; + int m_status; + + ExecCallback(wxDialog *dlg) + : m_waitdlg(dlg) + , m_pid(0) + , m_status(0) + { + } + + virtual void OnTerminate(int pid, int status) + { + m_pid = pid; + m_status = status; + + if( m_waitdlg ) { + // close the dialog and let it delete us + m_waitdlg->EndModal(wxID_OK); + } + else { + // our parent doesn't exist, delete ourselves + delete this; + } + } + }; + + class WaitDialog : public wxDialog + { + DECLARE_EVENT_TABLE() + public: + WaitDialog(wxWindow *parent, const wxString &msg, + const wxString &title) + : wxDialog(parent, wxID_ANY, title) + { + wxBoxSizer *top = new wxBoxSizer(wxVERTICAL); + top->Add( new wxStaticText(this, wxID_ANY, msg), + 0, wxALL | wxALIGN_LEFT, 10); + top->Add( new wxButton(this, wxID_CANCEL, + _T("Stop waiting")), + 0, wxALL | wxALIGN_RIGHT, 5); + SetSizer(top); + top->SetSizeHints(this); + top->Layout(); + + SetEscapeId(wxID_CANCEL); + } + + void OnButton(wxCommandEvent &event) + { + EndModal(wxID_CANCEL); + } + }; + + BEGIN_EVENT_TABLE(WaitDialog, wxDialog) + EVT_BUTTON (wxID_CANCEL, WaitDialog::OnButton) + END_EVENT_TABLE() +} // namespace + +////////////////////////////////////////////////////////////////////////////// +// Static utility functions + +long Evolution::ForceShutdown() +{ + ExecHelper shutdown(NULL); + shutdown.Run(NULL, "Evolution shutdown", _T("evolution --force-shutdown")); + shutdown.WaitForChild(); + return shutdown.GetAppStatus(); +} + +////////////////////////////////////////////////////////////////////////////// +// Evolution config UI class + +Evolution::Evolution() + : m_evolution(0) + , m_parent(0) +{ +} + +bool Evolution::AutoDetect() +{ + if( m_evolution->AutoDetect() ) { + // tell the user all went well + wxMessageBox(_T("Evolution's configuration successfully auto-detected."), _T("Evolution Config"), wxOK | wxICON_INFORMATION, m_parent); + return true; + } + else { + return false; + } +} + +bool Evolution::InitialRun() +{ + wxString msg = _T( + "Unable to automatically detect Evolution's configuration.\n" + "You need to run Evolution, and manually click each of the\n" + "section buttons:\n" + "\n" + " Mail, Contacts, Calendars, Memos, and Tasks\n" + "\n" + "Then quit Evolution to continue configuration.\n" + "\n" + "Would you like to start Evolution now?\n"); + + int choice = wxMessageBox(msg, _T("Evolution Config"), + wxYES_NO | wxICON_QUESTION, m_parent); + + if( choice == wxNO ) + return false; + + ForceShutdown(); + + // start Evolution, and wait for it to exit, showing a waiting + // message to the user + WaitDialog waitdlg(m_parent, _T("Waiting for Evolution to exit..."), + _T("Evolution Running")); + + ExecCallback *callback = new ExecCallback(&waitdlg); + + const wxChar *start_argv[] = { + _T("evolution"), + NULL + }; + long ret = wxExecute((wxChar**)start_argv, wxEXEC_ASYNC, callback); + if( ret == 0 ) { + delete callback; + wxMessageBox(_T("Failed to run evolution. Please make sure it is installed and in your PATH."), _T("Evolution Config"), wxOK | wxICON_ERROR, m_parent); + return false; + } + + if( waitdlg.ShowModal() == wxID_CANCEL ) { + // user aborted, so ExecCallback will be left + // waiting, and waitdlg will go out of scope, so + // reset the callback's pointer + callback->m_waitdlg = 0; + return false; // user aborted + } + else { + // if we don't get wxID_CANCEL, then the callback + // closed us, and we can delete it + if( callback->m_status ) { + // error status code + wxMessageBox(_T("Failed to run evolution. Please make sure it is installed and in your PATH."), _T("Evolution Config"), wxOK | wxICON_ERROR, m_parent); + delete callback; + return false; + } + else { + delete callback; + } + } + + // if we get here, assume that the user followed our instructions + // and attempt another autodetect + if( AutoDetect() ) + return true; // success! + + // and finally, failure + wxMessageBox(_T("Failed to find Evolution's usual data locations.\n" + "Please make sure the following directories are create by Evolution:\n" + "\n" + " ~/.evolution/addressbook/local/system\n" + " ~/.evolution/calendar/local/system\n" + " ~/.evolution/tasks/local/system\n" + " ~/.evolution/memos/local/system\n" + "\n" + "You may need to use each feature a bit before Evolution\n" + "creates these directories and the databases inside them.\n" + "Make sure you select the Personal folder in Contacts." + ), + _T("Evolution Config"), + wxOK | wxICON_ERROR, + m_parent); + return false; +} + +std::string Evolution::AppName() const +{ + return OpenSync::Config::Evolution::AppName(); +} + +bool Evolution::Configure(wxWindow *parent, plugin_ptr old_plugin) +{ + m_parent = parent; + + // create our plugin config + m_evolution = dynamic_cast (old_plugin.get()); + if( m_evolution ) { + m_evolution = m_evolution->Clone(); + } + else { + m_evolution = new OpenSync::Config::Evolution; + } + m_container.reset( m_evolution ); + + // if auto detect fails, fall back to starting Evolution + // for the first time + if( AutoDetect() || InitialRun() ) { + return true; + } + else { + m_container.reset(); + return false; + } +} + +ConfigUI::plugin_ptr Evolution::GetPlugin() +{ + m_evolution = 0; + return m_container; +} + +bool Evolution::RunApp(wxWindow *parent) +{ + return Run(parent, AppName(), _T("evolution")); +} + +void Evolution::PreSyncAppInit() +{ + ForceShutdown(); +} + +bool Evolution::ZapData(wxWindow *parent, + plugin_ptr plugin, + OpenSync::API *engine) +{ + m_parent = parent; + + // extract OpenSync::Config::Evolution from plugin + // this *can* throw an exception if the wrong plugin is + // passed in, but we want this... such an exception would + // represent a bug in the app, not a runtime error +// OpenSync::Config::Evolution &evo = +// dynamic_cast(*plugin); + + if( IsAppRunning() ) { + wxMessageBox(_T("Evolution already running."), + _T("No Biscuit"), wxOK | wxICON_INFORMATION, + m_parent); + return false; + } + + // tell the user what to do + wxString msg; + if( dynamic_cast(engine) ) { + msg = _T( + "Starting Evolution. Delete all contacts and calendar " + "entries manually."); + } + else { + msg = _T( + "Starting Evolution. Delete all contacts and calendar " + "entries manually (as well as memos and tasks if you are " + "syncing them too)." + ); + } + int choice = wxMessageBox(msg, _T("Starting Evolution"), + wxOK | wxCANCEL | wxICON_QUESTION, m_parent); + if( choice != wxOK ) + return false; + + RunApp(parent); + + // wait for app to finish... this is kinda lame, but + // we don't want other Zaps to happen before this is finished + while( IsAppRunning() ) + wxMilliSleep(500); + + return true; +} + +} // namespace AppConfig + diff -Nru barry-0.14/desktop/src/CUI_Evolution.h barry-0.0.20110506/desktop/src/CUI_Evolution.h --- barry-0.14/desktop/src/CUI_Evolution.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Evolution.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,64 @@ +/// +/// \file CUI_Evolution.h +/// ConfigUI derived class to configure the Evolution App +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CUI_EVOLUTION_H__ +#define __BARRY_CUI_EVOLUTION_H__ + +#include "configui.h" +#include "osconfig.h" +#include + +class wxWindow; + +namespace AppConfig { + +class Evolution : public ConfigUI +{ + OpenSync::Config::Evolution *m_evolution; + plugin_ptr m_container; // merely holds m_evolution + + // convenience pointers + wxWindow *m_parent; + +protected: + bool AutoDetect(); + bool InitialRun(); + +public: + Evolution(); + + // virtual overrides (ConfigUI) + virtual std::string AppName() const; + virtual bool Configure(wxWindow *parent, plugin_ptr old_plugin); + virtual plugin_ptr GetPlugin(); + virtual bool RunApp(wxWindow *parent); + virtual void PreSyncAppInit(); + virtual bool ZapData(wxWindow *parent, plugin_ptr plugin, + OpenSync::API *engine); + + // static utility functions + static long ForceShutdown(); +}; + +} + +#endif + diff -Nru barry-0.14/desktop/src/CUI_Google.cc barry-0.0.20110506/desktop/src/CUI_Google.cc --- barry-0.14/desktop/src/CUI_Google.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Google.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,140 @@ +/// +/// \file CUI_Google.cc +/// ConfigUI derived class to configure the Google App +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "CUI_Google.h" +//#include "os22.h" // only for the dynamic_cast +#include +#include +#include +#include + +using namespace std; + +namespace AppConfig { + +////////////////////////////////////////////////////////////////////////////// +// Google config UI class + +Google::Google() + : m_google(0) + , m_parent(0) +{ +// gcal_t google_calendar = gcal_new(GCALENDAR); +// gcal_get_authentication(google_calendar, "username", "password"); +} + +std::string Google::AppName() const +{ + return OpenSync::Config::Google::AppName(); +} + +bool Google::Configure(wxWindow *parent, plugin_ptr old_plugin) +{ + m_parent = parent; + + // create our plugin config + m_google = dynamic_cast (old_plugin.get()); + if( m_google ) { + m_google = m_google->Clone(); + } + else { + m_google = new OpenSync::Config::Google; + } + m_container.reset( m_google ); + + // display dialog and let user fill in the details + return false; // FIXME - not finished +} + +ConfigUI::plugin_ptr Google::GetPlugin() +{ + m_google = 0; + return m_container; +} + +bool Google::RunApp(wxWindow *parent) +{ + return false; +} + +void Google::PreSyncAppInit() +{ +} + +bool Google::ZapData(wxWindow *parent, + plugin_ptr plugin, + OpenSync::API *engine) +{ + m_parent = parent; + + // extract OpenSync::Config::Google from plugin + // this *can* throw an exception if the wrong plugin is + // passed in, but we want this... such an exception would + // represent a bug in the app, not a runtime error + OpenSync::Config::Google &google = + dynamic_cast(*plugin); + + // build intro message + ostringstream oss; + oss << "Please select the databases you wish to erase\n" + "in your Google Calendar: \n" + "\n" + "Note: all synced databases must be erased\n" + "to avoid a slow-sync."; + wxString msg(oss.str().c_str(), wxConvUTF8); + + // build list of databases (base on information from engine, if + // the pointer is valid) + wxArrayString dbs; + wxArrayInt selections; + dbs.Add( _T("Calendar") ); selections.Add(0); + dbs.Add( _T("Contacts") ); selections.Add(1); + + // present the list to the user + int count = wxGetMultipleChoices(selections, msg, + _T("Select Databases to Erase"), dbs, m_parent); + if( count <= 0 ) + return false; // nothing to do + + // display selections to the user for one final confirmation + oss.str(""); + oss << "You have selected the following databases to be completely " + "erased from your Google Calendar:\n\n"; + for( size_t i = 0; i < selections.GetCount(); i++ ) { + oss << string(dbs[selections[i]].utf8_str()) << "\n"; + } + oss << "\nProceed with erase?"; + wxString confirm(oss.str().c_str(), wxConvUTF8); + int choice = wxMessageBox(confirm, _T("Erase Confirmation"), + wxYES_NO | wxICON_QUESTION, m_parent); + if( choice != wxYES ) + return false; // nothing to do + + // might be busy for a bit + wxBusyCursor wait; + + // connect to Google Calendar and delete all selected databases + (void)google; + return false; // FIXME - not finished +} + +} // namespace AppConfig + diff -Nru barry-0.14/desktop/src/CUI_Google.h barry-0.0.20110506/desktop/src/CUI_Google.h --- barry-0.14/desktop/src/CUI_Google.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/CUI_Google.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,56 @@ +/// +/// \file CUI_Google.h +/// ConfigUI derived class to configure the Google App +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CUI_GOOGLE_H__ +#define __BARRY_CUI_GOOGLE_H__ + +#include "configui.h" +#include "osconfig.h" + +class wxWindow; + +namespace AppConfig { + +class Google : public ConfigUI +{ + OpenSync::Config::Google *m_google; + plugin_ptr m_container; // merely holds m_google + + // convenience pointers + wxWindow *m_parent; + +public: + Google(); + + // virtual overrides (ConfigUI) + virtual std::string AppName() const; + virtual bool Configure(wxWindow *parent, plugin_ptr old_plugin); + virtual plugin_ptr GetPlugin(); + virtual bool RunApp(wxWindow *parent); + virtual void PreSyncAppInit(); + virtual bool ZapData(wxWindow *parent, plugin_ptr plugin, + OpenSync::API *engine); +}; + +} + +#endif + diff -Nru barry-0.14/desktop/src/deviceset.cc barry-0.0.20110506/desktop/src/deviceset.cc --- barry-0.14/desktop/src/deviceset.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/deviceset.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,463 @@ +/// +/// \file deviceset.cc +/// Class which detects a set of available or known devices +/// in an opensync-able system. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "deviceset.h" +#include +#include +#include +#include +#include + +using namespace std; + +////////////////////////////////////////////////////////////////////////////// +// DeviceExtras class + +DeviceExtras::DeviceExtras(const Barry::Pin &pin) + : m_pin(pin) + , m_last_sync_time(0) +{ +} + +DeviceExtras::DeviceExtras(const Barry::Pin & pin, + const Barry::GlobalConfigFile &config, + const std::string &group_name) + : m_pin(pin) + , m_last_sync_time(0) +{ + Load(config, group_name); +} + +std::string DeviceExtras::MakeBaseKey(const std::string &group_name) +{ + ostringstream oss; + oss << m_pin.Str() << "-" << group_name << "-"; + return oss.str(); +} + +void DeviceExtras::Load(const Barry::GlobalConfigFile &config, + const std::string &group_name) +{ + string key = MakeBaseKey(group_name); + m_favour_plugin_name = config.GetKey(key + "FavourPlugin"); + + string num = config.GetKey(key + "LastSyncTime"); + m_last_sync_time = atol(num.c_str()); +} + +void DeviceExtras::Save(Barry::GlobalConfigFile &config, + const std::string &group_name) +{ + string key = MakeBaseKey(group_name); + config.SetKey(key + "FavourPlugin", m_favour_plugin_name); + + ostringstream oss; + oss << m_last_sync_time; + config.SetKey(key + "LastSyncTime", oss.str()); +} + + +////////////////////////////////////////////////////////////////////////////// +// DeviceEntry class + +DeviceEntry::DeviceEntry(const Barry::GlobalConfigFile &config, + const Barry::ProbeResult *result, + group_ptr group, + OpenSync::API *engine, + const std::string &secondary_device_name) + : m_result(result) + , m_group(group) + , m_engine(engine) + , m_device_name(secondary_device_name) +{ + // just make sure that our device name has something in it + if( !m_device_name.size() && m_result ) + m_device_name = m_result->m_cfgDeviceName; + + // load the extras if available + Barry::Pin pin = GetPin(); + if( pin.Valid() && IsConfigured() ) { + m_extras.reset( new DeviceExtras(pin, config, + m_group->GetGroupName()) ); + } +} + +// returns pointer to the Barry plugin object in m_group +// or 0 if not available +OpenSync::Config::Barry* DeviceEntry::FindBarry() +{ + if( m_group.get() && m_group->HasBarryPlugins() ) + return &m_group->GetBarryPlugin(); + return 0; +} + +Barry::Pin DeviceEntry::GetPin() const +{ + Barry::Pin pin; + + // load convenience values + if( m_result ) { + pin = m_result->m_pin; + } + + if( m_group.get() && m_group->HasBarryPlugins() ) { + const OpenSync::Config::Barry &bp = m_group->GetBarryPlugin(); + + if( bp.GetPin().Valid() ) { + // double check for possible conflicting pin numbers + if( pin.Valid() ) { + if( pin != bp.GetPin() ) { + throw std::logic_error("Probe pin != group pin in DeviceEntry"); + } + } + + // got a valid pin, save it + pin = bp.GetPin(); + } + } + + return pin; +} + +std::string DeviceEntry::GetDeviceName() const +{ + if( m_device_name.size() ) + return m_device_name; + else if( m_result ) + return m_result->m_cfgDeviceName; + else + return std::string(); +} + +std::string DeviceEntry::GetIdentifyingString() const +{ + ostringstream oss; + + oss << GetPin().Str(); + string name = GetDeviceName(); + if( name.size() ) + oss << " (" << name << ")"; + + if( IsConfigured() ) + oss << ", Group: " << GetConfigGroup()->GetGroupName(); + else + oss << ", Not configured"; + + if( GetEngine() ) + oss << ", Engine: " << GetEngine()->GetVersion(); + + return oss.str(); +} + +void DeviceEntry::SetConfigGroup(group_ptr group, + OpenSync::API *engine, + extras_ptr extras) +{ + m_group = group; + m_engine = engine; + m_extras = extras; +} + +std::ostream& operator<< (std::ostream &os, const DeviceEntry &de) +{ + os << setfill(' ') << setw(8) << de.GetPin().Str(); + os << "|" << setfill(' ') << setw(35) << de.GetDeviceName(); + os << "|" << setfill(' ') << setw(4) << (de.IsConnected() ? "yes" : "no"); + os << "|" << setfill(' ') << setw(4) << (de.IsConfigured() ? "yes" : "no"); + os << "|" << setfill(' ') << setw(7) + << (de.GetEngine() ? de.GetEngine()->GetVersion() : ""); + return os; +} + +////////////////////////////////////////////////////////////////////////////// +// DeviceSet class + +/// Does a USB probe automatically +DeviceSet::DeviceSet(const Barry::GlobalConfigFile &config, + OpenSync::APISet &apiset) + : m_config(config) + , m_apiset(apiset) +{ + Barry::Probe probe; + m_results = probe.GetResults(); + LoadSet(); +} + +/// Skips the USB probe and uses the results set given +DeviceSet::DeviceSet(const Barry::GlobalConfigFile &config, + OpenSync::APISet &apiset, + const Barry::Probe::Results &results) + : m_config(config) + , m_apiset(apiset) + , m_results(results) +{ + LoadSet(); +} + +void DeviceSet::LoadSet() +{ + if( m_apiset.os40() ) + LoadConfigured(*m_apiset.os40()); + if( m_apiset.os22() ) + LoadConfigured(*m_apiset.os22()); + LoadUnconfigured(); + Sort(); +} + +/// Constructor helper function. Adds configured DeviceEntry's to the set. +/// Does no sorting. +void DeviceSet::LoadConfigured(OpenSync::API &api) +{ + using namespace OpenSync; + + // + // we already have the connected devices in m_results, so + // load every Barry-related group that exists in the given API + // + + // get group list + string_list_type groups; + api.GetGroupNames(groups); + + // for each group + for( string_list_type::iterator b = groups.begin(); b != groups.end(); ++b ) { + try { + // load the group via Config::Group + DeviceEntry::group_ptr g( new Config::Group(*b, api, + OSCG_THROW_ON_UNSUPPORTED | + OSCG_THROW_ON_NO_BARRY | + OSCG_THROW_ON_MULTIPLE_BARRIES) ); + + // now that we have a config group, check to see + // if the pin in the group's Barry plugin is + // available in the probe results... if so, it is + // also connected + OpenSync::Config::Barry &plugin = g->GetBarryPlugin(); + Barry::Probe::Results::iterator result = + std::find(m_results.begin(), m_results.end(), + plugin.GetPin()); + const Barry::ProbeResult *connected = 0; + string dev_name; + if( result != m_results.end() ) { + connected = &(*result); + dev_name = connected->m_cfgDeviceName; + } + else { + // the device is not connected, so do a + // special load of a possible device config + // to load the device name + Barry::ConfigFile cf(plugin.GetPin()); + dev_name = cf.GetDeviceName(); + } + + // if no LoadError exceptions, add to configured list + push_back( DeviceEntry(m_config, connected, g, &api, + dev_name) ); + + } + catch( Config::LoadError &le ) { + // if we catch LoadError, it just means that this + // isn't a config that Barry Desktop can handle + // so just log and skip it + barryverbose("DeviceSet::LoadConfigured: " << le.what()); + } + } +} + +void DeviceSet::LoadUnconfigured() +{ + // cycle through the probe results, and add any devices for + // which their pins do not yet exist in the list + for( Barry::Probe::Results::const_iterator i = m_results.begin(); + i != m_results.end(); + ++i ) + { + iterator p = FindPin(i->m_pin); + if( p == end() ) { + // this pin isn't in the list yet, so add it + // as an unconfigured item + + // create the DeviceEntry with a null group_ptr + DeviceEntry item( m_config, &(*i), + DeviceEntry::group_ptr(), 0 ); + push_back( item ); + } + } +} + +/// Constructor helper function. Loads the device list. Sort by +/// pin number, but in the following groups: +/// +/// - configured first (both connected and unconnected) +/// - unconfigured but connected second +/// +/// This should preserve the sort order across multiple loads, to keep +/// a relatively consistent listing for the user. +/// +namespace { + bool DeviceEntryCompare(const DeviceEntry &a, const DeviceEntry &b) + { + if( a.IsConfigured() == b.IsConfigured() ) + return strcmp(a.GetPin().Str().c_str(), + b.GetPin().Str().c_str()) < 0; + else + return a.IsConfigured(); + } +} +void DeviceSet::Sort() +{ + std::sort(begin(), end(), &DeviceEntryCompare); +} + +DeviceSet::iterator DeviceSet::FindPin(const Barry::Pin &pin) +{ + for( iterator i = begin(); i != end(); ++i ) { + if( i->GetPin() == pin ) + return i; + } + return end(); +} + +DeviceSet::const_iterator DeviceSet::FindPin(const Barry::Pin &pin) const +{ + for( const_iterator i = begin(); i != end(); ++i ) { + if( i->GetPin() == pin ) + return i; + } + return end(); +} + +DeviceSet::subset_type::const_iterator DeviceSet::FindPin( + const DeviceSet::subset_type &subset, const Barry::Pin &pin) +{ + for( subset_type::const_iterator i = subset.begin(); + i != subset.end(); + ++i ) + { + if( (*i)->GetPin() == pin ) + return i; + } + return subset.end(); +} + +std::string DeviceSet::Subset2String(const DeviceSet::subset_type &set) +{ + std::string list; + + subset_type::const_iterator i = set.begin(); + for( ; i != set.end(); ++i ) { + if( list.size() ) + list += " "; + list += (*i)->GetPin().Str(); + } + return list; +} + +DeviceSet::subset_type DeviceSet::String2Subset(const std::string &list) +{ + subset_type set; + + istringstream iss(list); + Barry::Pin pin; + + while( iss >> pin ) { + if( !pin.Valid() ) + continue; + + // search for pin in device set + iterator i = FindPin(pin); + if( i != end() ) + set.push_back(i); + } + return set; +} + +DeviceSet::subset_type DeviceSet::FindDuplicates() +{ + subset_type dups; + + for( iterator i = begin(); i != end(); ++i ) { + + // start with this PIN + dups.push_back(i); + + // search for a duplicate, and add all dups found + for( iterator j = begin(); j != end(); ++j ) { + // skip ourselves + if( j == i ) + continue; + + if( i->GetPin() == j->GetPin() ) { + // found a duplicate + dups.push_back(j); + } + } + + // if we have multiple iterators in dups, we're done + if( dups.size() > 1 ) + return dups; + + // else, start over + dups.clear(); + } + + return dups; +} + +void DeviceSet::KillDuplicates(const subset_type &dups) +{ + // anything to do? + if( dups.size() == 0 ) + return; // nope + + // only one? + if( dups.size() == 1 ) { + erase(dups[0]); + return; + } + + // ok, we have multiple dups to erase, so we need to make + // a copy of ourselves and skip all matching iterators, + // then copy the result back to this + base_type copy; + for( iterator i = begin(); i != end(); ++i ) { + if( find(dups.begin(), dups.end(), i) == dups.end() ) { + // not in the dups list, copy it + copy.push_back(*i); + } + } + + // copy back + clear(); + base_type::operator=(copy); +} + +std::ostream& operator<< (std::ostream &os, const DeviceSet &ds) +{ + os << " PIN | Device Name |Con |Cfg |Engine\n"; + os << "--------+-----------------------------------+----+----+-------\n"; + + for( DeviceSet::const_iterator i = ds.begin(); i != ds.end(); ++i ) + os << *i << "\n" << i->GetIdentifyingString() << endl; + return os; +} + diff -Nru barry-0.14/desktop/src/deviceset.h barry-0.0.20110506/desktop/src/deviceset.h --- barry-0.14/desktop/src/deviceset.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/deviceset.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,213 @@ +/// +/// \file deviceset.h +/// Class which detects a set of available or known devices +/// in an opensync-able system. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_DEVICE_SET_H__ +#define __BARRY_DEVICE_SET_H__ + +#include "osconfig.h" +#include + +namespace Barry { + class GlobalConfigFile; +} + +// +// DeviceExtras +// +/// Config class to hold, load, and save device-related extras that are +/// not saved in either the Barry::ConfigFile or the OpenSync group +/// config. +/// +/// These items are not stored in Barry::ConfigFile since they pertain +/// to a particular OpenSync sync group. The user may have groups +/// configured outside of BarryDesktop. +class DeviceExtras +{ + Barry::Pin m_pin; + +public: + // config data... The Extras + std::string m_favour_plugin_name; // if empty, ask user + time_t m_last_sync_time; + +protected: + std::string MakeBaseKey(const std::string &group_name); + +public: + explicit DeviceExtras(const Barry::Pin &pin); + DeviceExtras(const Barry::Pin& pin, + const Barry::GlobalConfigFile &config, + const std::string &group_name); + + // + // operations + // + void Load(const Barry::GlobalConfigFile &config, + const std::string &group_name); + void Save(Barry::GlobalConfigFile &config, + const std::string &group_name); +}; + + +// +// DeviceEntry +// +/// Entry in the DeviceSet class. This class must be STL container safe. +/// +class DeviceEntry +{ +public: + typedef std::tr1::shared_ptr group_ptr; + typedef std::tr1::shared_ptr extras_ptr; + +private: + // pointers to external data + // pointers may be 0 if data is not available (such as when + // a device is not connected, it would not have a ProbeResult) + const Barry::ProbeResult *m_result; // pointer to external data + + group_ptr m_group; // may contain 0 + OpenSync::API *m_engine; // may be 0 + extras_ptr m_extras; // may contain 0 + + std::string m_device_name; + +protected: + OpenSync::Config::Barry* FindBarry(); // returns pointer to the Barry + // plugin object in m_group + // or 0 if not available + +public: + DeviceEntry(const Barry::GlobalConfigFile &config, + const Barry::ProbeResult *result, + group_ptr group, + OpenSync::API *engine, + const std::string &secondary_device_name = ""); + + Barry::Pin GetPin() const; + std::string GetDeviceName() const; + bool IsConnected() const { return m_result; } + bool IsConfigured() const { return m_group.get() && m_engine && m_group->AllConfigured(*m_engine); } + std::string GetAppNames() const { return m_group.get() && m_engine ? m_group->GetAppNames() : ""; } + + /// Returns a string uniquely identifying this DeviceEntry + std::string GetIdentifyingString() const; + + const Barry::ProbeResult* GetProbeResult() { return m_result; } + OpenSync::Config::Group* GetConfigGroup() { return m_group.get(); } + const OpenSync::Config::Group* GetConfigGroup() const { return m_group.get(); } + OpenSync::API* GetEngine() { return m_engine; } + const OpenSync::API* GetEngine() const { return m_engine; } + + DeviceExtras* GetExtras() { return m_extras.get(); } + const DeviceExtras* GetExtras() const { return m_extras.get(); } + + void SetConfigGroup(group_ptr group, OpenSync::API *engine, + extras_ptr extras); + void SetDeviceName(const std::string &name) { m_device_name = name; } +}; + +std::ostream& operator<< (std::ostream &os, const DeviceEntry &de); + +// +// DeviceSet +// +/// This class detects known devices on an opensync-able system. +/// It will search for connected (USB) devices and devices that have been +/// configured in OpenSync (both 0.22 and 0.4x) but are not currently +/// connected. +/// +/// For each device entry, it will know the following: +/// - pin +/// - device name (from barrybackup configs) +/// - whether connected or not +/// - whether configured for opensync or not... if so, it will also +/// keep track of: +/// - the app(s) it will sync with (in one sync group only) +/// - the version of the engine it is configured with +/// +/// If a device is configured in both 0.4x and 0.22, or even in two +/// groups in one engine, then all are loaded. Use FindDuplicates() +/// and KillDuplicates() to sort that out with the user's help. +/// +/// Since this class needs to open and parse a lot of information during +/// construction anyway, it will store as much as possible, to allow for +/// editing in a GUI and saving it later. The domain specific data +/// may be encapsulated in further classes. +/// +class DeviceSet : public std::vector +{ +public: + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + typedef std::vector subset_type; + +private: + const Barry::GlobalConfigFile &m_config; + OpenSync::APISet &m_apiset; + Barry::Probe::Results m_results; + +protected: + void LoadSet(); + void LoadConfigured(OpenSync::API &api); + void LoadUnconfigured(); + void Sort(); + +public: + /// Does a USB probe automatically + DeviceSet(const Barry::GlobalConfigFile &config, + OpenSync::APISet &apiset); + + /// Skips the USB probe and uses the results set given + DeviceSet(const Barry::GlobalConfigFile &config, + OpenSync::APISet &apiset, + const Barry::Probe::Results &results); + + iterator FindPin(const Barry::Pin &pin); + const_iterator FindPin(const Barry::Pin &pin) const; + static subset_type::const_iterator FindPin(const subset_type &subset, const Barry::Pin &pin); + static std::string Subset2String(const subset_type &set); + subset_type String2Subset(const std::string &list); + + /// Searches for DeviceEntry's in the set that have the same + /// pin number. This is most likely due to OpenSync having + /// multiple configurations with the same device. This + /// function returns a vector of iterators into the DeviceSet, + /// or an empty vector if no duplicates are found. + /// + /// You can solve the duplicate by erase()ing the chosen + /// iterator. Call this function multiple times to find + /// all the duplicates. + subset_type FindDuplicates(); + + /// Safely removes all entries that are referenced by + /// the iterators in dups. Note that a call to erase() + /// invalidates the other iterators, so this function + /// does it safely. + void KillDuplicates(const subset_type &dups); +}; + +std::ostream& operator<< (std::ostream &os, const DeviceSet &ds); + +#endif + diff -Nru barry-0.14/desktop/src/dlopen.cc barry-0.0.20110506/desktop/src/dlopen.cc --- barry-0.14/desktop/src/dlopen.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/dlopen.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,65 @@ +/// +/// \file dlopen.cc +/// Base class wrapper for dlopen() behaviour +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "dlopen.h" +#include +#include +#include +#include +#include + +using namespace std; + +///////////////////////////////////////////////////////////////////////////// +// DlOpen class -- protected members + +bool DlOpen::Open(const char *libname) +{ + Shutdown(); + m_handle = dlopen(libname, RTLD_NOW | RTLD_LOCAL); + return m_handle != NULL; +} + +void DlOpen::Shutdown() +{ + if( m_handle ) { + if( dlclose(m_handle) != 0 ) { + cout << "ERROR: dlclose() return non-zero" << endl; + cout << dlerror() << endl; + } + m_handle = 0; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// DlOpen class -- public members + +DlOpen::DlOpen() + : m_handle(0) +{ +} + +DlOpen::~DlOpen() +{ + Shutdown(); +} + diff -Nru barry-0.14/desktop/src/dlopen.h barry-0.0.20110506/desktop/src/dlopen.h --- barry-0.14/desktop/src/dlopen.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/dlopen.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,68 @@ +/// +/// \file dlopen.h +/// Base class wrapper for dlopen() behaviour +/// Drawback: only one dlopen'd library per class. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_DLOPEN_H__ +#define __BARRYDESKTOP_DLOPEN_H__ + +#include "error.h" +#include +#include +#include + +// +// DlOpen +// +/// Base class wrapper for dlopen() libraries. Only handles one +/// library handle at a time. +/// +class DlOpen +{ + void *m_handle; + +protected: + bool Open(const char *libname); + void Shutdown(); + + template + void LoadSym(FuncPtrT &funcptr, const char *symbol) + { + // work around the warning: ISO C++ forbids casting + // between pointer-to-function and pointer-to-object + //funcptr = (FuncPtrT) dlsym(this->m_handle, symbol); + + void *fptr = dlsym(this->m_handle, symbol); + if( fptr == NULL ) + throw DlError(std::string("Can't load ") + symbol); + + if( sizeof(fptr) != sizeof(FuncPtrT) ) + throw std::logic_error("Platform not supported: sizeof(void*) != sizeof(void (*)())"); + + memcpy(&funcptr, &fptr, sizeof(void*)); + } + +public: + DlOpen(); + virtual ~DlOpen(); +}; + +#endif + diff -Nru barry-0.14/desktop/src/error.cc barry-0.0.20110506/desktop/src/error.cc --- barry-0.14/desktop/src/error.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/error.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,46 @@ +/// +/// \file error.cc +/// Exception class implementations +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "error.h" +#include + +///////////////////////////////////////////////////////////////////////////// +// class DlError + +std::string DlError::GetMsg(const std::string &msg) +{ + std::string ret = msg; + char *derr = dlerror(); + if( derr == NULL ) { + ret += ": (dlerror returned NULL)"; + } + else { + ret += ": "; + ret += derr; + } + return ret; +} + +DlError::DlError(const std::string &msg) + : std::runtime_error(DlError::GetMsg(msg.c_str())) +{ +} + diff -Nru barry-0.14/desktop/src/error.h barry-0.0.20110506/desktop/src/error.h --- barry-0.14/desktop/src/error.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/error.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,48 @@ +/// +/// \file error.h +/// Exception classes specific to the desktop +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_ERROR_H__ +#define __BARRYDESKTOP_ERROR_H__ + +#include +#include + +/// \addtogroup exceptions +/// @{ + +// +// DlError +// +/// Represents and stores the error message from the last +/// dlopen() related error. +/// +class DlError : public std::runtime_error +{ + static std::string GetMsg(const std::string &msg); + +public: + DlError(const std::string &msg); +}; + +/// @} + +#endif + diff -Nru barry-0.14/desktop/src/exechelper.cc barry-0.0.20110506/desktop/src/exechelper.cc --- barry-0.14/desktop/src/exechelper.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/exechelper.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,195 @@ +/// +/// \file exechelper.cc +/// Helper class to wrap wxProcess and wxExecute operations +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "exechelper.h" + +#include + +#include +#include +#include +#include +#include +#include + +using namespace std; + +TermCatcher::~TermCatcher() +{ + if( m_eh ) + m_eh->m_catcher = 0; +} + +ExecHelper::ExecHelper(TermCatcher *catcher) + : m_catcher(catcher) + , m_app_callback(0) + , m_app_pid(-1) + , m_app_status(-1) +{ + // link ourselves to the catcher... the catcher will unlink if necessary + if( m_catcher ) + m_catcher->m_eh = this; +} + +ExecHelper::~ExecHelper() +{ + if( m_app_callback ) { + m_app_callback->Detach(); + m_app_callback = 0; + } + if( m_catcher ) + m_catcher->m_eh = 0; +} + +void ExecHelper::RunError(wxWindow *parent, const wxString &msg) +{ + if( !parent ) + return; + + wxMessageBox(msg, _T("Application Run Error"), + wxOK | wxICON_ERROR, parent); +} + +int ExecHelper::Execute(bool use_wx, + const wxString &command, + AppCallback *cb) +{ + if( use_wx ) { + return wxExecute(command, wxEXEC_ASYNC, m_app_callback); + } + + // + // use our own forking mechanism, due to bugs in wxWidgets :-( + // + + class WaitThread : public wxThread + { + int m_pid; + AppCallback *m_callback; + + public: + WaitThread(int pid, AppCallback *cb) + : m_pid(pid) + , m_callback(cb) + { + } + + virtual void* Entry() + { + int status; + int pid = waitpid(m_pid, &status, 0); + if( pid == m_pid ) { + // our child finished + m_callback->OnTerminate(pid, status); + } + + return 0; + } + }; + + + // create child + int pid = fork(); + if( pid == -1 ) { + // no child created + return -1; + } + else if( pid == 0 ) { + // we are the child + + // parse the command line into an array + char *argv[100]; + int argc = 0; + wxStringTokenizer t(command, _T(" ")); + while( t.HasMoreTokens() && argc < 99 ) { + wxString token = t.GetNextToken(); + std::string ctoken(token.utf8_str()); + argv[argc] = new char[ctoken.size() + 1]; + strcpy(argv[argc], ctoken.c_str()); + argc++; + } + argv[argc] = 0; + + execvp(argv[0], argv); + + cerr << "execvp() failed: " << strerror(errno) << endl; + for( int i = 0; argv[i]; i++ ) { + cerr << argv[i] << " "; + } + cerr << endl; + + exit(-1); + } + else { + // we are the parent... start the wait thread + WaitThread *wt = new WaitThread(pid, cb); + wt->Create(); + wt->Run(); + return pid; + } +} + +bool ExecHelper::Run(wxWindow *parent, + const std::string &appname, + const wxString &command) +{ + if( IsAppRunning() ) { + RunError(parent, wxString(appname.c_str(), wxConvUTF8) + + _T(" is already running.")); + return false; + } + + m_app_callback = new AppCallback(this); + m_app_pid = Execute(false, command, m_app_callback); + if( m_app_pid <= 0 ) { + delete m_app_callback; + m_app_callback = 0; + m_app_pid = -1; + + RunError(parent, _T("Failed to run ") + + wxString(appname.c_str(), wxConvUTF8) + + _T(". Please make sure it is installed and in your PATH.")); + return false; + } + + return true; +} + +bool ExecHelper::IsAppRunning() +{ + return m_app_callback && m_app_pid > 0; +} + +void ExecHelper::WaitForChild() +{ + while( IsAppRunning() ) + usleep(50000); +} + +void ExecHelper::KillApp(bool hardkill) +{ + if( IsAppRunning() ) { +// m_app_callback->Kill(m_app_pid, hardkill ? wxSIGKILL : wxSIGTERM); + kill(m_app_pid, hardkill ? SIGKILL : SIGTERM); + // let the callback handle the cleanup + } +} + diff -Nru barry-0.14/desktop/src/exechelper.h barry-0.0.20110506/desktop/src/exechelper.h --- barry-0.14/desktop/src/exechelper.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/exechelper.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,170 @@ +/// +/// \file exechelper.h +/// Helper class to wrap wxProcess and wxExecute operations +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_EXECHELPER_H__ +#define __BARRYDESKTOP_EXECHELPER_H__ + +#include +#include + +class ExecHelper; + +class TermCatcher +{ + friend class ExecHelper; + + wxEvtHandler *m_handler; + int m_id; + ExecHelper *m_eh; + +public: + TermCatcher(wxEvtHandler *handler = 0, int id = 0) + : m_handler(handler) + , m_id(id) + , m_eh(0) + { + } + + virtual ~TermCatcher(); + + // WARNING: this can be called from another thread when not + // using wxWidgets' exec code... it may not be possible to + // safely call GUI functions from this callback on all platforms. + // + // By default it just posts a wxProcessEvent(windowid, pid, status) + // which is thread-safe. Add a EVT_END_PROCESS(windowid, func) + // handler to your event table to handle this. + virtual void ExecTerminated(int pid, int status) + { + if( m_handler ) { + wxProcessEvent pe(m_id, pid, status); + m_handler->AddPendingEvent(pe); + } + } +}; + +// +// ExecHelper +// +/// Wrapper around the wxProcess class, that does much of the same +/// stuff, but also stores the child process's status code without +/// requiring a virtual override. +/// +/// If ExecHelper is destroyed before the app exits, the callback +/// will be "lost", but the AppCallback class will cleanup after itself. +/// +/// If you specify a TermCatcher pointer, then as long as TermCatcher +/// and ExecHelper exist, you will get an event via the virtual +/// ExecTerminated() call. If either ExecHelper or TermCatcher +/// go out of scope before that happens, the callback will be "lost" +/// but everything will be cleaned up automatically. +/// +/// The idea: Create a class where your real work happens, and derive +/// that class from TermCatcher. Then create an instance +/// of ExecHelper inside that class, and pass 'this' to its +/// constructor. If this is a dialog class that disappears +/// before the app exits, the destructors will handle things automatically. +/// +class ExecHelper +{ + friend class TermCatcher; + +protected: + // This funky class is required because wxProcess deletes itself, + // so that if ExecHelper is deleted before AppCallback, a segfault + // is not caused by the OnTerminate() call. + class AppCallback : public wxProcess + { + ExecHelper *m_container; + public: + AppCallback(ExecHelper *container) + : m_container(container) + { + } + + void Detach() + { + m_container = 0; + } + + // virtual overrides (wxProcess) + virtual void OnTerminate(int pid, int status) + { + if( m_container && this == m_container->m_app_callback ) { + m_container->m_app_pid = -1; + m_container->m_app_status = status; + m_container->m_app_callback = 0; + + // signal if legal + if( m_container->m_catcher ) { + try { + m_container->m_catcher->ExecTerminated(pid, status); + } + catch( ... ) { + // we are fully responsible + // for cleaning ourselves up, + // so do that, and then re- + // throw, and hope for the + // best... + delete this; + throw; + } + } + } + + // cleanup + delete this; + } + }; + + TermCatcher *m_catcher; + AppCallback *m_app_callback; + int m_app_pid; + int m_app_status; + +protected: + // helper functions + void RunError(wxWindow *parent, const wxString &msg); + int Execute(bool use_wx, const wxString &command, AppCallback *cb); + +public: + /// It is safe to pass a NULL catcher here. No default is + /// specified so that the compiler helps prevent forgetfulness. + ExecHelper(TermCatcher *catcher); + virtual ~ExecHelper(); + + /// Runs the Application, if not already running.. parent may + /// be NULL if you don't want this class to pop up error messages + /// if unable to run the app. The 'appname' argument is a + /// user-friendly name for the application you are running. + virtual bool Run(wxWindow *parent, const std::string &appname, + const wxString &command); + /// Returns true if App is currently running + virtual bool IsAppRunning(); + /// Blocks until child exits + virtual void WaitForChild(); + virtual int GetAppStatus() const { return m_app_status; } + /// Sends a termination signal to the App, if running + virtual void KillApp(bool hardkill = false); +}; + +#endif + diff -Nru barry-0.14/desktop/src/GroupCfgDlg.cc barry-0.0.20110506/desktop/src/GroupCfgDlg.cc --- barry-0.14/desktop/src/GroupCfgDlg.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/GroupCfgDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,520 @@ +/// +/// \file GroupCfgDlg.cc +/// The configuration dialog used when a user double clicks +/// on a device in the device list. It lets the user choose +/// the app to sync with Barry, as well as the engine to use. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "GroupCfgDlg.h" +#include "windowids.h" +#include "configui.h" +#include "barrydesktop.h" +#include + +using namespace std; +using namespace OpenSync; + +BEGIN_EVENT_TABLE(GroupCfgDlg, wxDialog) + EVT_BUTTON (Dialog_GroupCfg_AppConfigButton, + GroupCfgDlg::OnConfigureApp) + EVT_TEXT (Dialog_GroupCfg_EngineCombo, + GroupCfgDlg::OnEngineComboChange) + EVT_TEXT (Dialog_GroupCfg_AppCombo, + GroupCfgDlg::OnAppComboChange) +END_EVENT_TABLE() + +////////////////////////////////////////////////////////////////////////////// +// GroupCfgDlg class + +GroupCfgDlg::GroupCfgDlg(wxWindow *parent, + const DeviceEntry &device, + OpenSync::APISet &apiset) + : wxDialog(parent, Dialog_GroupCfg, _T("Device Sync Configuration")) + , m_device(device) + , m_apiset(apiset) + , m_app_count(0) + , m_engine(0) + , m_barry_plugin(m_device.GetPin()) + , m_topsizer(0) + , m_appsizer(0) + , m_engine_combo(0) + , m_app_combo(0) + , m_password_edit(0) + , m_name_edit(0) + , m_debug_check(0) + , m_favour_radios(0) +{ + std::string appname; + + // make sure there is at least one engine + if( !apiset.os22() && !apiset.os40() ) + throw std::logic_error("Must have at least one engine in GroupCfgDlg"); + + // setup the raw GUI + CreateLayout(); + + // set window title to device PIN and name + string label = "Configure Device - "; + label += m_device.GetPin().Str(); + if( m_device.GetDeviceName().size() ) + label += " (" + m_device.GetDeviceName() + ")"; + SetTitle(wxString(label.c_str(), wxConvUTF8)); + + // initialize current engine pointer + if( m_device.GetEngine() ) { + m_engine = const_cast (m_device.GetEngine()); + } + + // initialize local group and plugin data + if( m_engine && m_device.GetConfigGroup() ) { + const Config::Group *group = m_device.GetConfigGroup(); + // use existing group name, if available + m_group_name = group->GetGroupName(); + + // copy Barry plugin config, if available + if( group->HasBarryPlugins() ) + m_barry_plugin = group->GetBarryPlugin(); + + // copy non-Barry plugin config, if available + const Config::Plugin *plugin = group->GetNonBarryPlugin(); + if( plugin ) { + appname = plugin->GetAppName(); + m_plugins[m_engine][appname].reset( plugin->Clone() ); + } + } + else { + m_group_name = "barrydesktop_" + m_device.GetPin().Str(); + } + + // copy over the extras + if( m_device.GetExtras() ) { + const DeviceExtras *extras = m_device.GetExtras(); + m_favour_plugin_name = extras->m_favour_plugin_name; + } + + SelectCurrentEngine(); + LoadBarryConfig(); + SelectApplication(appname); + SelectFavour(); + + if( m_app_count == 0 ) { + wxMessageBox(_T("No supported applications found. You may need to install some opensync plugins."), + _T("No App Found"), wxOK | wxICON_ERROR, this); + } +} + +void GroupCfgDlg::CreateLayout() +{ + m_topsizer = new wxBoxSizer(wxVERTICAL); + AddEngineSizer(m_topsizer); + AddConfigSizer(m_topsizer); + AddFavourSizer(m_topsizer); + AddButtonSizer(m_topsizer); + + SetSizer(m_topsizer); + m_topsizer->SetSizeHints(this); + m_topsizer->Layout(); +} + +void GroupCfgDlg::AddEngineSizer(wxSizer *sizer) +{ + wxSizer *engine = new wxStaticBoxSizer( + new wxStaticBox(this, wxID_ANY, _T("OpenSync Engine")), + wxHORIZONTAL + ); + + wxArrayString engines; + if( m_apiset.os22() ) + engines.Add(wxString(m_apiset.os22()->GetVersion(),wxConvUTF8)); + if( m_apiset.os40() ) + engines.Add(wxString(m_apiset.os40()->GetVersion(),wxConvUTF8)); + + engine->Add( + m_engine_combo = new wxComboBox(this, + Dialog_GroupCfg_EngineCombo, _T(""), + wxDefaultPosition, wxSize(100, -1), engines, + wxCB_READONLY), + 1, wxALL, 5); + + sizer->Add(engine, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 10); + + // if only one engine is available, don't bother showing the combo + if( !m_apiset.os22() || !m_apiset.os40() ) { + sizer->Hide(engine, true); + } +} + +void GroupCfgDlg::AddConfigSizer(wxSizer *sizer) +{ + wxSizer *config = new wxBoxSizer(wxHORIZONTAL); + AddBarrySizer(config); + AddAppSizer(config); + + sizer->Add(config, 1, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 10); +} + +void GroupCfgDlg::AddBarrySizer(wxSizer *sizer) +{ + wxSizer *barry = new wxStaticBoxSizer( + new wxStaticBox(this, wxID_ANY, _T("Barry Config")), + wxVERTICAL + ); + + wxSizer *dname = new wxBoxSizer(wxHORIZONTAL); + dname->Add( + new wxStaticText(this, wxID_ANY, _T("Name:")), + 0, wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL, 2); + dname->Add( + m_name_edit = new wxTextCtrl(this, wxID_ANY, _T("")), + 1, wxALIGN_LEFT, 0); + barry->Add(dname, 0, wxALL | wxEXPAND, 5); + + wxSizer *password = new wxBoxSizer(wxHORIZONTAL); + password->Add( + new wxStaticText(this, wxID_ANY, _T("Password:")), + 0, wxALIGN_RIGHT | wxALIGN_CENTRE_VERTICAL, 2); + password->Add( + m_password_edit = new wxTextCtrl(this, wxID_ANY, _T(""), + wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD), + 1, wxALIGN_LEFT, 0); + barry->Add(password, 0, wxALL | wxEXPAND, 5); + + barry->Add( + m_debug_check = new wxCheckBox(this, wxID_ANY, + _T("Debug output during sync")), + 0, wxALIGN_LEFT, 5); + + sizer->Add(barry, 0, wxRIGHT | wxEXPAND, 5); +} + +void GroupCfgDlg::AddAppSizer(wxSizer *sizer) +{ + m_appsizer = new wxStaticBoxSizer( + new wxStaticBox(this, wxID_ANY, _T("Application")), + wxVERTICAL + ); + + UpdateAppSizer(false); + + sizer->Add(m_appsizer, 0, wxLEFT | wxEXPAND, 5); +} + +void GroupCfgDlg::UpdateAppSizer(bool relayout) +{ + // start fresh + m_appsizer->Clear(true); + + wxArrayString appnames; + LoadAppNames(appnames); + appnames.Sort(); + + // FIXME - make size of combobox the size of the longest + // string in apps? using textextent calcs + m_appsizer->Add( + m_app_combo = new wxComboBox(this, + Dialog_GroupCfg_AppCombo, _T(""), + wxDefaultPosition, wxSize(200, -1), appnames, + wxCB_READONLY), + 0, wxALL | wxALIGN_CENTRE, 5); + m_appsizer->Add( + new wxButton(this, Dialog_GroupCfg_AppConfigButton, + _T("&Configure...")), + 0, wxALL | wxALIGN_CENTRE, 5); + + // in case this is called after the dialog is already displayed, + // we need to readjust everything + if( relayout ) + m_topsizer->Layout(); +} + +void GroupCfgDlg::LoadAppNames(wxArrayString &appnames) +{ + // need to load app names based on engine plugin availability + // NOTE - do not load the Barry plugin, since that's already assumed + + if( !m_engine ) { + // no engine available + appnames.Add(_T("No engine selected")); + return; + } + + string_list_type plugins; + try { + m_engine->GetPluginNames(plugins); + } + catch( std::exception &e ) { + barrylog("Exception caught in LoadAppNames: " << e.what()); + return; + } + + // cycle through all available plugins, and add the ones + // that we support + int added = 0; + string_list_type::const_iterator i = plugins.begin(); + for( ; i != plugins.end(); ++i ) { + string appname; + if( m_engine->GetConverter().IsPluginSupported(*i, &appname) ) { + // found a supported plugin... + + // skip Barry + if( appname == Config::Barry::AppName() ) + continue; + + appnames.Add( wxString(appname.c_str(), wxConvUTF8) ); + added++; + } + } + + m_app_count = added; + + if( m_app_count == 0 ) { + appnames.Add(_T("No supported plugins available")); + return; + } +} + +void GroupCfgDlg::AddFavourSizer(wxSizer *sizer) +{ + wxArrayString labels; + labels.Add( _T("Favour device") ); + labels.Add( _T("Favour application") ); + labels.Add( _T("Ask me") ); + + sizer->Add( m_favour_radios = new wxRadioBox(this, wxID_ANY, + _T("To Resolve Conflicts:"), + wxDefaultPosition, wxDefaultSize, + labels, 1, wxRA_SPECIFY_ROWS), + 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 10); +} + +void GroupCfgDlg::AddButtonSizer(wxSizer *sizer) +{ + wxSizer *button = CreateSeparatedButtonSizer(wxOK | wxCANCEL); + sizer->Add(button, 0, wxALL | wxEXPAND | wxALIGN_RIGHT, 10); +} + +void GroupCfgDlg::SelectCurrentEngine() +{ + if( m_engine_combo ) { + if( !m_engine ) { + m_engine = m_apiset.os22() ? + m_apiset.os22() : m_apiset.os40(); + } + + if( m_engine ) + m_engine_combo->SetValue( + wxString(m_engine->GetVersion(), wxConvUTF8)); + + UpdateAppSizer(); + } +} + +void GroupCfgDlg::LoadBarryConfig() +{ + Config::Barry &bp = m_barry_plugin; + + wxString dname(wxGetApp().GetDeviceName(bp.GetPin()).c_str(), wxConvUTF8); + + m_name_edit->SetValue(dname); + m_password_edit->SetValue(wxString(bp.GetPassword().c_str(), wxConvUTF8)); + m_debug_check->SetValue( bp.IsDebugMode() ); +} + +void GroupCfgDlg::SelectApplication(const std::string appname) +{ + m_app_combo->SetValue(wxString(appname.c_str(), wxConvUTF8)); +} + +void GroupCfgDlg::SelectFavour() +{ + if( m_engine && + m_favour_plugin_name == Config::Barry::PluginName(*m_engine) ) + { + m_favour_radios->SetSelection(0); + } + else if( m_engine && m_favour_plugin_name.size() ) { + m_favour_radios->SetSelection(1); + } + else { + // ask the user + m_favour_radios->SetSelection(2); + } +} + +std::string GroupCfgDlg::GetCurrentAppName() const +{ + wxString app = m_app_combo->GetValue(); + return std::string(app.utf8_str()); +} + +GroupCfgDlg::plugin_ptr GroupCfgDlg::GetCurrentPlugin() +{ + string appname = GetCurrentAppName(); + appcfg_map &cfgs = m_plugins[m_engine]; + appcfg_map::iterator pi = cfgs.find(appname); + if( pi != cfgs.end() ) + return pi->second; + else + return plugin_ptr(); +} + +void GroupCfgDlg::OnConfigureApp(wxCommandEvent &event) +{ + string app = GetCurrentAppName(); + if( app.size() == 0 ) { + wxMessageBox(_T("Please select an application."), + _T("Application Config"), wxOK | wxICON_ERROR, this); + return; + } + + ConfigUI::ptr ui = ConfigUI::CreateConfigUI(app); + + if( !ui.get() ) { + wxMessageBox(_T("No configuration interface available for this Application."), + _T("Application Config"), + wxOK | wxICON_ERROR, this); + return; + } + + if( ui->Configure(this, GetCurrentPlugin()) ) { + ConfigUI::plugin_ptr plugin = ui->GetPlugin(); + if( plugin.get() ) { + m_plugins[m_engine][app] = plugin; + } + } +} + +void GroupCfgDlg::OnEngineComboChange(wxCommandEvent &event) +{ + // remember what plugin we're using + plugin_ptr old_app = GetCurrentPlugin(); + + // update engine pointer + wxString newEngine = m_engine_combo->GetValue(); + if( m_apiset.os22() && newEngine == wxString(m_apiset.os22()->GetVersion(), wxConvUTF8) ) { + m_engine = m_apiset.os22(); + } + else if( m_apiset.os40() && newEngine == wxString(m_apiset.os40()->GetVersion(), wxConvUTF8) ) { + m_engine = m_apiset.os40(); + } + + // update the application list + UpdateAppSizer(); + + // if plugin can be configured in new engine, keep our current + // config, otherwise, reset + if( old_app.get() && m_engine->GetConverter().IsPluginSupported(old_app->GetPluginName(*m_engine)) ) { + // update the app list + SelectApplication(old_app->GetAppName()); + } + else { + // leave GUI as is, and zap our plugin data + SelectApplication(""); + } +} + +void GroupCfgDlg::OnAppComboChange(wxCommandEvent &event) +{ +} + +bool GroupCfgDlg::TransferDataFromWindow() +{ + // engine must be set! + if( !m_engine ) { + wxMessageBox(_T("Please select an engine."), + _T("Device Config"), wxOK | wxICON_ERROR, this); + return false; + } + + // make sure the Barry plugin is configured + if( !m_barry_plugin.IsConfigured(*m_engine) ) { + wxMessageBox(_T("Barry doesn't have a PIN number. This should never happen."), + _T("Device Config"), wxOK | wxICON_ERROR, this); + return false; + } + + // make sure the application plugin is configured + plugin_ptr app = GetCurrentPlugin(); + if( !app.get() || !app->IsConfigured(*m_engine) ) { + // the app hasn't been configured yet, do it automatically + wxCommandEvent event; + OnConfigureApp(event); + + app = GetCurrentPlugin(); + if( !app.get() || !app->IsConfigured(*m_engine) ) { + wxMessageBox(_T("The application plugin is not fully configured."), + _T("Application Config"), wxOK | wxICON_ERROR, this); + return false; + } + } + + // copy over barry specific settings + m_device_name = string(m_name_edit->GetValue().utf8_str()); + m_barry_plugin.SetPassword(string(m_password_edit->GetValue().utf8_str())); + m_barry_plugin.DebugMode(m_debug_check->GetValue()); + + // make sure conflict resolution is known + int findex = m_favour_radios->GetSelection(); + switch( findex ) + { + case 0: // Favour device + m_favour_plugin_name = Config::Barry::PluginName(*m_engine); + break; + + case 1: // Favour application + m_favour_plugin_name = app->GetPluginName(*m_engine); + break; + + case 2: // Ask me + m_favour_plugin_name.clear(); + break; + + default: // borked + wxMessageBox(_T("Please select conflict resolution method."), + _T("Conflict Resolution"), wxOK | wxICON_ERROR, this); + return false; + } + + // save the new device name + wxGetApp().SetDeviceName(m_barry_plugin.GetPin(), m_device_name); + + return true; +} + +int GroupCfgDlg::ShowModal() +{ + int status = wxDialog::ShowModal(); + plugin_ptr app = GetCurrentPlugin(); + if( status == wxID_OK && app.get() ) { + // construct a new group from user's results + m_group.reset( new Config::Group(m_group_name) ); + m_group->AddPlugin( m_barry_plugin.Clone() ); + m_group->AddPlugin( app->Clone() ); + + // don't forget the extras + m_extras.reset( new DeviceExtras(m_barry_plugin.GetPin()) ); + m_extras->m_favour_plugin_name = m_favour_plugin_name; + } + else { + m_group.reset(); + m_extras.reset(); + } + return status; +} + diff -Nru barry-0.14/desktop/src/GroupCfgDlg.h barry-0.0.20110506/desktop/src/GroupCfgDlg.h --- barry-0.14/desktop/src/GroupCfgDlg.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/GroupCfgDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,116 @@ +/// +/// \file GroupCfgDlg.h +/// The configuration dialog used when a user double clicks +/// on a device in the device list. It lets the user choose +/// the app to sync with Barry, as well as the engine to use. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_GROUPCFGDLG_H__ +#define __BARRYDESKTOP_GROUPCFGDLG_H__ + +#include +#include "deviceset.h" + +class GroupCfgDlg : public wxDialog +{ + typedef OpenSync::Config::Group::plugin_ptr plugin_ptr; + typedef std::map appcfg_map; + typedef std::map engapp_map; + + DECLARE_EVENT_TABLE() + + // external data sources + const DeviceEntry &m_device; + OpenSync::APISet &m_apiset; + + // misc flags + int m_app_count; + + // results of the configuration + std::string m_device_name; + std::string m_group_name; + DeviceEntry::group_ptr m_group; + DeviceEntry::extras_ptr m_extras; + + // in-process config results... i.e. the plugin config + // is stored here, and can be overwritten as the user + // keeps fiddling with the controls... a map of engines + // and apps is kept, so that if the user changes engine + // or app, and then changes back, his settings are not lost... + // this also means that pre-existing configs from outside + // the dialog are kept if possible, to help with re-saving + // of opensync configs + engapp_map m_plugins; // map of engines/apps/plugins + OpenSync::API *m_engine; // current engine + OpenSync::Config::Barry m_barry_plugin; + std::string m_favour_plugin_name; // an extra + + // dialog controls + wxSizer *m_topsizer, *m_appsizer; + wxComboBox *m_engine_combo, *m_app_combo; + wxTextCtrl *m_password_edit, *m_name_edit; + wxCheckBox *m_debug_check; + wxRadioBox *m_favour_radios; + +protected: + void CreateLayout(); + void AddEngineSizer(wxSizer *sizer); + void AddConfigSizer(wxSizer *sizer); + void AddBarrySizer(wxSizer *sizer); + void AddAppSizer(wxSizer *sizer); + void UpdateAppSizer(bool relayout = true); // called if engine changes, + // to update the app combo, etc, with available + // apps + void LoadAppNames(wxArrayString &appnames); + void AddFavourSizer(wxSizer *sizer); + void AddButtonSizer(wxSizer *sizer); + + void SelectCurrentEngine(); + void LoadBarryConfig(); + void SelectApplication(const std::string appname); + void SelectFavour(); + + std::string GetCurrentAppName() const; // returns name of currently + // selected app, for the currently + // selected engine... if none selected, + // returns empty string (size() == 0) + plugin_ptr GetCurrentPlugin(); + +public: + GroupCfgDlg(wxWindow *parent, const DeviceEntry &device, + OpenSync::APISet &apiset); + + // results + std::string GetDeviceName() const { return m_device_name; } + DeviceEntry::group_ptr GetGroup() { return m_group; } + OpenSync::API* GetEngine() const { return m_engine; } + DeviceEntry::extras_ptr GetExtras() { return m_extras; } + + // event handlers + void OnConfigureApp(wxCommandEvent &event); + void OnEngineComboChange(wxCommandEvent &event); + void OnAppComboChange(wxCommandEvent &event); + + // overrides + virtual bool TransferDataFromWindow(); + int ShowModal(); +}; + +#endif + diff -Nru barry-0.14/desktop/src/ipc.h barry-0.0.20110506/desktop/src/ipc.h --- barry-0.14/desktop/src/ipc.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ipc.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,110 @@ +/// +/// \file ipc.h +/// Common things needed for both client and server +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_IPC_H__ +#define __BARRYDESKTOP_IPC_H__ + +#include + +#define SERVER_SERVICE_NAME _T("/tmp/bsyncjail.socket") + +// Connection Topics +#define TOPIC_STATUS _T("Status") +#define TOPIC_CONFLICT _T("Conflict") + +// Status items +#define STATUS_ITEM_ERROR _T("Error") +#define STATUS_ITEM_ENGINE _T("Engine") +#define STATUS_ITEM_MAPPING _T("Mapping") +#define STATUS_ITEM_ENTRY _T("Entry") +#define STATUS_ITEM_MEMBER _T("Member") + +// Special engine messages +#define ENGINE_STATUS_SLOW_SYNC _T("SLOW_SYNC: on") + +// Conflict items +#define CONFLICT_ITEM_START _T("Start") +#define CONFLICT_ITEM_CHANGE _T("Change") +#define CONFLICT_ITEM_ANSWER _T("Answer") + +// Used to convert const char* strings into temporary writable +// buffers, since wxConnection is not very const correct. +class SillyBuffer +{ + wxChar *m_buf; + int m_size; + int m_data_size; + +public: + SillyBuffer() + : m_buf( new wxChar[100] ) + , m_size(100) + , m_data_size(0) + { + } + + ~SillyBuffer() + { + delete [] m_buf; + } + + int size() const { return m_data_size; } + wxChar* buf() { return m_buf; } + + void resize(int len) + { + if( len+1 > m_size ) { + delete [] m_buf; + m_buf = 0; + m_buf = new wxChar[len+1]; + m_size = len+1; + m_data_size = 0; + } + } + + SillyBuffer& sbuf(const wxString &str) { buf(str); return *this; } + SillyBuffer& sbuf(const char *str) { buf(str); return *this; } + SillyBuffer& sbuf(const std::string &str) { buf(str); return *this; } + + wxChar* buf(const wxString &str) + { + resize(str.Len()); + memcpy(m_buf, str.GetData(), str.Len() * sizeof(wxChar)); + m_buf[str.Len()] = 0; + m_data_size = str.Len(); + return m_buf; + } + + wxChar* buf(const char *str) + { + return buf(wxString(str, wxConvUTF8)); + } + + wxChar* buf(const std::string &str) + { + return buf(wxString(str.c_str(), wxConvUTF8, str.size())); + } +}; + +extern SillyBuffer sb; + +#endif + diff -Nru barry-0.14/desktop/src/Makefile.am barry-0.0.20110506/desktop/src/Makefile.am --- barry-0.14/desktop/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,117 @@ +LIB_OSYNCWRAP_VERSION = 18:0:0 + +SUBDIRS = . 0.22 0.40 + +EXTRA_DIST = \ + ContactEditDlg.wxg \ + oextract.cc + +INCLUDES = $(TREE_BUILD_CXXFLAGS) $(BARRY_CFLAGS) $(OPENSYNC22_CFLAGS) $(OPENSYNC40_CFLAGS) $(GLIB2_CFLAGS) +# opensync libraries are not included here... they are loaded with dlopen() +LIBS = $(TREE_BUILD_LDFLAGS) $(BARRY_LIBS) $(GLIB2_LIBS) + +AM_CXXFLAGS = -ansi -Wall -g +AM_CPPFLAGS = -DBARRYDESKTOP_BASEDATADIR='"$(basedatadir)"' -DBARRYDESKTOP_IMAGEDIR='"$(imagedir)"' +AM_LDFLAGS = + +include_osyncwrapdir = ${includedir}/barry/osyncwrap + +bin_PROGRAMS = barrydesktop bsyncjail bsynccl +noinst_PROGRAMS = ostest xmlcompactor xmlmap +lib_LTLIBRARIES = libosyncwrap.la + +include_osyncwrap_HEADERS = + error.h \ + dlopen.h \ + tempdir.h \ + osbase.h osprivatebase.h \ + osconfig.h \ + osconv22.h \ + osconv40.h \ + os22.h \ + os40.h + +noinst_HEADERS = + +libosyncwrap_la_SOURCES = \ + error.cc error.h \ + dlopen.cc dlopen.h \ + tempdir.cc tempdir.h \ + osbase.cc osbase.h osprivatebase.h \ + osconfig.cc osconfig.h \ + osconv22.h \ + osconv40.h \ + os22.h \ + os40.h +if WITH_OPENSYNC22 +libosyncwrap_la_SOURCES += os22.cc osconv22.cc +else +libosyncwrap_la_SOURCES += null-os22.cc +endif +if WITH_OPENSYNC40 +libosyncwrap_la_SOURCES += os40.cc osconv40.cc +else +libosyncwrap_la_SOURCES += null-os40.cc +endif +libosyncwrap_la_LDFLAGS = -ldl -version-info ${LIB_OSYNCWRAP_VERSION} + +barrydesktop_SOURCES = \ + barrydesktop.cc barrydesktop.h \ + ipc.h optout.h \ + windowids.h \ + util.cc util.h \ + StringSync.cc StringSync.h \ + xmlcompactor.cc xmlcompactor.h \ + xmlmap.cc xmlmap.h \ + ClickImage.cc ClickImage.h \ + PNGButton.cc PNGButton.h \ + BaseButtons.cc BaseButtons.h \ + BaseFrame.cc BaseFrame.h \ + ContactPhotoWidget.cc ContactPhotoWidget.h \ + Mode.h \ + Mode_MainMenu.cc Mode_MainMenu.h \ + Mode_Sync.cc Mode_Sync.h \ + Mode_Browse.cc Mode_Browse.h \ + ContactEditDlg.cc ContactEditDlg.h \ + GroupCfgDlg.cc GroupCfgDlg.h \ + SyncStatusDlg.cc SyncStatusDlg.h \ + ConflictDlg.cc ConflictDlg.h \ + configui.cc configui.h \ + exechelper.cc exechelper.h \ + CUI_Barry.cc CUI_Barry.h \ + CUI_Evolution.cc CUI_Evolution.h \ + CUI_Google.cc CUI_Google.h \ + deviceset.cc deviceset.h +barrydesktop_LDADD = libosyncwrap.la -ldl @WX_LIBS@ $(LIBXMLPP_LIBS) $(LIBGCAL_LIBS) +barrydesktop_CXXFLAGS = $(AM_CXXFLAGS) @WX_CXXFLAGS@ $(LIBXMLPP_CFLAGS) \ + $(LIBGCAL_CFLAGS) + +bsyncjail_SOURCES = bsyncjail.cc ipc.h +bsyncjail_LDADD = libosyncwrap.la -ldl @WX_LIBS@ +bsyncjail_CXXFLAGS = $(AM_CXXFLAGS) @WX_CXXFLAGS@ + +bsynccl_SOURCES = bsynccl.cc +bsynccl_LDADD = libosyncwrap.la -ldl +bsynccl_CXXFLAGS = $(AM_CXXFLAGS) + +ostest_SOURCES = \ + deviceset.cc deviceset.h \ + ostest.cc +ostest_CXXFLAGS = +if WITH_OPENSYNC22 +ostest_CXXFLAGS += -DWITH_OPENSYNC22 +endif +if WITH_OPENSYNC40 +ostest_CXXFLAGS += -DWITH_OPENSYNC40 +endif +#ostest_LDFLAGS = -avoid-version +ostest_LDADD = libosyncwrap.la -ldl + +xmlcompactor_SOURCES = xmlcompactor.cc xmlcompactor.h +xmlcompactor_CXXFLAGS = -DXMLCOMPACTOR $(AM_CXXFLAGS) $(LIBXMLPP_CFLAGS) +xmlcompactor_LDADD = $(LIBXMLPP_LIBS) + +xmlmap_SOURCES = xmlmap.cc xmlmap.h +xmlmap_CXXFLAGS = -DXMLMAP $(AM_CXXFLAGS) $(LIBXMLPP_CFLAGS) +xmlmap_LDADD = $(LIBXMLPP_LIBS) + diff -Nru barry-0.14/desktop/src/Mode_Browse.cc barry-0.0.20110506/desktop/src/Mode_Browse.cc --- barry-0.14/desktop/src/Mode_Browse.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_Browse.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,821 @@ +/// +/// \file Mode_Browse.cc +/// Mode derived class for database browsing +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "Mode_Browse.h" +#include "BaseFrame.h" +#include "ContactEditDlg.h" +#include "windowids.h" +#include +#include +#include + +using namespace std; +using namespace Barry; + +BEGIN_EVENT_TABLE(BrowseMode, wxEvtHandler) + EVT_LIST_ITEM_SELECTED(BrowseMode_DBDBList, + BrowseMode::OnDBDBListSelChange) + EVT_LIST_ITEM_SELECTED(BrowseMode_RecordList, + BrowseMode::OnRecordListSelChange) + EVT_LIST_ITEM_ACTIVATED(BrowseMode_RecordList, + BrowseMode::OnRecordListActivated) + EVT_CHECKBOX (BrowseMode_ShowAllCheckbox, + BrowseMode::OnShowAll) + EVT_BUTTON (BrowseMode_AddRecordButton, + BrowseMode::OnAddRecord) + EVT_BUTTON (BrowseMode_CopyRecordButton, + BrowseMode::OnCopyRecord) + EVT_BUTTON (BrowseMode_EditRecordButton, + BrowseMode::OnEditRecord) + EVT_BUTTON (BrowseMode_DeleteRecordButton, + BrowseMode::OnDeleteRecord) +END_EVENT_TABLE() + + +////////////////////////////////////////////////////////////////////////////// +// Standalone functions + +bool EditRecord(wxWindow *parent, bool editable, Barry::Contact &rec) +{ + ContactEditDlg edit(parent, rec, editable); + return edit.ShowModal() == wxID_OK; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Bookmark &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Calendar &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::CalendarAll &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::ContentStore &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Folder &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Memo &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Message &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::CallLog &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::PINMessage &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::SavedMessage &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::ServiceBook &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Sms &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Task &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::Timezone &rec) +{ + return false; +} + +bool EditRecord(wxWindow *parent, bool editable, Barry::HandheldAgent &rec) +{ + return false; +} + + +////////////////////////////////////////////////////////////////////////////// +// GUIDesktopConnector + +bool GUIDesktopConnector::PasswordPrompt(const Barry::BadPassword &bp, + std::string &password_result) +{ + // create prompt based on exception data + ostringstream oss; + oss << "Please enter device password: (" + << bp.remaining_tries() + << " tries remaining)"; + wxString prompt(oss.str().c_str(), wxConvUTF8); + + // ask user for device password + wxString pass = wxGetPasswordFromUser(prompt, + _T("Device Password"), _T(""), m_parent); + + password_result = pass.utf8_str(); + + // assume that a blank password means the user wishes to quit... + // wxWidgets doesn't seem to handle this very well? + return password_result.size() > 0; +} + +////////////////////////////////////////////////////////////////////////////// +// DBDataCache + +DBDataCache::DBDataCache(DataCache::IndexType index, const Barry::DBData &raw) + : DataCache(index, raw.GetUniqueId()) + , m_raw(raw) +{ +} + +bool DBDataCache::Edit(wxWindow *parent, bool editable) +{ + return false; +} + +std::string DBDataCache::GetDescription() const +{ + return "raw data"; +} + + +////////////////////////////////////////////////////////////////////////////// +// DBCache + +DBCache::DBCache(ThreadableDesktop &tdesktop, const std::string &dbname) + : m_tdesktop(tdesktop) + , m_dbname(dbname) +{ + // lock the desktop + DesktopInstancePtr dip = m_tdesktop.Get(); + + // grab the DBID + m_dbid = dip->Desktop().GetDBID(m_dbname); + + // load the record state table + dip->Desktop().GetRecordStateTable(m_dbid, m_state); + + // load all records + AllRecordParser ap(*this, *this); + RecordStateTable::StateMapType::iterator i = m_state.StateMap.begin(); + for( ; i != m_state.StateMap.end(); ++i ) { + m_index = i->second.Index; // save for the callback + dip->Desktop().GetRecord(m_dbid, m_index, ap); + } + + // FIXME - sort here? +} + +DBCache::~DBCache() +{ +} + +DBCache::iterator DBCache::Get(int list_offset) +{ + iterator i = begin(); + for( ; i != end() && list_offset; ++i, list_offset-- ) + ; + return i; +} + +DBCache::const_iterator DBCache::Get(int list_offset) const +{ + const_iterator i = begin(); + for( ; i != end() && list_offset; ++i, list_offset-- ) + ; + return i; +} + +int DBCache::GetIndex(iterator record) const +{ + iterator i = const_cast (this)->begin(); + iterator e = const_cast (this)->end(); + for( int index = 0; i != e; ++i, index++ ) { + if( i == record ) + return index; + } + return -1; +} + +int DBCache::GetIndex(const_iterator record) const +{ + const_iterator i = begin(); + for( int index = 0; i != end(); ++i, index++ ) { + if( i == record ) + return index; + } + return -1; +} + +DBCache::iterator DBCache::Add(wxWindow *parent, iterator copy_record) +{ + DataCachePtr p; + +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(tname) \ + if( m_dbname == Barry::tname::GetDBName() ) { \ + Barry::tname rec; \ + if( copy_record != end() ) { \ + RecordCache *rc = dynamic_cast* > (copy_record->get()); \ + if( rc ) { \ + rec = rc->GetRecord(); \ + } \ + } \ + p.reset( new RecordCache(0, rec) ); \ + } + ALL_KNOWN_BUILDER_TYPES + + // anything else is not addable or buildable + if( !p.get() ) { + return end(); + } + + if( p->Edit(parent, true) ) { + // see if this record has a builder + Barry::Builder *bp = dynamic_cast (p.get()); + if( !bp ) { + return end(); + } + + // give record a new UniqueID + uint32_t record_id = m_state.MakeNewRecordId(); +cout << "New recordID generated: 0x" << hex << record_id << endl; + p->SetIds(p->GetStateIndex(), record_id); + + // add record to device + DesktopInstancePtr dip = m_tdesktop.Get(); + Barry::Mode::Desktop &desktop = dip->Desktop(); + desktop.AddRecord(m_dbid, *bp); + + // update our copy of the record state table from device + desktop.GetRecordStateTable(m_dbid, m_state); +cout << m_state << endl; + + // find our new record_id in list, to find the state index + IndexType new_index; + if( !m_state.GetIndex(record_id, &new_index) ) { + throw std::logic_error("Need to reconnect for adding a record?"); + } + + // update new state_index in the data cache record + p->SetIds(new_index, record_id); + + // add DataCachePtr to our own cache list + m_records.push_front(p); + + // return iterator pointing to new record + return begin(); + } + else { + return end(); + } +} + +bool DBCache::Edit(wxWindow *parent, iterator record) +{ + if( record == end() ) + return false; + + if( (*record)->Edit(parent, true) && (*record)->IsBuildable() ) { + // see if this record has a builder + Barry::Builder *bp = dynamic_cast ((*record).get()); + if( !bp ) + return false; + +cout << "Changing device record with index: 0x" << hex << (*record)->GetStateIndex() << endl; +cout << m_state << endl; + // update the device with new record data + DesktopInstancePtr dip = m_tdesktop.Get(); + Barry::Mode::Desktop &desktop = dip->Desktop(); + desktop.SetRecord(m_dbid, (*record)->GetStateIndex(), *bp); + + return true; + } + else { + return false; + } +} + +bool DBCache::Delete(wxWindow *parent, iterator record) +{ + if( record == end() ) + return false; + + // prompt user with Yes / No message + wxString desc((*record)->GetDescription().c_str(), wxConvUTF8); + int choice = wxMessageBox(_T("Delete record: ") + desc + _T("?"), + _T("Record Delete"), wxYES_NO | wxICON_QUESTION, parent); + + // if no, return false + if( choice != wxYES ) + return false; + +cout << "Deleting device record with index: 0x" << hex << (*record)->GetStateIndex() << endl; +cout << m_state << endl; + // delete record from device + DesktopInstancePtr dip = m_tdesktop.Get(); + Barry::Mode::Desktop &desktop = dip->Desktop(); + desktop.DeleteRecord(m_dbid, (*record)->GetStateIndex()); + + // remove record from cache list + m_records.erase(record); + return true; +} + +// For Barry::AllRecordStore +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ +void DBCache::operator() (const Barry::tname &rec) \ +{ \ + DataCachePtr p( new RecordCache(m_index, rec) ); \ + m_records.push_front(p); \ +} +ALL_KNOWN_PARSER_TYPES + +// For Barry::Parser +void DBCache::ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic) +{ + DataCachePtr p( new DBDataCache(m_index, data) ); + m_records.push_front(p); +} + + +////////////////////////////////////////////////////////////////////////////// +// DBMap + +DBMap::DBMap(ThreadableDesktop &tdesktop) + : m_tdesktop(tdesktop) +{ + if( pthread_mutex_init(&m_map_mutex, NULL) ) { + throw Barry::Error("Failed to create map mutex"); + } +} + +DBMap::DBCachePtr DBMap::LoadDBCache(const std::string &dbname) +{ + scoped_lock lock(m_map_mutex); + + MapType::iterator i = m_map.find(dbname); + if( i != m_map.end() ) + return i->second; + + // do not unlock here, since we only want to load this + // data once, not provide a window for loading it twice + + // not found, time to load it up + DBCachePtr p( new DBCache(m_tdesktop, dbname) ); + m_map[dbname] = p; + return p; +} + +DBMap::DBCachePtr DBMap::GetDBCache(const std::string &dbname) +{ + scoped_lock lock(m_map_mutex); + + MapType::iterator i = m_map.find(dbname); + if( i != m_map.end() ) + return i->second; + + return DBCachePtr(); +} + +////////////////////////////////////////////////////////////////////////////// +// BrowseMode + +BrowseMode::BrowseMode(wxWindow *parent, const ProbeResult &device) + : m_parent(parent) + , m_buildable(false) + , m_show_all(false) +{ + // create device identifying string + ostringstream oss; + oss << device.m_pin.Str(); + if( device.m_cfgDeviceName.size() ) { + oss << " (" << device.m_cfgDeviceName << ")"; + } + m_device_id_str = wxString(oss.str().c_str(), wxConvUTF8); + + // + // connect to the device + // + m_con.reset( new GUIDesktopConnector(m_parent, "", "utf-8", device) ); + m_con->Reconnect(2); + m_tdesktop.reset( new ThreadableDesktop(*m_con) ); + + // keep our own copy, and sort by name for later + m_dbdb = m_con->GetDesktop().GetDBDB(); + m_dbdb.SortByName(); + + CreateControls(); + + // create our DBMap and give it the threadable desktop, + // now that we're finished doing any desktop USB work + m_dbmap.reset( new DBMap(*m_tdesktop) ); + + // + // From here down, we assume that our constructor succeeds, with + // no exceptions! + // + + // fire off a background thread to cache database records + // in advance... if it fails, don't worry about it + m_abort_flag = false; + int ret = pthread_create(&m_cache_thread, NULL, + &BrowseMode::FillCacheThread, this); + if( ret != 0 ) + m_abort_flag = true; // no need to join later + + // connect ourselves to the parent's event handling chain + // do this last, so that we are guaranteed our destructor + // will run, in case of exceptions + m_parent->PushEventHandler(this); +} + +BrowseMode::~BrowseMode() +{ + // unhook that event handler! + m_parent->PopEventHandler(); + + // make sure the cache thread is finished before we destroy it :-) + if( !m_abort_flag ) { + m_abort_flag = true; + void *junk; + pthread_join(m_cache_thread, &junk); + } +} + +std::string& GetDBName(Barry::DatabaseDatabase::Database &db) +{ + return db.Name; +} + +void BrowseMode::CreateControls() +{ + m_top_sizer.reset( new wxBoxSizer(wxVERTICAL) ); + + // make space for the main header, which is not part of our + // work area + m_top_sizer->AddSpacer(MAIN_HEADER_OFFSET); + + + // + // add list boxes to main area, the list_sizer + // + + wxStaticBoxSizer *list_sizer = new wxStaticBoxSizer(wxHORIZONTAL, + m_parent, m_device_id_str); + + // add database listctrl + m_dbdb_list.reset (new wxListCtrl(m_parent, BrowseMode_DBDBList, + wxDefaultPosition, wxDefaultSize, + wxLC_REPORT | wxLC_SINGLE_SEL) ); //| wxLC_VRULES +// int max_db_width = GetMaxWidth(m_dbdb_list.get(), +// m_dbdb.Databases.begin(), m_dbdb.Databases.end(), +// &GetDBName); + list_sizer->Add( m_dbdb_list.get(), 4, wxEXPAND | wxALL, 4 ); + + // add the record listctrl + m_record_list.reset(new wxListCtrl(m_parent, BrowseMode_RecordList, + wxDefaultPosition, wxDefaultSize, + wxLC_REPORT | wxLC_SINGLE_SEL) ); //| wxLC_VRULES + list_sizer->Add( m_record_list.get(), 5, wxEXPAND | wxALL, 4 ); + + // add list sizer to top sizer + m_top_sizer->Add( list_sizer, 1, wxEXPAND | wxALL, 4 ); + + // + // add "show all" checkbox + // + + m_show_all_checkbox.reset( new wxCheckBox(m_parent, + BrowseMode_ShowAllCheckbox, + _T("Show All Databases"), + wxDefaultPosition, wxDefaultSize, + wxCHK_2STATE) ); + m_top_sizer->Add( m_show_all_checkbox.get(), 0, wxEXPAND | wxALL, 4 ); + m_show_all_checkbox->SetValue(m_show_all); + + // + // bottom buttons + // + + // add bottom buttons - these go in the bottom FOOTER area + // so their heights must be fixed to MAIN_HEADER_OFFSET + // minus a border of 5px top and bottom + wxSize footer(-1, MAIN_HEADER_OFFSET - 5 - 5); + wxBoxSizer *buttons = new wxBoxSizer(wxHORIZONTAL); + m_add_record_button.reset( new wxButton(m_parent, + BrowseMode_AddRecordButton, _T("Add..."), + wxDefaultPosition, footer) ); + m_copy_record_button.reset( new wxButton(m_parent, + BrowseMode_CopyRecordButton, _T("Copy..."), + wxDefaultPosition, footer) ); + m_edit_record_button.reset( new wxButton(m_parent, + BrowseMode_EditRecordButton, _T("Edit..."), + wxDefaultPosition, footer)); + m_delete_record_button.reset( new wxButton(m_parent, + BrowseMode_DeleteRecordButton, _T("Delete..."), + wxDefaultPosition, footer) ); + buttons->Add(m_add_record_button.get(), 0, wxRIGHT, 5); + buttons->Add(m_copy_record_button.get(), 0, wxRIGHT, 5); + buttons->Add(m_edit_record_button.get(), 0, wxRIGHT, 5); + buttons->Add(m_delete_record_button.get(), 0, wxRIGHT, 5); + m_top_sizer->Add(buttons, 0, wxALL | wxALIGN_RIGHT, 5); + + // + // recalc size of children and add columns + // + wxSize client_size = m_parent->GetClientSize(); + m_top_sizer->SetDimension(0, 0, + client_size.GetWidth(), client_size.GetHeight()); + + // m_dbdb_list + wxSize dbdb_size = m_dbdb_list->GetClientSize(); + int scroll_width = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); + int size = dbdb_size.GetWidth() - scroll_width; + m_dbdb_list->InsertColumn(0, _T("Databases"), wxLIST_FORMAT_LEFT, + size * 0.80); + m_dbdb_list->InsertColumn(1, _T("Count"), wxLIST_FORMAT_LEFT, + size * 0.20 + scroll_width); // add back the scroll width + // so it doesn't look half-baked when + // there is no scroll bar + + + // m_record_list + wxSize record_size = m_record_list->GetClientSize(); + m_record_list->InsertColumn(0, _T("Record Description"), + wxLIST_FORMAT_LEFT, record_size.GetWidth()); + + + // + // add data + // + FillDBDBList(); + +/* + // attempt to re-select the devices as we last saw them + ReselectDevices(m_device_set->String2Subset(wxGetApp().GetGlobalConfig().GetKey("SelectedDevices"))); + UpdateButtons(); + +*/ +} + +int BrowseMode::GUItoDBDBIndex(int gui_index) +{ + if( m_show_all ) + return gui_index; + + DatabaseDatabase::DatabaseArrayType::const_iterator + i = m_dbdb.Databases.begin(), e = m_dbdb.Databases.end(); + for( int index = 0; i != e; ++i, index++ ) { + // only bump index on the parsable databases + if( !m_show_all && !IsParsable(i->Name) ) + continue; + + if( !gui_index ) + return index; + + gui_index--; + } + + // error + return -1; +} + +void BrowseMode::FillDBDBList() +{ + // start fresh + m_dbdb_list->DeleteAllItems(); + + DatabaseDatabase::DatabaseArrayType::const_iterator + i = m_dbdb.Databases.begin(), e = m_dbdb.Databases.end(); + for( int index = 0; i != e; ++i, index++ ) { + // Only show parsable databases, depending on GUI + if( !m_show_all && !IsParsable(i->Name) ) + continue; + + // Database Name + wxString text(i->Name.c_str(), wxConvUTF8); + long item = m_dbdb_list->InsertItem(index, text); + + // Record Count + ostringstream oss; + oss << dec << i->RecordCount; + text = wxString(oss.str().c_str(), wxConvUTF8); + m_dbdb_list->SetItem(item, 1, text); + } + + UpdateButtons(); +} + +void BrowseMode::FillRecordList(const std::string &dbname) +{ + try { + + // start fresh + m_record_list->DeleteAllItems(); + + // grab our DB + DBMap::DBCachePtr db = m_dbmap->LoadDBCache(dbname); + + // cycle through the cache, and insert the descriptions + // given for each record + DBCache::const_iterator b = db->begin(), e = db->end(); + for( int index = 0; b != e; ++b, index++ ) { + wxString text((*b)->GetDescription().c_str(), wxConvUTF8); + //long item = + m_record_list->InsertItem(index, text); + } + + } catch( Barry::Error &be ) { + cerr << be.what() << endl; + } +} + +void BrowseMode::UpdateButtons() +{ + int selected_count = m_record_list->GetSelectedItemCount(); + + // can only add if we have a builder for this record type + m_add_record_button->Enable(m_buildable); + // can only copy or edit if we have a builder, and only 1 is selected + m_copy_record_button->Enable(m_buildable && selected_count == 1); + m_edit_record_button->Enable(m_buildable && selected_count == 1); + // can only delete if something is selected + m_delete_record_button->Enable(selected_count > 0); +} + +void BrowseMode::FillCache() +{ + // cycle through the dbdb and load all Parsable databases + DatabaseDatabase::DatabaseArrayType::const_iterator + i = m_dbdb.Databases.begin(), e = m_dbdb.Databases.end(); + for( ; i != e; ++i ) { + if( IsParsable(i->Name) ) try { + m_dbmap->LoadDBCache(i->Name); + } catch( Barry::Error &be ) { + cerr << be.what() << endl; + } + + if( m_abort_flag ) + break; + } + + // finished + m_abort_flag = true; +} + +void* BrowseMode::FillCacheThread(void *bobj) +{ + BrowseMode *bm = (BrowseMode*) bobj; + bm->FillCache(); + return NULL; +} + +void BrowseMode::OnDBDBListSelChange(wxListEvent &event) +{ + wxBusyCursor wait; + int index = GUItoDBDBIndex(event.GetIndex()); + m_current_dbname = m_dbdb.Databases.at(index).Name; + m_buildable = ::IsBuildable(m_current_dbname); + m_current_record_item = -1; + + FillRecordList(m_current_dbname); + UpdateButtons(); +} + +void BrowseMode::OnRecordListSelChange(wxListEvent &event) +{ + // grab the cache for the current database... Get is ok here, + // since the cache is already loaded by the main db list + DBMap::DBCachePtr p = m_dbmap->GetDBCache(m_current_dbname); + if( !p.get() ) + return; + + // grab the record list index + m_current_record_item = event.GetIndex(); +// m_current_record_item = m_record_list->GetNextItem( +// m_current_record_item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); + + UpdateButtons(); +} + +void BrowseMode::OnRecordListActivated(wxListEvent &event) +{ + wxCommandEvent ce; + OnEditRecord(ce); +} + +void BrowseMode::OnShowAll(wxCommandEvent &event) +{ + m_show_all = !m_show_all; + FillDBDBList(); +} + +void BrowseMode::OnAddRecord(wxCommandEvent &event) +{ + // grab the cache for the current database... Get is ok here, + // since the cache is already loaded by the main db list + DBMap::DBCachePtr p = m_dbmap->GetDBCache(m_current_dbname); + if( !p.get() ) + return; + + DBCache::iterator i = p->Add(m_parent, p->end()); + if( i != p->end() ) { + wxString text((*i)->GetDescription().c_str(), wxConvUTF8); + + // insert new record in same spot as DBCache has it + m_current_record_item = p->GetIndex(i); + m_record_list->InsertItem(m_current_record_item, text); + } +} + +void BrowseMode::OnCopyRecord(wxCommandEvent &event) +{ + // grab the cache for the current database... Get is ok here, + // since the cache is already loaded by the main db list + DBMap::DBCachePtr p = m_dbmap->GetDBCache(m_current_dbname); + if( !p.get() ) + return; + + DBCache::iterator source = p->Get(m_current_record_item); + DBCache::iterator i = p->Add(m_parent, source); + if( i != p->end() ) { + wxString text((*i)->GetDescription().c_str(), wxConvUTF8); + + // insert new record in same spot as DBCache has it + m_current_record_item = p->GetIndex(i); + m_record_list->InsertItem(m_current_record_item, text); + } +} + +void BrowseMode::OnEditRecord(wxCommandEvent &event) +{ + // grab the cache for the current database... Get is ok here, + // since the cache is already loaded by the main db list + DBMap::DBCachePtr p = m_dbmap->GetDBCache(m_current_dbname); + if( !p.get() ) + return; + + DBCache::iterator i = p->Get(m_current_record_item); + if( p->Edit(m_parent, i) ) { + wxString text((*i)->GetDescription().c_str(), wxConvUTF8); + m_record_list->SetItem(m_current_record_item, 0, text); + } +} + +void BrowseMode::OnDeleteRecord(wxCommandEvent &event) +{ + // grab the cache for the current database... Get is ok here, + // since the cache is already loaded by the main db list + DBMap::DBCachePtr p = m_dbmap->GetDBCache(m_current_dbname); + if( !p.get() ) + return; + + DBCache::iterator i = p->Get(m_current_record_item); + if( p->Delete(m_parent, i) ) { + m_record_list->DeleteItem(m_current_record_item); + } +} + diff -Nru barry-0.14/desktop/src/Mode_Browse.h barry-0.0.20110506/desktop/src/Mode_Browse.h --- barry-0.14/desktop/src/Mode_Browse.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_Browse.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,370 @@ +/// +/// \file Mode_Browse.h +/// Mode derived class for database browsing +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_MODE_BROWSE_H__ +#define __BARRYDESKTOP_MODE_BROWSE_H__ + +#include "Mode.h" +#include "util.h" +#include +#include +#include +#include + +class GUIDesktopConnector : public Barry::DesktopConnector +{ + wxWindow *m_parent; + +public: + GUIDesktopConnector(wxWindow *parent, const char *password, + const std::string &locale, const Barry::ProbeResult &result) + : Barry::DesktopConnector(password, locale, result) + , m_parent(parent) + { + } + + virtual bool PasswordPrompt(const Barry::BadPassword &bp, + std::string &password_result); +}; + +// Holds the "right" to use the desktop, and this right expires with the +// scope of this class, and no other code can use it while this object exists. +// +// Is copied around by the below auto_ptr<> +class DesktopInstance +{ +private: + Barry::scoped_lock m_lock; + + // external interfaces... owned by caller + GUIDesktopConnector &m_gdc; + +public: + explicit DesktopInstance(pthread_mutex_t &mutex, + GUIDesktopConnector &gdc) + : m_lock(mutex) + , m_gdc(gdc) + { + } + + GUIDesktopConnector& Connector() { return m_gdc; } + Barry::Mode::Desktop& Desktop() { return m_gdc.GetDesktop(); } + Barry::IConverter& IC() { return m_gdc.GetIConverter(); } +}; + +typedef std::auto_ptr DesktopInstancePtr; + +class ThreadableDesktop +{ +private: + pthread_mutex_t m_mutex; + + // external interfaces... owned by caller + GUIDesktopConnector &m_gdc; + +public: + explicit ThreadableDesktop(GUIDesktopConnector &gdc) + : m_gdc(gdc) + { + if( pthread_mutex_init(&m_mutex, NULL) ) { + throw Barry::Error("Failed to create mutex for ThreadableDesktop"); + } + } + + DesktopInstancePtr Get() + { + return DesktopInstancePtr( + new DesktopInstance(m_mutex, m_gdc)); + } +}; + +class DataCache +{ +public: + typedef Barry::RecordStateTable::IndexType IndexType; + +private: + IndexType m_state_index; + uint32_t m_record_id; + +public: + DataCache(IndexType state_index, uint32_t record_id) + : m_state_index(state_index) + , m_record_id(record_id) + { + } + + virtual ~DataCache() {} + + virtual IndexType GetStateIndex() const { return m_state_index; } + virtual uint32_t GetRecordId() const { return m_record_id; } + virtual void SetIds(IndexType state_index, uint32_t record_id) + { + std::cout << "DataCache::SetIds(" << state_index << ", " << record_id << ");" << std::endl; + m_state_index = state_index; + m_record_id = record_id; + } + + // set editable to false if you just want to view record + // non-buildable records will always be non-editable regardless + virtual bool Edit(wxWindow *parent, bool editable) = 0; + virtual std::string GetDescription() const = 0; + + virtual bool IsBuildable() const { return false; } + + bool operator< (const DataCache &other) + { + return GetDescription() < other.GetDescription(); + } + +}; + +typedef std::tr1::shared_ptr DataCachePtr; + +class DBDataCache : public DataCache +{ + Barry::DBData m_raw; + +public: + DBDataCache(DataCache::IndexType index, const Barry::DBData &raw); + + virtual bool Edit(wxWindow *parent, bool editable); + virtual std::string GetDescription() const; +}; + +// returns true if GUI indicates change (i.e. if dialogreturns wxID_OK) +#undef HANDLE_PARSER +#define HANDLE_PARSER(dbname) \ + bool EditRecord(wxWindow *parent, bool editable, Barry::dbname &rec); +ALL_KNOWN_PARSER_TYPES + +template +class RecordCache + : public DataCache + , public Barry::Builder +{ +private: + RecordT m_rec; + +public: + RecordCache(DataCache::IndexType index, const RecordT &rec) + : DataCache(index, rec.GetUniqueId()) + , m_rec(rec) + { + // if copying from another record, don't copy what + // we don't understand + m_rec.Unknowns.clear(); + } + + const RecordT& GetRecord() const { return m_rec; } + + // hook SetIds() to grab any new record_ids / UniqueIDs + virtual void SetIds(IndexType state_index, uint32_t record_id) + { + std::cout << "RecordCache::SetIds(" << state_index << ", " << record_id << ");" << std::endl; + DataCache::SetIds(state_index, record_id); + m_rec.SetIds(RecordT::GetDefaultRecType(), record_id); + } + + virtual bool Edit(wxWindow *parent, bool editable) + { + RecordT copy = m_rec; + bool changed = EditRecord(parent, editable, copy); + if( changed && editable ) { + m_rec = copy; + return true; + } + return false; + } + + virtual std::string GetDescription() const + { + return m_rec.GetDescription(); + } + + virtual bool IsBuildable() const + { + return ::IsBuildable(); + } + + // + // Barry::Builder overrides + // + virtual bool BuildRecord(Barry::DBData &data, size_t &offset, + const Barry::IConverter *ic) + { + Barry::SetDBData(m_rec, data, offset, ic); + return true; + } + + virtual bool FetchRecord(Barry::DBData &data, + const Barry::IConverter *ic) + { + size_t offset = 0; + Barry::SetDBData(m_rec, data, offset, ic); + return true; + } + + virtual bool EndOfFile() const + { + return true; + } +}; + +class DBCache : public Barry::AllRecordStore, public Barry::Parser +{ +public: + typedef Barry::RecordStateTable::IndexType IndexType; + typedef std::list DataList; + typedef DataList::iterator iterator; + typedef DataList::const_iterator const_iterator; + +private: + ThreadableDesktop &m_tdesktop; + std::string m_dbname; + unsigned int m_dbid; + Barry::RecordStateTable m_state; + DataList m_records; + + // per-record load state + IndexType m_index; + +public: + // loads records in constructor + DBCache(ThreadableDesktop &tdesktop, const std::string &dbname); + virtual ~DBCache(); + + const std::string& GetDBName() { return m_dbname; } + + iterator Get(int list_offset); + const_iterator Get(int list_offset) const; + // returns the numeric index of the record, to keep with GUI + int GetIndex(iterator record) const; + int GetIndex(const_iterator record) const; + + iterator Add(wxWindow *parent, iterator copy_record); + bool Edit(wxWindow *parent, iterator record); + bool Delete(wxWindow *parent, iterator record); + + iterator begin() { return m_records.begin(); } + iterator end() { return m_records.end(); } + const_iterator begin() const { return m_records.begin(); } + const_iterator end() const { return m_records.end(); } + + // For Barry::AllRecordStore +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + virtual void operator() (const Barry::tname &); + ALL_KNOWN_PARSER_TYPES + + // For Barry::Parser + virtual void ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic); +}; + +class DBMap +{ +public: + typedef std::tr1::shared_ptr DBCachePtr; + typedef std::map MapType; + +private: + ThreadableDesktop &m_tdesktop; + MapType m_map; + pthread_mutex_t m_map_mutex; + +public: + DBMap(ThreadableDesktop &tdesktop); + + DBCachePtr LoadDBCache(const std::string &dbname); + DBCachePtr GetDBCache(const std::string &dbname); +}; + +class BrowseMode : public wxEvtHandler, public Mode +{ +private: + DECLARE_EVENT_TABLE() + +private: + wxWindow *m_parent; + + // device interface + std::auto_ptr m_con; + std::auto_ptr m_tdesktop; + std::auto_ptr m_dbmap; + Barry::DatabaseDatabase m_dbdb; + + // window controls + std::auto_ptr m_top_sizer; + std::auto_ptr m_dbdb_list; + std::auto_ptr m_record_list; + std::auto_ptr m_show_all_checkbox; + std::auto_ptr m_add_record_button; + std::auto_ptr m_copy_record_button; + std::auto_ptr m_edit_record_button; + std::auto_ptr m_delete_record_button; + + // misc supporting data + wxString m_device_id_str; + + // GUI state + bool m_buildable; // true if currently displayed db has + // a Builder available for it + bool m_show_all; // if true, show all databases in list + // instead of just the parsable ones + std::string m_current_dbname; + long m_current_record_item; + + // thread state + pthread_t m_cache_thread; + volatile bool m_abort_flag; + +protected: + void CreateControls(); + int GUItoDBDBIndex(int gui_index); + void FillDBDBList(); + void FillRecordList(const std::string &dbname); + void UpdateButtons(); + void FillCache(); + + // background thread function + static void* FillCacheThread(void *bobj); + +public: + BrowseMode(wxWindow *parent, const Barry::ProbeResult &device); + ~BrowseMode(); + + // virtual override events (derived from Mode) + wxString GetTitleText() const { return _T("Barry Database Browser"); } + + // window events + void OnDBDBListSelChange(wxListEvent &event); + void OnRecordListSelChange(wxListEvent &event); + void OnRecordListActivated(wxListEvent &event); + void OnShowAll(wxCommandEvent &event); + void OnAddRecord(wxCommandEvent &event); + void OnCopyRecord(wxCommandEvent &event); + void OnEditRecord(wxCommandEvent &event); + void OnDeleteRecord(wxCommandEvent &event); +}; + +#endif + diff -Nru barry-0.14/desktop/src/Mode.h barry-0.0.20110506/desktop/src/Mode.h --- barry-0.14/desktop/src/Mode.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,42 @@ +/// +/// \file Mode.h +/// Mode base class... each main button gets a mode +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_MODE_H__ +#define __BARRYDESKTOP_MODE_H__ + +#include + +class Mode +{ +public: + Mode() {} + virtual ~Mode() {} + + // events (called from BaseFrame) + virtual wxString GetTitleText() const { return _T("FIXME"); } + virtual void OnPaint(wxDC &dc) {} + virtual void OnMouseMotion(wxDC &dc, int x, int y) {} + virtual void OnLeftDown(wxDC &dc, int x, int y) {} + virtual void OnLeftUp(wxDC &dc, int x, int y) {} +}; + +#endif + diff -Nru barry-0.14/desktop/src/Mode_MainMenu.cc barry-0.0.20110506/desktop/src/Mode_MainMenu.cc --- barry-0.14/desktop/src/Mode_MainMenu.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_MainMenu.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,91 @@ +/// +/// \file Mode_MainMenu.cc +/// Mode derived class for the main menu buttons +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "Mode_MainMenu.h" +#include "BaseButtons.h" +#include "barrydesktop.h" +#include + +////////////////////////////////////////////////////////////////////////////// +// MainMenuMode + +MainMenuMode::MainMenuMode(wxWindow *parent) + : m_basebuttons( new BaseButtons(parent) ) +{ +} + +MainMenuMode::~MainMenuMode() +{ +} + +void MainMenuMode::UpdateScreenshot(const Barry::Pin &pin) +{ + // clear existing screenshot + m_screenshot = wxBitmap(); + + // fetch the new device's screenshot + try { + if( pin.Valid() ) { + int index = Barry::Probe::FindActive(wxGetApp().GetResults(), pin); + if( index != -1 ) { + wxBusyCursor wait; + m_screenshot = wxGetApp().GetScreenshot(wxGetApp().GetResults()[index]); + } + } + } + catch( Barry::Error & ) { + // don't worry if we can't get a screenshot... not all + // devices support it + } +} + +void MainMenuMode::OnPaint(wxDC &dc) +{ +static bool init = false; + + // paint the buttons + if( !init ) { + m_basebuttons->InitAll(dc); + init = true; + } + m_basebuttons->DrawAll(dc); + + // paint the screenshot if available + if( m_screenshot.IsOk() ) { + dc.DrawBitmap(m_screenshot, 410, 290); + } +} + +void MainMenuMode::OnMouseMotion(wxDC &dc, int x, int y) +{ + m_basebuttons->HandleMotion(dc, x, y); +} + +void MainMenuMode::OnLeftDown(wxDC &dc, int x, int y) +{ + m_basebuttons->HandleDown(dc, x, y); +} + +void MainMenuMode::OnLeftUp(wxDC &dc, int x, int y) +{ + m_basebuttons->HandleUp(dc, x, y); +} + diff -Nru barry-0.14/desktop/src/Mode_MainMenu.h barry-0.0.20110506/desktop/src/Mode_MainMenu.h --- barry-0.14/desktop/src/Mode_MainMenu.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_MainMenu.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,58 @@ +/// +/// \file Mode_MainMenu.h +/// Mode derived class for the main menu buttons +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_MODE_MAINMENU_H__ +#define __BARRYDESKTOP_MODE_MAINMENU_H__ + +#include +#include +#include "Mode.h" + +class BaseButtons; +namespace Barry { + class Pin; +} + +class MainMenuMode : public Mode +{ + std::auto_ptr m_basebuttons; + wxBitmap m_screenshot; + +public: + MainMenuMode(wxWindow *parent); + ~MainMenuMode(); + + void UpdateScreenshot(const Barry::Pin &pin); + + // events (called from BaseFrame) + wxString GetTitleText() const + { + return _T("Barry Desktop Control Panel"); + } + + void OnPaint(wxDC &dc); + void OnMouseMotion(wxDC &dc, int x, int y); + void OnLeftDown(wxDC &dc, int x, int y); + void OnLeftUp(wxDC &dc, int x, int y); +}; + +#endif + diff -Nru barry-0.14/desktop/src/Mode_Sync.cc barry-0.0.20110506/desktop/src/Mode_Sync.cc --- barry-0.14/desktop/src/Mode_Sync.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_Sync.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,735 @@ +/// +/// \file Mode_Sync.cc +/// Mode derived class for syncing +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "Mode_Sync.h" +#include "BaseFrame.h" +#include "GroupCfgDlg.h" +#include "SyncStatusDlg.h" +#include "barrydesktop.h" +#include "windowids.h" +#include + +using namespace std; + +BEGIN_EVENT_TABLE(SyncMode, wxEvtHandler) + EVT_BUTTON (SyncMode_SyncNowButton, SyncMode::OnSyncNow) + EVT_BUTTON (SyncMode_ConfigureButton, SyncMode::OnConfigure) + EVT_BUTTON (SyncMode_RunAppButton, SyncMode::OnRunApp) + EVT_BUTTON (SyncMode_1WayResetButton, SyncMode::On1WayReset) + EVT_LIST_ITEM_SELECTED(SyncMode_DeviceList, SyncMode::OnListSelChange) + EVT_LIST_ITEM_DESELECTED(SyncMode_DeviceList, SyncMode::OnListSelChange) + EVT_LIST_ITEM_ACTIVATED(SyncMode_DeviceList, SyncMode::OnConfigureDevice) +END_EVENT_TABLE() + +////////////////////////////////////////////////////////////////////////////// +// SyncMode + +SyncMode::SyncMode(wxWindow *parent) + : m_parent(parent) +{ + wxBusyCursor wait; + + wxSize client_size = parent->GetClientSize(); + + // create our list of devices + m_device_set.reset( new DeviceSet(wxGetApp().GetGlobalConfig(), + wxGetApp().GetOpenSync(), + wxGetApp().GetResults()) ); + barryverbose(*m_device_set); + + // eliminate all duplicate device entries + DeviceSet::subset_type subset; + do { + subset = m_device_set->FindDuplicates(); + if( subset.size() ) { + // build list of choices + wxArrayString choices; + DeviceSet::subset_type::iterator i = subset.begin(); + for( ; i != subset.end(); ++i ) { + string desc = (*i)->GetIdentifyingString(); + choices.Add( wxString(desc.c_str(), wxConvUTF8) ); + } + + // let the user choose + // FIXME - the width of the choice dialog is + // determined by the length of the string... + // which is less than ideal + int choice = wxGetSingleChoiceIndex(_T("Multiple configurations have been found with the same PIN. Please select\nthe configuration that Barry Desktop should work with."), + _T("Duplicate PIN"), + choices, parent); + + // remove everything except keep + if( choice != -1 ) { + subset.erase(subset.begin() + choice); + } + + m_device_set->KillDuplicates(subset); + + barryverbose(*m_device_set); + } + } while( subset.size() ); + + // + // create the window controls we need + // + + m_topsizer.reset( new wxBoxSizer(wxVERTICAL) ); + + // make space for the main header, which is not part of our + // work area + m_topsizer->AddSpacer(MAIN_HEADER_OFFSET); + + // add status area + m_topsizer->AddSpacer(5); + m_sync_now_button.reset( new wxButton(parent, + SyncMode_SyncNowButton, _T("Sync Now"))); + m_topsizer->Add( m_sync_now_button.get(), + 0, wxRIGHT | wxALIGN_RIGHT, 10 ); + m_topsizer->AddSpacer(90); +// m_label.reset( new wxStaticText(parent, -1, _T("Static Text"), +// wxPoint(15, 100)) ); + + // add device list + wxStaticBoxSizer *box = new wxStaticBoxSizer(wxHORIZONTAL, parent, + _T("Device List")); + m_device_list.reset (new wxListCtrl(parent, SyncMode_DeviceList, + wxDefaultPosition, wxDefaultSize, + wxLC_REPORT /*| wxLC_VRULES*/) ); + box->Add( m_device_list.get(), 1, wxEXPAND | wxALL, 4 ); + m_topsizer->Add(box, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 10 ); + + // add bottom buttons - these go in the bottom FOOTER area + // so their heights must be fixed to MAIN_HEADER_OFFSET + // minus a border of 5px top and bottom + wxSize footer(-1, MAIN_HEADER_OFFSET - 5 - 5); + wxBoxSizer *buttons = new wxBoxSizer(wxHORIZONTAL); + m_run_app_button.reset( new wxButton(parent, + SyncMode_RunAppButton, _T("Run App"), + wxDefaultPosition, footer)); + m_configure_button.reset( new wxButton(parent, + SyncMode_ConfigureButton, _T("Configure..."), + wxDefaultPosition, footer) ); + m_1way_reset_button.reset( new wxButton(parent, + SyncMode_1WayResetButton, _T("1 Way Reset..."), + wxDefaultPosition, footer) ); + buttons->Add(m_run_app_button.get(), 0, wxRIGHT, 5 ); + buttons->Add(m_configure_button.get(), 0, wxRIGHT, 5 ); + buttons->Add(m_1way_reset_button.get(), 0, wxRIGHT, 5 ); + m_topsizer->Add(buttons, 0, wxALL | wxALIGN_RIGHT, 5 ); + + // recalc size of children + m_topsizer->SetDimension(0, 0, + client_size.GetWidth(), client_size.GetHeight()); + + // insert list columns based on the new list size + wxSize list_size = m_device_list->GetSize(); + int timestamp_width = GetMaxTimestampWidth(m_device_list.get()); + // FIXME - for some reason, even with the width calculated, + // when displayed in the listctrl, there's not enough space... + // possibly because there's space between columns... I don't + // know how to calculate the column inter-space size, so add + // a constant here :-( + timestamp_width += 8; + int usable_width = list_size.GetWidth() - timestamp_width; + m_device_list->InsertColumn(0, _T("PIN"), + wxLIST_FORMAT_LEFT, usable_width * 0.16); + m_device_list->InsertColumn(1, _T("Name"), + wxLIST_FORMAT_LEFT, usable_width * 0.33); + m_device_list->InsertColumn(2, _T("Connected"), + wxLIST_FORMAT_CENTRE, usable_width * 0.16); + m_device_list->InsertColumn(3, _T("Application"), + wxLIST_FORMAT_CENTRE, usable_width * 0.18); + m_device_list->InsertColumn(4, _T("Engine"), + wxLIST_FORMAT_CENTRE, usable_width * 0.17); + m_device_list->InsertColumn(5, _T("Last Sync"), + wxLIST_FORMAT_CENTRE, timestamp_width); + + FillDeviceList(); + + // attempt to re-select the devices as we last saw them + ReselectDevices(m_device_set->String2Subset(wxGetApp().GetGlobalConfig().GetKey("SelectedDevices"))); + UpdateButtons(); + + // connect ourselves to the parent's event handling chain + // do this last, so that we are guaranteed our destructor + // will run, in case of exceptions + m_parent->PushEventHandler(this); +} + +SyncMode::~SyncMode() +{ + m_parent->PopEventHandler(); + + // save selected devices for later + wxGetApp().GetGlobalConfig().SetKey("SelectedDevices", + DeviceSet::Subset2String(GetSelectedDevices())); +} + +std::string SyncMode::Timestamp(time_t last_sync) +{ + string ret; + struct tm local; + if( localtime_r(&last_sync, &local) != NULL ) { + char timestamp[20]; + strftime(timestamp, sizeof(timestamp), "%b %d, %H:%M", &local); + ret = timestamp; + } + return ret; +} + +int SyncMode::GetMaxTimestampWidth(wxWindow *win) +{ + int max_width = 0; + DeviceSet::const_iterator i = m_device_set->begin(); + for( ; i != m_device_set->end(); ++i ) { + int this_width = 0; + int this_height = 0; + if( i->GetExtras() ) { + time_t last_sync = i->GetExtras()->m_last_sync_time; + if( last_sync ) { + win->GetTextExtent(wxString(Timestamp(last_sync).c_str(), wxConvUTF8), &this_width, &this_height); + } + } + + max_width = max(max_width, this_width); + } + + return max_width; +} + +void SyncMode::FillDeviceList() +{ + // start fresh + m_device_list->DeleteAllItems(); + + DeviceSet::const_iterator i = m_device_set->begin(); + for( int index = 0; i != m_device_set->end(); ++i, index++ ) { + // PIN number + wxString text(i->GetPin().Str().c_str(), wxConvUTF8); + long item = m_device_list->InsertItem(index, text); + + // Device name + text = wxString(i->GetDeviceName().c_str(), wxConvUTF8); + m_device_list->SetItem(item, 1, text); + + // Connected? + text = i->IsConnected() ? _T("Yes") : _T("No"); + m_device_list->SetItem(item, 2, text); + + // Configured? + if( i->IsConfigured() ) { + text = wxString(i->GetAppNames().c_str(), wxConvUTF8); + } + else { + text = _T("(No config)"); + } + m_device_list->SetItem(item, 3, text); + + // Engine + if( i->GetEngine() ) + text = wxString(i->GetEngine()->GetVersion(), wxConvUTF8); + else + text = _T(""); + m_device_list->SetItem(item, 4, text); + + // Last Sync + if( i->GetExtras() ) { + time_t last_sync = i->GetExtras()->m_last_sync_time; + if( last_sync ) { + wxString ts(Timestamp(last_sync).c_str(), wxConvUTF8); + m_device_list->SetItem(item, 5, ts); + } + } + } + + UpdateButtons(); +} + +void SyncMode::UpdateButtons() +{ + int selected_count = m_device_list->GetSelectedItemCount(); + + // update the SyncNow button (only on if anything is selected) + m_sync_now_button->Enable(selected_count > 0); + m_configure_button->Enable(selected_count == 1); + m_run_app_button->Enable(selected_count == 1); + m_1way_reset_button->Enable(selected_count == 1); + + // if only one item is selected, enable RunApp button + bool enable_run_app = false; + if( selected_count == 1 ) { + // good, only one is selected, find out which one + long item = -1; + item = m_device_list->GetNextItem(item, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); + + if( item != -1 ) { + DeviceEntry &entry = (*m_device_set)[item]; + if( entry.GetAppNames().size() ) { + // has application configured! + enable_run_app = true; + } + } + } + m_run_app_button->Enable(enable_run_app); +} + +DeviceSet::subset_type SyncMode::GetSelectedDevices() +{ + DeviceSet::subset_type subset; + + long item = -1; + do { + item = m_device_list->GetNextItem(item, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); + + if( item != -1 ) { + subset.push_back(m_device_set->begin() + item); + } + } while( item != -1 ); + + return subset; +} + +void SyncMode::ReselectDevices(const DeviceSet::subset_type &set) +{ + for( long item = m_device_list->GetNextItem(-1); item != -1; + item = m_device_list->GetNextItem(item) ) + { + bool selected = DeviceSet::FindPin(set, (*m_device_set)[item].GetPin()) != set.end(); + + m_device_list->SetItemState(item, + selected ? wxLIST_STATE_SELECTED : 0, + wxLIST_STATE_SELECTED); + } +} + +void SyncMode::ConfigureDevice(int device_index) +{ + DeviceEntry &entry = (*m_device_set)[device_index]; + ConfigureDevice(entry); +} + +void SyncMode::ConfigureDevice(DeviceEntry &entry) +{ + // make sure it's not already running + if( m_cui.get() && m_cui->IsAppRunning() ) { + wxMessageBox(_T("An application is currently running."), + _T("Run App Error"), wxOK | wxICON_ERROR); + return; + } + + GroupCfgDlg dlg(m_parent, entry, wxGetApp().GetOpenSync()); + if( dlg.ShowModal() == wxID_OK && + dlg.GetEngine() && + dlg.GetGroup().get() && + dlg.GetExtras().get() ) + { + bool skip_rewrite = false; + bool delete_old = false; + + // does old group exist? + if( entry.GetEngine() && + entry.GetConfigGroup() && + entry.GetConfigGroup()->GroupExists(*entry.GetEngine()) ) + { + // yes, is the new group equal? + string v1 = entry.GetEngine()->GetVersion(); + string v2 = dlg.GetEngine()->GetVersion(); + skip_rewrite = (v1 == v2 && + dlg.GetGroup()->Compare(*entry.GetConfigGroup())); + + if( skip_rewrite ) { + // config is the same, don't bother saving again + barryverbose("Config is the same, skipping save"); + } + else { + // clean up after ourselves... if the new + // config uses a different engine, delete + // the config on the old engine + if( entry.GetEngine() != dlg.GetEngine() ) { + delete_old = true; + } + } + } + + if( !skip_rewrite ) try { + + OpenSync::API *eng = dlg.GetEngine(); + DeviceEntry::group_ptr grp = dlg.GetGroup(); + + // make sure that the save will be successful + if( grp->GroupExists(*eng) ) { + if( !grp->GroupMatchesExistingConfig(*eng) ) { + if( WarnAbout1WayReset() ) { + eng->DeleteGroup(grp->GetGroupName()); + grp->DisconnectMembers(); + } + else { + // skip save + return; + } + } + else { + // group we want to save has the + // same set of plugins and member IDs + // as the one already there... + // so do not disconnect members + } + } + else { + // we are saving a brand new group, so make + // sure that all members are new + grp->DisconnectMembers(); + } + + // save the new one + grp->Save(*dlg.GetEngine()); + + // clean up the old engine's group, so we don't leave + // garbage behind... do this after a successful + // save, so that we don't delete existing knowledge + // before we've crossed over + if( delete_old ) { + barryverbose("Engine change detected in config: deleting old config '" << entry.GetConfigGroup()->GetGroupName() << "' from engine " << entry.GetEngine()->GetVersion() << " in order to save it to engine " << dlg.GetEngine()->GetVersion()); + entry.GetEngine()->DeleteGroup(entry.GetConfigGroup()->GetGroupName()); + } + + } + catch( OpenSync::Config::SaveError &se ) { + barryverbose("Exception during save: " << se.what()); + wxString msg = _T("Unable to save configuration for this device.\nError: "); + msg += wxString(se.what(), wxConvUTF8); + wxMessageBox(msg, _T("OpenSync Save Error"), + wxOK | wxICON_ERROR); + return; + } + + // save the extras... this is cheap, so no need to check + // skip_rewrite + dlg.GetExtras()->Save(wxGetApp().GetGlobalConfig(), + dlg.GetGroup()->GetGroupName()); + + // update the device set + entry.SetConfigGroup(dlg.GetGroup(), dlg.GetEngine(), + dlg.GetExtras()); + entry.SetDeviceName(dlg.GetDeviceName()); + + // update! + RefillList(); + } +} + +void SyncMode::CheckConfigured(DeviceSet::subset_type &subset) +{ + for( DeviceSet::subset_type::iterator i = subset.begin(); + i != subset.end(); + ++i ) + { + DeviceEntry &device = *(*i); + if( !device.IsConnected() ) + continue; + if( device.IsConfigured() ) + continue; + + ostringstream msg; + msg << "Selected device " << device.GetPin().Str() + << " (" << device.GetDeviceName() << ")" + << " is not yet configured. Configure now?"; + + int response = wxMessageBox( + wxString(msg.str().c_str(),wxConvUTF8), + _T("Configure Now?"), wxYES_NO, m_parent); + if( response == wxYES ) { + ConfigureDevice(device); + } + } +} + +void SyncMode::RefillList() +{ + DeviceSet::subset_type subset = GetSelectedDevices(); + FillDeviceList(); + ReselectDevices(subset); +} + +int SyncMode::GetSelectedDevice() +{ + if( m_device_list->GetSelectedItemCount() != 1 ) { + wxMessageBox(_T("Please select one device from the list."), + _T("Device List"), wxOK | wxICON_ERROR); + return -1; + } + + // find selected device + long item = -1; + item = m_device_list->GetNextItem(item, wxLIST_NEXT_ALL, + wxLIST_STATE_SELECTED); + return item; +} + +// +// Returns an index into the config group for the given device index +// that represents the authoritative side of the sync. This means +// that during the 1-Way Reset, the plugin at this index must NOT +// be zapped! All the others must be zapped. +// +// Returns -1 if the user cancels, or if not enough data to decide. +// +int SyncMode::GetAuthoritativeSide(int device_index) +{ + // grab the device entry and group config + DeviceEntry &entry = (*m_device_set)[device_index]; + OpenSync::Config::Group *group = entry.GetConfigGroup(); + if( !group ) + return -1; + + // build message + wxString intro(_T( + "Which device / application should be considered\n" + "authoritative?\n" + "\n" + "All data in non-authoritative devices / applications\n" + "will be deleted in order to setup a straight copy on\n" + "the next sync.")); + + // build list of devices / applications + wxArrayString list; + OpenSync::Config::Group::iterator gi = group->begin(); + for( ; gi != group->end(); ++gi ) { + // the Barry plugin is special + if( dynamic_cast( (*gi).get() ) ) { + // this is a Barry plugin, so display the + // device name, not the plugin name + string device_name = entry.GetPin().Str(); + if( entry.GetDeviceName().size() ) + device_name += " (" + entry.GetDeviceName() + ")"; + + list.Add( wxString(device_name.c_str(), wxConvUTF8) ); + } + else { + // add the application name + list.Add( wxString((*gi)->GetAppName().c_str(), + wxConvUTF8) ); + } + } + + // ask the user + int choice = wxGetSingleChoiceIndex(intro, + _T("Select Authoritative Device / Application"), + list, m_parent); + return choice; +} + +bool SyncMode::ZapConflicts(int device_index, int authoritative_side) +{ + // grab the device entry and group config + DeviceEntry &entry = (*m_device_set)[device_index]; + OpenSync::Config::Group *group = entry.GetConfigGroup(); + if( !group ) + return false; + + // cycle through list of sync plugins, zapping each + // non-authoritative one + OpenSync::Config::Group::iterator gi = group->begin(); + for( int i = 0; gi != group->end(); ++gi, ++i ) { + + // skip the authoritative plugin! + if( i == authoritative_side ) + continue; + + OpenSync::Config::Plugin &plugin = *(*gi); + + // create a configUI object, for zapping + ConfigUI::ptr ui = ConfigUI::CreateConfigUI(plugin.GetAppName()); + if( !ui.get() ) { + // no possibility for zapping here... so just + // assume that it doesn't need it for now... + // worst that can happen, should be it slow-syncs + // all the time + continue; + } + + bool success = ui->ZapData(m_parent, *gi, entry.GetEngine()); + if( !success ) { + // if the user cancels one, cancel all the rest + return false; + } + } + + // if we reach this, we succeeded + return true; +} + +void SyncMode::RewriteConfig(int device_index) +{ + // grab the device entry and group config + DeviceEntry &entry = (*m_device_set)[device_index]; + OpenSync::Config::Group *group = entry.GetConfigGroup(); + OpenSync::API *engine = entry.GetEngine(); + if( !group || !engine ) + return; + + string group_name = group->GetGroupName(); + + try { + // delete the existing group name + engine->DeleteGroup(group_name); + + // disconnect the plugins from the group, to + // make them "new" again + group->DisconnectMembers(); + + // save + group->Save(*engine); + + // success! + barryverbose(group_name << " group config rewritten"); + return; + } + catch( std::runtime_error &re ) { + ostringstream oss; + oss << "Unable to rewrite config! Start over manually. " + "Error: " << re.what(); + wxString msg(oss.str().c_str(), wxConvUTF8); + + wxMessageBox(msg, _T("Error Rewriting Config"), + wxOK | wxICON_ERROR, m_parent); + } + + // if we get here, the group is in an undefined state, + // so delete it to make sure nothing odd is left behind + try { + engine->DeleteGroup(group_name); + } + catch( std::runtime_error &re ) { + barryverbose("Error while deleting undefined group '" << group_name << "': " << re.what()); + } +} + +bool SyncMode::WarnAbout1WayReset() +{ + int answer = wxMessageBox( _T("The sync config you are about to save " + "is sufficiently different from the existing one that " + "a 1-Way Reset will be required. You will need to " + "perform the reset at your earliest convenience, before " + "your next sync.\n\n" + "Continue anyway?"), + _T("1-Way Reset Warning"), + wxYES_NO | wxICON_QUESTION, m_parent); + return answer == wxYES; +} + +void SyncMode::OnSyncNow(wxCommandEvent &event) +{ + DeviceSet::subset_type subset = GetSelectedDevices(); + if( subset.size() == 0 ) + return; // nothing to do + + // make sure an app is not running + if( m_cui.get() && m_cui->IsAppRunning() ) { + wxMessageBox(_T("An application is currently running."), + _T("Sync Error"), wxOK | wxICON_ERROR); + return; + } + + // check that all selections are configured + CheckConfigured(subset); + + // do the sync + SyncStatusDlg dlg(m_parent, subset); + dlg.ShowModal(); + + // update the timestamps + RefillList(); +} + +void SyncMode::OnConfigure(wxCommandEvent &event) +{ + int item = GetSelectedDevice(); + if( item != -1 ) + ConfigureDevice(item); +} + +void SyncMode::OnRunApp(wxCommandEvent &event) +{ + // make sure it's not already running + if( m_cui.get() && m_cui->IsAppRunning() ) { + wxMessageBox(_T("An application is already running."), + _T("Run App Error"), wxOK | wxICON_ERROR); + return; + } + + // find selected device + int item = GetSelectedDevice(); + if( item == -1 ) + return; + + // retrieve device's group config + DeviceEntry &entry = (*m_device_set)[item]; + OpenSync::Config::Plugin *plugin = 0; + if( entry.GetConfigGroup() ) + plugin = entry.GetConfigGroup()->GetNonBarryPlugin(); + if( !plugin ) + return; + + // run the app + m_cui = ConfigUI::CreateConfigUI(plugin->GetAppName()); + if( m_cui.get() ) + m_cui->RunApp(m_parent); +} + +void SyncMode::On1WayReset(wxCommandEvent &event) +{ + int item = GetSelectedDevice(); + if( item == -1 ) + return; + + // let user pick the authoritative side of the sync + int side = GetAuthoritativeSide(item); + if( side == -1 ) + return; + + // zap the data of all remaining sync elements + if( !ZapConflicts(item, side) ) + return; + + // rewrite the config + RewriteConfig(item); + + // reload the deviceset + RefillList(); + + // tell the user all's well + wxMessageBox(_T("1-Way Reset is complete, and ready to sync."), + _T("Reset Complete"), wxOK | wxICON_INFORMATION, m_parent); +} + +void SyncMode::OnListSelChange(wxListEvent &event) +{ + UpdateButtons(); +} + +void SyncMode::OnConfigureDevice(wxListEvent &event) +{ + ConfigureDevice(event.GetIndex()); +} + diff -Nru barry-0.14/desktop/src/Mode_Sync.h barry-0.0.20110506/desktop/src/Mode_Sync.h --- barry-0.14/desktop/src/Mode_Sync.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/Mode_Sync.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,85 @@ +/// +/// \file Mode_Sync.h +/// Mode derived class for syncing +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_MODE_SYNC_H__ +#define __BARRYDESKTOP_MODE_SYNC_H__ + +#include "Mode.h" +#include "deviceset.h" +#include "configui.h" + +class SyncMode : public wxEvtHandler, public Mode +{ +private: + DECLARE_EVENT_TABLE() + +private: + wxWindow *m_parent; + + std::auto_ptr m_device_set; + ConfigUI::ptr m_cui; + + // window controls + std::auto_ptr m_topsizer; + std::auto_ptr m_sync_now_button; + std::auto_ptr m_configure_button; + std::auto_ptr m_run_app_button; + std::auto_ptr m_1way_reset_button; + std::auto_ptr m_device_list; + +protected: + static std::string Timestamp(time_t last_sync); + + int GetMaxTimestampWidth(wxWindow *win); + void FillDeviceList(); + void UpdateButtons(); + DeviceSet::subset_type GetSelectedDevices(); + void ReselectDevices(const DeviceSet::subset_type &set); + void ConfigureDevice(int device_index); + void ConfigureDevice(DeviceEntry &entry); + void CheckConfigured(DeviceSet::subset_type &subset); + void RefillList(); + int GetSelectedDevice(); // returns index, or -1 if none or + // more than one selected... also + // handles the message box + int GetAuthoritativeSide(int device_index); + bool ZapConflicts(int device_index, int authoritative_side); + void RewriteConfig(int device_index); + bool WarnAbout1WayReset(); + +public: + SyncMode(wxWindow *parent); + ~SyncMode(); + + // virtual override events (derived from Mode) + wxString GetTitleText() const { return _T("Barry Sync"); } + + // window events + void OnSyncNow(wxCommandEvent &event); + void OnConfigure(wxCommandEvent &event); + void OnRunApp(wxCommandEvent &event); + void On1WayReset(wxCommandEvent &event); + void OnListSelChange(wxListEvent &event);//to keep track of button state + void OnConfigureDevice(wxListEvent &event); +}; + +#endif + diff -Nru barry-0.14/desktop/src/null-os22.cc barry-0.0.20110506/desktop/src/null-os22.cc --- barry-0.14/desktop/src/null-os22.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/null-os22.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,223 @@ +/// +/// \file null-os22.cc +/// Null wrapper class for when opensync 0.22 is not available +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "os22.h" +#include "osconv22.h" + +namespace OpenSync { + +///////////////////////////////////////////////////////////////////////////// +// OpenSync22 - public members + +bool OpenSync22::symbols_loaded = false; + +OpenSync22::OpenSync22() +{ + throw std::runtime_error("OpenSync 0.22 support was not compiled in."); +} + +OpenSync22::~OpenSync22() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// Null implementations + +const char* OpenSync22::GetVersion() const +{ + return 0; +} + +const char* OpenSync22::GetEngineName() const +{ + return "0.22"; +} + +void OpenSync22::GetPluginNames(string_list_type &plugins) +{ +} + +void OpenSync22::GetFormats(format_list_type &formats) +{ +} + +void OpenSync22::GetGroupNames(string_list_type &groups) +{ +} + +void OpenSync22::GetMembers(const std::string &group_name, + member_list_type &members) +{ +} + +void OpenSync22::AddGroup(const std::string &group_name) +{ +} + +void OpenSync22::DeleteGroup(const std::string &group_name) +{ +} + +Converter& OpenSync22::GetConverter() +{ + throw std::logic_error("Not supported on this system."); +} + +long OpenSync22::AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name) +{ + return 0; +} + +bool OpenSync22::IsConfigurable(const std::string &group_name, + long member_id) +{ + return false; +} + +std::string OpenSync22::GetConfiguration(const std::string &group_name, + long member_id) +{ + return ""; +} + +void OpenSync22::SetConfiguration(const std::string &group_name, + long member_id, const std::string &config_data) +{ +} + +void OpenSync22::Discover(const std::string &group_name) +{ +} + +void OpenSync22::Sync(const std::string &group_name, + SyncStatus &status_callback) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// Null Converter class + +Converter22::Converter22(OpenSync::API &api) + : m_api(api) +{ +} + +bool Converter22::IsPluginSupported(const std::string &plugin_name, + std::string *appname) const +{ + return false; +} + +Converter::plugin_ptr Converter22::CreateAndLoadPlugin(const Member &member) +{ + return Converter::plugin_ptr(); +} + +std::string Converter22::GetPluginName(const Config::Barry &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter22::GetPluginName(const Config::Evolution &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter22::GetPluginName(const Config::Google &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter22::GetPluginName(const Config::Unsupported &) const +{ + throw std::logic_error("Not supported on this system."); +} + +bool Converter22::IsConfigured(const Config::Barry &) const +{ + return false; +} + +bool Converter22::IsConfigured(const Config::Evolution &) const +{ + return false; +} + +bool Converter22::IsConfigured(const Config::Google &) const +{ + return false; +} + +bool Converter22::IsConfigured(const Config::Unsupported &) const +{ + return false; +} + +void Converter22::Load(Config::Barry &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter22::GrabField(const std::string &cfg, + const std::string &name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Load(Config::Evolution &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Load(Config::Google &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Load(Config::Unsupported &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Save(const Config::Barry &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Save(const Config::Evolution &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Save(const Config::Google &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter22::Save(const Config::Unsupported &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +} + diff -Nru barry-0.14/desktop/src/null-os40.cc barry-0.0.20110506/desktop/src/null-os40.cc --- barry-0.14/desktop/src/null-os40.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/null-os40.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,224 @@ +/// +/// \file null-os40.cc +/// Null wrapper class for with opensync 0.4x is not available +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "os40.h" +#include "osconv40.h" + +namespace OpenSync { + +///////////////////////////////////////////////////////////////////////////// +// OpenSync40 - public members + +OpenSync40::OpenSync40() +{ + throw std::runtime_error("OpenSync 0.4x support was not compiled in."); +} + +OpenSync40::~OpenSync40() +{ +} + +///////////////////////////////////////////////////////////////////////////// +// Null implementations + +const char* OpenSync40::GetVersion() const +{ + return 0; +} + +const char* OpenSync40::GetEngineName() const +{ + return "0.40"; +} + +void OpenSync40::GetPluginNames(string_list_type &plugins) +{ +} + +void OpenSync40::GetFormats(format_list_type &formats) +{ +} + +void OpenSync40::GetGroupNames(string_list_type &groups) +{ +} + +void OpenSync40::GetMembers(const std::string &group_name, + member_list_type &members) +{ +} + +void OpenSync40::AddGroup(const std::string &group_name) +{ +} + +void OpenSync40::DeleteGroup(const std::string &group_name) +{ +} + +Converter& OpenSync40::GetConverter() +{ + throw std::logic_error("Not supported on this system."); +} + +long OpenSync40::AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name) +{ + return 0; +} + +void OpenSync40::DeleteMember(const std::string &group_name, long member_id) +{ +} + +void OpenSync40::DeleteMember(const std::string &group_name, + const std::string &plugin_name) +{ +} + +bool OpenSync40::IsConfigurable(const std::string &group_name, + long member_id) +{ + return false; +} + +std::string OpenSync40::GetConfiguration(const std::string &group_name, + long member_id) +{ + return ""; +} + +void OpenSync40::SetConfiguration(const std::string &group_name, + long member_id, const std::string &config_data) +{ +} + +void OpenSync40::Discover(const std::string &group_name) +{ +} + +void OpenSync40::Sync(const std::string &group_name, + SyncStatus &status_callback) +{ +} + +////////////////////////////////////////////////////////////////////////////// +// Null Converter40 + +Converter40::Converter40(OpenSync::OpenSync40 &api) + : m_api(api) +{ +} + +bool Converter40::IsPluginSupported(const std::string &plugin_name, + std::string *appname) const +{ + return false; +} + +Converter::plugin_ptr Converter40::CreateAndLoadPlugin(const Member &member) +{ + return Converter::plugin_ptr(); +} + +std::string Converter40::GetPluginName(const Config::Barry &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter40::GetPluginName(const Config::Evolution &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter40::GetPluginName(const Config::Google &) const +{ + throw std::logic_error("Not supported on this system."); +} + +std::string Converter40::GetPluginName(const Config::Unsupported &) const +{ + throw std::logic_error("Not supported on this system."); +} + +bool Converter40::IsConfigured(const Config::Barry &) const +{ + return false; +} + +bool Converter40::IsConfigured(const Config::Evolution &) const +{ + return false; +} + +bool Converter40::IsConfigured(const Config::Google &) const +{ + return false; +} + +bool Converter40::IsConfigured(const Config::Unsupported &) const +{ + return false; +} + +void Converter40::Load(Config::Barry &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Load(Config::Evolution &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Load(Config::Google &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Load(Config::Unsupported &config, const Member &member) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Save(const Config::Barry &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Save(const Config::Evolution &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Save(const Config::Google &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +void Converter40::Save(const Config::Unsupported &config, const std::string &group_name) +{ + throw std::logic_error("Not supported on this system."); +} + +} + diff -Nru barry-0.14/desktop/src/oextract.cc barry-0.0.20110506/desktop/src/oextract.cc --- barry-0.14/desktop/src/oextract.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/oextract.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,149 @@ +// +// This is just experimentation code to figure out the config API in 0.4x +// +// Compile with: +// g++ -Wall -o oextract oextract.cc $(pkg-config --cflags --libs libopensync1) +// + +#include +#include +#include +#include +#include +using namespace std; + +#define NP(x) (x ? x : "(null)") + +OSyncGroupEnv *genv; +OSyncPluginEnv *penv; + +void get_advanced(OSyncPluginConfig *config, const char *name) +{ + cout << "Advanced: " << name << ": " + << NP(osync_plugin_config_get_advancedoption_value_by_name(config, name)) + << endl; +} + +void add_advanced(OSyncPluginConfig *config, + const char *name, + const char *display, + const char *value) +{ + OSyncError *ose = NULL; + OSyncPluginAdvancedOption *option = osync_plugin_advancedoption_new(&ose); + if( !option ) throw "bad option"; + osync_plugin_advancedoption_set_displayname(option, "Test Display Name"); + osync_plugin_advancedoption_set_name(option, "TestName"); + osync_plugin_advancedoption_set_type(option, OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_STRING); + osync_plugin_advancedoption_set_value(option, "Whippoorwill"); + osync_plugin_config_add_advancedoption(config, option); + osync_plugin_advancedoption_unref(option); +} + +void dump_resource(OSyncPluginResource *res) +{ + cout << "Resource: " + << NP(osync_plugin_resource_get_name(res)) + << ": " + << (osync_plugin_resource_is_enabled(res) ? "enabled" : "disabled"); + if( osync_plugin_resource_get_preferred_format(res) ) + cout << "\n pref format: " + << osync_plugin_resource_get_preferred_format(res); + + if( osync_plugin_resource_get_mime(res) ) + cout << "\n mime: " + << NP(osync_plugin_resource_get_mime(res)); + + if( osync_plugin_resource_get_objtype(res) ) + cout << "\n objtype: " + << NP(osync_plugin_resource_get_objtype(res)); + + if( osync_plugin_resource_get_path(res) ) + cout << "\n path: " + << NP(osync_plugin_resource_get_path(res)); + + if( osync_plugin_resource_get_url(res) ) + cout << "\n url: " + << NP(osync_plugin_resource_get_url(res)); + osync_plugin_resource_set_url(res, "http://whoopiecushion/"); + + cout << endl; +} + +void dump_resources(OSyncPluginConfig *config) +{ + OSyncList *resources = osync_plugin_config_get_resources(config); + for( OSyncList *o = resources; o; o = o->next ) { + OSyncPluginResource *res = (OSyncPluginResource*) o->data; + dump_resource(res); + } +} + +void test_member(OSyncGroup *group, int member_id) +{ + OSyncError *ose = NULL; + + cout << "Testing member: " << member_id << endl; + + OSyncMember *member = osync_group_find_member(group, member_id); + if( !member ) throw "bad member id"; + OSyncPlugin *plugin = osync_plugin_env_find_plugin(penv, osync_member_get_pluginname(member)); + if( !plugin ) throw "bad plugin"; + OSyncPluginConfig *config = osync_member_get_config_or_default(member, &ose); + if( !config ) throw "bad config"; + + // extract advanced fields + get_advanced(config, "PinCode"); + get_advanced(config, "Debug"); + + // test add + add_advanced(config, "TestName", "Test Display Name", "Whippoorwill"); + get_advanced(config, "TestName"); + + // extract resources + dump_resources(config); + + // save new config + if( !osync_member_save(member, &ose) ) + throw "bad member save"; + + // due to leak in library, I don't think this is safe to call? + //osync_plugin_config_unref(config); +} + +void test() +{ + OSyncError *ose = NULL; + + // create + genv = osync_group_env_new(&ose); + if( !genv ) throw "bad genv"; + penv = osync_plugin_env_new(&ose); + if( !penv ) throw "bad penv"; + + // load + if( !osync_group_env_load_groups(genv, NULL, &ose) ) + throw "bad group load"; + if( !osync_plugin_env_load(penv, NULL, &ose) ) + throw "bad plugin load"; + + // find config + OSyncGroup *group = osync_group_env_find_group(genv, "test"); + if( !group ) throw "bad group"; + test_member(group, 1); + test_member(group, 2); + + // clean up + osync_plugin_env_unref(penv); + osync_group_env_unref(genv); +} + +int main() +{ + try { test(); } + catch( const char *msg ) { + cout << "Exception: " << msg << endl; + return 1; + } +} + diff -Nru barry-0.14/desktop/src/optout.h barry-0.0.20110506/desktop/src/optout.h --- barry-0.14/desktop/src/optout.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/optout.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,152 @@ +/// +/// \file OptOut.h +/// A set of container classes and element base class that support +/// smart elements that can remove themselves from the container +/// upon deletion. +/// +/// To use it, derive your element from OptOut::Element, and +/// then add new-ly allocated pointers to the Vector. The +/// Vector will delete any remaining elements, and each +/// element can be deleted early, either with a delete this +/// by themselves, or deleted manually outside of the Vector. +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __UTIL_OPTOUT_H__ +#define __UTIL_OPTOUT_H__ + +#include + +namespace OptOut { + +class ContainerBase; + +class Element +{ + friend class ContainerBase; + + ContainerBase *m_container; + +protected: + virtual void OptIn(ContainerBase *container) + { + OptOut(); + m_container = container; + } + + virtual void OptOut(); + +public: + Element() : m_container(0) {} + virtual ~Element() + { + OptOut(); + } +}; + +class ContainerBase +{ + friend class Element; + +protected: + virtual void NotifyElement(Element *element) + { + element->OptIn(this); + } + + virtual void OptOut(Element *element) = 0; + +public: + virtual ~ContainerBase() + { + } +}; + +inline void Element::OptOut() +{ + if( m_container ) { + m_container->OptOut(this); + m_container = 0; + } +} + +template +class Vector : public ContainerBase +{ +public: + typedef std::vector container_type; + typedef container_type::iterator iterator; + typedef container_type::const_iterator const_iterator; + typedef container_type::size_type size_type; + +private: + container_type m_con; + +protected: + virtual void OptOut(Element *element) + { + for( iterator i = m_con.begin(); i != m_con.end(); ++i ) { + if( (*i) == element ) { + m_con.erase(i); + return; + } + } + } + +public: + ~Vector() + { + iterator i; + while( (i = m_con.begin()) != m_con.end() ) { + // this will remove the element from the array, + // hence the while, starting over each time + delete (*i); + } + } + + // std::vector<> compatible functions + size_type size() { return m_con.size(); } + void push_back(Element *element) + { + NotifyElement(element); + m_con.push_back(element); + } + TypeT* operator[] (size_type n) + { + return dynamic_cast (m_con[n]); + } + iterator begin() { return m_con.begin(); } + const_iterator begin() const { return m_con.begin(); } + iterator end() { return m_con.end(); } + const_iterator end() const { return m_con.end(); } + iterator rbegin() { return m_con.rbegin(); } + const_iterator rbegin() const { return m_con.rbegin(); } + iterator rend() { return m_con.rend(); } + const_iterator rend() const { return m_con.rend(); } + + // since iterators hold Element* pointers, these functions + // are just a helpful dynamic cast aid + TypeT* GetType(iterator i) { return dynamic_cast (*i); } + const TypeT* GetType(const_iterator i) { return dynamic_cast (*i); } + +}; + +} // namespace OptOut + +#endif + diff -Nru barry-0.14/desktop/src/os22.cc barry-0.0.20110506/desktop/src/os22.cc --- barry-0.14/desktop/src/os22.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/os22.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,1096 @@ +/// +/// \file os22.cc +/// Wrapper class for opensync 0.22 syncing behaviour +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + Used code from msynctool (GPL v2+) as a guide to the API, + and copied some of its status messages and one function directly: + static const char *OSyncChangeType2String(OSyncChangeType c); + Copyright (C) 2004-2005 Armin Bauer + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "os22.h" +#include "osprivatebase.h" +#include "osconv22.h" +#include +#include +#include +#include +#include + +// use relative paths to backtrack enough to specify only 0.22 includes +#include <../opensync-1.0/opensync/opensync.h> +#include <../opensync-1.0/osengine/engine.h> + +using namespace std; + +namespace OpenSync { + +typedef Barry::vLateSmartPtr EngineHandle; + +class OpenSync22Private +{ +public: + // function pointers + const char* (*osync_get_version)(); + OSyncEnv* (*osync_env_new)(); + void (*osync_env_free)(OSyncEnv *env); + void (*osync_env_set_option)(OSyncEnv *env, + const char *name, const char *value); + osync_bool (*osync_env_finalize)(OSyncEnv *env, + OSyncError **error); + int (*osync_env_num_plugins)(OSyncEnv *env); + OSyncPlugin* (*osync_env_nth_plugin)(OSyncEnv *env, int nth); + const char* (*osync_plugin_get_name)(OSyncPlugin *plugin); + void (*osync_error_free)(OSyncError **error); + const char* (*osync_error_print)(OSyncError **error); + osync_bool (*osync_env_initialize)(OSyncEnv *env, + OSyncError **error); + int (*osync_env_num_groups)(OSyncEnv *env); + OSyncGroup* (*osync_env_nth_group)(OSyncEnv *env, int nth); + const char* (*osync_group_get_name)(OSyncGroup *group); + OSyncGroup* (*osync_env_find_group)(OSyncEnv *env, + const char *name); + int (*osync_group_num_members)(OSyncGroup *group); + OSyncMember* (*osync_group_nth_member)(OSyncGroup *group, + int nth); + long long int (*osync_member_get_id)(OSyncMember *member); + const char* (*osync_member_get_pluginname)( + OSyncMember *member); + OSyncFormatEnv* (*osync_conv_env_new)(OSyncEnv *env); + void (*osync_conv_env_free)(OSyncFormatEnv *env); + int (*osync_conv_num_objtypes)(OSyncFormatEnv *env); + OSyncObjType* (*osync_conv_nth_objtype)(OSyncFormatEnv *env, + int nth); + int (*osync_conv_num_objformats)( + OSyncObjType *type); + OSyncObjFormat* (*osync_conv_nth_objformat)(OSyncObjType *type, + int nth); + const char* (*osync_objformat_get_name)( + OSyncObjFormat *format); + const char* (*osync_objtype_get_name)(OSyncObjType *type); + OSyncGroup* (*osync_group_new)(OSyncEnv *env); + void (*osync_group_set_name)(OSyncGroup *group, + const char *name); + osync_bool (*osync_group_save)(OSyncGroup *group, + OSyncError **error); + osync_bool (*osync_group_delete)(OSyncGroup *group, + OSyncError **error); + OSyncMember* (*osync_member_new)(OSyncGroup *group); + osync_bool (*osync_member_instance_plugin)( + OSyncMember *member, + const char *pluginname, + OSyncError **error); + osync_bool (*osync_member_save)(OSyncMember *member, + OSyncError **error); + OSyncMember* (*osync_member_from_id)(OSyncGroup *group, + int id); + osync_bool (*osync_member_need_config)(OSyncMember *member, + OSyncConfigurationTypes *type, + OSyncError **error); + osync_bool (*osync_member_get_config_or_default)( + OSyncMember *member, + char **data, int *size, + OSyncError **error); + void (*osync_member_set_config)(OSyncMember *member, + const char *data, int size); + osync_bool (*osengine_mapping_ignore_supported)( + OSyncEngine *engine, + OSyncMapping *mapping); + osync_bool (*osengine_mapping_check_timestamps)( + OSyncEngine *engine, + OSyncMapping *mapping, + OSyncError **error); + OSyncChange* (*osengine_mapping_nth_change)( + OSyncMapping *mapping, int nth); + void (*osengine_mapping_solve)(OSyncEngine *engine, + OSyncMapping *mapping, + OSyncChange *change); + void (*osengine_mapping_duplicate)( + OSyncEngine *engine, + OSyncMapping *dupe_mapping); + osync_bool (*osengine_mapping_ignore_conflict)( + OSyncEngine *engine, + OSyncMapping *mapping, + OSyncError **error); + osync_bool (*osengine_mapping_solve_latest)( + OSyncEngine *engine, + OSyncMapping *mapping, + OSyncError **error); + const char* (*osync_change_get_uid)(OSyncChange *change); + osync_bool (*osengine_init)(OSyncEngine *engine, + OSyncError **error); + OSyncMember* (*osync_change_get_member)(OSyncChange *change); + int (*osync_change_get_datasize)( + OSyncChange *change); + OSyncEngine* (*osengine_new)(OSyncGroup *group, + OSyncError **error); + void (*osengine_free)(OSyncEngine *engine); + void (*osengine_finalize)(OSyncEngine *engine); + osync_bool (*osengine_sync_and_block)(OSyncEngine *engine, + OSyncError **error); + void (*osengine_set_memberstatus_callback)( + OSyncEngine *engine, + void (* function) (OSyncMemberUpdate *, + void *), + void *user_data); + void (*osengine_set_changestatus_callback)( + OSyncEngine *engine, + void (* function) (OSyncEngine *, + OSyncChangeUpdate *, + void *), + void *user_data); + void (*osengine_set_enginestatus_callback)( + OSyncEngine *engine, + void (* function) (OSyncEngine *, + OSyncEngineUpdate *, + void *), + void *user_data); + void (*osengine_set_mappingstatus_callback)( + OSyncEngine *engine, + void (* function) (OSyncMappingUpdate *, + void *), + void *user_data); + void (*osengine_set_conflict_callback)( + OSyncEngine *engine, + void (* function) (OSyncEngine *, + OSyncMapping *, + void *), + void *user_data); + int (*osengine_mapping_num_changes)( + OSyncMapping *mapping); + OSyncChangeType (*osync_change_get_changetype)( + OSyncChange *change); + char* (*osync_change_get_printable)( + OSyncChange *change); + + // data pointers + OSyncEnv *env; + + Converter22 converter; + + OpenSync22Private(OpenSync22 &api) + : env(0) + , converter(api) + { + } +}; + +class SyncConflict22Private : public SyncConflictPrivateBase +{ + OpenSync22Private *m_priv; + OSyncEngine *m_engine; + OSyncMapping *m_mapping; + +public: + SyncConflict22Private(OpenSync22Private *priv, + OSyncEngine *engine, OSyncMapping *mapping); + ~SyncConflict22Private(); + + virtual bool IsAbortSupported() const; + virtual bool IsIgnoreSupported() const; + virtual bool IsKeepNewerSupported() const; + + virtual void Select(int change_id); // takes id of SyncChange object + virtual void Abort(); // not supported in 0.22 + virtual void Duplicate(); + virtual void Ignore(); + virtual void KeepNewer(); + + void AppendChanges(std::vector &list); +}; + +struct CallbackBundle22 +{ + OpenSync22Private *m_priv; + SyncStatus *m_status; + + CallbackBundle22(OpenSync22Private *priv, SyncStatus &status) + : m_priv(priv) + , m_status(&status) + { + } +}; + +void member_status(OSyncMemberUpdate *, void *); +void entry_status(OSyncEngine *, OSyncChangeUpdate *, void *); +void engine_status(OSyncEngine *, OSyncEngineUpdate *,void *); +void mapping_status(OSyncMappingUpdate *, void *); +void conflict_handler(OSyncEngine *, OSyncMapping *, void *); + + +///////////////////////////////////////////////////////////////////////////// +// Static helper functions + +static const char *OSyncChangeType2String(OSyncChangeType c) +{ + switch (c) { + case CHANGE_ADDED: return "ADDED"; + case CHANGE_UNMODIFIED: return "UNMODIFIED"; + case CHANGE_DELETED: return "DELETED"; + case CHANGE_MODIFIED: return "MODIFIED"; + default: + case CHANGE_UNKNOWN: return "?"; + } +} + +///////////////////////////////////////////////////////////////////////////// +// SyncConflict22Private member functions + +SyncConflict22Private::SyncConflict22Private(OpenSync22Private *priv, + OSyncEngine *engine, OSyncMapping *mapping) + : m_priv(priv) + , m_engine(engine) + , m_mapping(mapping) +{ +} + +SyncConflict22Private::~SyncConflict22Private() +{ +} + +bool SyncConflict22Private::IsAbortSupported() const +{ + return false; // Abort not explicitly supported in 0.22 +} + +bool SyncConflict22Private::IsIgnoreSupported() const +{ + return m_priv->osengine_mapping_ignore_supported(m_engine, m_mapping); +} + +bool SyncConflict22Private::IsKeepNewerSupported() const +{ + return m_priv->osengine_mapping_check_timestamps(m_engine, m_mapping, NULL); +} + +void SyncConflict22Private::Select(int change_id) +{ + OSyncChange *change = m_priv->osengine_mapping_nth_change(m_mapping, change_id); + if( !change ) { + throw std::runtime_error("Bad change_id, or error getting nth change object."); + } + + m_priv->osengine_mapping_solve(m_engine, m_mapping, change); +} + +void SyncConflict22Private::Abort() +{ + throw std::logic_error("Conflict::Abort() not supported in 0.22"); +} + +void SyncConflict22Private::Duplicate() +{ + m_priv->osengine_mapping_duplicate(m_engine, m_mapping); +} + +void SyncConflict22Private::Ignore() +{ + if( !IsIgnoreSupported() ) + throw std::logic_error("Ignore not supported, yet Ignore() called."); + + OSyncError *error = NULL; + if( !m_priv->osengine_mapping_ignore_conflict(m_engine, m_mapping, &error)) { + ostringstream oss; + oss << "Conflict not ignored: " + << m_priv->osync_error_print(&error); + m_priv->osync_error_free(&error); + throw std::runtime_error(oss.str()); + } +} + +void SyncConflict22Private::KeepNewer() +{ + if( !IsKeepNewerSupported() ) + throw std::logic_error("Keep Newer not supported, yet KeepNewer() called."); + + OSyncError *error = NULL; + if( !m_priv->osengine_mapping_solve_latest(m_engine, m_mapping, &error)) { + ostringstream oss; + oss << "Conflict not resolved: " + << m_priv->osync_error_print(&error); + m_priv->osync_error_free(&error); + throw std::runtime_error(oss.str()); + } +} + +void SyncConflict22Private::AppendChanges(std::vector &list) +{ + for( int i = 0; i < m_priv->osengine_mapping_num_changes(m_mapping); i++ ) { + OSyncChange *change = m_priv->osengine_mapping_nth_change(m_mapping, i); + if( m_priv->osync_change_get_changetype(change) != CHANGE_UNKNOWN ) { + + SyncChange entry; + + char *printable = m_priv->osync_change_get_printable(change); + if( printable ) { + entry.printable_data = printable; + g_free(printable); + } + + OSyncMember *member = m_priv->osync_change_get_member(change); + + entry.id = i; + entry.member_id = m_priv->osync_member_get_id(member); + entry.plugin_name = m_priv->osync_member_get_pluginname(member); + entry.uid = m_priv->osync_change_get_uid(change); + + // add to list + list.push_back(entry); + } + } +} + + +///////////////////////////////////////////////////////////////////////////// +// Callback functions + +void member_status(OSyncMemberUpdate *status, void *cbdata) +{ + CallbackBundle22 *cb = (CallbackBundle22*) cbdata; + + try { + ostringstream oss; + bool error_event = false; + bool valid = true; + + oss << "Member " + << cb->m_priv->osync_member_get_id(status->member) + << " (" + << cb->m_priv->osync_member_get_pluginname(status->member) + << ")"; + + switch( status->type ) + { + case MEMBER_CONNECTED: + oss << " just connected"; + break; + case MEMBER_DISCONNECTED: + oss << " just disconnected"; + break; + case MEMBER_SENT_CHANGES: + oss << " just sent all changes"; + break; + case MEMBER_COMMITTED_ALL: + oss << " committed all changes"; + break; + case MEMBER_CONNECT_ERROR: + oss << " had an error while connecting: " + << cb->m_priv->osync_error_print(&status->error); + break; + case MEMBER_GET_CHANGES_ERROR: + oss << " had an error while getting changes: " + << cb->m_priv->osync_error_print(&status->error); + error_event = true; + break; + case MEMBER_SYNC_DONE_ERROR: + oss << " had an error while calling sync done: " + << cb->m_priv->osync_error_print(&status->error); + error_event = true; + break; + case MEMBER_DISCONNECT_ERROR: + oss << " had an error while disconnecting: " + << cb->m_priv->osync_error_print(&status->error); + error_event = true; + break; + case MEMBER_COMMITTED_ALL_ERROR: + oss << " had an error while commiting changes: " + << cb->m_priv->osync_error_print(&status->error); + error_event = true; + break; + default: + valid = false; + break; + } + + // call the status handler + if( oss.str().size() && valid ) { + cb->m_status->MemberStatus( + cb->m_priv->osync_member_get_id(status->member), + cb->m_priv->osync_member_get_pluginname(status->member), + oss.str(), error_event); + } + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("member_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in member_status()"); + } + +} + +void entry_status(OSyncEngine *engine, OSyncChangeUpdate *status, void *cbdata) +{ + CallbackBundle22 *cb = (CallbackBundle22*) cbdata; + + try { + ostringstream oss; + + OSyncMember *member = cb->m_priv->osync_change_get_member(status->change); + bool error_event = false; + + switch( status->type ) + { + case CHANGE_RECEIVED_INFO: + oss << "Received an entry " + << cb->m_priv->osync_change_get_uid(status->change) + << " without data from member " + << status->member_id + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "). " + << "Changetype " + << OSyncChangeType2String(cb->m_priv->osync_change_get_changetype(status->change)); + break; + case CHANGE_RECEIVED: + oss << "Received an entry " + << cb->m_priv->osync_change_get_uid(status->change) + << " with data of size " + << cb->m_priv->osync_change_get_datasize(status->change) + << " from member " + << status->member_id + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "). Changetype " + << OSyncChangeType2String(cb->m_priv->osync_change_get_changetype(status->change)); + break; + case CHANGE_SENT: + oss << "Sent an entry " + << cb->m_priv->osync_change_get_uid(status->change) + << " of size " + << cb->m_priv->osync_change_get_datasize(status->change) + << " to member " + << status->member_id + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "). Changetype " + << OSyncChangeType2String(cb->m_priv->osync_change_get_changetype(status->change)); + break; + case CHANGE_WRITE_ERROR: + error_event = true; + oss << "Error writing entry " + << cb->m_priv->osync_change_get_uid(status->change) + << " to member " + << status->member_id + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "): " + << cb->m_priv->osync_error_print(&status->error); + break; + case CHANGE_RECV_ERROR: + error_event = true; + oss << "Error reading entry " + << cb->m_priv->osync_change_get_uid(status->change) + << " from member " + << status->member_id + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "): " + << cb->m_priv->osync_error_print(&(status->error)); + break; + } + + // call the status handler + if( oss.str().size() ) { + cb->m_status->EntryStatus(oss.str(), error_event); + } + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("entry_status error:") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in entry_status()"); + } +} + +void engine_status(OSyncEngine *engine, OSyncEngineUpdate *status, void *cbdata) +{ + CallbackBundle22 *cb = (CallbackBundle22*) cbdata; + + try { + ostringstream oss; + bool error_event = false; + + switch( status->type ) + { + case ENG_PREV_UNCLEAN: + oss << "The previous synchronization was unclean. Slow-syncing."; + break; + case ENG_ENDPHASE_CON: + oss << "All clients connected or error"; + break; + case ENG_END_CONFLICTS: + oss << "All conflicts have been reported"; + break; + case ENG_ENDPHASE_READ: + oss << "All clients sent changes or error"; + break; + case ENG_ENDPHASE_WRITE: + oss << "All clients have written"; + break; + case ENG_ENDPHASE_DISCON: + oss << "All clients have disconnected"; + break; + case ENG_SYNC_SUCCESSFULL: + oss << "The sync was successful"; + break; + case ENG_ERROR: + oss << "The sync failed: " + << cb->m_priv->osync_error_print(&status->error); + error_event = true; + break; + } + + // call the status handler + if( oss.str().size() ) + cb->m_status->EngineStatus(oss.str(), + error_event, + status->type == ENG_PREV_UNCLEAN); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("engine_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in engine_status()"); + } +} + +void mapping_status(OSyncMappingUpdate *status, void *cbdata) +{ + CallbackBundle22 *cb = (CallbackBundle22*) cbdata; + + try { + ostringstream oss; + bool error_event = false; + + switch( status->type ) + { + case MAPPING_SOLVED: + oss << "Mapping solved"; + break; + case MAPPING_SYNCED: + oss << "Mapping Synced"; + break; + case MAPPING_WRITE_ERROR: + error_event = true; + oss << "Mapping Write Error: " + << cb->m_priv->osync_error_print(&status->error); + break; + } + + // call the status handler + if( oss.str().size() ) + cb->m_status->MappingStatus(oss.str(), error_event); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("mapping_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in mapping_status()"); + } +} + +void conflict_handler(OSyncEngine *engine, OSyncMapping *mapping, void *cbdata) +{ + CallbackBundle22 *cb = (CallbackBundle22*) cbdata; + + try { + // build the SyncConflict object + SyncConflict22Private scp(cb->m_priv, engine, mapping); + SyncConflict conflict(scp); + + // append all conflicting changes as vector objects in the same + // order as the opensync library mapping + scp.AppendChanges(conflict); + + // call the status handler + cb->m_status->HandleConflict(conflict); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("Conflict not resolved. ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in conflict_handler()"); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// OpenSync22 - public members + +bool OpenSync22::symbols_loaded = false; + +OpenSync22::OpenSync22() +{ + if( !Open("libosengine.so.0") ) + throw DlError("Can't dlopen libosengine.so.0"); + + // the symbol table is now thoroughly polluted... + symbols_loaded = true; + + // store locally in case of constructor exception in LoadSym + std::auto_ptr p(new OpenSync22Private(*this)); + + // load all required symbols... + // we don't need to use try/catch here, since the base + // class destructor will clean up for us if LoadSym() throws + LoadSym(p->osync_get_version, "osync_get_version"); + LoadSym(p->osync_env_new, "osync_env_new"); + LoadSym(p->osync_env_free, "osync_env_free"); + LoadSym(p->osync_env_set_option, "osync_env_set_option"); + LoadSym(p->osync_env_finalize, "osync_env_finalize"); + LoadSym(p->osync_env_num_plugins, "osync_env_num_plugins"); + LoadSym(p->osync_env_nth_plugin, "osync_env_nth_plugin"); + LoadSym(p->osync_plugin_get_name, "osync_plugin_get_name"); + LoadSym(p->osync_error_free, "osync_error_free"); + LoadSym(p->osync_error_print, "osync_error_print"); + LoadSym(p->osync_env_initialize, "osync_env_initialize"); + LoadSym(p->osync_env_num_groups, "osync_env_num_groups"); + LoadSym(p->osync_env_nth_group, "osync_env_nth_group"); + LoadSym(p->osync_group_get_name, "osync_group_get_name"); + LoadSym(p->osync_env_find_group, "osync_env_find_group"); + LoadSym(p->osync_group_num_members, "osync_group_num_members"); + LoadSym(p->osync_group_nth_member, "osync_group_nth_member"); + LoadSym(p->osync_member_get_id, "osync_member_get_id"); + LoadSym(p->osync_member_get_pluginname, "osync_member_get_pluginname"); + LoadSym(p->osync_conv_env_new, "osync_conv_env_new"); + LoadSym(p->osync_conv_env_free, "osync_conv_env_free"); + LoadSym(p->osync_conv_num_objtypes, "osync_conv_num_objtypes"); + LoadSym(p->osync_conv_nth_objtype, "osync_conv_nth_objtype"); + LoadSym(p->osync_conv_num_objformats, "osync_conv_num_objformats"); + LoadSym(p->osync_conv_nth_objformat, "osync_conv_nth_objformat"); + LoadSym(p->osync_objformat_get_name, "osync_objformat_get_name"); + LoadSym(p->osync_objtype_get_name, "osync_objtype_get_name"); + LoadSym(p->osync_group_new, "osync_group_new"); + LoadSym(p->osync_group_set_name, "osync_group_set_name"); + LoadSym(p->osync_group_save, "osync_group_save"); + LoadSym(p->osync_group_delete, "osync_group_delete"); + LoadSym(p->osync_member_new, "osync_member_new"); + LoadSym(p->osync_member_instance_plugin,"osync_member_instance_plugin"); + LoadSym(p->osync_member_save, "osync_member_save"); + LoadSym(p->osync_member_from_id, "osync_member_from_id"); + LoadSym(p->osync_member_need_config, "osync_member_need_config"); + LoadSym(p->osync_member_get_config_or_default, + "osync_member_get_config_or_default"); + LoadSym(p->osync_member_set_config, "osync_member_set_config"); + LoadSym(p->osengine_mapping_ignore_supported, + "osengine_mapping_ignore_supported"); + LoadSym(p->osengine_mapping_check_timestamps, + "osengine_mapping_check_timestamps"); + LoadSym(p->osengine_mapping_nth_change, "osengine_mapping_nth_change"); + LoadSym(p->osengine_mapping_solve, "osengine_mapping_solve"); + LoadSym(p->osengine_mapping_duplicate, "osengine_mapping_duplicate"); + LoadSym(p->osengine_mapping_ignore_conflict, + "osengine_mapping_ignore_conflict"); + LoadSym(p->osengine_mapping_solve_latest, + "osengine_mapping_solve_latest"); + LoadSym(p->osync_change_get_uid, "osync_change_get_uid"); + LoadSym(p->osengine_init, "osengine_init"); + LoadSym(p->osync_change_get_member, "osync_change_get_member"); + LoadSym(p->osync_change_get_datasize, "osync_change_get_datasize"); + LoadSym(p->osengine_new, "osengine_new"); + LoadSym(p->osengine_free, "osengine_free"); + LoadSym(p->osengine_finalize, "osengine_finalize"); + LoadSym(p->osengine_sync_and_block, "osengine_sync_and_block"); + LoadSym(p->osengine_set_memberstatus_callback, + "osengine_set_memberstatus_callback"); + LoadSym(p->osengine_set_changestatus_callback, + "osengine_set_changestatus_callback"); + LoadSym(p->osengine_set_enginestatus_callback, + "osengine_set_enginestatus_callback"); + LoadSym(p->osengine_set_mappingstatus_callback, + "osengine_set_mappingstatus_callback"); + LoadSym(p->osengine_set_conflict_callback, + "osengine_set_conflict_callback"); + LoadSym(p->osengine_mapping_num_changes, + "osengine_mapping_num_changes"); + LoadSym(p->osync_change_get_changetype, "osync_change_get_changetype"); + LoadSym(p->osync_change_get_printable, "osync_change_get_printable"); + + // do common initialization of opensync environment + SetupEnvironment(p.get()); + + // this pointer is ours now + m_priv = p.release(); +} + +OpenSync22::~OpenSync22() +{ + // clean up opensync environment, closing plugins, etc. + if( m_priv->env ) { + m_priv->osync_env_finalize(m_priv->env, NULL); + m_priv->osync_env_free(m_priv->env); + } + + // free private class data + delete m_priv; + m_priv = 0; +} + +void OpenSync22::SetupEnvironment(OpenSync22Private *p) +{ + // we are fully responsible for this pointer, since + // we run inside the constructor... only on success + // will responsibility be transferred to the destructor + p->env = p->osync_env_new(); + if( !p->env ) + throw std::runtime_error("Error allocating opensync 0.22 environment"); + + p->osync_env_set_option(p->env, "GROUPS_DIRECTORY", NULL); + p->osync_env_set_option(p->env, "LOAD_GROUPS", "TRUE"); + p->osync_env_set_option(p->env, "LOAD_PLUGINS", "TRUE"); + p->osync_env_set_option(p->env, "LOAD_FORMATS", "TRUE"); + + OSyncError *error = NULL; + if( !p->osync_env_initialize(p->env, &error) ) { + // grab error message + std::runtime_error err(m_priv->osync_error_print(&error)); + + // cleanup + p->osync_error_free(&error); + p->osync_env_free(m_priv->env); + + // throw + throw err; + } +} + +const char* OpenSync22::GetVersion() const +{ + return m_priv->osync_get_version(); +} + +const char* OpenSync22::GetEngineName() const +{ + return "0.22"; +} + +void OpenSync22::GetPluginNames(string_list_type &plugins) +{ + // start fresh + plugins.clear(); + + OSyncPlugin *p; + for( int i = 0; i < m_priv->osync_env_num_plugins(m_priv->env); i++) { + p = m_priv->osync_env_nth_plugin(m_priv->env, i); + plugins.push_back(m_priv->osync_plugin_get_name(p)); + } +} + +void OpenSync22::GetFormats(format_list_type &formats) +{ + // start fresh + formats.clear(); + + // cycle through all object types and simulate a 0.4x-like + // list based on the attached formats + + OSyncFormatEnv *fenv = m_priv->osync_conv_env_new(m_priv->env); + if( !fenv ) { + throw std::runtime_error("GetFormats(): Unable to load format environment in GetFormats (22)"); + } + + for( int i = 0; i < m_priv->osync_conv_num_objtypes(fenv); i++ ) { + OSyncObjType *type = m_priv->osync_conv_nth_objtype(fenv, i); + + for( int i = 0; i < m_priv->osync_conv_num_objformats(type); i++ ) { + OSyncObjFormat *format = m_priv->osync_conv_nth_objformat(type, i); + const char *objformat_name = m_priv->osync_objformat_get_name(format); + + if( !formats.Find(objformat_name) ) { + Format new_format; + new_format.name = objformat_name; + new_format.object_type = m_priv->osync_objtype_get_name(type); + formats.push_back(new_format); + } + } + } + + m_priv->osync_conv_env_free(fenv); +} + +void OpenSync22::GetGroupNames(string_list_type &groups) +{ + // start fresh + groups.clear(); + + OSyncGroup *g; + for( int i = 0; i < m_priv->osync_env_num_groups(m_priv->env); i++ ) { + g = m_priv->osync_env_nth_group(m_priv->env, i); + groups.push_back(m_priv->osync_group_get_name(g)); + } +} + +void OpenSync22::GetMembers(const std::string &group_name, + member_list_type &members) +{ + // start fresh + members.clear(); + + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) { + throw std::runtime_error("GetMembers(): Unable to find group with name: " + group_name); + } + + for( int i = 0; i < m_priv->osync_group_num_members(group); i++ ) { + OSyncMember *member = m_priv->osync_group_nth_member(group, i); + + Member new_member; + + new_member.group_name = group_name; + new_member.id = m_priv->osync_member_get_id(member); + new_member.plugin_name = m_priv->osync_member_get_pluginname(member); + + // we are switching opensync's long long int ID to + // our long... to double check they are equal after + // the conversion + if( new_member.id != m_priv->osync_member_get_id(member) ) { + throw std::logic_error("GetMembers(): OpenSync's member ID is too large to fit in OpenSyncAPI (22)"); + } + + // add to member list + members.push_back(new_member); + } +} + +void OpenSync22::AddGroup(const std::string &group_name) +{ + if( m_priv->osync_env_find_group(m_priv->env, group_name.c_str()) ) + throw std::runtime_error("AddGroup(): Group already exists: " + group_name); + + OSyncGroup *group = m_priv->osync_group_new(m_priv->env); + m_priv->osync_group_set_name(group, group_name.c_str()); + + OSyncError *error = NULL; + if( !m_priv->osync_group_save(group, &error) ) { + // grab error message + std::runtime_error err(string("AddGroup(): Unable to save group: ") + m_priv->osync_error_print(&error)); + + // cleanup + m_priv->osync_error_free(&error); + + throw err; + } +} + +void OpenSync22::DeleteGroup(const std::string &group_name) +{ + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("DeleteGroup(): Group not found: " + group_name); + + OSyncError *error = NULL; + if( !m_priv->osync_group_delete(group, &error) ) { + std::runtime_error err(string("DeleteGroup(): Unable to delete group: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } +} + +Converter& OpenSync22::GetConverter() +{ + return m_priv->converter; +} + +long OpenSync22::AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name) +{ + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("AddMember(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_member_new(group); + + OSyncError *error = NULL; + if( !m_priv->osync_member_instance_plugin(member, plugin_name.c_str(), &error) ) { + std::runtime_error err(string("AddMember(): Unable to connect plugin with member: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } + + if( !m_priv->osync_member_save(member, &error) ) { + std::runtime_error err(string("AddMember(): Unable to save member: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } + + return m_priv->osync_member_get_id(member); +} + +bool OpenSync22::IsConfigurable(const std::string &group_name, + long member_id) +{ + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_member_from_id(group, member_id); + if( !member ) { + ostringstream oss; + oss << "IsConfigurable(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncConfigurationTypes type = NO_CONFIGURATION; + OSyncError *error = NULL; + if( !m_priv->osync_member_need_config(member, &type, &error) ) { + std::runtime_error err(string("Unable to determine needed config: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } + + return type != NO_CONFIGURATION; +} + +std::string OpenSync22::GetConfiguration(const std::string &group_name, + long member_id) +{ + if( !IsConfigurable(group_name, member_id) ) { + ostringstream oss; + oss << "GetConfiguration(): Member " << member_id << " of group '" << group_name << "' does not accept configuration."; + throw std::runtime_error(oss.str()); + } + + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("GetConfiguration(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_member_from_id(group, member_id); + if( !member ) { + ostringstream oss; + oss << "GetConfiguration(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncError *error = NULL; + char *data = NULL; + int size = 0; + if( !m_priv->osync_member_get_config_or_default(member, &data, &size, &error)) { + std::runtime_error err(string("GetConfiguration(): Unable to retrieve config: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } + + std::string config(data, size); + g_free(data); + + return config; +} + +void OpenSync22::SetConfiguration(const std::string &group_name, + long member_id, + const std::string &config_data) +{ + if( !IsConfigurable(group_name, member_id) ) { + ostringstream oss; + oss << "SetConfiguration(): Member " << member_id << " of group '" << group_name << "' does not accept configuration."; + throw std::runtime_error(oss.str()); + } + + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("SetConfiguration(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_member_from_id(group, member_id); + if( !member ) { + ostringstream oss; + oss << "SetConfiguration(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + m_priv->osync_member_set_config(member, config_data.c_str(), config_data.size()); + + OSyncError *error = NULL; + if( !m_priv->osync_member_save(member, &error) ) { + std::runtime_error err(string("SetConfiguration(): Unable to save member's config: ") + m_priv->osync_error_print(&error)); + m_priv->osync_error_free(&error); + throw err; + } +} + +void OpenSync22::Discover(const std::string &group_name) +{ + // Discover is a successful noop on 0.22 +} + +void OpenSync22::Sync(const std::string &group_name, + SyncStatus &status_callback) +{ + OSyncGroup *group = m_priv->osync_env_find_group(m_priv->env, group_name.c_str()); + if( !group ) + throw std::runtime_error("Sync(): Group not found: " + group_name); + + OSyncError *error = NULL; + EngineHandle engine(m_priv->osengine_free); + engine = m_priv->osengine_new(group, &error); + if( !engine.get() ) { + std::ostringstream oss; + oss << "Error while synchronizing: " + << m_priv->osync_error_print(&error); + m_priv->osync_error_free(&error); + throw std::runtime_error(oss.str()); + } + + CallbackBundle22 cbdata(m_priv, status_callback); + + m_priv->osengine_set_memberstatus_callback(engine.get(), + &member_status, &cbdata); + m_priv->osengine_set_changestatus_callback(engine.get(), + &entry_status, &cbdata); + m_priv->osengine_set_enginestatus_callback(engine.get(), + &engine_status, &cbdata); + m_priv->osengine_set_mappingstatus_callback(engine.get(), + &mapping_status, &cbdata); + m_priv->osengine_set_conflict_callback(engine.get(), + &conflict_handler, &cbdata); + + if( !m_priv->osengine_init(engine.get(), &error) ) { + ostringstream oss; + oss << "Error initializing osengine: " + << m_priv->osync_error_print(&error); + m_priv->osync_error_free(&error); + throw std::runtime_error(oss.str()); + } + + // successfully initialized, so finalize must be called + EngineHandle initialized_engine(m_priv->osengine_finalize); + initialized_engine = engine.get(); + + if( !m_priv->osengine_sync_and_block(engine.get(), &error) ) { + ostringstream oss; + oss << "Error during sync: " + << m_priv->osync_error_print(&error); + m_priv->osync_error_free(&error); + throw std::runtime_error(oss.str()); + } +} + +} // namespace OpenSync + diff -Nru barry-0.14/desktop/src/os22.h barry-0.0.20110506/desktop/src/os22.h --- barry-0.14/desktop/src/os22.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/os22.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,98 @@ +/// +/// \file os22.h +/// Wrapper class for opensync 0.22 syncing behaviour +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_OS22_H__ +#define __BARRYDESKTOP_OS22_H__ + +#include "dlopen.h" +#include "osbase.h" + +namespace OpenSync { + +class OpenSync22Private; + +class OpenSync22 : public DlOpen, public OpenSync::API +{ + static bool symbols_loaded; + + OpenSync22Private *m_priv; + +protected: + void SetupEnvironment(OpenSync22Private *p); + +public: + OpenSync22(); + ~OpenSync22(); + + static bool SymbolsLoaded() { return symbols_loaded; } + + // + // Virtual API overrides + // + + // Functional abilities information... this does not come from + // the engine itself, but is information the osbase library + // determines useful for applications to know + bool IsSlowSyncSupported() const { return false; } + bool IsContactSyncSupported() const { return true; } + bool IsCalendarSyncSupported() const { return true; } + bool IsMemoSyncSupported() const { return false; } + bool IsTodoSyncSupported() const { return false; } + + // General engine information + const char* GetVersion() const; + const char* GetEngineName() const; + void GetPluginNames(string_list_type &plugins); + void GetFormats(format_list_type &formats); + + // Information about configured groups + void GetGroupNames(string_list_type &groups); + void GetMembers(const std::string &group_name, + member_list_type &members); + + // Group configuration + void AddGroup(const std::string &group_name); + void DeleteGroup(const std::string &group_name); + + // Plugin configuration helper + Converter& GetConverter(); + + // Member configuration + long AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name); + // DeleteMember() not possible to implement in 0.22 + bool IsConfigurable(const std::string &group_name, + long member_id); + std::string GetConfiguration(const std::string &group_name, + long member_id); + void SetConfiguration(const std::string &group_name, + long member_id, const std::string &config_data); + void Discover(const std::string &group_name); + + // Syncing + void Sync(const std::string &group_name, SyncStatus &status_callback); +}; + +} // namespace OpenSync + +#endif + diff -Nru barry-0.14/desktop/src/os40.cc barry-0.0.20110506/desktop/src/os40.cc --- barry-0.14/desktop/src/os40.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/os40.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2235 @@ +/// +/// \file os40.cc +/// Wrapper class for opensync 0.22 syncing behaviour +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + Used code from osynctool (GPL v2+) as a guide to the API, + and copied some of the status messages, as well as one funcion + directly: + static const char *OSyncChangeType2String(OSyncChangeType type) + Copyright (C) 2004-2005 Armin Bauer + Copyright (C) 2006-2007 Daniel Friedrich + Copyright (C) 2008-2009 Daniel Gollub + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "os40.h" +#include "os22.h" +#include "osprivatebase.h" +#include "tempdir.h" +#include "osconv40.h" +#include +#include +#include +#include +#include +#include + +// use relative paths to backtrack enough to specify only 0.4x includes +#include <../libopensync1/opensync/opensync.h> +#include <../libopensync1/opensync/opensync-group.h> +#include <../libopensync1/opensync/opensync-format.h> +#include <../libopensync1/opensync/opensync-plugin.h> +#include <../libopensync1/opensync/opensync-engine.h> +#include <../libopensync1/opensync/opensync-data.h> +#include <../libopensync1/opensync/opensync-capabilities.h> + +using namespace std; +using namespace Barry; + +namespace OpenSync { + + +typedef Barry::vLateSmartPtr EngineHandle; +typedef Barry::vLateSmartPtr SyncListHandle; + + +// +// Private class declarations +// + + +class TossError +{ + OSyncError *m_error; + OpenSync40Private *m_priv; + +public: + // simple wrapper... unref's the error on destruction + TossError(OpenSync40Private *priv) + : m_error(0) + , m_priv(priv) + { + } + + ~TossError() + { + Clear(); + } + + /// Returns NULL if no error + std::string GetErrorMsg(); + bool IsSet(); + void Clear(); + + operator OSyncError**() + { + return &m_error; + } +}; + +class OpenSync40Private +{ +public: + // function pointers + const char* (*osync_get_version)(); + const char* (*osync_error_print)(OSyncError **error); + osync_bool (*osync_error_is_set)(OSyncError **error); + void (*osync_error_unref)(OSyncError **error); + OSyncGroupEnv* (*osync_group_env_new)(OSyncError **error); + OSyncFormatEnv* (*osync_format_env_new)(OSyncError **error); + OSyncPluginEnv* (*osync_plugin_env_new)(OSyncError **error); + void (*osync_group_env_unref)(OSyncGroupEnv *env); + void (*osync_format_env_unref)(OSyncFormatEnv *env); + void (*osync_plugin_env_unref)(OSyncPluginEnv *env); + osync_bool (*osync_plugin_env_load)(OSyncPluginEnv *env, + const char *path, OSyncError **error); + OSyncList* (*osync_plugin_env_get_plugins)( + OSyncPluginEnv *env); + const char* (*osync_plugin_get_name)(OSyncPlugin *plugin); + void (*osync_list_free)(OSyncList *list); + osync_bool (*osync_group_env_load_groups)( + OSyncGroupEnv *env, const char *path, + OSyncError **error); + osync_bool (*osync_format_env_load_plugins)( + OSyncFormatEnv *env, const char *path, + OSyncError **error); + OSyncList* (*osync_group_env_get_groups)( + OSyncGroupEnv *env); + const char* (*osync_group_get_name)(OSyncGroup *group); + OSyncGroup* (*osync_group_env_find_group)( + OSyncGroupEnv *env, const char *name); + OSyncList* (*osync_group_get_members)(OSyncGroup *group); + const char* (*osync_member_get_name)(OSyncMember *member); + osync_memberid (*osync_member_get_id)(OSyncMember *member); + const char* (*osync_member_get_pluginname)( + OSyncMember *member); + OSyncList* (*osync_format_env_get_objformats)( + OSyncFormatEnv *env); + const char* (*osync_objformat_get_name)( + OSyncObjFormat *format); + const char* (*osync_objformat_get_objtype)( + OSyncObjFormat *format); + OSyncGroup* (*osync_group_new)(OSyncError **error); + void (*osync_group_unref)(OSyncGroup *group); + void (*osync_group_set_name)(OSyncGroup *group, + const char *name); + osync_bool (*osync_group_env_add_group)(OSyncGroupEnv *env, + OSyncGroup *group, + OSyncError **error); + osync_bool (*osync_group_save)(OSyncGroup *group, + OSyncError **error); + osync_bool (*osync_group_delete)(OSyncGroup *group, + OSyncError **error); + void (*osync_group_env_remove_group)( + OSyncGroupEnv *env, OSyncGroup *group); + OSyncPlugin* (*osync_plugin_env_find_plugin)( + OSyncPluginEnv *env, const char *name); + void (*osync_member_unref)(OSyncMember *member); + OSyncMember* (*osync_member_new)(OSyncError **error); + void (*osync_group_add_member)(OSyncGroup *group, + OSyncMember *member); + void (*osync_member_set_pluginname)( + OSyncMember *member, + const char *pluginname); + void (*osync_member_set_name)(OSyncMember *member, + const char *name); + osync_bool (*osync_member_save)(OSyncMember *member, + OSyncError **error); + OSyncMember* (*osync_group_find_member)(OSyncGroup *group, + osync_memberid id); + osync_bool (*osync_member_delete)(OSyncMember *member, + OSyncError **error); + void (*osync_group_remove_member)(OSyncGroup *group, + OSyncMember *member); + OSyncPluginConfig* (*osync_plugin_config_new)(OSyncError **error); + osync_bool (*osync_plugin_config_file_load)( + OSyncPluginConfig *config, + const char *path, + OSyncError **error); + void (*osync_member_set_config)(OSyncMember *member, + OSyncPluginConfig *config); + OSyncPluginConfig* (*osync_member_get_config_or_default)( + OSyncMember *member, + OSyncError **error); + osync_bool (*osync_plugin_config_file_save)( + OSyncPluginConfig *config, + const char *path, OSyncError **error); + OSyncPluginConfigurationType (*osync_plugin_get_config_type)( + OSyncPlugin *plugin); + OSyncEngine* (*osync_engine_new)(OSyncGroup *group, + OSyncError **error); + void (*osync_engine_unref)(OSyncEngine *engine); + osync_bool (*osync_engine_discover_and_block)( + OSyncEngine *engine, + OSyncMember *member, + OSyncError **error); + OSyncList* (*osync_member_get_objtypes)( + OSyncMember *member); + unsigned int (*osync_list_length)(const OSyncList *list); + void (*osync_error_set)(OSyncError **error, + OSyncErrorType type, + const char *format, ...); + osync_bool (*osync_engine_finalize)(OSyncEngine *engine, + OSyncError **error); + OSyncList* (*osync_mapping_engine_get_changes)( + OSyncMappingEngine *engine); + osync_bool (*osync_mapping_engine_supports_ignore)( + OSyncMappingEngine *engine); + osync_bool (*osync_mapping_engine_supports_use_latest)( + OSyncMappingEngine *engine); + OSyncList* (*osync_list_nth)(OSyncList *list, + unsigned int n); + osync_bool (*osync_engine_mapping_solve)( + OSyncEngine *engine, + OSyncMappingEngine *mapping_engine, + OSyncChange *change, + OSyncError **error); + osync_bool (*osync_engine_abort)(OSyncEngine *engine, + OSyncError **error); + osync_bool (*osync_engine_mapping_duplicate)( + OSyncEngine *engine, + OSyncMappingEngine *mapping_engine, + OSyncError **error); + osync_bool (*osync_engine_mapping_ignore_conflict)( + OSyncEngine *engine, + OSyncMappingEngine *mapping_engine, + OSyncError **error); + osync_bool (*osync_engine_mapping_use_latest)( + OSyncEngine *engine, + OSyncMappingEngine *mapping_engine, + OSyncError **error); + OSyncChangeType (*osync_change_get_changetype)( + OSyncChange *change); + OSyncMember* (*osync_mapping_engine_change_find_member)( + OSyncMappingEngine *engine, + OSyncChange *change); + OSyncData* (*osync_change_get_data)(OSyncChange *change); + char* (*osync_data_get_printable)(OSyncData *data, + OSyncError **error); + void (*osync_free)(void *ptr); + const char* (*osync_change_get_uid)(OSyncChange *change); + osync_bool (*osync_engine_continue)(OSyncEngine *engine, + OSyncError **error); + OSyncList* (*osync_engine_get_objengines)( + OSyncEngine *engine); + OSyncList* (*osync_obj_engine_get_members)( + OSyncObjEngine* engine); + const char* (*osync_obj_engine_get_objtype)( + OSyncObjEngine *engine); + const OSyncList* (*osync_obj_engine_get_mapping_entry_engines_of_member)( + OSyncObjEngine *engine, + OSyncMember *member); + osync_bool (*osync_entry_engine_is_dirty)( + OSyncMappingEntryEngine *engine); + OSyncChangeType (*osync_entry_engine_get_changetype)( + OSyncMappingEntryEngine *engine); + OSyncChange* (*osync_engine_change_update_get_change)( + OSyncEngineChangeUpdate *update); + OSyncMember* (*osync_engine_change_update_get_member)( + OSyncEngineChangeUpdate *update); + OSyncError* (*osync_engine_change_update_get_error)( + OSyncEngineChangeUpdate *update); + OSyncEngineChangeEvent (*osync_engine_change_update_get_event)( + OSyncEngineChangeUpdate *update); + OSyncObjFormat* (*osync_change_get_objformat)( + OSyncChange *change); + OSyncError* (*osync_engine_mapping_update_get_error)( + OSyncEngineMappingUpdate *update); + OSyncError* (*osync_engine_update_get_error)( + OSyncEngineUpdate *update); + OSyncEngineEvent (*osync_engine_update_get_event)( + OSyncEngineUpdate *update); + const char* (*osync_engine_member_update_get_objtype)( + OSyncEngineMemberUpdate *update); + OSyncMember* (*osync_engine_member_update_get_member)( + OSyncEngineMemberUpdate *update); + OSyncError* (*osync_engine_member_update_get_error)( + OSyncEngineMemberUpdate *update); + OSyncEngineMemberEvent (*osync_engine_member_update_get_event)( + OSyncEngineMemberUpdate *update); + void (*osync_engine_set_conflict_callback)( + OSyncEngine *engine, + osync_conflict_cb callback, + void *user_data); + void (*osync_engine_set_changestatus_callback)( + OSyncEngine *engine, + osync_status_change_cb callback, + void *user_data); + void (*osync_engine_set_mappingstatus_callback)( + OSyncEngine *engine, + osync_status_mapping_cb callback, + void *user_data); + void (*osync_engine_set_enginestatus_callback)( + OSyncEngine *engine, + osync_status_engine_cb callback, + void *user_data); + void (*osync_engine_set_memberstatus_callback)( + OSyncEngine *engine, + osync_status_member_cb callback, + void *user_data); + void (*osync_engine_set_multiply_callback)( + OSyncEngine *engine, + osync_multiply_cb callback, + void *user_data); + osync_bool (*osync_engine_initialize)(OSyncEngine *engine, + OSyncError **error); + osync_bool (*osync_engine_synchronize_and_block)( + OSyncEngine *engine,OSyncError **error); + OSyncEngineMappingEvent (*osync_engine_mapping_update_get_event)( + OSyncEngineMappingUpdate *update); + void (*osync_plugin_resource_unref)( + OSyncPluginResource *resource); + void (*osync_plugin_config_add_resource)( + OSyncPluginConfig *config, + OSyncPluginResource *resource); + osync_bool (*osync_plugin_resource_is_enabled)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_enable)( + OSyncPluginResource *resource, + osync_bool enable); + OSyncList* (*osync_plugin_resource_get_objformat_sinks)( + OSyncPluginResource *resource); + const char* (*osync_objformat_sink_get_objformat)( + OSyncObjFormatSink *sink); + const char* (*osync_objformat_sink_get_config)( + OSyncObjFormatSink *sink); + void (*osync_objformat_sink_set_config)( + OSyncObjFormatSink *sink, + const char *config); + OSyncObjFormatSink* (*osync_objformat_sink_new)( + const char *objformat, + OSyncError **error); + void (*osync_plugin_resource_add_objformat_sink)( + OSyncPluginResource *resource, + OSyncObjFormatSink *formatsink); + void (*osync_objformat_sink_unref)( + OSyncObjFormatSink *sink); + const char* (*osync_plugin_resource_get_preferred_format)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_preferred_format)( + OSyncPluginResource *resource, + const char *preferred_format); + const char* (*osync_plugin_resource_get_mime)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_mime)( + OSyncPluginResource *resource, + const char *mime); + const char* (*osync_plugin_resource_get_objtype)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_objtype)( + OSyncPluginResource *resource, + const char *objtype); + const char* (*osync_plugin_resource_get_path)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_path)( + OSyncPluginResource *resource, + const char *path); + const char* (*osync_plugin_resource_get_url)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_url)( + OSyncPluginResource *resource, + const char *url); + const char* (*osync_plugin_config_get_advancedoption_value_by_name)( + OSyncPluginConfig *config, + const char *name); + OSyncList* (*osync_plugin_config_get_advancedoptions)( + OSyncPluginConfig *config); + void (*osync_plugin_config_add_advancedoption)( + OSyncPluginConfig *config, + OSyncPluginAdvancedOption *option); + OSyncPluginAdvancedOption* (*osync_plugin_advancedoption_new)( + OSyncError **error); + void (*osync_plugin_advancedoption_unref)( + OSyncPluginAdvancedOption *option); + const char* (*osync_plugin_advancedoption_get_name)( + OSyncPluginAdvancedOption *option); + void (*osync_plugin_advancedoption_set_name)( + OSyncPluginAdvancedOption *option, + const char *name); + void (*osync_plugin_advancedoption_set_displayname)( + OSyncPluginAdvancedOption *option, + const char *displayname); + void (*osync_plugin_advancedoption_set_type)( + OSyncPluginAdvancedOption *option, + OSyncPluginAdvancedOptionType type); + void (*osync_plugin_advancedoption_set_value)( + OSyncPluginAdvancedOption *option, + const char *value); + OSyncList* (*osync_plugin_config_get_resources)( + OSyncPluginConfig *config); + OSyncPluginResource* (*osync_plugin_resource_ref)( + OSyncPluginResource *resource); + OSyncPluginResource* (*osync_plugin_resource_new)( + OSyncError **error); + const char* (*osync_plugin_resource_get_name)( + OSyncPluginResource *resource); + void (*osync_plugin_resource_set_name)( + OSyncPluginResource *resource, + const char *name); + OSyncPluginAuthentication* (*osync_plugin_config_get_authentication)( + OSyncPluginConfig *config); + const char* (*osync_plugin_authentication_get_password)( + OSyncPluginAuthentication *auth); + OSyncPluginAuthentication* (*osync_plugin_authentication_new)( + OSyncError **error); + osync_bool (*osync_plugin_authentication_option_is_supported)( + OSyncPluginAuthentication *auth, + OSyncPluginAuthenticationOptionSupportedFlag flag); + void (*osync_plugin_authentication_unref)( + OSyncPluginAuthentication *auth); + void (*osync_plugin_config_set_authentication)( + OSyncPluginConfig *config, + OSyncPluginAuthentication *auth); + void (*osync_plugin_authentication_set_password)( + OSyncPluginAuthentication *auth, + const char *password); + const char* (*osync_plugin_authentication_get_username)( + OSyncPluginAuthentication *auth); + void (*osync_plugin_authentication_set_username)( + OSyncPluginAuthentication *auth, + const char *password); + + // data pointers + vLateSmartPtr group_env; + vLateSmartPtr format_env; + vLateSmartPtr plugin_env; + + TossError error; + Converter40 converter; + + OpenSync40Private(OpenSync40 &api) + : error(this) + , converter(api) + { + } +}; + +class SyncConflict40Private : public SyncConflictPrivateBase +{ + OpenSync40Private *m_priv; + OSyncEngine *m_engine; + OSyncMappingEngine *m_mapping; + OSyncList *m_changes; + +public: + SyncConflict40Private(OpenSync40Private *priv, + OSyncEngine *engine, OSyncMappingEngine *mapping); + ~SyncConflict40Private(); + + virtual bool IsAbortSupported() const; + virtual bool IsIgnoreSupported() const; + virtual bool IsKeepNewerSupported() const; + + virtual void Select(int change_id); // takes the id of SyncChange + virtual void Abort(); + virtual void Duplicate(); + virtual void Ignore(); + virtual void KeepNewer(); + + void AppendChanges(std::vector &list); +}; + +class SyncSummary40Private : public SyncSummaryPrivateBase +{ + OpenSync40Private *m_priv; + OSyncEngine *m_engine; + +public: + SyncSummary40Private(OpenSync40Private *priv, OSyncEngine *engine); + ~SyncSummary40Private(); + + virtual void Abort(); + virtual void Continue(); + + // returns true if any member is dirty + bool AppendMembers(std::vector &list); +}; + +class OS40PluginConfigPrivate +{ +public: + OSyncMember *m_member; + OSyncPluginConfig *m_config; + + OS40PluginConfigPrivate() + : m_member(0) + , m_config(0) + { + } +}; + +class OS40ConfigResourcePrivate +{ +public: + OpenSync40Private *m_privapi; + OS40PluginConfigPrivate *m_parentpriv; + OSyncPluginResource *m_resource; + + OS40ConfigResourcePrivate() + : m_privapi(0) + , m_parentpriv(0) + , m_resource(0) + { + } +}; + +struct CallbackBundle +{ + OpenSync40Private *m_priv; + SyncStatus *m_status; + + CallbackBundle(OpenSync40Private *priv, SyncStatus &status) + : m_priv(priv) + , m_status(&status) + { + } +}; + +void conflict_handler(OSyncEngine *, OSyncMappingEngine *, void *); +void entry_status(OSyncEngineChangeUpdate *, void *); +void mapping_status(OSyncEngineMappingUpdate *, void *); +void engine_status(OSyncEngineUpdate *, void *); +void member_status(OSyncEngineMemberUpdate *, void *); +void multiply_summary(OSyncEngine *, void *); + + +///////////////////////////////////////////////////////////////////////////// +// Static helper functions + +static const char *OSyncChangeType2String(OSyncChangeType type) +{ + switch (type) { + case OSYNC_CHANGE_TYPE_ADDED: return "ADDED"; + case OSYNC_CHANGE_TYPE_UNMODIFIED: return "UNMODIFIED"; + case OSYNC_CHANGE_TYPE_DELETED: return "DELETED"; + case OSYNC_CHANGE_TYPE_MODIFIED: return "MODIFIED"; + default: + case OSYNC_CHANGE_TYPE_UNKNOWN: return "?"; + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SyncConflict40Private member functions + +SyncConflict40Private::SyncConflict40Private(OpenSync40Private *priv, + OSyncEngine *engine, OSyncMappingEngine *mapping) + : m_priv(priv) + , m_engine(engine) + , m_mapping(mapping) + , m_changes(0) +{ + m_changes = m_priv->osync_mapping_engine_get_changes(m_mapping); +} + +SyncConflict40Private::~SyncConflict40Private() +{ + m_priv->osync_list_free(m_changes); +} + +bool SyncConflict40Private::IsAbortSupported() const +{ + return true; +} + +bool SyncConflict40Private::IsIgnoreSupported() const +{ + return m_priv->osync_mapping_engine_supports_ignore(m_mapping); +} + +bool SyncConflict40Private::IsKeepNewerSupported() const +{ + return m_priv->osync_mapping_engine_supports_use_latest(m_mapping); +} + +void SyncConflict40Private::Select(int change_id) +{ + OSyncList *c = m_priv->osync_list_nth(m_changes, change_id); + if( !c ) + throw std::logic_error("Bad change_id"); + + OSyncChange *change = (OSyncChange *) c->data; + + if( !m_priv->osync_engine_mapping_solve(m_engine, m_mapping, + change, m_priv->error) ) + { + throw std::runtime_error(m_priv->error.GetErrorMsg()); + } +} + +void SyncConflict40Private::Abort() +{ + if( !m_priv->osync_engine_abort(m_engine, m_priv->error) ) { + ostringstream oss; + oss << "Problems while aborting: " + << m_priv->error.GetErrorMsg(); + throw std::runtime_error(oss.str()); + } +} + +void SyncConflict40Private::Duplicate() +{ + if( !m_priv->osync_engine_mapping_duplicate(m_engine, m_mapping, m_priv->error) ) + throw std::runtime_error(m_priv->error.GetErrorMsg()); +} + +void SyncConflict40Private::Ignore() +{ + if( !IsIgnoreSupported() ) + throw std::logic_error("Ignore not supported, yet Ignore() called."); + + if( !m_priv->osync_engine_mapping_ignore_conflict(m_engine, m_mapping, + m_priv->error) ) + { + throw std::runtime_error(m_priv->error.GetErrorMsg()); + } +} + +void SyncConflict40Private::KeepNewer() +{ + if( !IsKeepNewerSupported() ) + throw std::logic_error("Keep Newer not supported, yet KeepNewer() called."); + + if( !m_priv->osync_engine_mapping_use_latest(m_engine, m_mapping, m_priv->error) ) + throw std::runtime_error(m_priv->error.GetErrorMsg()); +} + +void SyncConflict40Private::AppendChanges(std::vector &list) +{ + int i = 0; + for( OSyncList *c = m_changes; c; c = c->next, i++ ) { + OSyncChange *change = (OSyncChange *) c->data; + + if( m_priv->osync_change_get_changetype(change) != OSYNC_CHANGE_TYPE_UNKNOWN ) { + OSyncMember *member = m_priv->osync_mapping_engine_change_find_member(m_mapping, change); + + OSyncData *data = m_priv->osync_change_get_data(change); + + SyncChange entry; + + char *printable = m_priv->osync_data_get_printable(data, m_priv->error); + if( printable ) + entry.printable_data = printable; + m_priv->osync_free(printable); + + if( m_priv->error.IsSet() ) + throw std::runtime_error(m_priv->error.GetErrorMsg()); + + entry.id = i; + entry.member_id = m_priv->osync_member_get_id(member); + entry.plugin_name = m_priv->osync_member_get_pluginname(member); + entry.uid = m_priv->osync_change_get_uid(change); + + // add to list + list.push_back(entry); + } + } +} + + +///////////////////////////////////////////////////////////////////////////// +// SyncSummary40Private member functions + +SyncSummary40Private::SyncSummary40Private(OpenSync40Private *priv, + OSyncEngine *engine) + : m_priv(priv) + , m_engine(engine) +{ +} + +SyncSummary40Private::~SyncSummary40Private() +{ +} + +void SyncSummary40Private::Abort() +{ + if( !m_priv->osync_engine_abort(m_engine, m_priv->error) ) + throw std::runtime_error(m_priv->error.GetErrorMsg()); +} + +void SyncSummary40Private::Continue() +{ + if( !m_priv->osync_engine_continue(m_engine, m_priv->error) ) + throw std::runtime_error(m_priv->error.GetErrorMsg()); +} + +bool SyncSummary40Private::AppendMembers(std::vector &list) +{ + SyncListHandle objengines(m_priv->osync_list_free); + objengines = m_priv->osync_engine_get_objengines(m_engine); + + int i = 0; + bool dirty = false; + + for( OSyncList *o = objengines.get(); o; o = o->next ) { + OSyncObjEngine *objengine = (OSyncObjEngine *) o->data; + + + + + + SyncListHandle members(m_priv->osync_list_free); + members = m_priv->osync_obj_engine_get_members(objengine); + for( OSyncList *m = members.get(); m; m = m->next ) { + OSyncMember *member = (OSyncMember *) m->data; + + // Fill in common summary data + SyncMemberSummary entry; + entry.id = i; + entry.objtype_name = m_priv->osync_obj_engine_get_objtype(objengine); + entry.member_id = m_priv->osync_member_get_id(member); + entry.plugin_name = m_priv->osync_member_get_pluginname(member); + + const OSyncList *mapping_entry_engines = m_priv->osync_obj_engine_get_mapping_entry_engines_of_member(objengine, member); + + // Calculate summary counts + for( const OSyncList *e = mapping_entry_engines; e; e = e->next ) { + OSyncMappingEntryEngine *entry_engine = (OSyncMappingEntryEngine*) e->data; + + if( !m_priv->osync_entry_engine_is_dirty(entry_engine) ) + continue; + + dirty = true; + + OSyncChangeType type = m_priv->osync_entry_engine_get_changetype(entry_engine); + switch (type) + { + case OSYNC_CHANGE_TYPE_ADDED: + entry.added++; + break; + case OSYNC_CHANGE_TYPE_MODIFIED: + entry.modified++; + break; + case OSYNC_CHANGE_TYPE_DELETED: + entry.deleted++; + break; + default: + break; + } + } + + // Add entry to list + list.push_back(entry); + + } + } + + return dirty; +} + + +///////////////////////////////////////////////////////////////////////////// +// Callback functions + +void conflict_handler(OSyncEngine *engine, OSyncMappingEngine *mapping, + void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + // build the SyncConflict object + SyncConflict40Private scp(cb->m_priv, engine, mapping); + SyncConflict conflict(scp); + + // append all conflicting changes as vector objects in the same + // order as the opensync library mapping + scp.AppendChanges(conflict); + + // call the status handler + cb->m_status->HandleConflict(conflict); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("Conflict not resolved. ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in conflict_handler()"); + } +} + +void entry_status(OSyncEngineChangeUpdate *status, void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + ostringstream oss; + + OSyncChange *change = cb->m_priv->osync_engine_change_update_get_change(status); + OSyncMember *member = cb->m_priv->osync_engine_change_update_get_member(status); + OSyncError *error = cb->m_priv->osync_engine_change_update_get_error(status); + + const char *action = NULL; + const char *direction = NULL; + const char *msg = NULL; + bool error_event = false; + + switch( cb->m_priv->osync_engine_change_update_get_event(status) ) + { + case OSYNC_ENGINE_CHANGE_EVENT_READ: + action = "Received an entry"; + direction = "from"; + msg = OSyncChangeType2String(cb->m_priv->osync_change_get_changetype(change)); + break; + + case OSYNC_ENGINE_CHANGE_EVENT_WRITTEN: + action = "Sent an entry"; + direction = "to"; + msg = OSyncChangeType2String(cb->m_priv->osync_change_get_changetype(change)); + break; + + case OSYNC_ENGINE_CHANGE_EVENT_ERROR: + error_event = true; + action = "Error for entry"; + direction = "and"; + msg = cb->m_priv->osync_error_print(&(error)); + break; + } + + if( action ) { + oss << action << " " + << cb->m_priv->osync_change_get_uid(change) + << "(" + << cb->m_priv->osync_objformat_get_name( cb->m_priv->osync_change_get_objformat(change)) + << ") " << direction << " member " + << cb->m_priv->osync_member_get_id(member) + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << "): " + << msg; + + // call the status handler + cb->m_status->EntryStatus(oss.str(), error_event); + } + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("entry_status error:") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in entry_status()"); + } +} + +void mapping_status(OSyncEngineMappingUpdate *status, void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + OSyncError *error = cb->m_priv->osync_engine_mapping_update_get_error(status); + + ostringstream oss; + bool error_event = false; + + switch( cb->m_priv->osync_engine_mapping_update_get_event(status) ) + { + case OSYNC_ENGINE_MAPPING_EVENT_SOLVED: + oss << "Mapping solved"; + break; + + case OSYNC_ENGINE_MAPPING_EVENT_ERROR: + error_event = true; + oss << "Mapping error: " + << cb->m_priv->osync_error_print(&(error)); + break; + } + + // call the status handler + if( oss.str().size() ) + cb->m_status->MappingStatus(oss.str(), error_event); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("mapping_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in mapping_status()"); + } +} + +void engine_status(OSyncEngineUpdate *status, void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + OSyncError *error = cb->m_priv->osync_engine_update_get_error(status); + + ostringstream oss; + bool error_event = false; + bool slow_sync = false; + + switch( cb->m_priv->osync_engine_update_get_event(status) ) + { + case OSYNC_ENGINE_EVENT_CONNECTED: + oss << "All clients connected or error"; + break; + case OSYNC_ENGINE_EVENT_CONNECT_DONE: + /* Not of interest for regular user. */ + break; + case OSYNC_ENGINE_EVENT_READ: + oss << "All clients sent changes or error"; + break; + case OSYNC_ENGINE_EVENT_MAPPED: + oss << "All changes got mapped"; + break; + case OSYNC_ENGINE_EVENT_MULTIPLIED: + oss << "All changes got multiplied"; + break; + case OSYNC_ENGINE_EVENT_PREPARED_WRITE: + oss << "All changes got prepared for write"; + break; + case OSYNC_ENGINE_EVENT_PREPARED_MAP: + /* Not of interest for regular user. */ + break; + case OSYNC_ENGINE_EVENT_WRITTEN: + oss << "All clients have written"; + break; + case OSYNC_ENGINE_EVENT_DISCONNECTED: + oss << "All clients have disconnected"; + break; + case OSYNC_ENGINE_EVENT_ERROR: + error_event = true; + oss << "The sync failed: " << cb->m_priv->osync_error_print(&(error)); + break; + case OSYNC_ENGINE_EVENT_SUCCESSFUL: + oss << "The sync was successful"; + break; + case OSYNC_ENGINE_EVENT_PREV_UNCLEAN: + oss << "The previous synchronization was unclean. Slow-syncing"; + slow_sync = true; + break; + case OSYNC_ENGINE_EVENT_END_CONFLICTS: + oss << "All conflicts have been reported"; + break; + case OSYNC_ENGINE_EVENT_SYNC_DONE: + oss << "All clients reported sync done"; + break; + } + + // call the status handler + if( oss.str().size() ) + cb->m_status->EngineStatus(oss.str(), + error_event, + slow_sync); + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("engine_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in engine_status()"); + } +} + +void member_status(OSyncEngineMemberUpdate *status, void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + ostringstream oss; + bool error_event = false; + bool valid = true; + + const char *objtype = cb->m_priv->osync_engine_member_update_get_objtype(status); + if( objtype == NULL ) + oss << "Main sink"; + else + oss << objtype << " sink"; + + + OSyncMember *member = cb->m_priv->osync_engine_member_update_get_member(status); + + oss << " of member " + << cb->m_priv->osync_member_get_id(member) + << " (" + << cb->m_priv->osync_member_get_pluginname(member) + << ")"; + + OSyncError *error = cb->m_priv->osync_engine_member_update_get_error(status); + + switch( cb->m_priv->osync_engine_member_update_get_event(status) ) + { + case OSYNC_ENGINE_MEMBER_EVENT_CONNECTED: + oss << " just connected"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_CONNECT_DONE: + // Special event - but not interesting for + // the normal user. + break; + case OSYNC_ENGINE_MEMBER_EVENT_DISCONNECTED: + oss << " just disconnected"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_READ: + oss << " just sent all changes"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_WRITTEN: + oss << " committed all changes"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_SYNC_DONE: + oss << " reported sync done"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_DISCOVERED: + oss << " discovered its objtypes"; + break; + case OSYNC_ENGINE_MEMBER_EVENT_ERROR: + oss << " had an error: " + << cb->m_priv->osync_error_print(&error); + error_event = true; + break; + default: + valid = false; + break; + } + + // call the status handler + if( oss.str().size() && valid ) { + cb->m_status->MemberStatus( + cb->m_priv->osync_member_get_id(member), + cb->m_priv->osync_member_get_pluginname(member), + oss.str(), error_event); + } + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("member_status error: ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in member_status()"); + } +} + +void multiply_summary(OSyncEngine *engine, void *cbdata) +{ + CallbackBundle *cb = (CallbackBundle*) cbdata; + + try { + // build the SyncSummary object + SyncSummary40Private ssp(cb->m_priv, engine); + SyncSummary summary(ssp); + + // append a summary for each objtype member + if( ssp.AppendMembers(summary) ) { + // call the status handler only if dirty + cb->m_status->CheckSummary(summary); + } + else { + // nothing dirty, just continue + summary.Continue(); + } + } + catch( std::exception &e ) { + cb->m_status->ReportError( + string("Error handling summary. ") + e.what()); + } + catch( ... ) { + cb->m_status->ReportError( + "Unknown exception caught in multiply_summary()"); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// OS40ConfigResource - public members + +OS40ConfigResource::OS40ConfigResource(const OS40PluginConfig &parent, + void *resource, + bool existing_resource) + : m_priv( new OS40ConfigResourcePrivate ) + , m_exists(existing_resource) +{ + m_priv->m_privapi = parent.m_privapi; + m_priv->m_parentpriv = parent.m_priv.get(); + m_priv->m_resource = (OSyncPluginResource*) resource; +} + +OS40ConfigResource::~OS40ConfigResource() +{ + // unref the resource, since we hold a copy + m_priv->m_privapi-> + osync_plugin_resource_unref(m_priv->m_resource); + delete m_priv; +} + +bool OS40ConfigResource::IsExistingResource() const +{ + return m_exists; +} + +// safe to call multiple times +void OS40ConfigResource::AddResource() +{ + if( !IsExistingResource() ) { + m_priv->m_privapi-> + osync_plugin_config_add_resource( + m_priv->m_parentpriv->m_config, + m_priv->m_resource); + } +} + +bool OS40ConfigResource::IsEnabled() const +{ + return m_priv->m_privapi-> + osync_plugin_resource_is_enabled(m_priv->m_resource); +} + +OS40ConfigResource& OS40ConfigResource::Enable(bool enabled) +{ + m_priv->m_privapi->osync_plugin_resource_enable(m_priv->m_resource, + enabled); + return *this; +} + +bool OS40ConfigResource::FindObjFormat(const std::string &objformat, + std::string &config) +{ + SyncListHandle sinks(m_priv->m_privapi->osync_list_free); + sinks = m_priv->m_privapi-> + osync_plugin_resource_get_objformat_sinks(m_priv->m_resource); + for( OSyncList *o = sinks.get(); o; o = o->next ) { + OSyncObjFormatSink *sink = (OSyncObjFormatSink*) o->data; + if( objformat == m_priv->m_privapi->osync_objformat_sink_get_objformat(sink) ) { + const char *cfg = m_priv->m_privapi->osync_objformat_sink_get_config(sink); + if( cfg ) + config = cfg; + else + config.clear(); + return true; + } + } + return false; +} + +OS40ConfigResource& OS40ConfigResource::SetObjFormat(const std::string &objformat, + const std::string &config) +{ + // if it already exists, just set the config value + SyncListHandle sinks(m_priv->m_privapi->osync_list_free); + sinks = m_priv->m_privapi-> + osync_plugin_resource_get_objformat_sinks(m_priv->m_resource); + for( OSyncList *o = sinks.get(); o; o = o->next ) { + OSyncObjFormatSink *sink = (OSyncObjFormatSink*) o->data; + if( objformat == m_priv->m_privapi->osync_objformat_sink_get_objformat(sink) ) { + m_priv->m_privapi->osync_objformat_sink_set_config(sink, config.c_str()); + return *this; + } + } + + // if we get here, it doesn't exist, and we need to add it + OSyncObjFormatSink *sink = m_priv->m_privapi-> + osync_objformat_sink_new(objformat.c_str(), + m_priv->m_privapi->error); + if( !sink ) + throw std::runtime_error(m_priv->m_privapi->error.GetErrorMsg()); + + if( config.size() ) + m_priv->m_privapi->osync_objformat_sink_set_config(sink, + config.c_str()); + m_priv->m_privapi->osync_plugin_resource_add_objformat_sink( + m_priv->m_resource, sink); + m_priv->m_privapi->osync_objformat_sink_unref(sink); + return *this; +} + +std::string OS40ConfigResource::GetName() const +{ + string value; + const char *pv = m_priv->m_privapi-> + osync_plugin_resource_get_name(m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetName(const std::string &name) +{ + m_priv->m_privapi-> + osync_plugin_resource_set_name(m_priv->m_resource, name.c_str()); + return *this; +} + +std::string OS40ConfigResource::GetPreferredFormat() const +{ + string value; + const char *pv = m_priv->m_privapi-> + osync_plugin_resource_get_preferred_format(m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetPreferredFormat(const std::string &format) +{ + m_priv->m_privapi-> + osync_plugin_resource_set_preferred_format(m_priv->m_resource, + format.c_str()); + return *this; +} + +std::string OS40ConfigResource::GetMime() const +{ + string value; + const char *pv = m_priv->m_privapi->osync_plugin_resource_get_mime( + m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetMime(const std::string &mime) +{ + m_priv->m_privapi->osync_plugin_resource_set_mime(m_priv->m_resource, + mime.c_str()); + return *this; +} + +std::string OS40ConfigResource::GetObjType() const +{ + string value; + const char *pv = m_priv->m_privapi->osync_plugin_resource_get_objtype( + m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetObjType(const std::string &objtype) +{ + m_priv->m_privapi->osync_plugin_resource_set_objtype(m_priv->m_resource, + objtype.c_str()); + return *this; +} + +std::string OS40ConfigResource::GetPath() const +{ + string value; + const char *pv = m_priv->m_privapi->osync_plugin_resource_get_path( + m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetPath(const std::string &path) +{ + m_priv->m_privapi->osync_plugin_resource_set_path(m_priv->m_resource, + path.c_str()); + return *this; +} + +std::string OS40ConfigResource::GetUrl() const +{ + string value; + const char *pv = m_priv->m_privapi->osync_plugin_resource_get_url( + m_priv->m_resource); + if( pv ) + value = pv; + return value; +} + +OS40ConfigResource& OS40ConfigResource::SetUrl(const std::string &url) +{ + m_priv->m_privapi->osync_plugin_resource_set_url(m_priv->m_resource, + url.c_str()); + return *this; +} + + +///////////////////////////////////////////////////////////////////////////// +// OS40PluginConfig - public members + +OS40PluginConfig::OS40PluginConfig(OpenSync40Private *privapi, + void *member, + void *config) + : m_privapi(privapi) +{ + m_priv.reset( new OS40PluginConfigPrivate ); + m_priv->m_member = (OSyncMember*) member; + m_priv->m_config = (OSyncPluginConfig*) config; +} + +std::string OS40PluginConfig::GetAdvanced(const std::string &name) +{ + const char *value = m_privapi->osync_plugin_config_get_advancedoption_value_by_name(m_priv->m_config, name.c_str()); + string val; + if( value ) + val = value; + return val; +} + +void OS40PluginConfig::SetAdvanced(const std::string &name, + const std::string &display_name, + const std::string &val) +{ + SetAdvanced(name, display_name, STRING_TYPE, val); +} + +void OS40PluginConfig::SetAdvanced(const std::string &name, + const std::string &display_name, + int val_type, + const std::string &val) +{ + // find the first advanced option with this name + SyncListHandle aos(m_privapi->osync_list_free); + aos = m_privapi->osync_plugin_config_get_advancedoptions(m_priv->m_config); + OSyncPluginAdvancedOption *option = 0; + for( OSyncList *o = aos.get(); o; o = o->next ) { + option = (OSyncPluginAdvancedOption*) o->data; + + if( name == m_privapi->osync_plugin_advancedoption_get_name(option) ) + break; + } + + if( option ) { + // found existing option, set it with val + m_privapi->osync_plugin_advancedoption_set_value(option, val.c_str()); + } + else { + // option with that name does not exist, so create it + option = m_privapi->osync_plugin_advancedoption_new(m_privapi->error); + if( !option ) + throw std::runtime_error(m_privapi->error.GetErrorMsg()); + + m_privapi->osync_plugin_advancedoption_set_name(option, name.c_str()); + m_privapi->osync_plugin_advancedoption_set_displayname(option, display_name.c_str()); + OSyncPluginAdvancedOptionType type; + switch( val_type ) + { + case NONE_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_NONE; + break; + case BOOL_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_BOOL; + break; + case CHAR_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_CHAR; + break; + case DOUBLE_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_DOUBLE; + break; + case INT_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_INT; + break; + case LONG_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_LONG; + break; + case LONGLONG_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_LONGLONG; + break; + case UINT_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_UINT; + break; + case ULONG_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_ULONG; + break; + case ULONGLONG_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_ULONGLONG; + break; + case STRING_TYPE: + type = OSYNC_PLUGIN_ADVANCEDOPTION_TYPE_STRING; + break; + default: + throw std::logic_error("Bad type in SetAdvanced()"); + } + m_privapi->osync_plugin_advancedoption_set_type(option, type); + m_privapi->osync_plugin_advancedoption_set_value(option, val.c_str()); + m_privapi->osync_plugin_config_add_advancedoption(m_priv->m_config, option); + m_privapi->osync_plugin_advancedoption_unref(option); + } +} + +OS40PluginConfig::OS40ConfigResourcePtr +OS40PluginConfig::GetResource(const std::string &objtype) +{ + OS40ConfigResourcePtr ptr; + + // FIXME - get_resources() does not give us a copy, so don't use + // the SyncListHandle here + OSyncList *rs = m_privapi->osync_plugin_config_get_resources(m_priv->m_config); + for( OSyncList *o = rs; o; o = o->next ) { + OSyncPluginResource *res = (OSyncPluginResource*) o->data; + if( objtype == m_privapi->osync_plugin_resource_get_objtype(res) ) { + // bump the resource count, since OS40ConfigResource + // will unref it in the destructor + m_privapi->osync_plugin_resource_ref(res); + ptr.reset( new OS40ConfigResource(*this, res, true) ); + return ptr; + } + } + + // this res has a ref bump already, no ref() needed like it is above + OSyncPluginResource *res = m_privapi->osync_plugin_resource_new(m_privapi->error); + if( !res ) + throw std::runtime_error(m_privapi->error.GetErrorMsg()); + ptr.reset( new OS40ConfigResource(*this, res, false) ); + // we search by objtype name, so make sure this is set in + // the new object + ptr->SetObjType(objtype); + return ptr; +} + +std::string OS40PluginConfig::GetUsername() const +{ + string username; + + OSyncPluginAuthentication *auth = m_privapi->osync_plugin_config_get_authentication(m_priv->m_config); + if( !auth ) + return username; + + const char *un = m_privapi->osync_plugin_authentication_get_username(auth); + if( !un ) + return username; + + username = un; + return username; +} + +void OS40PluginConfig::SetUsername(const std::string &username) +{ + OSyncPluginAuthentication *auth = m_privapi->osync_plugin_config_get_authentication(m_priv->m_config); + if( !auth ) { + auth = m_privapi->osync_plugin_authentication_new(m_privapi->error); + if( !auth ) + throw std::runtime_error(m_privapi->error.GetErrorMsg()); + if( !m_privapi->osync_plugin_authentication_option_is_supported(auth, OSYNC_PLUGIN_AUTHENTICATION_USERNAME) ) { + m_privapi->osync_plugin_authentication_unref(auth); + throw std::runtime_error("Username (authentication parameter) is not supported in plugin!"); + } + + // all looks ok, add it to the config + m_privapi->osync_plugin_config_set_authentication(m_priv->m_config, auth); + // unref our copy, since the config now has it... + // our auth pointer will still be valid since config holds it + m_privapi->osync_plugin_authentication_unref(auth); + } + + m_privapi->osync_plugin_authentication_set_username(auth, username.c_str()); +} + +std::string OS40PluginConfig::GetPassword() const +{ + string password; + + OSyncPluginAuthentication *auth = m_privapi->osync_plugin_config_get_authentication(m_priv->m_config); + if( !auth ) + return password; + + const char *pass = m_privapi->osync_plugin_authentication_get_password(auth); + if( !pass ) + return password; + + password = pass; + return password; +} + +void OS40PluginConfig::SetPassword(const std::string &password) +{ + OSyncPluginAuthentication *auth = m_privapi->osync_plugin_config_get_authentication(m_priv->m_config); + if( !auth ) { + auth = m_privapi->osync_plugin_authentication_new(m_privapi->error); + if( !auth ) + throw std::runtime_error(m_privapi->error.GetErrorMsg()); + if( !m_privapi->osync_plugin_authentication_option_is_supported(auth, OSYNC_PLUGIN_AUTHENTICATION_PASSWORD) ) { + m_privapi->osync_plugin_authentication_unref(auth); + throw std::runtime_error("Password authentication is not supported in plugin!"); + } + + // all looks ok, add it to the config + m_privapi->osync_plugin_config_set_authentication(m_priv->m_config, auth); + // unref our copy, since the config now has it... + // our auth pointer will still be valid since config holds it + m_privapi->osync_plugin_authentication_unref(auth); + } + + m_privapi->osync_plugin_authentication_set_password(auth, password.c_str()); +} + +void OS40PluginConfig::Save() +{ + if( !m_privapi->osync_member_save(m_priv->m_member, m_privapi->error) ) + throw std::runtime_error(m_privapi->error.GetErrorMsg()); +} + + +///////////////////////////////////////////////////////////////////////////// +// OpenSync40 (API override class) - public members + +OpenSync40::OpenSync40() +{ + // due to bugs in the way opensync 0.22 loads its modules, + // (i.e. it doesn't load the plugins using RTLD_LOCAL, and + // so libopensync.so.0 is loaded and pollutes the symbol table, + // causing symbol clashes) we need to make sure that + // OpenSync40 is only loaded first... if OpenSync22 was + // loaded first, we will fail, so error out + if( OpenSync22::SymbolsLoaded() ) + throw std::logic_error("Always load OpenSync40 before OpenSync22, to avoid symbol table conflicts."); + + if( !Open("libopensync.so.1") ) + throw DlError("Can't dlopen libopensync.so.1"); + + // store locally in case of constructor exception in LoadSym + std::auto_ptr p(new OpenSync40Private(*this)); + + // load all required symbols... + // we don't need to use try/catch here, since the base + // class destructor will clean up for us if LoadSym() throws + LoadSym(p->osync_get_version, "osync_get_version"); + LoadSym(p->osync_error_print, "osync_error_print"); + LoadSym(p->osync_error_is_set, "osync_error_is_set"); + LoadSym(p->osync_error_unref, "osync_error_unref"); + LoadSym(p->osync_group_env_new, "osync_group_env_new"); + LoadSym(p->osync_format_env_new, "osync_format_env_new"); + LoadSym(p->osync_plugin_env_new, "osync_plugin_env_new"); + LoadSym(p->osync_group_env_unref, "osync_group_env_unref"); + LoadSym(p->osync_format_env_unref, "osync_format_env_unref"); + LoadSym(p->osync_plugin_env_unref, "osync_plugin_env_unref"); + LoadSym(p->osync_plugin_env_load, "osync_plugin_env_load"); + LoadSym(p->osync_plugin_env_get_plugins,"osync_plugin_env_get_plugins"); + LoadSym(p->osync_plugin_get_name, "osync_plugin_get_name"); + LoadSym(p->osync_list_free, "osync_list_free"); + LoadSym(p->osync_group_env_load_groups, "osync_group_env_load_groups"); + LoadSym(p->osync_format_env_load_plugins, + "osync_format_env_load_plugins"); + LoadSym(p->osync_group_env_get_groups, "osync_group_env_get_groups"); + LoadSym(p->osync_group_get_name, "osync_group_get_name"); + LoadSym(p->osync_group_env_find_group, "osync_group_env_find_group"); + LoadSym(p->osync_group_get_members, "osync_group_get_members"); + LoadSym(p->osync_member_get_name, "osync_member_get_name"); + LoadSym(p->osync_member_get_id, "osync_member_get_id"); + LoadSym(p->osync_member_get_pluginname, "osync_member_get_pluginname"); + LoadSym(p->osync_format_env_get_objformats, + "osync_format_env_get_objformats"); + LoadSym(p->osync_objformat_get_name, "osync_objformat_get_name"); + LoadSym(p->osync_objformat_get_objtype, "osync_objformat_get_objtype"); + LoadSym(p->osync_group_new, "osync_group_new"); + LoadSym(p->osync_group_unref, "osync_group_unref"); + LoadSym(p->osync_group_set_name, "osync_group_set_name"); + LoadSym(p->osync_group_env_add_group, "osync_group_env_add_group"); + LoadSym(p->osync_group_save, "osync_group_save"); + LoadSym(p->osync_group_delete, "osync_group_delete"); + LoadSym(p->osync_group_env_remove_group,"osync_group_env_remove_group"); + LoadSym(p->osync_plugin_env_find_plugin,"osync_plugin_env_find_plugin"); + LoadSym(p->osync_member_unref, "osync_member_unref"); + LoadSym(p->osync_member_new, "osync_member_new"); + LoadSym(p->osync_group_add_member, "osync_group_add_member"); + LoadSym(p->osync_member_set_pluginname, "osync_member_set_pluginname"); + LoadSym(p->osync_member_set_name, "osync_member_set_name"); + LoadSym(p->osync_member_save, "osync_member_save"); + LoadSym(p->osync_group_find_member, "osync_group_find_member"); + LoadSym(p->osync_member_delete, "osync_member_delete"); + LoadSym(p->osync_group_remove_member, "osync_group_remove_member"); + LoadSym(p->osync_plugin_config_new, "osync_plugin_config_new"); + LoadSym(p->osync_plugin_config_file_load, + "osync_plugin_config_file_load"); + LoadSym(p->osync_member_set_config, "osync_member_set_config"); + LoadSym(p->osync_member_get_config_or_default, + "osync_member_get_config_or_default"); + LoadSym(p->osync_plugin_config_file_save, + "osync_plugin_config_file_save"); + LoadSym(p->osync_plugin_get_config_type,"osync_plugin_get_config_type"); + LoadSym(p->osync_engine_new, "osync_engine_new"); + LoadSym(p->osync_engine_unref, "osync_engine_unref"); + LoadSym(p->osync_engine_discover_and_block, + "osync_engine_discover_and_block"); + LoadSym(p->osync_member_get_objtypes, "osync_member_get_objtypes"); + LoadSym(p->osync_list_length, "osync_list_length"); + LoadSym(p->osync_error_set, "osync_error_set"); + LoadSym(p->osync_engine_finalize, "osync_engine_finalize"); + LoadSym(p->osync_mapping_engine_get_changes, + "osync_mapping_engine_get_changes"); + LoadSym(p->osync_mapping_engine_supports_ignore, + "osync_mapping_engine_supports_ignore"); + LoadSym(p->osync_mapping_engine_supports_use_latest, + "osync_mapping_engine_supports_use_latest"); + LoadSym(p->osync_list_nth, "osync_list_nth"); + LoadSym(p->osync_engine_mapping_solve, "osync_engine_mapping_solve"); + LoadSym(p->osync_engine_abort, "osync_engine_abort"); + LoadSym(p->osync_engine_mapping_duplicate, + "osync_engine_mapping_duplicate"); + LoadSym(p->osync_engine_mapping_ignore_conflict, + "osync_engine_mapping_ignore_conflict"); + LoadSym(p->osync_engine_mapping_use_latest, + "osync_engine_mapping_use_latest"); + LoadSym(p->osync_change_get_changetype, "osync_change_get_changetype"); + LoadSym(p->osync_mapping_engine_change_find_member, + "osync_mapping_engine_change_find_member"); + LoadSym(p->osync_change_get_data, "osync_change_get_data"); + LoadSym(p->osync_data_get_printable, "osync_data_get_printable"); + LoadSym(p->osync_free, "osync_free"); + LoadSym(p->osync_change_get_uid, "osync_change_get_uid"); + LoadSym(p->osync_engine_continue, "osync_engine_continue"); + LoadSym(p->osync_engine_get_objengines, "osync_engine_get_objengines"); + LoadSym(p->osync_obj_engine_get_members, + "osync_obj_engine_get_members"); + LoadSym(p->osync_obj_engine_get_objtype, + "osync_obj_engine_get_objtype"); + LoadSym(p->osync_obj_engine_get_mapping_entry_engines_of_member, + "osync_obj_engine_get_mapping_entry_engines_of_member"); + LoadSym(p->osync_entry_engine_is_dirty,"osync_entry_engine_is_dirty"); + LoadSym(p->osync_entry_engine_get_changetype, + "osync_entry_engine_get_changetype"); + LoadSym(p->osync_engine_change_update_get_change, + "osync_engine_change_update_get_change"); + LoadSym(p->osync_engine_change_update_get_member, + "osync_engine_change_update_get_member"); + LoadSym(p->osync_engine_change_update_get_error, + "osync_engine_change_update_get_error"); + LoadSym(p->osync_engine_change_update_get_event, + "osync_engine_change_update_get_event"); + LoadSym(p->osync_change_get_objformat, "osync_change_get_objformat"); + LoadSym(p->osync_engine_mapping_update_get_error, + "osync_engine_mapping_update_get_error"); + LoadSym(p->osync_engine_update_get_error, + "osync_engine_update_get_error"); + LoadSym(p->osync_engine_update_get_event, + "osync_engine_update_get_event"); + LoadSym(p->osync_engine_member_update_get_objtype, + "osync_engine_member_update_get_objtype"); + LoadSym(p->osync_engine_member_update_get_member, + "osync_engine_member_update_get_member"); + LoadSym(p->osync_engine_member_update_get_error, + "osync_engine_member_update_get_error"); + LoadSym(p->osync_engine_member_update_get_event, + "osync_engine_member_update_get_event"); + LoadSym(p->osync_engine_set_conflict_callback, + "osync_engine_set_conflict_callback"); + LoadSym(p->osync_engine_set_changestatus_callback, + "osync_engine_set_changestatus_callback"); + LoadSym(p->osync_engine_set_mappingstatus_callback, + "osync_engine_set_mappingstatus_callback"); + LoadSym(p->osync_engine_set_enginestatus_callback, + "osync_engine_set_enginestatus_callback"); + LoadSym(p->osync_engine_set_memberstatus_callback, + "osync_engine_set_memberstatus_callback"); + LoadSym(p->osync_engine_set_multiply_callback, + "osync_engine_set_multiply_callback"); + LoadSym(p->osync_engine_initialize, "osync_engine_initialize"); + LoadSym(p->osync_engine_synchronize_and_block, + "osync_engine_synchronize_and_block"); + LoadSym(p->osync_engine_mapping_update_get_event, + "osync_engine_mapping_update_get_event"); + LoadSym(p->osync_plugin_resource_unref, + "osync_plugin_resource_unref"); + LoadSym(p->osync_plugin_config_add_resource, + "osync_plugin_config_add_resource"); + LoadSym(p->osync_plugin_resource_is_enabled, + "osync_plugin_resource_is_enabled"); + LoadSym(p->osync_plugin_resource_enable, + "osync_plugin_resource_enable"); + LoadSym(p->osync_plugin_resource_get_objformat_sinks, + "osync_plugin_resource_get_objformat_sinks"); + LoadSym(p->osync_objformat_sink_get_objformat, + "osync_objformat_sink_get_objformat"); + LoadSym(p->osync_objformat_sink_get_config, + "osync_objformat_sink_get_config"); + LoadSym(p->osync_objformat_sink_set_config, + "osync_objformat_sink_set_config"); + LoadSym(p->osync_objformat_sink_new, + "osync_objformat_sink_new"); + LoadSym(p->osync_plugin_resource_add_objformat_sink, + "osync_plugin_resource_add_objformat_sink"); + LoadSym(p->osync_objformat_sink_unref, + "osync_objformat_sink_unref"); + LoadSym(p->osync_plugin_resource_get_preferred_format, + "osync_plugin_resource_get_preferred_format"); + LoadSym(p->osync_plugin_resource_set_preferred_format, + "osync_plugin_resource_set_preferred_format"); + LoadSym(p->osync_plugin_resource_get_mime, + "osync_plugin_resource_get_mime"); + LoadSym(p->osync_plugin_resource_set_mime, + "osync_plugin_resource_set_mime"); + LoadSym(p->osync_plugin_resource_get_objtype, + "osync_plugin_resource_get_objtype"); + LoadSym(p->osync_plugin_resource_set_objtype, + "osync_plugin_resource_set_objtype"); + LoadSym(p->osync_plugin_resource_get_path, + "osync_plugin_resource_get_path"); + LoadSym(p->osync_plugin_resource_set_path, + "osync_plugin_resource_set_path"); + LoadSym(p->osync_plugin_resource_get_url, + "osync_plugin_resource_get_url"); + LoadSym(p->osync_plugin_resource_set_url, + "osync_plugin_resource_set_url"); + LoadSym(p->osync_plugin_config_get_advancedoption_value_by_name, + "osync_plugin_config_get_advancedoption_value_by_name"); + LoadSym(p->osync_plugin_config_get_advancedoptions, + "osync_plugin_config_get_advancedoptions"); + LoadSym(p->osync_plugin_config_add_advancedoption, + "osync_plugin_config_add_advancedoption"); + LoadSym(p->osync_plugin_advancedoption_new, + "osync_plugin_advancedoption_new"); + LoadSym(p->osync_plugin_advancedoption_unref, + "osync_plugin_advancedoption_unref"); + LoadSym(p->osync_plugin_advancedoption_get_name, + "osync_plugin_advancedoption_get_name"); + LoadSym(p->osync_plugin_advancedoption_set_name, + "osync_plugin_advancedoption_set_name"); + LoadSym(p->osync_plugin_advancedoption_set_displayname, + "osync_plugin_advancedoption_set_displayname"); + LoadSym(p->osync_plugin_advancedoption_set_type, + "osync_plugin_advancedoption_set_type"); + LoadSym(p->osync_plugin_advancedoption_set_value, + "osync_plugin_advancedoption_set_value"); + LoadSym(p->osync_plugin_config_get_resources, + "osync_plugin_config_get_resources"); + LoadSym(p->osync_plugin_resource_ref, + "osync_plugin_resource_ref"); + LoadSym(p->osync_plugin_resource_new, + "osync_plugin_resource_new"); + LoadSym(p->osync_plugin_resource_get_name, + "osync_plugin_resource_get_name"); + LoadSym(p->osync_plugin_resource_set_name, + "osync_plugin_resource_set_name"); + LoadSym(p->osync_plugin_config_get_authentication, + "osync_plugin_config_get_authentication"); + LoadSym(p->osync_plugin_authentication_get_password, + "osync_plugin_authentication_get_password"); + LoadSym(p->osync_plugin_authentication_new, + "osync_plugin_authentication_new"); + LoadSym(p->osync_plugin_authentication_option_is_supported, + "osync_plugin_authentication_option_is_supported"); + LoadSym(p->osync_plugin_authentication_unref, + "osync_plugin_authentication_unref"); + LoadSym(p->osync_plugin_config_set_authentication, + "osync_plugin_config_set_authentication"); + LoadSym(p->osync_plugin_authentication_set_password, + "osync_plugin_authentication_set_password"); + LoadSym(p->osync_plugin_authentication_get_username, + "osync_plugin_authentication_get_username"); + LoadSym(p->osync_plugin_authentication_set_username, + "osync_plugin_authentication_set_username"); + + // fixup free pointers + p->group_env.SetFreeFunc(p->osync_group_env_unref); + p->format_env.SetFreeFunc(p->osync_format_env_unref); + p->plugin_env.SetFreeFunc(p->osync_plugin_env_unref); + + // setup opensync support environment + SetupEnvironment(p.get()); + + // this pointer is ours now + m_priv = p.release(); +} + +OpenSync40::~OpenSync40() +{ + delete m_priv; + m_priv = 0; +} + +void OpenSync40::SetupEnvironment(OpenSync40Private *p) +{ + // allocate group, format, and env + p->group_env = p->osync_group_env_new(p->error); + if( !p->group_env.get() ) + throw std::runtime_error(p->error.GetErrorMsg()); + + p->format_env = p->osync_format_env_new(p->error); + if( !p->format_env.get() ) + throw std::runtime_error(p->error.GetErrorMsg()); + + p->plugin_env = p->osync_plugin_env_new(p->error); + if( !p->plugin_env.get() ) + throw std::runtime_error(p->error.GetErrorMsg()); + + // load group, format, and env + if( !p->osync_group_env_load_groups(p->group_env.get(), NULL, p->error) || + !p->osync_format_env_load_plugins(p->format_env.get(), NULL, p->error) || + !p->osync_plugin_env_load(p->plugin_env.get(), NULL, p->error) ) + throw std::runtime_error(p->error.GetErrorMsg()); +} + +const char* OpenSync40::GetVersion() const +{ + return m_priv->osync_get_version(); +} + +const char* OpenSync40::GetEngineName() const +{ + return "0.40"; +} + +void OpenSync40::GetPluginNames(string_list_type &plugins) +{ + // start fresh + plugins.clear(); + + OSyncPlugin *plugin; + OSyncList *plugin_list, *p; + + plugin_list = m_priv->osync_plugin_env_get_plugins(m_priv->plugin_env.get()); + for( p = plugin_list; p; p = p->next ) { + plugin = (OSyncPlugin *) p->data; + plugins.push_back(m_priv->osync_plugin_get_name(plugin)); + } + + m_priv->osync_list_free(plugin_list); +} + +void OpenSync40::GetFormats(format_list_type &formats) +{ + // start fresh + formats.clear(); + + OSyncList *o, *list = m_priv->osync_format_env_get_objformats(m_priv->format_env.get()); + + for( o = list; o; o = o->next ) { + OSyncObjFormat *format = (OSyncObjFormat *) o->data; + + Format new_format; + new_format.name = m_priv->osync_objformat_get_name(format); + new_format.object_type = m_priv->osync_objformat_get_objtype(format); + + formats.push_back(new_format); + } + + m_priv->osync_list_free(list); +} + +void OpenSync40::GetGroupNames(string_list_type &groups) +{ + // start fresh + groups.clear(); + + OSyncGroup *group; + OSyncList *g, *group_list = m_priv->osync_group_env_get_groups(m_priv->group_env.get()); + + for( g = group_list; g; g = g->next ) { + group = (OSyncGroup *) g->data; + groups.push_back(m_priv->osync_group_get_name(group)); + } + + m_priv->osync_list_free(group_list); +} + +void OpenSync40::GetMembers(const std::string &group_name, + member_list_type &members) +{ + // start fresh + members.clear(); + + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) { + ostringstream oss; + oss << "GetMembers: Unable to find group with name: " << group_name; + throw std::runtime_error(oss.str()); + } + + OSyncList *member_list = m_priv->osync_group_get_members(group); + for( OSyncList *m = member_list; m; m = m->next ) { + Member new_member; + OSyncMember *member = (OSyncMember *) m->data; + const char *membername = m_priv->osync_member_get_name(member); + if (membername) { + new_member.friendly_name = membername; + } + + new_member.group_name = group_name; + new_member.id = m_priv->osync_member_get_id(member); + new_member.plugin_name = m_priv->osync_member_get_pluginname(member); + + // add to member list + members.push_back(new_member); + } + + // cleanup + m_priv->osync_list_free(member_list); +} + +void OpenSync40::AddGroup(const std::string &group_name) +{ + OSyncGroup *group = m_priv->osync_group_new(m_priv->error); + if( !group ) + throw std::runtime_error("AddGroup(): " + m_priv->error.GetErrorMsg()); + + m_priv->osync_group_set_name(group, group_name.c_str()); + if( !m_priv->osync_group_env_add_group(m_priv->group_env.get(), group, m_priv->error) ) { + m_priv->osync_group_unref(group); + throw std::runtime_error("AddGroup(): " + m_priv->error.GetErrorMsg()); + } + + if( !m_priv->osync_group_save(group, m_priv->error) ) { + m_priv->osync_group_unref(group); + throw std::runtime_error("AddGroup(): " + m_priv->error.GetErrorMsg()); + } + + m_priv->osync_group_unref(group); +} + +void OpenSync40::DeleteGroup(const std::string &group_name) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("DeleteGroup(): Group not found: " + group_name); + + if( !m_priv->osync_group_delete(group, m_priv->error) ) + throw std::runtime_error("DeleteGroup(): " + m_priv->error.GetErrorMsg()); + + m_priv->osync_group_env_remove_group(m_priv->group_env.get(), group); +} + +Converter& OpenSync40::GetConverter() +{ + return m_priv->converter; +} + +long OpenSync40::AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("AddMember(): Group not found: " + group_name); + + OSyncPlugin *plugin = m_priv->osync_plugin_env_find_plugin(m_priv->plugin_env.get(), plugin_name.c_str()); + if( !plugin ) + throw std::runtime_error("AddMember(): Plugin not found: " + plugin_name); + + vLateSmartPtr mptr(m_priv->osync_member_unref); + mptr = m_priv->osync_member_new(m_priv->error); + if( !mptr.get() ) + throw std::runtime_error("AddMember(): " + m_priv->error.GetErrorMsg()); + + m_priv->osync_group_add_member(group, mptr.get()); + m_priv->osync_member_set_pluginname(mptr.get(), plugin_name.c_str()); + + if( member_name.size() ) + m_priv->osync_member_set_name(mptr.get(), member_name.c_str()); + + if( !m_priv->osync_member_save(mptr.get(), m_priv->error) ) + throw std::runtime_error("AddMember(): " + m_priv->error.GetErrorMsg()); + + return m_priv->osync_member_get_id(mptr.get()); +} + +void OpenSync40::DeleteMember(const std::string &group_name, long member_id) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("DeleteMember(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_group_find_member(group, member_id); + if( !member ) { + ostringstream oss; + oss << "DeleteMember(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + if( !m_priv->osync_member_delete(member, m_priv->error) ) + throw std::runtime_error("DeleteMember(): " + m_priv->error.GetErrorMsg()); + + m_priv->osync_group_remove_member(group, member); +} + +void OpenSync40::DeleteMember(const std::string &group_name, + const std::string &plugin_name) +{ + member_list_type mlist; + GetMembers(group_name, mlist); + Member *member = mlist.Find(plugin_name.c_str()); + if( !member ) + throw std::runtime_error("DeleteMember(): Member not found: " + plugin_name); + + DeleteMember(group_name, member->id); +} + +bool OpenSync40::IsConfigurable(const std::string &group_name, + long member_id) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("IsConfigurable(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_group_find_member(group, member_id); + if( !member ) { + ostringstream oss; + oss << "IsConfigurable(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncPlugin *plugin = m_priv->osync_plugin_env_find_plugin(m_priv->plugin_env.get(), m_priv->osync_member_get_pluginname(member)); + if( !plugin ) + throw std::runtime_error(string("IsConfigurable(): Unable to find plugin with name: ") + m_priv->osync_member_get_pluginname(member)); + + + OSyncPluginConfigurationType type = m_priv->osync_plugin_get_config_type(plugin); + return type != OSYNC_PLUGIN_NO_CONFIGURATION; +} + +std::string OpenSync40::GetConfiguration(const std::string &group_name, + long member_id) +{ + if( !IsConfigurable(group_name, member_id) ) { + ostringstream oss; + oss << "GetConfiguration(): Member " << member_id << " of group '" << group_name << "' does not accept configuration."; + throw std::runtime_error(oss.str()); + } + + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("GetConfiguration(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_group_find_member(group, member_id); + if( !member ) { + ostringstream oss; + oss << "GetConfiguration(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncPlugin *plugin = m_priv->osync_plugin_env_find_plugin(m_priv->plugin_env.get(), m_priv->osync_member_get_pluginname(member)); + if( !plugin ) + throw std::runtime_error(string("GetConfiguration(): Unable to find plugin with name: ") + m_priv->osync_member_get_pluginname(member)); + + + OSyncPluginConfig *config = m_priv->osync_member_get_config_or_default(member, m_priv->error); + if( !config ) + throw std::runtime_error("GetConfiguration(): " + m_priv->error.GetErrorMsg()); + + // To emulate 0.22 behaviour, we need to use 0.4x save-to-file + // functions, and then load that from the file again, and + // return that string as the configuratin. + + TempDir tempdir("opensyncapi"); + + string filename = tempdir.GetNewFilename(); + + if( !m_priv->osync_plugin_config_file_save(config, filename.c_str(), m_priv->error) ) + throw std::runtime_error("GetConfiguration(): " + m_priv->error.GetErrorMsg()); + + ifstream in(filename.c_str()); + string config_data; + char buf[4096]; + while( in ) { + in.read(buf, sizeof(buf)); + config_data.append(buf, in.gcount()); + } + + return config_data; +} + +OS40PluginConfig OpenSync40::GetConfigurationObj(const std::string &group_name, + long member_id) +{ + if( !IsConfigurable(group_name, member_id) ) { + ostringstream oss; + oss << "GetConfigurationObj(): Member " << member_id << " of group '" << group_name << "' does not accept configuration."; + throw std::runtime_error(oss.str()); + } + + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("GetConfigurationObj(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_group_find_member(group, member_id); + if( !member ) { + ostringstream oss; + oss << "GetConfigurationObj(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncPlugin *plugin = m_priv->osync_plugin_env_find_plugin(m_priv->plugin_env.get(), m_priv->osync_member_get_pluginname(member)); + if( !plugin ) + throw std::runtime_error(string("GetConfigurationObj(): Unable to find plugin with name: ") + m_priv->osync_member_get_pluginname(member)); + + + OSyncPluginConfig *config = m_priv->osync_member_get_config_or_default(member, m_priv->error); + if( !config ) + throw std::runtime_error("GetConfigurationObj(): " + m_priv->error.GetErrorMsg()); + + return OS40PluginConfig(m_priv, member, config); +} + +void OpenSync40::SetConfiguration(const std::string &group_name, + long member_id, + const std::string &config_data) +{ + if( !IsConfigurable(group_name, member_id) ) { + ostringstream oss; + oss << "SetConfiguration(): Member " << member_id << " of group '" << group_name << "' does not accept configuration."; + throw std::runtime_error(oss.str()); + } + + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("SetConfiguration(): Group not found: " + group_name); + + OSyncMember *member = m_priv->osync_group_find_member(group, member_id); + if( !member ) { + ostringstream oss; + oss << "SetConfiguration(): Member " << member_id << " not found."; + throw std::runtime_error(oss.str()); + } + + OSyncPlugin *plugin = m_priv->osync_plugin_env_find_plugin(m_priv->plugin_env.get(), m_priv->osync_member_get_pluginname(member)); + if( !plugin ) + throw std::runtime_error(string("SetConfiguration(): Unable to find plugin with name: ") + m_priv->osync_member_get_pluginname(member)); + + + // To emulate 0.22 behaviour, we need to use 0.4x save-to-file + // functions, and then load that from the file again, and + // return that string as the configuratin. + + TempDir tempdir("opensyncapi"); + + string filename = tempdir.GetNewFilename(); + + // write config data to file + { + ofstream out(filename.c_str()); + out << config_data; + } + + // load brand new config from file + // if a new config object isn't created here, the loaded config + // will be added to the existing config + OSyncPluginConfig *new_config = m_priv->osync_plugin_config_new(m_priv->error); + if( !m_priv->osync_plugin_config_file_load(new_config, filename.c_str(), m_priv->error) ) + throw std::runtime_error("SetConfiguration(): " + m_priv->error.GetErrorMsg()); + + m_priv->osync_member_set_config(member, new_config); + + if( !m_priv->osync_member_save(member, m_priv->error)) + throw std::runtime_error("SetConfiguration(): " + m_priv->error.GetErrorMsg()); +} + +void OpenSync40::Discover(const std::string &group_name) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("Discover(): Group not found: " + group_name); + + EngineHandle engine(m_priv->osync_engine_unref); + engine = m_priv->osync_engine_new(group, m_priv->error); + if( !engine.get() ) + throw std::runtime_error("Discover(): " + m_priv->error.GetErrorMsg()); + + SyncListHandle members(m_priv->osync_list_free); + members = m_priv->osync_group_get_members(group); + OSyncList *m = NULL; + for( m = members.get(); m; m = m->next ) { + OSyncMember *member = (OSyncMember *) m->data; + + /* Discover the objtypes for the members */ + if( !m_priv->osync_engine_discover_and_block(engine.get(), member, m_priv->error)) + break; + + SyncListHandle objtypes(m_priv->osync_list_free); + objtypes = m_priv->osync_member_get_objtypes(member); + if( m_priv->osync_list_length(objtypes.get()) == 0 ) { + m_priv->osync_error_set(m_priv->error, OSYNC_ERROR_GENERIC, "discover failed: no objtypes returned"); + break; + } + + if( !m_priv->osync_member_save(member, m_priv->error) ) + break; + } + + // check for error + if( m ) { + m_priv->osync_engine_finalize(engine.get(), m_priv->error); + throw std::runtime_error("Discover(): " + m_priv->error.GetErrorMsg()); + } +} + +void OpenSync40::Sync(const std::string &group_name, + SyncStatus &status_callback) +{ + OSyncGroup *group = m_priv->osync_group_env_find_group(m_priv->group_env.get(), group_name.c_str()); + if( !group ) + throw std::runtime_error("Sync(): Group not found: " + group_name); + + EngineHandle engine(m_priv->osync_engine_unref); + engine = m_priv->osync_engine_new(group, m_priv->error); + if( !engine.get() ) + throw std::runtime_error("Sync(): " + m_priv->error.GetErrorMsg()); + + + CallbackBundle cbdata(m_priv, status_callback); + + m_priv->osync_engine_set_conflict_callback(engine.get(), conflict_handler, &cbdata); + m_priv->osync_engine_set_changestatus_callback(engine.get(), entry_status, &cbdata); + m_priv->osync_engine_set_mappingstatus_callback(engine.get(), mapping_status, &cbdata); + m_priv->osync_engine_set_enginestatus_callback(engine.get(), engine_status, &cbdata); + m_priv->osync_engine_set_memberstatus_callback(engine.get(), member_status, &cbdata); + m_priv->osync_engine_set_multiply_callback(engine.get(), multiply_summary, &cbdata); + + + SyncListHandle members(m_priv->osync_list_free); + members = m_priv->osync_group_get_members(group); + OSyncList *m = NULL; + for( m = members.get(); m; m = m->next ) { + OSyncMember *member = (OSyncMember *) m->data; + + SyncListHandle objtypes(m_priv->osync_list_free); + objtypes = m_priv->osync_member_get_objtypes(member); + if( m_priv->osync_list_length(objtypes.get()) == 0 ) { + cout << "Sync(): Member " << m_priv->osync_member_get_id(member) << " has no objtypes. Has it already been discovered?" << endl; + } + } + + if( !m_priv->osync_engine_initialize(engine.get(), m_priv->error) ) + throw std::runtime_error("Sync(): " + m_priv->error.GetErrorMsg()); + + if( !m_priv->osync_engine_synchronize_and_block(engine.get(), m_priv->error) ) { + m_priv->osync_engine_finalize(engine.get(), NULL); + throw std::runtime_error("Sync(): " + m_priv->error.GetErrorMsg()); + } + + if( !m_priv->osync_engine_finalize(engine.get(), m_priv->error) ) + throw std::runtime_error("Sync(): " + m_priv->error.GetErrorMsg()); +} + + +///////////////////////////////////////////////////////////////////////////// +// TossError public members + +/// Returns NULL if no error +std::string TossError::GetErrorMsg() +{ + return std::string(m_priv->osync_error_print(&m_error)); +} + +bool TossError::IsSet() +{ + return m_priv->osync_error_is_set(&m_error); +} + +void TossError::Clear() +{ + if( m_error ) { + m_priv->osync_error_unref(&m_error); + m_error = 0; + } +} + +} // namespace OpenSync + diff -Nru barry-0.14/desktop/src/os40.h barry-0.0.20110506/desktop/src/os40.h --- barry-0.14/desktop/src/os40.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/os40.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,212 @@ +/// +/// \file os40.h +/// Wrapper class for opensync 0.4x syncing behaviour +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_OS40_H__ +#define __BARRYDESKTOP_OS40_H__ + +#include "dlopen.h" +#include "osbase.h" +#include + +namespace OpenSync { + +class OpenSync40Private; +class OS40PluginConfigPrivate; +class OS40ConfigResourcePrivate; + +class OS40PluginConfig; +class OpenSync40; + +class OS40ConfigResource +{ + friend class OS40PluginConfig; + +private: + OS40ConfigResourcePrivate *m_priv; + bool m_exists; // true if this resources exists + // in the plugin config. + // AddResource() sets this to true + +private: + OS40ConfigResource(const OS40PluginConfig &parent, void *resource, + bool existing_resource); + OS40ConfigResource(const OS40ConfigResource &other);//disabled copy + OS40ConfigResource& operator=(const OS40ConfigResource &other); + +public: + ~OS40ConfigResource(); + + /// Returns true if this instance represents an existing + /// resource in the config. If this is false, then + /// AddResource() must be called, otherwise any changes + /// will not be saved to the config object. + bool IsExistingResource() const; + void AddResource(); // safe to call multiple times + + bool IsEnabled() const; + OS40ConfigResource& Enable(bool enabled = true); + + // searches for the objformat, and fills in config with its config + // value if it exists and returns true... otherwise returns false + bool FindObjFormat(const std::string &objformat, std::string &config); + OS40ConfigResource& SetObjFormat(const std::string &objformat, + const std::string &config = ""); + + std::string GetName() const; + OS40ConfigResource& SetName(const std::string &name); + + std::string GetPreferredFormat() const; + OS40ConfigResource& SetPreferredFormat(const std::string &format); + + std::string GetMime() const; + OS40ConfigResource& SetMime(const std::string &mime); + + std::string GetObjType() const; +private:OS40ConfigResource& SetObjType(const std::string &objtype); // objtype is set + // automatically when this object is created with GetResource() + +public: + std::string GetPath() const; + OS40ConfigResource& SetPath(const std::string &path); + + std::string GetUrl() const; + OS40ConfigResource& SetUrl(const std::string &url); +}; + +class OS40PluginConfig +{ + friend class OS40ConfigResource; + friend class OpenSync40; + +public: + typedef std::auto_ptr OS40ConfigResourcePtr; + + enum { + NONE_TYPE, + BOOL_TYPE, + CHAR_TYPE, + DOUBLE_TYPE, + INT_TYPE, + LONG_TYPE, + LONGLONG_TYPE, + UINT_TYPE, + ULONG_TYPE, + ULONGLONG_TYPE, + STRING_TYPE + }; + +private: + OpenSync40Private *m_privapi; // external pointer to OpenSync40 + std::tr1::shared_ptr m_priv; + +private: + OS40PluginConfig(OpenSync40Private *privapi, void *member, void *config); + +public: + std::string GetAdvanced(const std::string &name); + void SetAdvanced(const std::string &name, + const std::string &display_name, const std::string &val); + void SetAdvanced(const std::string &name, + const std::string &display_name, + int val_type, const std::string &val); + + OS40ConfigResourcePtr GetResource(const std::string &objtype); + + std::string GetUsername() const; + void SetUsername(const std::string &username); + + std::string GetPassword() const; + void SetPassword(const std::string &password); + + void Save(); +}; + +class OpenSync40 : public DlOpen, public OpenSync::API +{ +public: + +private: + // private opensync 0.40 function pointers and data + OpenSync40Private *m_priv; + +protected: + void SetupEnvironment(OpenSync40Private *p); + +public: + OpenSync40(); + ~OpenSync40(); + + // + // Virtual API overrides + // + + // Functional abilities information... this does not come from + // the engine itself, but is information the osbase library + // determines useful for applications to know + bool IsSlowSyncSupported() const { return true; } // FIXME - is this right? + bool IsContactSyncSupported() const { return true; } + bool IsCalendarSyncSupported() const { return true; } + bool IsMemoSyncSupported() const { return true; } + bool IsTodoSyncSupported() const { return true; } + + // General engine information + const char* GetVersion() const; + const char* GetEngineName() const; + void GetPluginNames(string_list_type &plugins); + void GetFormats(format_list_type &formats); + + // Information about configured groups + void GetGroupNames(string_list_type &groups); + void GetMembers(const std::string &group_name, + member_list_type &members); + + // Group configuration + void AddGroup(const std::string &group_name); + void DeleteGroup(const std::string &group_name); + + // Plugin configuration helper + Converter& GetConverter(); + + // Member configuration + long AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name); + void DeleteMember(const std::string &group_name, long member_id); + void DeleteMember(const std::string &group_name, + const std::string &plugin_name); + bool IsConfigurable(const std::string &group_name, + long member_id); + std::string GetConfiguration(const std::string &group_name, + long member_id); + OS40PluginConfig GetConfigurationObj(const std::string &group_name, + long member_id); + void SetConfiguration(const std::string &group_name, + long member_id, const std::string &config_data); + void Discover(const std::string &group_name); + + // Syncing + void Sync(const std::string &group_name, SyncStatus &status_callback); +}; + +} // namespace OpenSync + +#endif + diff -Nru barry-0.14/desktop/src/osbase.cc barry-0.0.20110506/desktop/src/osbase.cc --- barry-0.14/desktop/src/osbase.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osbase.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,439 @@ +/// +/// \file osbase.cc +/// Base API class helpers +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "osbase.h" +#include "os22.h" +#include "os40.h" +#include "osprivatebase.h" +#include +#include +#include +#include + +using namespace std; + +namespace OpenSync { + +std::ostream& operator<< (std::ostream &os, const string_list_type &list) +{ + string_list_type::const_iterator b = list.begin(), e = list.end(); + for( ; b != e; ++b ) { + os << *b << endl; + } + return os; +} + +std::ostream& operator<< (std::ostream &os, const Member &member) +{ + os << "Member ID: 0x" << hex << member.id + << "\n Plugin Name: " << member.plugin_name; + os << "\n Friendly Name: "; + if( member.friendly_name.size() ) + os << member.friendly_name; + else + os << ""; + return os; +} + +std::ostream& operator<< (std::ostream &os, const member_list_type &list) +{ + member_list_type::const_iterator b = list.begin(), e = list.end(); + for( ; b != e; ++b ) { + os << *b << endl; + } + return os; +} + +std::ostream& operator<< (std::ostream &os, const Format &format) +{ + os << "Format: " << format.name + << " (Object Type: " << format.object_type << ")"; + return os; +} + +std::ostream& operator<< (std::ostream &os, const format_list_type &list) +{ + format_list_type::const_iterator b = list.begin(), e = list.end(); + for( ; b != e; ++b ) { + os << *b << endl; + } + return os; +} + + +///////////////////////////////////////////////////////////////////////////// +// MemberSet public members + +Member* MemberSet::Find(long id) +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( b->id == id ) + return &(*b); + } + return 0; +} + +Member* MemberSet::Find(const char *plugin_name) +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( b->plugin_name == plugin_name ) + return &(*b); + } + return 0; +} + +long MemberSet::FindId(const char *plugin_name) +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( b->plugin_name == plugin_name ) + return b->id; + } + return -1; +} + +///////////////////////////////////////////////////////////////////////////// +// FormatSet public members + +Format* FormatSet::Find(const char *name) +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( b->name == name ) + return &(*b); + } + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// SyncConflict public members + +SyncConflict::SyncConflict(SyncConflictPrivateBase &conflict) + : m_conflict(conflict) +{ +} + +SyncConflict::~SyncConflict() +{ +} + +bool SyncConflict::IsAbortSupported() const +{ + return m_conflict.IsAbortSupported(); +} + +bool SyncConflict::IsIgnoreSupported() const +{ + return m_conflict.IsIgnoreSupported(); +} + +bool SyncConflict::IsKeepNewerSupported() const +{ + return m_conflict.IsKeepNewerSupported(); +} + +std::string SyncConflict::GetMenu() const +{ + ostringstream oss; + oss << "Which entry do you want to use?\n[1-9] To select a side"; + + if( IsAbortSupported() ) + oss << ", [A]bort"; + + oss << ", [D]uplicate"; + + if( IsIgnoreSupported() ) + oss << ", [I]gnore"; + + if( IsKeepNewerSupported() ) + oss << ", Keep [N]ewer"; + + return oss.str(); +} + +void SyncConflict::Select(int change_index) +{ + m_conflict.Select(change_index); +} + +void SyncConflict::Abort() +{ + m_conflict.Abort(); +} + +void SyncConflict::Duplicate() +{ + m_conflict.Duplicate(); +} + +void SyncConflict::Ignore() +{ + m_conflict.Ignore(); +} + +void SyncConflict::KeepNewer() +{ + m_conflict.KeepNewer(); +} + +std::ostream& SyncConflict::Dump(std::ostream &os) const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + os << "Entry " << (b->id+1) << ":\n" + << "Member: " << b->member_id << "(" << b->plugin_name << ")\n" + << "UID: " << b->uid << "\n" + << "Data: " << b->printable_data << "\n"; + } + return os; +} + + +///////////////////////////////////////////////////////////////////////////// +// SyncSummary public members + +SyncSummary::SyncSummary(SyncSummaryPrivateBase &summary) + : m_summary(summary) +{ +} + +SyncSummary::~SyncSummary() +{ +} + +void SyncSummary::Abort() +{ + m_summary.Abort(); +} + +void SyncSummary::Continue() +{ + m_summary.Continue(); +} + +std::ostream& SyncSummary::Dump(std::ostream &os) const +{ + string objtype_name; + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( b->objtype_name != objtype_name ) { + objtype_name = b->objtype_name; + os << "Objtype: " << b->objtype_name << "\n"; + } + + os << "\tMember " << b->id << "(" << b->member_id << ") " + << b->plugin_name + << ": Adding(" << b->added << ") " + << "Modifying(" << b->modified << ") " + << "Deleting(" << b->deleted << ")\n"; + } + return os; +} + + +///////////////////////////////////////////////////////////////////////////// +// SyncStatus public members - default, CLI imeplementations + +SyncStatus::~SyncStatus() +{ +} + +void SyncStatus::HandleConflict(SyncConflict &conflict) +{ + bool again = true; + while( again ) { + again = false; + cout << "Conflicting items:\n" << conflict << endl; + cout << conflict.GetMenu() << ": "; + string line; + getline(cin, line); + switch( line[0] ) + { + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + conflict.Select(atoi(line.c_str()) - 1); + break; + case 'A': + case 'a': + if( conflict.IsAbortSupported() ) + conflict.Abort(); + else + cout << "Abort not supported!" << endl; + break; + case 'D': + case 'd': + conflict.Duplicate(); + break; + case 'I': + case 'i': + if( conflict.IsIgnoreSupported() ) + conflict.Ignore(); + else + cout << "Ignore not supported!" << endl; + break; + case 'N': + case 'n': + if( conflict.IsKeepNewerSupported() ) + conflict.KeepNewer(); + else + cout << "Keep Newer not supported!" << endl; + break; + default: + again = true; + break; + } + } +} + +void SyncStatus::EntryStatus(const std::string &msg, bool error) +{ + if( error ) + cout << "ERROR: "; + cout << msg << endl; +} + +void SyncStatus::MappingStatus(const std::string &msg, bool error) +{ + if( error ) + cout << "ERROR: "; + cout << msg << endl; +} + +void SyncStatus::EngineStatus(const std::string &msg, bool error, bool slowsync) +{ + if( error ) + cout << "ERROR: "; + cout << msg << endl; +} + +void SyncStatus::MemberStatus(long member_id, + const std::string &plugin_name, + const std::string &msg, + bool error) +{ + if( error ) + cout << "ERROR: "; + cout << msg << endl; +} + +void SyncStatus::CheckSummary(SyncSummary &summary) +{ + cout << "\nSynchronization Forecast Summary:\n"; + cout << summary << endl; + + cout << "Do you want to continue the synchronization? (N/y): "; + string line; + getline(cin, line); + + // Abort if not got accepted with 'y' + if( line[0] != 'y') { + cout << "\nAborting! Synchronization got aborted by user!" << endl; + summary.Abort(); + } else { + cout << "\nOK! Completing synchronization!" << endl; + summary.Continue(); + } +} + +void SyncStatus::ReportError(const std::string &msg) +{ + cout << "CALLBACK ERROR: " << msg << endl; +} + + +///////////////////////////////////////////////////////////////////////////// +// OpenSyncAPISet public members + +APISet::APISet() +{ +} + +APISet::~APISet() +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + delete *b; + } + + base_type::clear(); +} + +// throws if not all can be opened +void APISet::OpenAll() +{ + push_back( new OpenSync40 ); + push_back( new OpenSync22 ); +} + +// does not throw +int APISet::OpenAvailable() +{ + int loaded = 0; + + try { + API *p = new OpenSync40; + push_back(p); + loaded++; + } + catch( std::exception &e ) { + cerr << "Unable to load opensync 0.40: " << e.what(); + push_back(0); + } + + try { + API *p = new OpenSync22; + push_back(p); + loaded++; + } + catch( std::exception &e ) { + cerr << "Unable to load opensync 0.22: " << e.what(); + push_back(0); + } + + return loaded; +} + +int APISet::GetAvailable() const +{ + return ((*this)[0] ? 1 : 0) + ((*this)[1] ? 1 : 0); +} + +API* APISet::os40() +{ + return (*this)[0]; +} + +API* APISet::os22() +{ + return (*this)[1]; +} + +} // namespace OpenSync + diff -Nru barry-0.14/desktop/src/osbase.h barry-0.0.20110506/desktop/src/osbase.h --- barry-0.14/desktop/src/osbase.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osbase.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,325 @@ +/// +/// \file osbase.h +/// Base API class for OpenSync interaction. +/// This API will operate both 0.22 and 0.4x +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_OSBASE_H__ +#define __BARRYDESKTOP_OSBASE_H__ + +#include +#include +#include +#include + +namespace OpenSync { + +struct Member +{ + std::string group_name; + long id; + std::string friendly_name; // may not always have a name + std::string plugin_name; +}; + +struct MemberSet : public std::vector +{ + Member* Find(long id); + Member* Find(const char *plugin_name); + long FindId(const char *plugin_name); // returns -1 if not found +}; + +struct Format +{ + std::string name; + std::string object_type; +}; + +struct FormatSet : public std::vector +{ + Format* Find(const char *name); +}; + +typedef std::vector string_list_type; +typedef MemberSet member_list_type; +typedef FormatSet format_list_type; + +std::ostream& operator<< (std::ostream &os, const string_list_type &list); +std::ostream& operator<< (std::ostream &os, const Member &member); +std::ostream& operator<< (std::ostream &os, const member_list_type &list); +std::ostream& operator<< (std::ostream &os, const Format &format); +std::ostream& operator<< (std::ostream &os, const format_list_type &list); + + +class SyncConflictPrivateBase; + +struct SyncChange +{ + int id; + long member_id; + std::string plugin_name; + std::string uid; + std::string printable_data; +}; + +class SyncConflict : public std::vector +{ + SyncConflictPrivateBase &m_conflict; + +public: + SyncConflict(SyncConflictPrivateBase &conflict); + ~SyncConflict(); + + bool IsAbortSupported() const; + bool IsIgnoreSupported() const; + bool IsKeepNewerSupported() const; + + std::string GetMenu() const; + void Select(int change_id); // takes the id field of SyncChange + void Abort(); + void Duplicate(); + void Ignore(); + void KeepNewer(); + + std::ostream& Dump(std::ostream &os) const; +}; + +inline std::ostream& operator<< (std::ostream &os, const SyncConflict &conflict) +{ + return conflict.Dump(os); +} + + +class SyncSummaryPrivateBase; + +struct SyncMemberSummary +{ + int id; + std::string objtype_name; + long member_id; + std::string plugin_name; + unsigned long added; + unsigned long modified; + unsigned long deleted; + + SyncMemberSummary() + : added(0), modified(0), deleted(0) + {} +}; + +class SyncSummary : public std::vector +{ + SyncSummaryPrivateBase &m_summary; + +public: + SyncSummary(SyncSummaryPrivateBase &summary); + ~SyncSummary(); + + void Abort(); + void Continue(); + + std::ostream& Dump(std::ostream &os) const; +}; + +inline std::ostream& operator<< (std::ostream &os, const SyncSummary &summary) +{ + return summary.Dump(os); +} + + +// notes: OpenSync::SyncStatus is a base class with all the opensync +// callbacks as virtual functions, with reasonable defaults. The +// programmer can override any callbacks he so chooses as below. +// +// If a callback has state or information or requires a decision, it +// passes in a reference to a base class (example below: SyncConflict). +// This base class is really a reference to a derived class specific +// to the 0.22 or 0.4x library API, and contains pointers to the +// OpenSync40 or OpenSync22 classes and private structs, and handles +// all cleanup of the state it holds. Also, these classes hold +// information in C++ style variables... for example SyncConflict +// will hold a vector of objects that contain the osync change +// information of each conflicting change, as well as a means to +// access a pretty printed version. No OpenSync constants will +// be used in these objects. +// +// If abstracted enough, the override code should be dead simple, +// like below, and also be generic enough to run on both 0.22 and +// 0.4x libraries, dynamically. :-D +// +class SyncStatus +{ +public: + virtual ~SyncStatus(); + + // virtual overrides + virtual void HandleConflict(OpenSync::SyncConflict &conflict); + virtual void EntryStatus(const std::string &msg, bool error); + virtual void MappingStatus(const std::string &msg, bool error); + virtual void EngineStatus(const std::string &msg, bool error, bool slowsync); + virtual void MemberStatus(long member_id, + const std::string &plugin_name, + const std::string &msg, bool error); + virtual void CheckSummary(OpenSync::SyncSummary &summary); + + virtual void ReportError(const std::string &msg); +}; + +// forward declarations for the Converter class +namespace Config { + class Plugin; + class Barry; + class Evolution; + class Google; + class Unsupported; +} + +// +// Converter +// +/// Base class for the converter api, which converts from/to a data-holding +/// plugin configuration class to/from the API. +/// +/// For 0.22, it will manually write the config fields into a std::string +/// suitable for a call to API::SetConfiguration(), and then call +/// SetConfiguration() itself. +/// +/// For 0.4x, it may do the same thing, or might use the new 0.4x calls +/// to set the individual fields through the low level opensync API. +/// +/// The API class creates an instance of a matching derived class +/// (for 0.22 or 0.4x, per the API itself), and returns a pointer +/// whenever asked. +/// +class Converter +{ +public: + typedef std::tr1::shared_ptr plugin_ptr; + +public: + virtual ~Converter() {} + + virtual bool IsPluginSupported(const std::string &plugin_name, + std::string *appname = 0) const = 0; + virtual plugin_ptr CreateAndLoadPlugin(const Member &member) = 0; + + virtual std::string GetPluginName(const Config::Barry &) const = 0; + virtual std::string GetPluginName(const Config::Evolution &) const = 0; + virtual std::string GetPluginName(const Config::Google &) const = 0; + virtual std::string GetPluginName(const Config::Unsupported &) const = 0; + + virtual bool IsConfigured(const Config::Barry &) const = 0; + virtual bool IsConfigured(const Config::Evolution &) const = 0; + virtual bool IsConfigured(const Config::Google &) const = 0; + virtual bool IsConfigured(const Config::Unsupported &) const = 0; + + virtual void Load(Config::Barry &config, const Member &member) = 0; + virtual void Load(Config::Evolution &config, const Member &member) = 0; + virtual void Load(Config::Google &config, const Member &member) = 0; + virtual void Load(Config::Unsupported &config, const Member &member) = 0; + + virtual void Save(const Config::Barry &config, + const std::string &group_name) = 0; + virtual void Save(const Config::Evolution &config, + const std::string &group_name) = 0; + virtual void Save(const Config::Google &config, + const std::string &group_name) = 0; + virtual void Save(const Config::Unsupported &config, + const std::string &group_name) = 0; +}; + +class API +{ +public: + API() + { + } + + virtual ~API() + { + } + + // Functional abilities information... this does not come from + // the engine itself, but is information the osbase library + // determines useful for applications to know + virtual bool IsSlowSyncSupported() const = 0; + virtual bool IsContactSyncSupported() const = 0; + virtual bool IsCalendarSyncSupported() const = 0; + virtual bool IsMemoSyncSupported() const = 0; + virtual bool IsTodoSyncSupported() const = 0; + + // General engine information + virtual const char* GetVersion() const = 0; + virtual const char* GetEngineName() const = 0; // "0.22" or "0.40", etc + virtual void GetPluginNames(string_list_type &plugins) = 0; + virtual void GetFormats(format_list_type &formats) = 0; + + // Information about configured groups + virtual void GetGroupNames(string_list_type &groups) = 0; + virtual void GetMembers(const std::string &group_name, + member_list_type &members) = 0; + + // Group configuration + virtual void AddGroup(const std::string &group_name) = 0; + virtual void DeleteGroup(const std::string &group_name) = 0; + + // Plugin configuration helper + virtual Converter& GetConverter() = 0; + + // Member configuration + // AddMember() returns new member_id? + virtual long AddMember(const std::string &group_name, + const std::string &plugin_name, + const std::string &member_name) = 0; + virtual bool IsConfigurable(const std::string &group_name, + long member_id) = 0; + virtual std::string GetConfiguration(const std::string &group_name, + long member_id) = 0; + virtual void SetConfiguration(const std::string &group_name, + long member_id, const std::string &config_data) = 0; + virtual void Discover(const std::string &group_name) = 0; + + // Syncing + virtual void Sync(const std::string &group_name, + SyncStatus &status_callback) = 0; +}; + +class APISet : private std::vector +{ + typedef std::vector base_type; + +public: + APISet(); + ~APISet(); + + void OpenAll(); // throws if not all can be opened + int OpenAvailable(); // opens only what is available and + // returns # of APIs successfully loaded. + // throws if some already loaded + + int GetAvailable() const;// returns # of APIs successfully loaded + + API* os40(); + API* os22(); +}; + +} // namespace OpenSync + +#endif + diff -Nru barry-0.14/desktop/src/osconfig.cc barry-0.0.20110506/desktop/src/osconfig.cc --- barry-0.14/desktop/src/osconfig.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconfig.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,429 @@ +/// +/// \file osconfig.cc +/// Class which detects a set of available or known devices +/// in an opensync-able system. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "osconfig.h" +#include "os40.h" +#include +#include +#include +#include +#include + +using namespace std; + +namespace OpenSync { namespace Config { + +////////////////////////////////////////////////////////////////////////////// +// Evolution + +void Evolution::SetIfExists(std::string &var, const std::string &dir) +{ + struct stat s; + if( stat(dir.c_str(), &s) == 0 ) { + if( S_ISDIR(s.st_mode) ) { + var = dir; + } + } +} + +bool Evolution::AutoDetect() +{ + struct passwd *pw = getpwuid(getuid()); + if( !pw ) + return false; + + string base = pw->pw_dir; + base += "/.evolution/"; + + string tail = "/local/system"; + + SetIfExists(m_address_path, base + "addressbook" + tail); + SetIfExists(m_calendar_path, base + "calendar" + tail); + SetIfExists(m_tasks_path, base + "tasks" + tail); + SetIfExists(m_memos_path, base + "memos" + tail); + + // first three are required + return m_address_path.size() && + m_calendar_path.size() && + m_tasks_path.size(); +} + +////////////////////////////////////////////////////////////////////////////// +// Group class + +Group::Group(const std::string &group_name, + OpenSync::API &api, + unsigned throw_mask) + : m_group_name(group_name) +{ + Load(api, throw_mask); +} + +Group::Group(const std::string &group_name) + : m_group_name(group_name) +{ +} + +// Checks for OSCG_THROW_ON_NO_BARRY and OSCG_THROW_ON_MULTIPLE_BARRIES +void Group::BarryCheck(OpenSync::API &api, + const std::string &group_name, + const member_list_type &members, + unsigned throw_mask) +{ + if( ! (throw_mask & (OSCG_THROW_ON_NO_BARRY | OSCG_THROW_ON_MULTIPLE_BARRIES) ) ) + return; // nothing to do + + int found = 0; + std::string barry_name = Config::Barry::PluginName(api); + member_list_type::const_iterator b = members.begin(), e = members.end(); + for( ; b != e; ++b ) { + if( b->plugin_name == barry_name ) + found++; + } + + if( found == 0 && (throw_mask & OSCG_THROW_ON_NO_BARRY) ) { + ostringstream oss; + oss << "No Barry plugins found in group '" << group_name << "' and OSCG_THROW_ON_NO_BARRY is set."; + throw LoadError(oss.str()); + } + + if( found > 1 && (throw_mask & OSCG_THROW_ON_MULTIPLE_BARRIES) ) { + ostringstream oss; + oss << "Found " << found << " Barry plugins in group '" << group_name << "' and OSCG_THROW_ON_MULTIPLE_BARRIES is set."; + throw LoadError(oss.str()); + } +} + +bool Group::GroupMatchesExistingConfig(OpenSync::API &api) +{ + member_list_type members; + api.GetMembers(m_group_name, members); + + // what needs to match: + // + // - number of connected Config::Plugin objects in our + // list must match number of members in config + // - each member ID must match along with the plugin_name + // of each member + // + + // check totals match + if( (unsigned) GetConnectedCount() != members.size() ) { + barryverbose("Connected count of " << GetConnectedCount() << " does not match member count of " << members.size()); + return false; + } + + // cycle through our own vector, matching against each member_id + // in the members list + const_iterator ci = begin(), ce = end(); + for( ; ci != ce; ++ci ) { + if( (*ci)->GetMemberId() == -1 ) + continue; + + Member *m = members.Find( (*ci)->GetMemberId() ); + if( !m ) { + barryverbose("Can't match member ID: " << (*ci)->GetMemberId() ); + return false; + } + + if( m->plugin_name != (*ci)->GetPluginName(api) ) { + barryverbose("Plugin names don't match: " + << m->plugin_name << ", " + << (*ci)->GetPluginName(api)); + return false; + } + } + + return true; +} + +bool Group::HasUnsupportedPlugins() const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( (*b)->IsUnsupported() ) + return true; + } + return false; +} + +bool Group::HasBarryPlugins() const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( (*b)->GetAppName() == Config::Barry::AppName() ) + return true; + } + return false; +} + +bool Group::GroupExists(OpenSync::API &api) const +{ + // does m_group_name exist in the API list? + string_list_type groups; + api.GetGroupNames(groups); + return std::find(groups.begin(), groups.end(), m_group_name) != groups.end(); +} + +bool Group::AllConfigured(OpenSync::API &api) const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( !(*b)->IsConfigured(api) ) + return false; + } + return true; +} + +int Group::GetConnectedCount() const +{ + int count = 0; + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( (*b)->GetMemberId() != -1 ) + count++; + } + return count; +} + +std::string Group::GetAppNames() const +{ + std::string names; + + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + std::string name = (*b)->GetAppName(); + if( name != Config::Barry::AppName() ) { + if( names.size() ) + names += ", "; + names += name; + } + } + + return names; +} + +OpenSync::Config::Barry& Group::GetBarryPlugin() +{ + return const_cast ( const_cast (this)->GetBarryPlugin() ); +} + +const OpenSync::Config::Barry& Group::GetBarryPlugin() const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( (*b)->GetAppName() == Config::Barry::AppName() ) + return dynamic_cast (*(*b)); + } + + // not found + throw std::logic_error("No Barry Plugins in Group"); +} + +OpenSync::Config::Plugin* Group::GetNonBarryPlugin() +{ + return const_cast ( const_cast (this)->GetNonBarryPlugin() ); +} + +const OpenSync::Config::Plugin* Group::GetNonBarryPlugin() const +{ + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + if( (*b)->GetAppName() != Config::Barry::AppName() ) + return (*b).get(); + } + + return 0; +} + +void Group::DisconnectMembers() +{ + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + (*b)->SetMemberId(-1); + } +} + +void Group::Load(OpenSync::API &api, unsigned throw_mask) +{ + Load(m_group_name, api, throw_mask); +} + +void Group::Load(const std::string &src_group_name, + OpenSync::API &api, + unsigned throw_mask) +{ + member_list_type members; + api.GetMembers(src_group_name, members); + + BarryCheck(api, src_group_name, members, throw_mask); + + member_list_type::const_iterator b = members.begin(), e = members.end(); + for( ; b != e; ++b ) { + Converter &converter = api.GetConverter(); + Converter::plugin_ptr p = converter.CreateAndLoadPlugin(*b); + p->SetMemberId(b->id); + + if( p->IsUnsupported() && (throw_mask & OSCG_THROW_ON_UNSUPPORTED) ) { + ostringstream oss; + oss << "Unsupported plugin '" << b->plugin_name << "' in group '" << src_group_name << "' and OSCG_THROW_ON_UNSUPPORTED is set."; + throw LoadError(oss.str()); + } + + // everything looks ok, add the plugin to our list + push_back(p); + } +} + +void Group::ResetGroupName(const std::string &new_group_name) +{ + m_group_name = new_group_name; +} + +void Group::AddPlugin(OpenSync::Config::Plugin *plugin) +{ + plugin_ptr pp(plugin); + push_back(pp); +} + +void Group::DeletePlugin(iterator i, OpenSync::API &api) +{ + // is this plugin connected to a previously saved group config? + if( (*i)->GetMemberId() != -1 ) { + // this plugin has a member ID... only OpenSync 0.40 can + // delete members like that... do we have 40 support? + OpenSync::OpenSync40 *api40 = dynamic_cast (&api); + if( !api40 ) { + // not version 0.40... can't do it capt'n! + throw DeleteError("Cannot delete individual members from an OpenSync group with versions < 0.40."); + } + + // so... we have the capability... check that the plugin + // name of the ID in the group matches what we think it + // should be + + member_list_type members; + api40->GetMembers(m_group_name, members); + + Member *m = members.Find( (*i)->GetMemberId() ); + if( !m ) { + ostringstream oss; + oss << "Tried to delete non-existent member ID " << (*i)->GetMemberId() << " (" << (*i)->GetPluginName(api) << ") from group '" << m_group_name << "'"; + throw DeleteError(oss.str()); + } + + if( m->plugin_name != (*i)->GetPluginName(api) ) { + ostringstream oss; + oss << "Tried to delete member ID " << (*i)->GetMemberId() << " using plugin '" << (*i)->GetPluginName(api) << "' from group '" << m_group_name << "', but the existing member uses plugin '" << m->plugin_name << "'"; + throw DeleteError(oss.str()); + } + + // so far so good... try deleting it + api40->DeleteMember(m_group_name, (*i)->GetMemberId()); + } + + // remove from our own array + erase(i); +} + +void Group::Save(OpenSync::API &api) +{ + if( GroupExists(api) ) { + // groups already exists, so need to confirm that our + // connected plugins match the existing member_ids and + // plugin names in the group's member list + if( !GroupMatchesExistingConfig(api) ) { + ostringstream oss; + oss << "Tried to overwrite group '" << m_group_name << "' with a Group set that did not match in ID's and plugin names."; + throw SaveError(oss.str()); + } + } + else { + // group does not exist, so create it if needed + if( size() ) + api.AddGroup(m_group_name); + } + + // cycle through all plugins and save them all + iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + Config::Plugin &p = *(*b); + + if( p.GetMemberId() == -1 ) { + // this plugin has never been saved yet, so + // add it fresh + long newid = api.AddMember(m_group_name, + p.GetPluginName(api), ""); + p.SetMemberId(newid); + } + + // save config + p.Save(api, m_group_name); + } +} + +bool Group::Compare(const Group &other) const +{ + // size of group equal? + if( size() != other.size() ) + return false; + + // name of group? + if( m_group_name != other.m_group_name ) + return false; + + // cycle through all plugins, searching for a match in other + const_iterator i = begin(); + for( ; i != end(); ++i ) { + bool sametype, equal; + bool match = false; + + // search other for a match + const_iterator oi = other.begin(); + for( ; oi != other.end(); ++oi ) { + if( (match = (*i)->Compare(*(*oi), sametype, equal)) ) + break; + } + + if( !match ) + return false; + } + + return true; +} + +Group::group_ptr Group::Clone() const +{ + group_ptr g( new Group(m_group_name) ); + + // clone all plugins + const_iterator b = begin(), e = end(); + for( ; b != e; ++b ) { + plugin_ptr p( (*b)->Clone() ); + g->push_back(p); + } + + return g; +} + +}} // namespace OpenSync::Config + diff -Nru barry-0.14/desktop/src/osconfig.h barry-0.0.20110506/desktop/src/osconfig.h --- barry-0.14/desktop/src/osconfig.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconfig.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,576 @@ +/// +/// \file osconfig.h +/// Class which detects a set of available or known devices +/// in an opensync-able system. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_OSCONFIG_H__ +#define __BARRY_OSCONFIG_H__ + +#include +#include +#include +#include +#include "osbase.h" +#include + +namespace OpenSync { namespace Config { + +// Exception class for configuration load errors +class LoadError : public std::exception +{ + std::string m_msg; +public: + LoadError(const std::string &msg) : m_msg(msg) {} + virtual ~LoadError() throw() {} + virtual const char* what() const throw() { return m_msg.c_str(); } +}; + +class SaveError : public std::exception +{ + std::string m_msg; +public: + SaveError(const std::string &msg) : m_msg(msg) {} + virtual ~SaveError() throw() {} + virtual const char* what() const throw() { return m_msg.c_str(); } +}; + +/// Thrown when a member cannot be deleted from the group +class DeleteError : public std::logic_error +{ +public: + DeleteError(const std::string &msg) : std::logic_error(msg) {} +}; + +// Base class for all opensync plugin configurations +class Plugin +{ + long m_member_id; // -1 if not saved to the group yet + +public: + Plugin() + : m_member_id(-1) + { + } + + virtual ~Plugin() + { + } + + long GetMemberId() const { return m_member_id; } + void SetMemberId(long id) { m_member_id = id; } + + // + // operations + // + + virtual Plugin* Clone() const = 0; + + /// IsUnsupported() returns true if the config format for this + /// plugin has no OpenSync::Config::* class to parse / handle it. + virtual bool IsUnsupported() const { return true; } + virtual std::string GetAppName() const = 0; // returns a GUI-friendly + // name for the application that this plugin + // is for... i.e. plugin name might + // be "evo2-sync" but the app name + // would be "Evolution" + /// Throws SaveError if member_id is -1 + virtual void Save(OpenSync::API &api, const std::string &group_name) const = 0; + // sample implementation: + //{ + // api.GetConverter().Save(*this, group_name); + //} + virtual std::string GetPluginName(OpenSync::API &api) const = 0; + // sample implementation: + //{ + // return api.GetConverter().GetPluginName(*this); + //} + virtual bool IsConfigured(OpenSync::API &api) const = 0; + // sample implementation: + //{ + // return api.GetConverter().IsConfigured(*this); + //} + + /// Support function for Group::Compare(). If plugin is the + /// same type as this, sametype is set to true. If sametype + /// is true, and the data is functionally equivalent, + /// equal is set to true. Returns (sametype && equal). + virtual bool Compare(const Plugin &plugin, + bool &sametype, bool &equal) const + { + sametype = equal = false; + return sametype && equal; + } +}; + +class Unsupported : public Plugin +{ +private: + // configuration settings + std::string m_raw_config; + +public: + Unsupported() + { + } + + explicit Unsupported(Converter *load_converter, const Member &member) + { + load_converter->Load(*this, member); + } + + const std::string& GetRawConfig() const { return m_raw_config; } + + void SetRawConfig(const std::string &c) { m_raw_config = c; } + + // virtual overrides + virtual Unsupported* Clone() const { return new Unsupported(*this); } + virtual bool IsUnsupported() const { return true; } + virtual std::string GetAppName() const { return AppName(); } + virtual void Save(OpenSync::API &api, const std::string &group_name) const + { + api.GetConverter().Save(*this, group_name); + } + virtual std::string GetPluginName(OpenSync::API &api) const + { + return api.GetConverter().GetPluginName(*this); + } + virtual bool IsConfigured(OpenSync::API &api) const + { + return api.GetConverter().IsConfigured(*this); + } + + // statics + static std::string AppName() { return "Unsupported"; } +}; + +class Barry : public Plugin +{ +private: + // configuration settings + bool m_debug_mode; + ::Barry::Pin m_pin; + std::string m_password; + +protected: + // This constructor is protected, so that only derived + // classes can create a configuration without a pin number. + Barry() + : m_debug_mode(false) + { + } + +public: + explicit Barry(const ::Barry::Pin &pin) + : m_debug_mode(false) + , m_pin(pin) + { + if( !m_pin.Valid() ) + throw std::logic_error("Barry config must have valid pin number."); + } + + explicit Barry(Converter *load_converter, const Member &member) + : m_debug_mode(false) + { + load_converter->Load(*this, member); + // + // check that the loaded pin is valid... if not, it is + // likely safe to assume that something is horribly wrong. + // in the case where the Application wishes to add a new + // barry plugin, it should use the Pin constructor. + // if you *really* need to try to salvage an old + // corrupt config, you can always do the + // converter->Load(barry_obj) manually, and pick out + // the left overs. + // + if( !m_pin.Valid() ) { + std::ostringstream oss; + oss << "Unable to load pin number from Barry plugin config. Consider this group corrupt, or not fully configured: " << member; + throw LoadError(oss.str()); + } + } + + bool IsDebugMode() const { return m_debug_mode; } + ::Barry::Pin GetPin() const { return m_pin; } + std::string GetPassword() const { return m_password; } + + void DebugMode(bool mode = true) { m_debug_mode = mode; } + void SetPin(const ::Barry::Pin &pin) { m_pin = pin; } + void SetPassword(const std::string &pass) { m_password = pass; } + + // virtual overrides + virtual Barry* Clone() const { return new Barry(*this); } + virtual bool IsUnsupported() const { return false; } + virtual std::string GetAppName() const { return AppName(); } + virtual void Save(OpenSync::API &api, const std::string &group_name) const + { + api.GetConverter().Save(*this, group_name); + } + virtual std::string GetPluginName(OpenSync::API &api) const + { + return api.GetConverter().GetPluginName(*this); + } + virtual bool IsConfigured(OpenSync::API &api) const + { + return api.GetConverter().IsConfigured(*this); + } + virtual bool Compare(const Plugin &plugin, + bool &sametype, bool &equal) const + { + sametype = equal = false; + const Barry *other = dynamic_cast (&plugin); + if( other ) { + sametype = true; + + if( m_debug_mode == other->m_debug_mode && + m_pin == other->m_pin && + m_password == other->m_password ) + equal = true; + } + return sametype && equal; + } + + // statics + static std::string AppName() { return "Barry"; } + static std::string PluginName(OpenSync::API &api) + { + return api.GetConverter().GetPluginName(Barry()); + } +}; + +class Evolution : public Plugin +{ +private: + // configuration settings + std::string m_address_path; + std::string m_calendar_path; + std::string m_tasks_path; + std::string m_memos_path; + +protected: + static void SetIfExists(std::string &var, const std::string &dir); + +public: + Evolution() + { + } + + explicit Evolution(Converter *load_converter, const Member &member) + { + load_converter->Load(*this, member); + } + + const std::string& GetAddressPath() const { return m_address_path; } + const std::string& GetCalendarPath() const { return m_calendar_path; } + const std::string& GetTasksPath() const { return m_tasks_path; } + const std::string& GetMemosPath() const { return m_memos_path; } + + void SetAddressPath(const std::string &p) { m_address_path = p; } + void SetCalendarPath(const std::string &p) { m_calendar_path = p; } + void SetTasksPath(const std::string &p) { m_tasks_path = p; } + void SetMemosPath(const std::string &p) { m_memos_path = p; } + + // specific operations + bool AutoDetect(); // throw if unable to detect?? + + // virtual overrides + virtual Evolution* Clone() const { return new Evolution(*this); } + virtual bool IsUnsupported() const { return false; } + virtual std::string GetAppName() const { return AppName(); } + virtual void Save(OpenSync::API &api, const std::string &group_name) const + { + api.GetConverter().Save(*this, group_name); + } + virtual std::string GetPluginName(OpenSync::API &api) const + { + return api.GetConverter().GetPluginName(*this); + } + virtual bool IsConfigured(OpenSync::API &api) const + { + return api.GetConverter().IsConfigured(*this); + } + virtual bool Compare(const Plugin &plugin, + bool &sametype, bool &equal) const + { + sametype = equal = false; + const Evolution *other = dynamic_cast (&plugin); + if( other ) { + sametype = true; + + if( m_address_path == other->m_address_path && + m_calendar_path == other->m_calendar_path && + m_tasks_path == other->m_tasks_path && + m_memos_path == other->m_memos_path ) + equal = true; + } + return sametype && equal; + } + + // statics + static std::string AppName() { return "Evolution"; } + static std::string PluginName(OpenSync::API &api) + { + return api.GetConverter().GetPluginName(Evolution()); + } +}; + +class Google : public Plugin +{ +private: + // configuration settings + std::string m_username; + std::string m_password; + bool m_contacts_enabled; + bool m_calendar_enabled; + +public: + Google() + : m_contacts_enabled(true) + , m_calendar_enabled(true) + { + } + + explicit Google(Converter *load_converter, const Member &member) + { + load_converter->Load(*this, member); + } + + const std::string& GetUsername() const { return m_username; } + const std::string& GetPassword() const { return m_password; } + bool IsContactsEnabled() const { return m_contacts_enabled; } + bool IsCalendarEnabled() const { return m_calendar_enabled; } + + void SetUsername(const std::string &u) { m_username = u; } + void SetPassword(const std::string &p) { m_password = p; } + bool EnableContacts(bool setting = true) + { + bool old = m_contacts_enabled; + m_contacts_enabled = setting; + return old; + } + bool EnableCalendar(bool setting = true) + { + bool old = m_calendar_enabled; + m_calendar_enabled = setting; + return old; + } + + // virtual overrides + virtual Google* Clone() const { return new Google(*this); } + virtual bool IsUnsupported() const { return false; } + virtual std::string GetAppName() const { return AppName(); } + virtual void Save(OpenSync::API &api, const std::string &group_name) const + { + api.GetConverter().Save(*this, group_name); + } + virtual std::string GetPluginName(OpenSync::API &api) const + { + return api.GetConverter().GetPluginName(*this); + } + virtual bool IsConfigured(OpenSync::API &api) const + { + return api.GetConverter().IsConfigured(*this); + } + virtual bool Compare(const Plugin &plugin, + bool &sametype, bool &equal) const + { + sametype = equal = false; + const Google *other = dynamic_cast (&plugin); + if( other ) { + sametype = true; + + if( m_username == other->m_username && + m_password == other->m_password && + m_contacts_enabled == other->m_contacts_enabled && + m_calendar_enabled == other->m_calendar_enabled ) + equal = true; + } + return sametype && equal; + } + + // statics + static std::string AppName() { return "Google Calendar"; } + static std::string PluginName(OpenSync::API &api) + { + return api.GetConverter().GetPluginName(Google()); + } +}; + +// +// Group +// +/// This class handles the loading of all the config plugins in a +/// given group. +/// +class Group : + private std::vector > +{ +public: + typedef std::tr1::shared_ptr value_type; + typedef std::tr1::shared_ptr group_ptr; + typedef value_type plugin_ptr; + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + +private: + std::string m_group_name; + +protected: + static void BarryCheck(OpenSync::API &api, + const std::string &group_name, + const member_list_type &members, + unsigned throw_mask); + + // not copyable... use Clone() + Group(const Group &other); + Group& operator=(const Group &other); + +public: +// OpenSync Config Group Throw Masks +#define OSCG_THROW_ON_UNSUPPORTED 0x01 +#define OSCG_THROW_ON_NO_BARRY 0x02 +#define OSCG_THROW_ON_MULTIPLE_BARRIES 0x04 + + /// This constructor loads an existing Group from the + /// given OpenSync api resource, filling the vector + /// array with the required plugin config classes. + /// + /// If desired, specify a mask, which will cause the + /// constructor to throw exceptions on the given conditions. + /// + /// OSCG_THROW_ON_UNSUPPORTED - if set, the constructor will + /// throw LoadError if there is a plugin in the group + /// for which there is no corresponding Plugin- + /// derived class to handle it + /// OSCG_THROW_ON_NO_BARRY - if set, the constructor will + /// throw LoadError if there are no Barry plugins + /// in the group + /// OSCG_THROW_ON_MULTIPLE_BARRIES - if set, the constructor will + /// throw LoadError if there is more than one Barry + /// plugin in the group + /// + Group(const std::string &group_name, OpenSync::API &api, + unsigned throw_mask = 0); + + /// This constructor creates an empty, but named, Group. + explicit Group(const std::string &group_name); + + bool HasUnsupportedPlugins() const; + bool HasBarryPlugins() const; + bool GroupExists(OpenSync::API &api) const; + bool AllConfigured(OpenSync::API &api) const; + int GetConnectedCount() const; + const std::string& GetGroupName() const { return m_group_name; } + + /// Returns comma separated string of application/plugin names, + /// excluding Barry + std::string GetAppNames() const; + + /// Returns a reference to the (first) Barry plugin in the group. + /// Will throw std::logic_error if not found. + OpenSync::Config::Barry& GetBarryPlugin(); + const OpenSync::Config::Barry& GetBarryPlugin() const; + + /// Returns a pointer to the first non-Barry plugin in the group. + /// Returns 0 if not found. + OpenSync::Config::Plugin* GetNonBarryPlugin(); + const OpenSync::Config::Plugin* GetNonBarryPlugin() const; + + /// Sets the member_id of all plugins to -1, thereby making them + /// appear like they have never been saved to an API before. + /// A call to Save() after a call to DisconnectMembers() will + /// create a completely new group. Note that if the group name + /// already exists in the API, saving to it again may cause + /// a low level exception to be thrown. + void DisconnectMembers(); + + /// Loads all available plugins from the named group, using + /// the api given. If this Group isn't empty (size() != 0), + /// then DisconnectMembers() will be called first. + void Load(OpenSync::API &api, unsigned throw_mask = 0); + /// Same as Load() above, but loads from src_group_name instead + /// of m_group_name. m_group_name will not be changed. + void Load(const std::string &src_group_name, OpenSync::API &api, + unsigned throw_mask = 0); + + /// Overwrites m_group_name with a new one. + void ResetGroupName(const std::string &new_group_name); + + /// Adds plugin to group, and takes ownership of the pointer + void AddPlugin(OpenSync::Config::Plugin *plugin); + + /// Remove the plugin from the group. Only can guarantee removal + /// of non-saved (i.e. disconnected) plugins. If a plugin has + /// already been saved to the underlying OpenSync API, it + /// may not be possible to delete just one member from the + /// group (0.22), and a DeleteError will be thrown. + /// + /// If you don't want to actually delete any members from any + /// existing configs, then DisconnectMembers() first. + void DeletePlugin(iterator i, OpenSync::API &api); + + /// Returns true if it is possible to resave this + /// Group to the existing opensync config. If this returns + /// false, and there are connected members, Save() will + /// throw. Save() will automatically call this function + /// during saving. + /// + /// Note: only call this if GroupExists() is true, otherwise, + /// this function is irrelevant. + bool GroupMatchesExistingConfig(OpenSync::API &api); + + /// Save all plugins as members of the group. If the group doesn't + /// exist, it will be created. If the group does exist, and its + /// existing plugin list and member_id's don't match this Group's + /// list, SaveError will be thrown. If a plugin doesn't have a + /// member_id, it will be added as a new member to the group and + /// given an id. Note that an exception thrown from this function + /// means that the group is left in an undefined state. Best to + /// delete it and start over. Or load it, delete it (through the API), + /// disconnect it, and save it again. + void Save(OpenSync::API &api); + + /// Compares against another group, including all the plugins, + /// and each plugin data. Order of plugins in group does not + /// matter, nor do file-specific data, like member IDs. + /// If saving both groups would result in functionally equivalent + /// sync groups, then they are equal. This is used to avoid + /// re-saving when not necessary. + /// Returns true if equal. + bool Compare(const Group &group) const; + + /// Clones this Group object and returns a group_ptr of the new one + group_ptr Clone() const; + + /// Forget all plugins and delete them all + using base_type::clear; + + // bring underlying implementation forward + using base_type::size; + using base_type::begin; + using base_type::end; + using base_type::operator[]; +}; + + +}} // namespace OpenSync::Config + +#endif + diff -Nru barry-0.14/desktop/src/osconv22.cc barry-0.0.20110506/desktop/src/osconv22.cc --- barry-0.14/desktop/src/osconv22.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconv22.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,276 @@ +/// +/// \file osconv22.cc +/// Converter class for opensync 0.22 plugins +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "osconv22.h" +#include "osconfig.h" +#include + +using namespace std; + +// Supported plugin names +#define PLUGIN_BARRY "barry-sync" +#define PLUGIN_EVOLUTION "evo2-sync" +#define PLUGIN_GOOGLE "google-calendar" // "google-data" ??? +#define PLUGIN_KDEPIM "kdepim-sync" +#define PLUGIN_FILE "file-sync" +#define PLUGIN_SUNBIRD "sunbird-sync" +#define PLUGIN_LDAP "ldap-sync" + +namespace OpenSync { + +////////////////////////////////////////////////////////////////////////////// +// Converter22 + +Converter22::Converter22(OpenSync::API &api) + : m_api(api) +{ +} + +bool Converter22::IsPluginSupported(const std::string &plugin_name, + std::string *appname) const +{ + if( plugin_name == PLUGIN_BARRY ) { + if( appname ) + *appname = Config::Barry::AppName(); + return true; + } + else if( plugin_name == PLUGIN_EVOLUTION ) { + if( appname ) + *appname = Config::Evolution::AppName(); + return true; + } + + return false; +} + +Converter::plugin_ptr Converter22::CreateAndLoadPlugin(const Member &member) +{ + Converter::plugin_ptr ptr; + + // compare plugin name in member with all known plugins that + // we support... and default to Unsupported if not + if( member.plugin_name == PLUGIN_BARRY ) { + ptr.reset( new Config::Barry(this, member) ); + } + else if( member.plugin_name == PLUGIN_EVOLUTION ) { + ptr.reset( new Config::Evolution(this, member) ); + } + // default: Unsupported + else { + ptr.reset( new Config::Unsupported(this, member) ); + } + + return ptr; +} + +std::string Converter22::GetPluginName(const Config::Barry &) const +{ + return PLUGIN_BARRY; +} + +std::string Converter22::GetPluginName(const Config::Evolution &) const +{ + return PLUGIN_EVOLUTION; +} + +std::string Converter22::GetPluginName(const Config::Google &) const +{ + return PLUGIN_GOOGLE; +} + +std::string Converter22::GetPluginName(const Config::Unsupported &) const +{ + return "unsupported-sync"; +} + +bool Converter22::IsConfigured(const Config::Barry &config) const +{ + return config.GetPin().Valid(); +} + +bool Converter22::IsConfigured(const Config::Evolution &config) const +{ + // the 22 barry plugin only supports address and calendar, + // but the evolution plugin seems to like these 3 + return config.GetAddressPath().size() && + config.GetCalendarPath().size() && + config.GetTasksPath().size(); +} + +bool Converter22::IsConfigured(const Config::Google &config) const +{ + return false; +} + +bool Converter22::IsConfigured(const Config::Unsupported &) const +{ + return false; +} + +void Converter22::Load(Config::Barry &config, const Member &member) +{ + // start with a default setting + config.DebugMode(false); + config.SetPassword(""); + config.SetPin(Barry::Pin()); + + // grab the config + string cfg = m_api.GetConfiguration(member.group_name, member.id); + + // The config data should contain: + // - Keyword: DebugMode + // - if the single word "DebugMode" is found, enable Debug + // + // - Keyword: Device ... + // - PIN of device to sync with + // - or a flag that says "autoconfig with first device found" + // which will autodetect, and update the config + // automatically with the found PIN... all future syncs + // will then have a PIN + // - checkboxes for (both can be on): + // - sync calendar items + // - sync contacts + + istringstream iss(cfg); + string line; + while( getline(iss, line) ) { + + if( line[0] == '#' ) + continue; + + istringstream ils(line); + string key; + ils >> key; + + if( key == "DebugMode" ) { + config.DebugMode(true); + } + else if( key == "Device" ) { + Barry::Pin pin; + int cal = 0, con = 0; + ils >> pin >> cal >> con; + + config.SetPin(pin); + + // ignore cal and con, since syncs are + // not reliable if they are set... assume 1 for both + } + else if ( key == "Password" ) { + string password; + ils >> password; + config.SetPassword(password); + } + } +} + +// yes, I know that I should use an XML library here, but... but... but :-) +// this is such a simple format, I should be able to do this manually.... +// (famous last words, eh?) +std::string Converter22::GrabField(const std::string &cfg, + const std::string &name) +{ + string start = "<" + name + ">file://"; + string end = ""; + + unsigned spos = cfg.find(start); + unsigned epos = cfg.find(end); + + if( spos == string::npos || epos == string::npos ) + return ""; + + spos += 9 + name.size(); + int count = epos - spos; + + return cfg.substr(spos, count); +} + +void Converter22::Load(Config::Evolution &config, const Member &member) +{ + string cfg = m_api.GetConfiguration(member.group_name, member.id); + + config.SetAddressPath(GrabField(cfg, "address_path")); + config.SetCalendarPath(GrabField(cfg, "calendar_path")); + config.SetTasksPath(GrabField(cfg, "tasks_path")); +} + +void Converter22::Load(Config::Google &config, const Member &member) +{ + throw std::logic_error("Loading config for Google calendar plugin is not supported for 0.22. Use the Unsupported class."); +} + +void Converter22::Load(Config::Unsupported &config, const Member &member) +{ + string cfg = m_api.GetConfiguration(member.group_name, member.id); + config.SetRawConfig(cfg); +} + +void Converter22::Save(const Config::Barry &config, + const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + ostringstream oss; + + oss << "Device " << config.GetPin().Str() << " 1 1" << endl; + if( config.IsDebugMode() ) + oss << "DebugMode" << endl; + if( config.GetPassword().size() ) + oss << "Password " << config.GetPassword() << endl; + + m_api.SetConfiguration(group_name, config.GetMemberId(), oss.str()); +} + +void Converter22::Save(const Config::Evolution &config, + const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + ostringstream oss; + oss << "\n" + << " file://" << config.GetAddressPath() << "\n" + << " file://" << config.GetCalendarPath() << "\n" + << " file://" << config.GetTasksPath() << "\n" + << "" + << endl; + + m_api.SetConfiguration(group_name, config.GetMemberId(), oss.str()); +} + +void Converter22::Save(const Config::Google &config, + const std::string &group_name) +{ + throw std::logic_error("Saving config for Google calendar plugin is not supported for 0.22. Use the Unsupported class."); +} + +void Converter22::Save(const Config::Unsupported &config, + const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + m_api.SetConfiguration(group_name, config.GetMemberId(), + config.GetRawConfig()); +} + +} // namespace OpenSync + diff -Nru barry-0.14/desktop/src/osconv22.h barry-0.0.20110506/desktop/src/osconv22.h --- barry-0.14/desktop/src/osconv22.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconv22.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,67 @@ +/// +/// \file osconv22.h +/// Converter class for opensync 0.22 plugins +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_OSCONV22_H__ +#define __BARRY_OSCONV22_H__ + +#include "osbase.h" + +namespace OpenSync { + +class Converter22 : public Converter +{ + OpenSync::API &m_api; + +protected: + std::string GrabField(const std::string &cfg, const std::string &name); + +public: + Converter22(OpenSync::API &api); + + virtual bool IsPluginSupported(const std::string &plugin_name, + std::string *appname = 0) const; + virtual plugin_ptr CreateAndLoadPlugin(const Member &member); + + virtual std::string GetPluginName(const Config::Barry &) const; + virtual std::string GetPluginName(const Config::Evolution &) const; + virtual std::string GetPluginName(const Config::Google &) const; + virtual std::string GetPluginName(const Config::Unsupported &) const; + + virtual bool IsConfigured(const Config::Barry &) const; + virtual bool IsConfigured(const Config::Evolution &) const; + virtual bool IsConfigured(const Config::Google &) const; + virtual bool IsConfigured(const Config::Unsupported &) const; + + virtual void Load(Config::Barry &config, const Member &member); + virtual void Load(Config::Evolution &config, const Member &member); + virtual void Load(Config::Google &config, const Member &member); + virtual void Load(Config::Unsupported &config, const Member &member); + + virtual void Save(const Config::Barry &config, const std::string &group_name); + virtual void Save(const Config::Evolution &config, const std::string &group_name); + virtual void Save(const Config::Google &config, const std::string &group_name); + virtual void Save(const Config::Unsupported &config, const std::string &group_name); +}; + +} // namespace OpenSync + +#endif + diff -Nru barry-0.14/desktop/src/osconv40.cc barry-0.0.20110506/desktop/src/osconv40.cc --- barry-0.14/desktop/src/osconv40.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconv40.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,300 @@ +/// +/// \file osconv40.cc +/// Converter class for opensync 0.40 plugins +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "osconv40.h" +#include "osconfig.h" +#include + +using namespace std; + +// Supported plugin names +#define PLUGIN_BARRY "barry-sync" +#define PLUGIN_EVOLUTION "evo2-sync" +#define PLUGIN_GOOGLE "google-data" +#define PLUGIN_KDEPIM "kdepim-sync" +#define PLUGIN_FILE "file-sync" +#define PLUGIN_SUNBIRD "sunbird-sync" +#define PLUGIN_LDAP "ldap-sync" + +namespace OpenSync { + +////////////////////////////////////////////////////////////////////////////// +// Converter40 + +Converter40::Converter40(OpenSync::OpenSync40 &api) + : m_api(api) +{ +} + +bool Converter40::IsPluginSupported(const std::string &plugin_name, + std::string *appname) const +{ + if( plugin_name == PLUGIN_BARRY ) { + if( appname ) + *appname = Config::Barry::AppName(); + return true; + } + else if( plugin_name == PLUGIN_EVOLUTION ) { + if( appname ) + *appname = Config::Evolution::AppName(); + return true; + } + else if( plugin_name == PLUGIN_GOOGLE ) { + if( appname ) + *appname = Config::Google::AppName(); + return true; + } + + return false; +} + +Converter::plugin_ptr Converter40::CreateAndLoadPlugin(const Member &member) +{ + Converter::plugin_ptr ptr; + + // compare plugin name in member with all known plugins that + // we support... and default to Unsupported if not + if( member.plugin_name == PLUGIN_BARRY ) { + ptr.reset( new Config::Barry(this, member) ); + } + else if( member.plugin_name == PLUGIN_EVOLUTION ) { + ptr.reset( new Config::Evolution(this, member) ); + } + else if( member.plugin_name == PLUGIN_GOOGLE ) { + ptr.reset( new Config::Google(this, member) ); + } + // default: Unsupported + else { + ptr.reset( new Config::Unsupported(this, member) ); + } + + return ptr; +} + +std::string Converter40::GetPluginName(const Config::Barry &) const +{ + return PLUGIN_BARRY; +} + +std::string Converter40::GetPluginName(const Config::Evolution &) const +{ + return PLUGIN_EVOLUTION; +} + +std::string Converter40::GetPluginName(const Config::Google &) const +{ + return PLUGIN_GOOGLE; +} + +std::string Converter40::GetPluginName(const Config::Unsupported &) const +{ + return "unsupported-sync"; +} + +bool Converter40::IsConfigured(const Config::Barry &config) const +{ + return config.GetPin().Valid(); +} + +bool Converter40::IsConfigured(const Config::Evolution &config) const +{ + // the 40 plugin supports all 4, so check all 4 + return config.GetAddressPath().size() && + config.GetCalendarPath().size() && + config.GetTasksPath().size() && + config.GetMemosPath().size(); +} + +bool Converter40::IsConfigured(const Config::Google &config) const +{ + // password might (maaayybe) be empty, so skip it + return config.GetUsername().size(); +} + +bool Converter40::IsConfigured(const Config::Unsupported &) const +{ + return false; +} + + +void Converter40::Load(Config::Barry &config, const Member &member) +{ + // start with a default setting + config.DebugMode(false); + config.SetPassword(""); + config.SetPin(Barry::Pin()); + + // read in config for barry-sync + OS40PluginConfig cfg = m_api.GetConfigurationObj(member.group_name, + member.id); + string value = cfg.GetAdvanced("Debug"); + if( value == "1" ) + config.DebugMode(true); + + value = cfg.GetAdvanced("PinCode"); + { + istringstream iss(value); + uint32_t pin = 0; + iss >> hex >> pin; + config.SetPin(Barry::Pin(pin)); + } + + value = cfg.GetPassword(); + config.SetPassword(value); +} + +std::string GrabPath(const std::string &url) +{ + if( url.substr(0, 7) == "file://" ) + return url.substr(7); + return url; +} + +void Converter40::Load(Config::Evolution &config, const Member &member) +{ + OS40PluginConfig cfg = m_api.GetConfigurationObj(member.group_name, + member.id); + + config.SetAddressPath(GrabPath(cfg.GetResource("contact")->GetUrl())); + config.SetCalendarPath(GrabPath(cfg.GetResource("event")->GetUrl())); + config.SetTasksPath(GrabPath(cfg.GetResource("todo")->GetUrl())); + config.SetMemosPath(GrabPath(cfg.GetResource("note")->GetUrl())); +} + +void Converter40::Load(Config::Google &config, const Member &member) +{ + OS40PluginConfig cfg = m_api.GetConfigurationObj(member.group_name, + member.id); + + config.SetUsername(cfg.GetUsername()); + config.SetPassword(cfg.GetPassword()); + config.EnableContacts(cfg.GetResource("contact")->IsEnabled()); + config.EnableCalendar(cfg.GetResource("event")->IsEnabled()); +} + +void Converter40::Load(Config::Unsupported &config, const Member &member) +{ + string cfg = m_api.GetConfiguration(member.group_name, member.id); + config.SetRawConfig(cfg); +} + +void Converter40::Save(const Config::Barry &config, const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + OS40PluginConfig cfg = m_api.GetConfigurationObj(group_name, + config.GetMemberId()); + cfg.SetAdvanced("Debug", "Debug mode", OS40PluginConfig::BOOL_TYPE, + config.IsDebugMode() ? "1" : "0"); + cfg.SetAdvanced("PinCode", "PIN number", OS40PluginConfig::STRING_TYPE, + config.GetPin().Str()); + + cfg.SetPassword(config.GetPassword()); + + cfg.GetResource("contact")-> + SetName("Contacts"). + Enable(true). + SetObjFormat("vcard30"). + AddResource(); + cfg.GetResource("event")-> + SetName("Event"). + Enable(true). + SetObjFormat("vevent20"). + AddResource(); + cfg.GetResource("todo")-> + SetName("Todo"). + Enable(true). + SetObjFormat("vtodo20"). + AddResource(); + cfg.GetResource("note")-> + SetName("Memo"). + Enable(true). + SetObjFormat("vjournal"). + AddResource(); + + cfg.Save(); +} + +void Converter40::Save(const Config::Evolution &config, const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + OS40PluginConfig cfg = m_api.GetConfigurationObj(group_name, + config.GetMemberId()); + cfg.GetResource("contact")-> + Enable(true). + SetObjFormat("vcard21", "VCARD_EXTENSION=Evolution"). + SetObjFormat("vcard30", "VCARD_EXTENSION=Evolution"). + SetUrl("file://" + config.GetAddressPath()). + AddResource(); + cfg.GetResource("event")-> + Enable(true). + SetObjFormat("vevent20"). + SetUrl("file://" + config.GetCalendarPath()). + AddResource(); + cfg.GetResource("todo")-> + Enable(true). + SetObjFormat("vtodo20"). + SetUrl("file://" + config.GetTasksPath()). + AddResource(); + cfg.GetResource("note")-> + Enable(true). + SetObjFormat("vjournal"). + SetUrl("file://" + config.GetMemosPath()). + AddResource(); + + cfg.Save(); +} + +void Converter40::Save(const Config::Google &config, const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + OS40PluginConfig cfg = m_api.GetConfigurationObj(group_name, + config.GetMemberId()); + cfg.SetUsername(config.GetUsername()); + cfg.SetPassword(config.GetPassword()); + cfg.GetResource("contact")-> + Enable(config.IsContactsEnabled()). + SetObjFormat("xmlformat-contact-doc"). + AddResource(); + cfg.GetResource("event")-> + Enable(config.IsCalendarEnabled()). + SetObjFormat("xmlformat-event-doc"). + AddResource(); + + cfg.Save(); +} + +void Converter40::Save(const Config::Unsupported &config, const std::string &group_name) +{ + if( config.GetMemberId() == -1 ) + throw Config::SaveError("Cannot save a plugin with a member_id of -1"); + + m_api.SetConfiguration(group_name, config.GetMemberId(), + config.GetRawConfig()); +} + +} // namespace OpenSync + diff -Nru barry-0.14/desktop/src/osconv40.h barry-0.0.20110506/desktop/src/osconv40.h --- barry-0.14/desktop/src/osconv40.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osconv40.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,65 @@ +/// +/// \file osconv40.h +/// Converter class for opensync 0.40 plugins +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_OSCONV40_H__ +#define __BARRY_OSCONV40_H__ + +#include "osbase.h" +#include "os40.h" + +namespace OpenSync { + +class Converter40 : public Converter +{ + OpenSync::OpenSync40 &m_api; + +public: + Converter40(OpenSync::OpenSync40 &api); + + virtual bool IsPluginSupported(const std::string &plugin_name, + std::string *appname = 0) const; + virtual plugin_ptr CreateAndLoadPlugin(const Member &member); + + virtual std::string GetPluginName(const Config::Barry &) const; + virtual std::string GetPluginName(const Config::Evolution &) const; + virtual std::string GetPluginName(const Config::Google &) const; + virtual std::string GetPluginName(const Config::Unsupported &) const; + + virtual bool IsConfigured(const Config::Barry &) const; + virtual bool IsConfigured(const Config::Evolution &) const; + virtual bool IsConfigured(const Config::Google &) const; + virtual bool IsConfigured(const Config::Unsupported &) const; + + virtual void Load(Config::Barry &config, const Member &member); + virtual void Load(Config::Evolution &config, const Member &member); + virtual void Load(Config::Google &config, const Member &member); + virtual void Load(Config::Unsupported &config, const Member &member); + + virtual void Save(const Config::Barry &config, const std::string &group_name); + virtual void Save(const Config::Evolution &config, const std::string &group_name); + virtual void Save(const Config::Google &config, const std::string &group_name); + virtual void Save(const Config::Unsupported &config, const std::string &group_name); +}; + +} // namespace OpenSync + +#endif + diff -Nru barry-0.14/desktop/src/osprivatebase.h barry-0.0.20110506/desktop/src/osprivatebase.h --- barry-0.14/desktop/src/osprivatebase.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/osprivatebase.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,59 @@ +/// +/// \file osprivatebase.h +/// Base API class for OpenSync sync conflicts +/// This API will operate both 0.22 and 0.4x +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_OSPRIVATEBASE_H__ +#define __BARRYDESKTOP_OSPRIVATEBASE_H__ + +#include +#include + +namespace OpenSync { + +class SyncConflictPrivateBase +{ +public: + virtual ~SyncConflictPrivateBase() {} + + virtual bool IsAbortSupported() const = 0; + virtual bool IsIgnoreSupported() const = 0; + virtual bool IsKeepNewerSupported() const = 0; + + virtual void Select(int change_id) = 0; + virtual void Abort() = 0; + virtual void Duplicate() = 0; + virtual void Ignore() = 0; + virtual void KeepNewer() = 0; +}; + +class SyncSummaryPrivateBase +{ +public: + virtual ~SyncSummaryPrivateBase() {} + + virtual void Abort() = 0; + virtual void Continue() = 0; +}; + +} + +#endif + diff -Nru barry-0.14/desktop/src/ostest.cc barry-0.0.20110506/desktop/src/ostest.cc --- barry-0.14/desktop/src/ostest.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/ostest.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,266 @@ +/// +/// \file ostest.cc +/// Test application for the OpenSync API +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include +#include "os22.h" +#include "os40.h" +#include "deviceset.h" + +using namespace std; +using namespace OpenSync; + +void DeviceSetTest(Barry::GlobalConfigFile &config, APISet &set) +{ + DeviceSet dset(config, set); + cout << "========================================================\n"; + cout << " Device Set results:\n"; + cout << "========================================================\n"; + cout << dset << endl; +} + +void Test(API &os) +{ + cout << "=======================================================\n"; + cout << " Begin test run: " << os.GetVersion() << "\n"; + cout << "=======================================================\n"; + + format_list_type flist; + os.GetFormats(flist); + cout << "Formats:\n" << flist << endl; + + string_list_type slist; + os.GetPluginNames(slist); + cout << "Plugins:\n" << slist << endl; + + os.GetGroupNames(slist); + cout << "Groups:\n" << slist << endl; + + for( string_list_type::iterator b = slist.begin(); b != slist.end(); ++ b) { + member_list_type mlist; + os.GetMembers(*b, mlist); + cout << "Members for group: " << *b << endl; + cout << "---------------------------------------\n"; + cout << mlist << endl; + } + + // + // Test Group / Members + // + + const std::string group_name = "ostest_trial_group"; + + cout << "Testing with group_name: " << group_name << endl; + + // start fresh + try { os.DeleteGroup(group_name); } + catch( std::runtime_error &re ) { + cout << "DeleteGroup: " << re.what() << endl; + } + + // add group twice, to confirm behaviour + os.AddGroup(group_name); + cout << "Added: " << group_name << endl; + + try { + os.AddGroup(group_name); + throw std::logic_error("AddGroup() succeeded incorrectly!"); + } + catch( std::runtime_error &re ) { + cout << "AddGroup: " << re.what() << endl; + } + + if( OpenSync40 *os40 = dynamic_cast(&os) ) { + try { os40->DeleteMember(group_name, 1); } + catch( std::runtime_error &re ) { + cout << "DeleteMember: " << re.what() << endl; + } + } + + os.AddMember(group_name, "barry-sync", "Barry sync member"); + os.AddMember(group_name, "evo2-sync", "Evolution sync member"); + + // test deleting the member twice, to confirm behaviour + // only os40 has DeleteMember() + if( OpenSync40 *os40 = dynamic_cast(&os) ) { + os.AddMember(group_name, "file-sync", "File sync member"); + os40->DeleteMember(group_name, "file-sync"); + try { os40->DeleteMember(group_name, "file-sync"); } + catch( std::runtime_error &re ) { + cout << "DeleteMember: " << re.what() << endl; + } + } + + // display our test group + member_list_type mlist; + os.GetMembers(group_name, mlist); + cout << "Members for group: " << group_name << endl; + cout << "---------------------------------------\n"; + cout << mlist << endl; + + // dump configurations + cout << group_name << "(1): " << (os.IsConfigurable(group_name, 1) ? + "configurable" : "not configurable") << endl; + cout << group_name << "(2): " << (os.IsConfigurable(group_name, 2) ? + "configurable" : "not configurable") << endl; + + cout << "Member 1's configuration:\n"; + cout << os.GetConfiguration(group_name, 1) << endl; + cout << "Member 2's configuration:\n"; + cout << os.GetConfiguration(group_name, 2) << endl; + + // add comment to bottom of barry-sync config + long id = mlist.FindId("barry-sync"); + string barry_config = os.GetConfiguration(group_name, id); + if( dynamic_cast(&os) ) + barry_config += "\n# This is a test\n"; + else + barry_config += "\n"; + os.SetConfiguration(group_name, id, barry_config); + cout << "New config for member " << id << ":\n"; + cout << os.GetConfiguration(group_name, id); + + // discover + os.Discover(group_name); + + // try a sync + SyncStatus status_callbacks; + os.Sync(group_name, status_callbacks); + os.Sync(group_name, status_callbacks); + + // loop + string command; + while( (cout << "Enter 'q' to quit: "), + getline(cin, command), + command[0] != 'q' ) + { + os.Sync(group_name, status_callbacks); + } + + // delete group twice, to confirm behaviour + os.DeleteGroup(group_name); + cout << "Deleted: " << group_name << endl; + + try { + os.DeleteGroup(group_name); + throw std::logic_error("DeleteGroup() succeeded incorrectly!"); + } + catch( std::runtime_error &re ) { + cout << "DeleteGroup failed as expected" << endl; + } + + cout << "=======================================================\n"; + cout << " End test run: " << os.GetVersion() << "\n"; + cout << "=======================================================\n"; +} + +#ifdef WITH_OPENSYNC40 +void ShowAdvanced(OS40PluginConfig &cfg, const char *name) +{ + cout << name << ": " << cfg.GetAdvanced(name) << endl; +} +#endif + +void TestConfig(OpenSync40 &os, const char *name, long member_id) +{ +#ifndef WITH_OPENSYNC40 + cout << "OpenSync40 support not compiled in." << endl; +#else + OS40PluginConfig cfg = os.GetConfigurationObj(name, member_id); + ShowAdvanced(cfg, "PinCode"); + ShowAdvanced(cfg, "Debug"); + cfg.SetAdvanced("TestName", "Test Display Name", "Whippoorwill"); + + OS40PluginConfig::OS40ConfigResourcePtr res = + cfg.GetResource("contact"); + if( res->IsExistingResource() ) { + cout << "Resource: " << res->GetName() << ": " + << (res->IsEnabled() ? "enabled" : "disabled") + << endl; + cout << " pref format: " << res->GetPreferredFormat() << endl; + cout << " mime: " << res->GetMime() << endl; + cout << " objtype: " << res->GetObjType() << endl; + cout << " path: " << res->GetPath() << endl; + cout << " url: " << res->GetUrl() << endl; + + string config; + if( res->FindObjFormat("vcard30", config) ) { + cout << " objformat: vcard30: " << config << endl; + } + else { + cout << " no vcard30 found" << endl; + } + } + else { + cout << "No contact resource found" << endl; + } + + // add one / set one + res = cfg.GetResource("testresource"); + if( res->IsExistingResource() ) + cout << "testresource exists" << endl; + res->SetObjFormat("vcard30"). + SetUrl("http://netdirect.ca/"). + SetName("ResourceName"). + Enable(). + AddResource(); + cfg.Save(); +#endif +} + +void TestConfig(API &os) +{ + OpenSync40 *os40 = dynamic_cast (&os); + TestConfig(*os40, "test", 1); + TestConfig(*os40, "test", 2); +} + +int main() +{ + Barry::Init(true); + + try { + Barry::GlobalConfigFile config("ostest"); + + APISet set; + set.OpenAvailable(); + + DeviceSetTest(config, set); + + if( set.os40() ) { + TestConfig(*set.os40()); + Test(*set.os40()); + } + + if( set.os22() ) { + Test(*set.os22()); + } + + } + catch( std::exception &e ) { + cout << "TEST FAILED: " << e.what() << endl; + } + + return 0; +} + diff -Nru barry-0.14/desktop/src/PNGButton.cc barry-0.0.20110506/desktop/src/PNGButton.cc --- barry-0.14/desktop/src/PNGButton.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/PNGButton.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,118 @@ +/// +/// \file PNGButton.cc +/// Class for turning a set of PNG images into buttons +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "PNGButton.h" +#include "barrydesktop.h" + +////////////////////////////////////////////////////////////////////////////// +// PNGButton + +PNGButton::PNGButton(wxWindow *parent, int ID, int x, int y, bool enabled) + : m_parent(parent) + , m_id(ID) + , m_x(x) + , m_y(y) + , m_state(0) + , m_enabled(enabled) +{ + // normal[0] + m_bitmaps[BUTTON_STATE_NORMAL] = LoadButtonBitmap(BUTTON_STATE_NORMAL); + + // focus[1] + m_bitmaps[BUTTON_STATE_FOCUS] = LoadButtonBitmap(BUTTON_STATE_FOCUS); + + // pushed[2] + m_bitmaps[BUTTON_STATE_PUSHED] = LoadButtonBitmap(BUTTON_STATE_PUSHED); +} + +wxBitmap PNGButton::LoadButtonBitmap(int state) +{ + wxString file = GetButtonFilename(m_id, state); + wxImage image(file); + wxBitmap bmp(image); + if( !image.IsOk() || !bmp.IsOk() ) { + wxGetApp().Yield(); + throw std::runtime_error("Cannot load button bitmap."); + } + return bmp; +} + +void PNGButton::Init(wxDC &dc) +{ + int width = m_bitmaps[BUTTON_STATE_NORMAL].GetWidth(); + int height = m_bitmaps[BUTTON_STATE_NORMAL].GetHeight(); + + m_background = wxBitmap(width, height); + + wxMemoryDC grab_dc; + grab_dc.SelectObject(m_background); + grab_dc.Blit(0, 0, width, height, &dc, m_x, m_y, wxCOPY, false); +} + +void PNGButton::Draw(wxDC &dc) +{ + dc.DrawBitmap(m_background, m_x, m_y, false); + dc.DrawBitmap(m_bitmaps[m_state], m_x, m_y); +} + +void PNGButton::Normal(wxDC &dc) +{ + if( !m_enabled ) + return; + + m_state = BUTTON_STATE_NORMAL; + Draw(dc); +} + +void PNGButton::Focus(wxDC &dc) +{ + if( !m_enabled ) + return; + + m_state = BUTTON_STATE_FOCUS; + Draw(dc); +} + +void PNGButton::Push(wxDC &dc) +{ + if( !m_enabled ) + return; + + m_state = BUTTON_STATE_PUSHED; + Draw(dc); +} + +void PNGButton::Click(wxDC &dc) +{ + if( !m_enabled ) + return; + + if( IsPushed() ) { + // return to normal + m_state = BUTTON_STATE_NORMAL; + Draw(dc); + + // send the event + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_id); + m_parent->GetEventHandler()->ProcessEvent(event); + } +} + diff -Nru barry-0.14/desktop/src/PNGButton.h barry-0.0.20110506/desktop/src/PNGButton.h --- barry-0.14/desktop/src/PNGButton.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/PNGButton.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,55 @@ +/// +/// \file PNGButton.h +/// Class for turning a set of PNG images into buttons +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_PNGBUTTON_H__ +#define __BARRYDESKTOP_PNGBUTTON_H__ + +#include +#include "util.h" + +class PNGButton +{ + wxBitmap m_bitmaps[3]; // normal[0], focus[1], pushed[2] + wxBitmap m_background; + wxWindow *m_parent; + int m_id; + int m_x, m_y; + int m_state; // index into m_bitmaps + bool m_enabled; + +protected: + wxBitmap LoadButtonBitmap(int state); + +public: + PNGButton(wxWindow *parent, int ID, int x, int y, bool enabled = true); + + bool IsPushed() const { return m_state == BUTTON_STATE_PUSHED; } + + void Init(wxDC &dc); + void Draw(wxDC &dc); + void Normal(wxDC &dc); + void Focus(wxDC &dc); + void Push(wxDC &dc); + void Click(wxDC &dc); +}; + +#endif + diff -Nru barry-0.14/desktop/src/StringSync.cc barry-0.0.20110506/desktop/src/StringSync.cc --- barry-0.14/desktop/src/StringSync.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/StringSync.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,68 @@ +/// +/// \file StringSync.h +/// Class to easily manage the wxString / std::string boundary +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "StringSync.h" + +using namespace std; + + +////////////////////////////////////////////////////////////////////////////// +// StringSync + +StringSync::~StringSync() +{ + Sync(); +} + +wxString* StringSync::Add(std::string &source) +{ + m_wx.push_front(WxIsCopyType(wxString(source.c_str(), wxConvUTF8), &source)); + return &m_wx.begin()->first; +} + +std::string* StringSync::Add(wxString &source) +{ + m_std.push_front(StdIsCopyType(std::string(source.utf8_str()), &source)); + return &m_std.begin()->first; +} + +void StringSync::SyncToStd() +{ + WxIsCopyList::iterator b = m_wx.begin(); + for( ; b != m_wx.end(); ++b ) { + b->second->assign(b->first.utf8_str()); + } +} + +void StringSync::SyncToWx() +{ + StdIsCopyList::iterator b = m_std.begin(); + for( ; b != m_std.end(); ++b ) { + *b->second = wxString(b->first.c_str(), wxConvUTF8); + } +} + +void StringSync::Sync() +{ + SyncToStd(); + SyncToWx(); +} + diff -Nru barry-0.14/desktop/src/StringSync.h barry-0.0.20110506/desktop/src/StringSync.h --- barry-0.14/desktop/src/StringSync.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/StringSync.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,72 @@ +/// +/// \file StringSync.h +/// Class to easily manage the wxString / std::string boundary +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_STRING_SYNC_H__ +#define __BARRYDESKTOP_STRING_SYNC_H__ + +#include +#include + +// +// StringSync +// +/// Provides a wxString or std::string while maintaining a link to +/// a corresponding external string of the opposite kind. When +/// Sync() is called, the external linked string is updated with the +/// current contents of the returned string. +/// +class StringSync +{ +public: + typedef std::pair WxIsCopyType; + typedef std::pair StdIsCopyType; + typedef std::list WxIsCopyList; + typedef std::list StdIsCopyList; + +private: + WxIsCopyList m_wx; + StdIsCopyList m_std; + +public: + /// On destruction, calls Sync() + ~StringSync(); + + /// Creates an internal wxString, copies the contents of source + /// into it, and returns its reference. + wxString* Add(std::string &source); + + /// Does the opposite + std::string* Add(wxString &source); + + /// Copies all internal wxString contents into the corresponding + /// external std::strings. + void SyncToStd(); + + /// Copies all internal std::string contents into the corresponding + /// external wxStrings. + void SyncToWx(); + + /// Calls SyncToStd() and then SyncToWx() + void Sync(); +}; + +#endif + diff -Nru barry-0.14/desktop/src/SyncStatusDlg.cc barry-0.0.20110506/desktop/src/SyncStatusDlg.cc --- barry-0.14/desktop/src/SyncStatusDlg.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/SyncStatusDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,686 @@ +/// +/// \file SyncStatusDlg.cc +/// The dialog used during a sync, to display status messages +/// and error messages, and handle sync conflicts via callback. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "SyncStatusDlg.h" +#include "ConflictDlg.h" +#include "windowids.h" +#include "configui.h" +#include "barrydesktop.h" +#include +#include +#include +#include +#include + +using namespace std; + +SillyBuffer sb; + +////////////////////////////////////////////////////////////////////////////// +// StatusConnection class + +StatusConnection::StatusConnection(SyncStatusDlg &dlg, + wxTextCtrl &window) + : m_dlg(dlg) + , m_status(window) +{ +} + +bool StatusConnection::OnPoke(const wxString &topic, + const wxString &item, + wxChar *data, + int size, + wxIPCFormat format) +{ + if( topic != TOPIC_STATUS ) + return false; + + wxString msg(data, size); + + if( item == STATUS_ITEM_ERROR ) { + m_dlg.Print(msg, *wxRED); + m_dlg.ShortPrint(msg); + } + else if( item == STATUS_ITEM_ENTRY ) { + m_dlg.Print(msg, *wxBLUE); + m_dlg.ShortPrint("Syncing entries..."); + } + else if( item == STATUS_ITEM_MAPPING ) { + m_dlg.Print(msg, *wxBLUE); + } + else if( item == STATUS_ITEM_ENGINE ) { + wxString key = ENGINE_STATUS_SLOW_SYNC; + if( msg.substr(0, key.size()) == key ) { + m_dlg.OnSlowSync(); + } + else { + m_dlg.Print(msg, *wxGREEN); + m_dlg.ShortPrint(msg); + } + } + else if( item == STATUS_ITEM_MEMBER ) { + m_dlg.Print(msg, *wxCYAN); + } + else { + // unknown item + m_dlg.Print(msg, *wxBLACK); + } + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// ConflictConnection class + +ConflictConnection::ConflictConnection(SyncStatusDlg &dlg) + : m_dlg(dlg) + , m_asking_user(false) + , m_current_sequenceID(-1) + , m_current_offset(-1) + , m_expected_total_changes(0) +{ + // check if there's a favoured plugin name from the DeviceEntry config + if( m_dlg.GetCurrentDevice() && + m_dlg.GetCurrentDevice()->GetExtras() ) + { + m_always.m_favour_plugin_name = m_dlg.GetCurrentDevice()-> + GetExtras()->m_favour_plugin_name; + } +} + +bool ConflictConnection::OnPoke(const wxString &topic, + const wxString &item, + wxChar *data, + int size, + wxIPCFormat format) +{ + barryverbose("Conflict::OnPoke: " << topic.utf8_str() << ", " + << item.utf8_str()); + + if( topic != TOPIC_CONFLICT ) + return false; + + // if currently handling a user request, don't change + // the state machine... the client shouldn't be poking + // if he just Request'd anyway + if( m_asking_user ) + return false; + + wxString msg(data, size); + istringstream iss(string(msg.utf8_str())); + + if( item == CONFLICT_ITEM_START ) { + // overwrite any existing sequence + m_changes.clear(); + iss >> m_current_sequenceID + >> m_current_offset + >> m_expected_total_changes + >> m_supported_commands; + if( !iss || m_current_offset != 0 || m_expected_total_changes < 2) { + // invalid start command, throw it away + m_current_sequenceID = -1; + m_current_offset = -1; + m_expected_total_changes = 0; + return false; + } + + barryverbose("New conflict item: " << m_current_sequenceID + << ", " << m_current_offset << ", " + << "expected changes: " << m_expected_total_changes + << ", supported commands: " << m_supported_commands); + } + else if( item == CONFLICT_ITEM_CHANGE ) { + int sequenceID = 0, offset = 0; + OpenSync::SyncChange change; + iss >> sequenceID >> offset >> change.id >> ws; + getline(iss, change.plugin_name); + getline(iss, change.uid); + change.member_id = 0; + + if( !iss || sequenceID != m_current_sequenceID || offset != (m_current_offset + 1) ) { + return false; + } + + m_current_offset = offset; + + // grab remaining "printable data" + copy((istreambuf_iterator(iss)), + (istreambuf_iterator()), + back_inserter(change.printable_data)); + + m_changes.push_back(change); + barryverbose("New conflict change: " << m_current_sequenceID + << ", " << m_current_offset << ", data: " + << change.printable_data); + } + + return true; +} + +wxChar* ConflictConnection::OnRequest(const wxString &topic, + const wxString &item, + int *size, + wxIPCFormat format) +{ + // make sure we are in a valid sequence + if( m_current_sequenceID == -1 || m_current_offset == -1 || m_expected_total_changes < 2) { + barryverbose("Conflict: not in a valid sequence: " + << m_current_sequenceID << ", " + << m_current_offset << ", " + << m_expected_total_changes); + return NULL; + } + + // make sure we have a valid set of changes + if( m_current_offset != m_expected_total_changes || (size_t)m_expected_total_changes != m_changes.size() ) { + barryverbose("Conflict: not a valid set of changes: " + << m_current_offset << ", " + << m_expected_total_changes << ", " + << m_changes.size()); + return NULL; + } + + m_asking_user = true; + + // ask the user what to do + if( !m_dlg.GetCurrentDevice() ) { + barryverbose("Conflict: current device is null"); + return NULL; + } + OpenSync::API *engine = m_dlg.GetCurrentDevice()->GetEngine(); + ConflictDlg dlg(&m_dlg, *engine, m_supported_commands, + m_changes, m_always); + m_dlg.StopTimer(); + dlg.ShowModal(); + m_dlg.StartTimer(); + + // done + m_asking_user = false; + + // did the user ask to kill the sync? + if( dlg.IsKillSync() ) { + // die! + m_dlg.KillSync(); + return NULL; + } + + // prepare response for client + ostringstream oss; + oss << m_current_sequenceID << " " << dlg.GetCommand(); + m_buf.buf(oss.str()); + // oddly, this is the size in bytes, not in wxChars + *size = (m_buf.size() + 1) * sizeof(wxChar); + return m_buf.buf(); +} + + +////////////////////////////////////////////////////////////////////////////// +// SyncStatus class + +BEGIN_EVENT_TABLE(SyncStatusDlg, wxDialog) + EVT_INIT_DIALOG (SyncStatusDlg::OnInitDialog) + EVT_BUTTON (Dialog_SyncStatus_RunAppButton, + SyncStatusDlg::OnRunApp) + EVT_BUTTON (Dialog_SyncStatus_SyncAgainButton, + SyncStatusDlg::OnSyncAgain) + EVT_BUTTON (Dialog_SyncStatus_KillCloseButton, + SyncStatusDlg::OnKillClose) + EVT_BUTTON (Dialog_SyncStatus_ShowDetailsButton, + SyncStatusDlg::OnShowDetails) + EVT_END_PROCESS (Dialog_SyncStatus_SyncTerminated, + SyncStatusDlg::OnExecTerminated) + EVT_TIMER (Dialog_SyncStatus_Timer, + SyncStatusDlg::OnTimer) +END_EVENT_TABLE() + +SyncStatusDlg::SyncStatusDlg(wxWindow *parent, + const DeviceSet::subset_type &subset) + : wxDialog(parent, Dialog_SyncStatus, _T("Device Sync Progress")) + , TermCatcher(this, Dialog_SyncStatus_SyncTerminated) + , m_subset(subset) + , m_next_device(m_subset.begin()) + , m_jailexec(this) + , m_killingjail(false) + , m_timer(this, Dialog_SyncStatus_Timer) + , m_topsizer(0) + , m_short_status(0) + , m_throbber(0) + , m_status_edit(0) + , m_runapp_button(0) + , m_syncagain_button(0) + , m_killclose_button(0) +{ + wxBusyCursor wait; + + // setup the raw GUI + CreateLayout(); + + // create the IPC server + wxServer::Create(SERVER_SERVICE_NAME); +} + +SyncStatusDlg::~SyncStatusDlg() +{ + // make sure bsyncjail dies if we do + m_jailexec.KillApp(); +} + +void SyncStatusDlg::CreateLayout() +{ + m_topsizer = new wxBoxSizer(wxVERTICAL); + AddStatusSizer(m_topsizer); + AddButtonSizer(m_topsizer); + + SetSizer(m_topsizer); + m_topsizer->SetSizeHints(this); + m_topsizer->Layout(); +} + +void SyncStatusDlg::AddStatusSizer(wxSizer *sizer) +{ + wxSizer *ss = new wxStaticBoxSizer( + new wxStaticBox(this, wxID_ANY, _T("Sync Progress")), + wxVERTICAL + ); + + // add a set of short status and progress throbber + wxSizer *shorts = new wxBoxSizer(wxHORIZONTAL); + shorts->Add( + m_short_status = new wxStaticText(this, wxID_ANY, _T(""), + wxDefaultPosition, wxSize(350, -1), + wxALIGN_LEFT), + 1, wxALIGN_CENTRE_VERTICAL | wxALL, 2); + shorts->Add( + m_throbber = new wxGauge(this, wxID_ANY, 0), + 0, wxALL | wxEXPAND, 2); + ss->Add( shorts, 0, wxEXPAND, 0); + + ss->Add( + m_status_edit = new wxTextCtrl(this, wxID_ANY, _T(""), + wxDefaultPosition, wxSize(475, 450), + wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH), + 0, wxALL | wxEXPAND, 2); + // start with the details hidden + m_status_edit->Hide(); + + sizer->Add(ss, 1, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 5); +} + +void SyncStatusDlg::AddButtonSizer(wxSizer *sizer) +{ + wxSizer *button = new wxBoxSizer(wxHORIZONTAL); + + button->Add( + m_details_button = new wxButton(this, + Dialog_SyncStatus_ShowDetailsButton, + _T("Show Details")), + 0, wxALL, 3); + + button->Add( -1, -1, 1 ); + + if( m_subset.size() == 1 ) { + button->Add( + m_runapp_button = new wxButton(this, + Dialog_SyncStatus_RunAppButton, + _T("Run App")), + 0, wxALL, 3); + } + button->Add( + m_syncagain_button = new wxButton(this, + Dialog_SyncStatus_SyncAgainButton, + _T("Sync Again")), + 0, wxALL, 3); + button->Add( + m_killclose_button = new wxButton(this, + Dialog_SyncStatus_KillCloseButton, + _T("Kill Sync")), + 0, wxALL, 3); + + sizer->Add(button, 0, wxALL | wxEXPAND, 5); +} + +void SyncStatusDlg::SetRunning() +{ + if( m_runapp_button ) + m_runapp_button->Enable(false); + m_syncagain_button->Enable(false); + m_killclose_button->SetLabel(_T("Kill Sync")); + m_killclose_button->Enable(true); + UpdateTitle(); + + m_throbber->SetRange(10); + m_throbber->SetValue(0); + StartTimer(); +} + +void SyncStatusDlg::SetClose() +{ + if( m_runapp_button ) + m_runapp_button->Enable(true); + m_syncagain_button->Enable(true); + m_killclose_button->SetLabel(_T("Close")); + m_killclose_button->Enable(true); + UpdateTitle(); + + m_throbber->SetRange(10); + m_throbber->SetValue(10); + StopTimer(); +} + +void SyncStatusDlg::Print(const std::string &msg, const wxColour &colour) +{ + Print(wxString(msg.c_str(), wxConvUTF8), colour); +} + +void SyncStatusDlg::Print(const wxString &msg, const wxColour &colour) +{ + m_status_edit->SetDefaultStyle(wxTextAttr(colour)); + m_status_edit->AppendText(_T("\n") + msg); +} + +void SyncStatusDlg::ShortPrint(const std::string &msg) +{ + ShortPrint(wxString(msg.c_str(), wxConvUTF8)); +} + +void SyncStatusDlg::ShortPrint(const wxString &msg) +{ + m_short_status->SetLabel(msg); +} + +void SyncStatusDlg::Throb() +{ + m_throbber->Pulse(); +} + +void SyncStatusDlg::StartTimer() +{ + m_timer.Start(250); +} + +void SyncStatusDlg::StopTimer() +{ + m_timer.Stop(); +} + +DeviceEntry* SyncStatusDlg::GetCurrentDevice() +{ + if( m_current_device == m_subset.end() ) + return 0; + return &(*(*m_current_device)); +} + +void SyncStatusDlg::UpdateTitle() +{ + if( m_next_device == m_subset.end() ) { + SetTitle(_T("Sync Progress Dialog")); + } + else { + ostringstream oss; + oss << "Syncing: " << (*m_next_device)->GetPin().Str() + << " with " << (*m_next_device)->GetAppNames(); + wxString label(oss.str().c_str(), wxConvUTF8); + SetTitle(label); + } +} + +void SyncStatusDlg::UpdateLastSyncTime() +{ + if( m_current_device != m_subset.end() && + (*m_current_device)->GetConfigGroup() && + (*m_current_device)->GetExtras() ) + { + (*m_current_device)->GetExtras()->m_last_sync_time = time(NULL); + (*m_current_device)->GetExtras()->Save( + wxGetApp().GetGlobalConfig(), + (*m_current_device)->GetConfigGroup()->GetGroupName()); + } +} + +void SyncStatusDlg::KillSync() +{ + m_jailexec.KillApp(m_killingjail); + m_killingjail = true; + + // jump to the end of the sync roster, so we don't start the + // next device + m_current_device = m_next_device = m_subset.end(); +} + +void SyncStatusDlg::StartNextSync() +{ + m_killingjail = false; + + // anything to do? + if( m_next_device == m_subset.end() ) { + Print("No more devices to sync.", *wxBLACK); + SetClose(); + return; + } + else { + SetRunning(); + } + + // grab all required information we need to sync + m_current_device = m_next_device; + DeviceEntry &device = *(*m_next_device); + m_device_id = device.GetPin().Str() + " (" + device.GetDeviceName() + ")"; + + if( !device.IsConfigured() ) { + Print(m_device_id + " is not configured, skipping.", *wxRED); + ShortPrint("Skipping unconfigured: " + m_device_id); + ++m_next_device; + m_current_device = m_subset.end(); + StartNextSync(); + return; + } + + OpenSync::API *engine = device.GetEngine(); + OpenSync::Config::Group *group = device.GetConfigGroup(); + string group_name = group->GetGroupName(); + + string statusmsg = "Starting sync for: " + m_device_id; + Print(statusmsg, *wxBLACK); + ShortPrint(statusmsg); + + // for each plugin / app, perform the pre-sync steps + for( OpenSync::Config::Group::iterator i = group->begin(); + i != group->end(); + ++i ) + { + ConfigUI::ptr ui = ConfigUI::CreateConfigUI((*i)->GetAppName()); + if( ui.get() ) { + ui->PreSyncAppInit(); + } + } + + // initialize sync jail process + if( m_jailexec.IsAppRunning() ) { + string msg = "ERROR: App running in StartNextSync()"; + Print(msg, *wxRED); + ShortPrint(msg); + SetClose(); + return; + } + + // assume that bsyncjail is in the same directory as barrydesktop + wxFileName path(wxTheApp->argv[0]); + wxString command = path.GetPath(); + // if command is empty, there is no path to the 'barrydesktop' + // command, and therefore it was run via the PATH environment + // variable... if the PATH was good enough for 'barrydesktop', + // then it's good enough for 'bsyncjail' as well. Skip the + // separator so that we don't try to run '/bsyncjail' + if( command.size() ) + command += path.GetPathSeparator(); + command += _T("bsyncjail "); + command += wxString(engine->GetVersion(), wxConvUTF8); + command += _T(" "); + command += wxString(group_name.c_str(), wxConvUTF8); + + if( !m_jailexec.Run(NULL, "bsyncjail", command) ) { + Print("ERROR: unable to start bsyncjail: " + string(command.utf8_str()), *wxRED); + ShortPrint("ERROR: unable to start bsyncjail"); + SetClose(); + return; + } + + // sync is underway... advance to the next device + ++m_next_device; +} + +void SyncStatusDlg::OnSlowSync() +{ + Print("Slow sync detected! Killing sync automatically.", *wxRED); + KillSync(); + + Print("Slow syncs are known to be unreliable.", *wxBLACK); + Print("Do a 1 Way Reset, and sync again.", *wxBLACK); +} + +void SyncStatusDlg::OnInitDialog(wxInitDialogEvent &event) +{ + barryverbose("OnInitDialog"); + StartNextSync(); +} + +void SyncStatusDlg::OnRunApp(wxCommandEvent &event) +{ + if( m_subset.size() != 1 ) + return; + + if( m_ui.get() && m_ui->IsAppRunning() ) { + wxMessageBox(_T("The application is already running."), + _T("Run Application"), wxOK | wxICON_ERROR); + return; + } + + OpenSync::Config::Group *group = m_subset[0]->GetConfigGroup(); + if( !group ) + return; + + m_ui = ConfigUI::CreateConfigUI(group->GetAppNames()); + if( !m_ui.get() ) + return; + + m_ui->RunApp(this); +} + +void SyncStatusDlg::OnSyncAgain(wxCommandEvent &event) +{ + m_next_device = m_subset.begin(); + StartNextSync(); +} + +void SyncStatusDlg::OnKillClose(wxCommandEvent &event) +{ + if( m_jailexec.IsAppRunning() ) { + int choice; + if( m_killingjail ) { + choice = wxMessageBox(_T("Already killing sync. Kill again?"), + _T("Kill Sync"), wxYES_NO | wxICON_QUESTION); + } + else { + choice = wxMessageBox(_T("This will kill the syncing child process, and will likely require a configuration reset.\n\nKill sync process anyway?"), + _T("Kill Sync"), wxYES_NO | wxICON_QUESTION); + } + + if( choice == wxYES ) { + KillSync(); + + // print a warning so the user know's what's going on + Print("Killing sync... this may take a little while...", *wxRED); + Print("Remember to re-plug your device.", *wxRED); + + // let the terminate call clean up the buttons + return; + } + } + else { + EndModal(0); + } +} + +void SyncStatusDlg::OnShowDetails(wxCommandEvent &event) +{ + if( m_status_edit->IsShown() ) { + m_status_edit->Hide(); + m_details_button->SetLabel(_T("Show Details")); + } + else { + m_status_edit->Show(); + m_details_button->SetLabel(_T("Hide Details")); + } + m_topsizer->Fit(this); + + // try to position the window in a readable spot + wxSize size = GetSize(); + wxPoint pos = GetScreenPosition(); + int screen_height = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y); + if( (pos.y + size.GetHeight()) > screen_height && + size.GetHeight() < screen_height ) + { + int wiggle_room = screen_height - size.GetHeight(); + int y = wiggle_room / 2; + Move(pos.x, y); + } +} + +wxConnectionBase* SyncStatusDlg::OnAcceptConnection(const wxString &topic) +{ + wxConnectionBase *con = 0; + + if( topic == TOPIC_STATUS && m_status_edit ) + con = new StatusConnection(*this, *m_status_edit); + else if( topic == TOPIC_CONFLICT ) + con = new ConflictConnection(*this); + + if( con ) + m_connections.push_back( dynamic_cast (con) ); + + return con; +} + +void SyncStatusDlg::OnExecTerminated(wxProcessEvent &event) +{ + ostringstream oss; + if( m_killingjail ) + oss << "Sync terminated: "; + else + oss << "Sync finished: "; + oss << m_device_id; + if( m_jailexec.GetAppStatus() ) + oss << " with error " << m_jailexec.GetAppStatus(); + Print(oss.str(), *wxBLACK); + ShortPrint(oss.str()); + UpdateLastSyncTime(); + + m_current_device = m_subset.end(); + + StartNextSync(); +} + +void SyncStatusDlg::OnTimer(wxTimerEvent &event) +{ + Throb(); +} + diff -Nru barry-0.14/desktop/src/SyncStatusDlg.h barry-0.0.20110506/desktop/src/SyncStatusDlg.h --- barry-0.14/desktop/src/SyncStatusDlg.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/SyncStatusDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,171 @@ +/// +/// \file SyncStatusDlg.h +/// The dialog used during a sync, to display status messages +/// and error messages, and handle sync conflicts via callback. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_SYNCSTATUSDLG_H__ +#define __BARRYDESKTOP_SYNCSTATUSDLG_H__ + +#include +#include "ipc.h" +#include "osbase.h" +#include "deviceset.h" +#include "exechelper.h" +#include "optout.h" +#include "configui.h" +#include "ConflictDlg.h" + +class SyncStatusDlg; + +class StatusConnection : public wxConnection, public OptOut::Element +{ + SyncStatusDlg &m_dlg; + wxTextCtrl &m_status; + +public: + StatusConnection(SyncStatusDlg &dlg, wxTextCtrl &window); + + bool OnPoke(const wxString &topic, const wxString &item, + wxChar *data, int size, wxIPCFormat format); + + // wxWidgets bug override - stop the 'delete this' behaviour, + // since sometimes events seem to come through after + // the delete... not sure why, and hard to debug. + // This is with wxWidgets 2.8.7. + // + // With this override, the container in SyncStatusDlg + // will handle all the deleting. + virtual bool OnDisconnect() { return true; } +}; + +class ConflictConnection : public wxConnection, public OptOut::Element +{ + SyncStatusDlg &m_dlg; + SillyBuffer m_buf; + + // conflict state machine + bool m_asking_user; + int m_current_sequenceID; + int m_current_offset; + int m_expected_total_changes; + std::string m_supported_commands; + std::vector m_changes; + + // "always" memory + ConflictDlg::AlwaysMemoryBlock m_always; + +public: + ConflictConnection(SyncStatusDlg &dlg); + + bool OnPoke(const wxString &topic, const wxString &item, + wxChar *data, int size, wxIPCFormat format); + wxChar* OnRequest(const wxString &topic, const wxString &item, + int *size, wxIPCFormat format); + + // wxWidgets bug override - stop the 'delete this' behaviour, + // since sometimes events seem to come through after + // the delete... not sure why, and hard to debug. + // This is with wxWidgets 2.8.7. + // + // With this override, the container in SyncStatusDlg + // will handle all the deleting. + virtual bool OnDisconnect() { return true; } +}; + +class SyncStatusDlg + : public wxDialog + , public wxServer + , public TermCatcher +{ + DECLARE_EVENT_TABLE() + + // external data sources + DeviceSet::subset_type m_subset; + DeviceSet::subset_type::iterator m_next_device, m_current_device; + + // for handling bsyncjail + ExecHelper m_jailexec; + std::string m_device_id; + bool m_killingjail; + + // for handling run app + ConfigUI::ptr m_ui; + + // connection holder, to make sure they get deleted if we + // go out of scope + OptOut::Vector m_connections; + + wxTimer m_timer; + + // dialog controls + wxSizer *m_topsizer; + wxStaticText *m_short_status; + wxGauge *m_throbber; + wxTextCtrl *m_status_edit; + wxButton *m_runapp_button, *m_syncagain_button, *m_killclose_button; + wxButton *m_details_button; + +protected: + void CreateLayout(); + void AddStatusSizer(wxSizer *sizer); + void AddButtonSizer(wxSizer *sizer); + + // set buttons to "running" state + void SetRunning(); + // set buttons to "close" state + void SetClose(); + + void UpdateTitle(); + void UpdateLastSyncTime(); + +public: + SyncStatusDlg(wxWindow *parent, const DeviceSet::subset_type &subset); + ~SyncStatusDlg(); + + // operations + void KillSync(); + void StartNextSync(); + + void Print(const std::string &msg, const wxColour &colour); + void Print(const wxString &msg, const wxColour &colour); + void ShortPrint(const std::string &msg); + void ShortPrint(const wxString &msg); + void Throb(); + void StartTimer(); + void StopTimer(); + + DeviceEntry* GetCurrentDevice(); + + // event handlers + void OnSlowSync(); // called from StatusConnection + void OnInitDialog(wxInitDialogEvent &event); + void OnRunApp(wxCommandEvent &event); + void OnSyncAgain(wxCommandEvent &event); + void OnKillClose(wxCommandEvent &event); + void OnShowDetails(wxCommandEvent &event); + void OnExecTerminated(wxProcessEvent &event); + void OnTimer(wxTimerEvent &event); + + // virtual overrides from wxServer + wxConnectionBase* OnAcceptConnection(const wxString &topic); +}; + +#endif + diff -Nru barry-0.14/desktop/src/tempdir.cc barry-0.0.20110506/desktop/src/tempdir.cc --- barry-0.14/desktop/src/tempdir.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/tempdir.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,68 @@ +/// +/// \file tempdir.cc +/// Temp directory & file wrapper class +/// + +/* + Copyright (C) 2009-2011, Chris Frey + The idea to use glib's g_get_tmp_dir() came from opensync's osynctool. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "tempdir.h" +#include +#include +#include +#include +#include +#include +#include + +TempDir::TempDir(const char *basename) + : m_template(0) + , m_files(0) +{ + m_template = g_strdup_printf("%s/%s-XXXXXX", g_get_tmp_dir(), basename); + if( mkdtemp(m_template) == NULL ) { + g_free(m_template); + throw std::runtime_error(std::string("Cannot create temp directory: ") + strerror(errno)); + } +} + +TempDir::~TempDir() +{ + // delete all files + for( int i = 0; i < m_files; i++ ) { + unlink(MakeFilename(i).c_str()); + } + + // delete directory + rmdir(m_template); + + // cleanup memory + g_free(m_template); +} + +std::string TempDir::MakeFilename(int file_id) const +{ + std::ostringstream oss; + oss << m_template << "/" << file_id; + return oss.str(); +} + +std::string TempDir::GetNewFilename() +{ + return MakeFilename(m_files++); +} + diff -Nru barry-0.14/desktop/src/tempdir.h barry-0.0.20110506/desktop/src/tempdir.h --- barry-0.14/desktop/src/tempdir.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/tempdir.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,56 @@ +/// +/// \file tempdir.h +/// Temp directory & file wrapper class +/// + +/* + Copyright (C) 2009-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_TEMPDIR_H__ +#define __BARRYDESKTOP_TEMPDIR_H__ + +#include + +// +// class TempDir +// +/// This class creates a new temp directory on instantiation, +/// and provides access members to retrieve the directory name +/// and incrementing filenames. On destruction, all the returned +/// filenames are deleted, and the directory is removed. +/// +class TempDir +{ + char *m_template; + int m_files; + + std::string MakeFilename(int file_id) const; + +public: + /// basename is a simple identifier, such as "barry" + /// The /tmp dir will be prepended automatically. + TempDir(const char *basename); + ~TempDir(); + + std::string GetDir() const { return m_template; } + + /// Returns unique filename in the form of + /// /tmp/opensyncapi-XXXXX/0, 1, 2, etc. + std::string GetNewFilename(); +}; + +#endif + diff -Nru barry-0.14/desktop/src/util.cc barry-0.0.20110506/desktop/src/util.cc --- barry-0.14/desktop/src/util.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/util.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,132 @@ +/// +/// \file util.cc +/// Utility functions specific to Barry Desktop +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "util.h" +#include "barrydesktop.h" +#include "windowids.h" + +const wxChar *ButtonNames[] = { + _T("backuprestore"), + _T("sync"), + _T("modem"), + _T("apploader"), + _T("deviceswitch"), + _T("browsedatabases"), + _T("media"), + _T("misc"), + 0 + }; + +bool ButtonEnabled[] = { + true, // backuprestore + true, // sync + false, // modem + false, // apploader + false, // deviceswitch + true, // browsedatabases + false, // media + false, // misc + false + }; + +const wxChar *StateNames[] = { + _T("-normal.png"), + _T("-focus.png"), + _T("-pushed.png"), + 0 + }; + +////////////////////////////////////////////////////////////////////////////// +// Utility functions + +std::string GetBaseFilename(const std::string &filename) +{ + std::string file = BARRYDESKTOP_BASEDATADIR; + file += filename; + if( wxFileExists(wxString(file.c_str(), wxConvUTF8)) ) + return file; + + // fall back to the devel tree + return filename; +} + +/// Returns full path and filename for given filename. +/// 'filename' should have no directory component, as the +/// directory will be prepended and returned. +wxString GetImageFilename(const wxString &filename) +{ + // try the official install directory first + wxString file = _T(BARRYDESKTOP_IMAGEDIR); + file += filename; + if( wxFileExists(file) ) + return file; + + // oops, assume we're running from the build directory, + // and use the images dir + file = wxPathOnly(wxGetApp().argv[0]); + file += _T("/../images/"); + file += filename; + if( wxFileExists(file) ) + return file; + + // hmmm.... maybe we're running from inside the libtool + // build subdirectories + file = wxPathOnly(wxGetApp().argv[0]); + file += _T("/../../images/"); + file += filename; + return file; +} + +wxString GetButtonFilename(int id, int state) +{ + return GetImageFilename( + wxString(ButtonNames[id - MainMenu_FirstButton]) + + StateNames[state] + ); +} + +bool IsButtonEnabled(int id) +{ + return ButtonEnabled[id - MainMenu_FirstButton]; +} + +bool IsParsable(const std::string &dbname) +{ +#undef HANDLE_PARSER +#define HANDLE_PARSER(dbn) \ + if( dbname == Barry::dbn::GetDBName() ) return true; + + ALL_KNOWN_PARSER_TYPES + + return false; +} + +bool IsBuildable(const std::string &dbname) +{ +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(dbn) \ + if( dbname == Barry::dbn::GetDBName() ) return true; + + ALL_KNOWN_BUILDER_TYPES + + return false; +} + diff -Nru barry-0.14/desktop/src/util.h barry-0.0.20110506/desktop/src/util.h --- barry-0.14/desktop/src/util.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/util.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,87 @@ +/// +/// \file util.h +/// Utility functions specific to Barry Desktop +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_UTIL_H__ +#define __BARRYDESKTOP_UTIL_H__ + +#include +#include + +#define BUTTON_STATE_NORMAL 0 +#define BUTTON_STATE_FOCUS 1 +#define BUTTON_STATE_PUSHED 2 + +template +int GetMaxWidth(wxWindow *win, IteratorT begin, IteratorT end, StrFn sfn) +{ + int max_width = 0; + for( ; begin != end(); ++begin ) { + int this_width = 0; + int this_height = 0; + win->GetTextExtent(wxString(sfn(*begin).c_str(), wxConvUTF8), + &this_width, &this_height); + + max_width = std::max(max_width, this_width); + } + + return max_width; +} + +std::string GetBaseFilename(const std::string &filename); +wxString GetImageFilename(const wxString &filename); +wxString GetButtonFilename(int id, int state); +bool IsButtonEnabled(int id); + +bool IsParsable(const std::string &dbname); +bool IsBuildable(const std::string &dbname); + +// Determine parsable classes via template specialization +template +inline bool IsParsable() +{ + return false; +} +#undef HANDLE_PARSER +#define HANDLE_PARSER(dbname) \ + template <> \ + inline bool IsParsable() \ + { \ + return true; \ + } +ALL_KNOWN_PARSER_TYPES + +// Determine buildable classes via template specialization +template +inline bool IsBuildable() +{ + return false; +} +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(dbname) \ + template <> \ + inline bool IsBuildable() \ + { \ + return true; \ + } +ALL_KNOWN_BUILDER_TYPES + +#endif + diff -Nru barry-0.14/desktop/src/windowids.h barry-0.0.20110506/desktop/src/windowids.h --- barry-0.14/desktop/src/windowids.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/windowids.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,125 @@ +/// +/// \file windowids.h +/// Window IDs for the Barry Desktop GUI +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYDESKTOP_WINDOWIDS_H__ +#define __BARRYDESKTOP_WINDOWIDS_H__ + +#include + +////////////////////////////////////////////////////////////////////////////// +// IDs for controls and menu items (no menus in this app yet) +enum { + SysMenu_Exit = wxID_EXIT, + SysMenu_About = wxID_ABOUT, + + MainMenu_FirstButton = wxID_HIGHEST, + + MainMenu_BackupAndRestore = MainMenu_FirstButton, + MainMenu_Sync, + MainMenu_Modem, + MainMenu_AppLoader, + MainMenu_DeviceSwitch, + MainMenu_BrowseDatabases, + MainMenu_MediaManagement, + MainMenu_Misc, + + MainMenu_LastButton = MainMenu_Misc, + + // Main menu buttons that don't always exist + MainMenu_BackButton, + + // Clickable, "hot" images that do something + HotImage_BarryLogo, + HotImage_NetDirectLogo, + + // Misc IDs + Ctrl_DeviceCombo, + Process_BackupAndRestore, + + // SyncMode IDs + SyncMode_SyncNowButton, + SyncMode_ConfigureButton, + SyncMode_RunAppButton, + SyncMode_1WayResetButton, + SyncMode_DeviceList, + + // BrowseMode IDs + BrowseMode_DBDBList, + BrowseMode_RecordList, + BrowseMode_ShowAllCheckbox, + BrowseMode_AddRecordButton, + BrowseMode_CopyRecordButton, + BrowseMode_EditRecordButton, + BrowseMode_DeleteRecordButton, + + // Dialog IDs + Dialog_GroupCfg, + Dialog_GroupCfg_EngineCombo, + Dialog_GroupCfg_AppCombo, + Dialog_GroupCfg_AppConfigButton, + Dialog_SyncStatus, + Dialog_SyncStatus_RunAppButton, + Dialog_SyncStatus_SyncAgainButton, + Dialog_SyncStatus_KillCloseButton, + Dialog_SyncStatus_SyncTerminated, + Dialog_SyncStatus_ShowDetailsButton, + Dialog_SyncStatus_Timer, + Dialog_Conflict, + Dialog_Conflict_DataList, + Dialog_Conflict_SelectButton1, + Dialog_Conflict_SelectButton2, + Dialog_Conflict_SelectButton3, + Dialog_Conflict_SelectButton4, + Dialog_Conflict_SelectButton5, + Dialog_Conflict_SelectButton6, + Dialog_Conflict_SelectButton7, + Dialog_Conflict_SelectButton8, + Dialog_Conflict_SelectButton9, + Dialog_Conflict_ShowButton1, + Dialog_Conflict_ShowButton2, + Dialog_Conflict_ShowButton3, + Dialog_Conflict_ShowButton4, + Dialog_Conflict_ShowButton5, + Dialog_Conflict_ShowButton6, + Dialog_Conflict_ShowButton7, + Dialog_Conflict_ShowButton8, + Dialog_Conflict_ShowButton9, + Dialog_Conflict_DuplicateButton, + Dialog_Conflict_AbortButton, + Dialog_Conflict_IgnoreButton, + Dialog_Conflict_KeepNewerButton, + Dialog_Conflict_KillSyncButton, + Dialog_Conflict_AlwaysCheckbox, + Dialog_ContactEdit, + Dialog_ContactEdit_PhotoButton, + + SysMenu_FirstItem, + + SysMenu_VerboseLogging = SysMenu_FirstItem, + SysMenu_RenameDevice, + SysMenu_ResetDevice, + SysMenu_RescanUsb, + + SysMenu_LastItem = SysMenu_RescanUsb +}; + +#endif + diff -Nru barry-0.14/desktop/src/xmlcompactor.cc barry-0.0.20110506/desktop/src/xmlcompactor.cc --- barry-0.14/desktop/src/xmlcompactor.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/xmlcompactor.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,215 @@ +/// +/// \file xmlcompactor.cc +/// Compact an XML file into a map of pretty xpaths and content +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "xmlcompactor.h" +#include +#include +#include +using namespace std; + +std::ostream& operator<<(std::ostream &os, XmlCompactor &parser) +{ + parser.Dump(os); + return os; +} + +XmlCompactor::XmlCompactor() +{ +} + +// ugly hack to pretty up the output +Glib::ustring XmlCompactor::HackPath(const Glib::ustring &path) +{ + const char *bad[] = { "[0]", "[1]", "[2]", "[3]", "[4]", + "[5]", "[6]", "[7]", "[8]", "[9]" }; + const char *good[] = { "[00]", "[01]", "[02]", "[03]", "[04]", + "[05]", "[06]", "[07]", "[08]", "[09]" }; + + Glib::ustring p = path; + + // strip off the ending "text()" + size_t pos = p.rfind("/text()"); + if( pos != Glib::ustring::npos && (pos + 7) == p.size() ) + p.resize(pos); + + // remove leading name if possible + if( m_skip_prefix.size() && p.find(m_skip_prefix) == 0 ) + p.replace(0, m_skip_prefix.size(), ""); + + // remove leading slash + if( p[0] == '/' ) + p.replace(0, 1, ""); + + // convert single digit offsets to two + for( int i = 0; i < 10; i++ ) { + size_t pos; + while( (pos = p.find(bad[i])) != Glib::ustring::npos ) { + p.replace(pos, 3, good[i]); + } + } + + return p; +} + +bool XmlCompactor::WalkNodes(xmlpp::Node *node, content_handler handler) +{ + xmlpp::ContentNode *content = dynamic_cast(node); + if( content ) { + if( content->is_white_space() ) + return true; // skip whitespace between content + if( !(this->*handler)(content) ) + return false; // handler had a problem,stop processing + } + + xmlpp::Node::NodeList list = node->get_children(); + xmlpp::Node::NodeList::iterator i = list.begin(); + for( ; i != list.end(); ++i ) { + if( !WalkNodes(*i, handler) ) + return false; // pass the "stop processing" msg down + } + return true; +} + +bool XmlCompactor::DoMap(xmlpp::ContentNode *content) +{ + (*this)[HackPath(content->get_path())] = content->get_content(); + return true; +} + +bool XmlCompactor::ComparePrefix(xmlpp::ContentNode *content) +{ + Glib::ustring path = content->get_path(); + + if( m_common_prefix.size() == 0 ) { + m_common_prefix = path; + } + else { + // find max length of matching strings + size_t len = min(m_common_prefix.size(), path.size()); + size_t max = 0; + while( len-- ) { + if( m_common_prefix[max] != path[max] ) + break; + max++; + } + + if( max == 0 ) { + // there's no prefix available + m_common_prefix.clear(); + return false; + } + else { + // snag the largest prefix! + m_common_prefix = m_common_prefix.substr(0, max); + } + } + return true; +} + +Glib::ustring XmlCompactor::FindCommonPrefix() +{ + m_common_prefix.clear(); + xmlpp::Node *root = get_document()->get_root_node(); + WalkNodes(root, &XmlCompactor::ComparePrefix); + return m_common_prefix; +} + +void XmlCompactor::Map(const Glib::ustring &skip) +{ + m_skip_prefix = skip; + xmlpp::Node *root = get_document()->get_root_node(); + WalkNodes(root, &XmlCompactor::DoMap); +} + +Glib::ustring XmlCompactor::Value(const Glib::ustring &key) +{ + iterator i = find(key); + if( i == end() ) + return ""; + return i->second; +} + +XmlCompactor::content_set XmlCompactor::Find(const Glib::ustring &xpath) const +{ + using namespace xmlpp; + + content_set content; + + Node *root = get_document()->get_root_node(); + NodeSet nodes = root->find(xpath); + + NodeSet::iterator ni = nodes.begin(); + for( ; ni != nodes.end(); ++ni ) { + ContentNode *cn = dynamic_cast (*ni); + + if( cn && !cn->is_white_space() ) { + content.push_back(cn->get_content()); + } + } + + return content; +} + +void XmlCompactor::Dump(std::ostream &os) const +{ + for( const_iterator i = begin(); i != end(); ++i ) { + os << i->first.raw() << ": " << i->second.raw() << "\n"; + } +} + + +#ifdef XMLCOMPACTOR +int main(int argc, char *argv[]) +{ + try { + locale loc(""); + cin.imbue( loc ); + cout.imbue( loc ); + XmlCompactor parser; + parser.parse_stream(cin); + cerr << "Common prefix: " << parser.FindCommonPrefix() << endl; + parser.Map(argc >= 2 ? argv[1] : ""); + cout << parser << endl; + cout << endl; + + for( int i = 2; i < argc; i++ ) { + XmlCompactor::content_set content = parser.Find(argv[i]); + cout << "XPath: " << argv[i] << endl; + cout << "Found " << content.size() << " values" << endl; + + XmlCompactor::content_set::iterator ci = content.begin(); + for( ; ci != content.end(); ++ci ) { + cout << " " << (*ci) << endl; + } + } + + } + catch( Glib::ConvertError &e ) { + cerr << e.what() << endl; + return 1; + } + catch( std::exception &e ) { + cerr << e.what() << endl; + return 1; + } +} +#endif + diff -Nru barry-0.14/desktop/src/xmlcompactor.h barry-0.0.20110506/desktop/src/xmlcompactor.h --- barry-0.14/desktop/src/xmlcompactor.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/xmlcompactor.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,74 @@ +/// +/// \file xmlcompactor.h +/// Compact an XML file into a map of pretty xpaths and content +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __XMLCOMPACTOR_H__ +#define __XMLCOMPACTOR_H__ + +#include +#include +#include + +class XmlCompactor + : public std::map + , public xmlpp::DomParser +{ +public: + typedef Glib::ustring string_type; + typedef std::map base_map_type; + typedef xmlpp::DomParser base_xml_type; + typedef base_map_type::iterator iterator; + typedef base_map_type::const_iterator const_iterator; + typedef bool (XmlCompactor::*content_handler)(xmlpp::ContentNode*); + typedef std::vector content_set; + +private: + Glib::ustring m_skip_prefix; + Glib::ustring m_common_prefix; + +protected: + Glib::ustring HackPath(const Glib::ustring &path); + bool WalkNodes(xmlpp::Node *node, content_handler handler); + bool DoMap(xmlpp::ContentNode *content); + bool ComparePrefix(xmlpp::ContentNode *content); + +public: + XmlCompactor(); + + /// returns the common prefix of all entries, suitable for + /// use as an argument to Map() + Glib::ustring FindCommonPrefix(); + + void Map(const Glib::ustring &skip); + Glib::ustring Value(const Glib::ustring &key); + + // + // XML-based helpers + // + + content_set Find(const Glib::ustring &xpath) const; + + void Dump(std::ostream &os) const; +}; + +std::ostream& operator<<(std::ostream &os, XmlCompactor &parser); + +#endif + diff -Nru barry-0.14/desktop/src/xmlmap.cc barry-0.0.20110506/desktop/src/xmlmap.cc --- barry-0.14/desktop/src/xmlmap.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/xmlmap.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,562 @@ +/// +/// \file xmlmap.cc +/// Map an XML node tree according to an XML map file. +/// The map is not fully nested, and provides mostly a +/// flat view, based on the map. +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "xmlmap.h" +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +////////////////////////////////////////////////////////////////////////////// +// XmlNodeSummary + +XmlNodeSummary::XmlNodeSummary(xmlpp::Node *node, XmlNodeMapping *mapping) + : m_node(node) + , m_mapping(mapping) + , m_name(node->get_name()) +{ + CreateSummary(); +} + +void XmlNodeSummary::ProcessListKey(ostream &os, const Glib::ustring &name) +{ + xmlpp::Node::NodeList list = m_node->get_children(name); + xmlpp::Node::NodeList::iterator i = list.begin(); + for( int count = 0; i != list.end(); ++i ) { + Glib::ustring content = GetContent(*i); + if( !content.size() ) + continue; + + if( count ) + os << ", "; + os << content; + count++; + } +} + +void XmlNodeSummary::ProcessKey(ostream &os, const Glib::ustring &key) +{ + if( key.size() == 0 ) + return; + + switch( key[0] ) + { + case '(': + os << "("; + ProcessKey(os, key.substr(1)); + os << ") "; + break; + + case '$': { + bool comma = false; + Glib::ustring wkey = key; + if( key[key.size()-1] == ',' ) { + comma = true; + wkey = key.substr(0, key.size()-1); + } + + Glib::ustring content = GetContent(wkey.substr(1)); + os << content; + if( comma && content.size() ) + os << ","; + os << " "; + } + break; + + case '%': + ProcessListKey(os, key.substr(1)); + break; + + default: + os << key << " "; + break; + } +} + +void XmlNodeSummary::CreateSummary() +{ + ostringstream oss; + istringstream iss(m_mapping->Format()); + Glib::ustring key; + while( iss >> key ) { + ProcessKey(oss, key); + } + m_summary = oss.str(); +} + +Glib::ustring XmlNodeSummary::GetContent(const Glib::ustring &child_name) const +{ + xmlpp::Node::NodeList list = m_node->get_children(child_name); + if( list.size() ) { + return GetContent(*list.begin()); + } + else { + return Glib::ustring(); + } +} + +Glib::ustring XmlNodeSummary::GetContent(xmlpp::Node *node) const +{ + Glib::ustring content_value; + + xmlpp::ContentNode *content = dynamic_cast(node); + while( !content ) { + xmlpp::Node::NodeList list = node->get_children(); + if( !list.size() ) + break; + + node = *list.begin(); + content = dynamic_cast(node); + } + + if( content ) { + content_value = content->get_content(); + } + return content_value; +} + +bool XmlNodeSummary::SummaryCompare(const XmlNodeSummary &a, + const XmlNodeSummary &b) +{ + return a.Summary() < b.Summary(); +} + +bool XmlNodeSummary::PathCompare(const XmlNodeSummary &a, + const XmlNodeSummary &b) +{ + return a.Path() < b.Path(); +} + + +////////////////////////////////////////////////////////////////////////////// +// XmlNodeMapping + +XmlNodeMapping::XmlNodeMapping(const Glib::ustring &node_name, + int priority, + const Glib::ustring &format) + : m_node_key_name(node_name) + , m_priority(priority) + , m_format(format) +{ +} + +void XmlNodeMapping::AddCompareName(const Glib::ustring &node_name) +{ + m_compare_node_names.push_back(node_name); +} + +void XmlNodeMapping::AddNode(xmlpp::Node *node) +{ + XmlNodeSummary summary(node, this); + m_summaries.push_back(summary); +} + +void XmlNodeMapping::SortBySummary() +{ + sort(m_summaries.begin(), m_summaries.end(), + &XmlNodeSummary::SummaryCompare); +} + +void XmlNodeMapping::SortByPath() +{ + sort(m_summaries.begin(), m_summaries.end(), + &XmlNodeSummary::PathCompare); +} + +const XmlNodeSummary& XmlNodeMapping::operator[] (int index) const +{ + return m_summaries[index]; +} + +// Parse a compare_name in the format of "name[type]" into +// its component parts, without the brackets. +void XmlNodeMapping::SplitCompareName(const Glib::ustring &compare_name, + Glib::ustring &name, + Glib::ustring &type) +{ + size_t pos = compare_name.find('['); + if( pos == Glib::ustring::npos ) { + name = compare_name; + type.clear(); + } + else { + name = compare_name.substr(0, pos); + pos++; + while( compare_name[pos] && compare_name[pos] != ']' ) { + type += compare_name[pos]; + pos++; + } + } +} + +bool Timestamp2Unix(const Glib::ustring &stamp, time_t &result) +{ + struct tm split; + bool utc; + if( !Barry::Sync::iso_to_tm(stamp.c_str(), &split, utc) ) + return false; + + split.tm_isdst = -1; + + if( utc ) + result = Barry::Sync::utc_mktime(&split); + else + result = mktime(&split); + + return result != (time_t)-1; +} + +bool TimestampsEqual(const Glib::ustring &content1, + const Glib::ustring &content2) +{ + time_t t1, t2; + if( !Timestamp2Unix(content1, t1) || !Timestamp2Unix(content2, t2) ) { + // could throw there, but this is just used to + // pretty up the display, so defaulting to false + // is fine + return false; + } + return t1 == t2; +} + +bool XmlNodeMapping::operator== (const XmlNodeMapping &other) const +{ + // make sure mapfile data are the same + if( KeyName() != other.KeyName() || + Priority() != other.Priority() || + Format() != other.Format() || + m_compare_node_names != other.m_compare_node_names ) + return false; + + // if the node counts are different, not equal + if( m_summaries.size() != other.m_summaries.size() ) + return false; + + // cycle through all compare names, and compare the + // values for those names from each node summary + for( compare_list::const_iterator namei = m_compare_node_names.begin(); + namei != m_compare_node_names.end(); + ++namei ) + { + for( summary_list::const_iterator sumi = m_summaries.begin(), + other_sumi = other.m_summaries.begin(); + sumi != m_summaries.end() && + other_sumi != other.m_summaries.end(); + ++sumi, ++other_sumi ) + { + Glib::ustring name, type; + SplitCompareName(*namei, name, type); + + Glib::ustring + content1 = sumi->GetContent(name), + content2 = other_sumi->GetContent(name); + + if( type == "timestamp" ) { + // compare content as timestamps + if( !TimestampsEqual(content1, content2) ) + return false; + } + else { + // compare as raw strings + if( content1 != content2 ) + return false; + } + } + } + + // all good! + return true; +} + +void XmlNodeMapping::Dump(std::ostream &os) const +{ + os << m_node_key_name << ": Priority " << m_priority + << ", Nodes: " << m_summaries.size() << "\n"; + os << " Format: " << m_format << "\n"; + os << " Compare Names (" << m_compare_node_names.size() << "):\n"; + os << " "; + for( compare_list::const_iterator i = m_compare_node_names.begin(); + i != m_compare_node_names.end(); + ++i ) + { + if( i != m_compare_node_names.begin() ) + os << ", "; + os << (*i); + } + os << "\n"; + + if( m_summaries.size() ) { + os << " Summaries (" << m_summaries.size() << " nodes):\n"; + for( summary_list::const_iterator i = m_summaries.begin(); + i != m_summaries.end(); + ++i ) + { + os << " " << i->Name() << " > " << i->Summary() << "\n"; + } + } + + os << "\n"; +} + +void XmlNodeMapping::DumpSummaries(std::ostream &os) const +{ + for( size_t n = 0; n < size(); n++ ) { + os << m_summaries[n].Summary() << endl; + } +} + + +////////////////////////////////////////////////////////////////////////////// +// XmlNodeMap + +XmlNodeMap::XmlNodeMap(const std::string &type_name, + const std::string &map_filename) +{ + LoadMap(type_name, map_filename); +} + +XmlNodeMap::XmlNodeMap(const std::string &map_filename) +{ + LoadMap(string(), map_filename); +} + +// copy constructor - only copies the map data, not the node. +// you must Import as usual +XmlNodeMap::XmlNodeMap(const XmlNodeMap &other) +{ + operator=(other); +} + +void XmlNodeMap::LoadMap(const std::string &type_name, + const std::string &map_filename) +{ + ifstream is(map_filename.c_str()); + if( !is ) + throw std::runtime_error("Unable to open: " + map_filename); + + std::string line; + while( getline(is, line) ) { + if( line[0] == '#' || line[0] == '\t' ) + continue; + if( line.size() == 0 ) + continue; + + string type, key, format; + int priority = -1; + istringstream iss(line); + iss >> type >> key >> priority >> std::ws; + getline(iss, format); + + if( !iss ) { + // skip if error + continue; + } + + if( type_name.size() && type != type_name ) { + // skip types not for us + continue; + } + + ptr_type mapping( new XmlNodeMapping(key, priority, format) ); + + while( is.peek() == '\t' ) { + getline(is, line); + mapping->AddCompareName(line.substr(1)); + } + + push_back(mapping); + } +} + +void XmlNodeMap::ImportNodes(xmlpp::Node *node, bool purge) +{ + if( XmlNodeMapping *mapping = Find(node->get_path()) ) { + mapping->AddNode(node); + return; + } + + xmlpp::Node::NodeList list = node->get_children(); + xmlpp::Node::NodeList::iterator i = list.begin(); + for( ; i != list.end(); ++i ) { + ImportNodes(*i, false); + } + + if( purge ) { + PurgeEmpties(); + } +} + +/// Removes all XmlNodeMappings that contain no node summaries. +/// This lets the caller remove mappings that do not match the +/// XML data that was imported. For example, a map may contain +/// mappings for Contacts and Calendar items, but only one +/// is parsed and imported at once. This function will remove +/// the unused mappings. +void XmlNodeMap::PurgeEmpties() +{ +// iterator new_end = remove_if(begin(), end(), +// mem_fun_ref(&XmlNodeMapping::IsEmpty)); + + // ------------------------------------------------------- + // not all compilers compile remove_if() for us, so do it + // manually: find the first empty + iterator new_end = begin(); + for( ; new_end != end(); ++new_end ) { + if( new_end->IsEmpty() ) + break; + } + if( new_end == end() ) + return; // nothing is empty, nothing to purge + + // copy the remainder, skipping the empties + iterator good = new_end; + ++good; + for( ; good != end(); ++good ) { + if( !good->IsEmpty() ) { + *new_end = *good; + ++new_end; + } + } + // done re-implementation of remove_if() + // ------------------------------------------------------- + + // erase the junk at the end (need to call this whether + // you use remove_if() or not + erase(new_end, end()); +} + +XmlNodeMapping* XmlNodeMap::Find(const Glib::ustring &node_name) +{ + iterator i = begin(); + for( ; i != end(); ++i ) { + const Glib::ustring &xpath = node_name; + XmlNodeMapping *mapping = &(*i); + const Glib::ustring &key = mapping->KeyName(); + + if( xpath.size() == key.size() && xpath == key ) { + return mapping; + } + else if( xpath.size() > key.size() && + xpath.substr(0, key.size()) == key && + xpath[key.size()] == '[' ) + { + return mapping; + } + } + return 0; +} + +void XmlNodeMap::SortBySummary() +{ + for_each(begin(), end(), mem_fun_ref(&XmlNodeMapping::SortBySummary)); +} + +void XmlNodeMap::SortByPath() +{ + for_each(begin(), end(), mem_fun_ref(&XmlNodeMapping::SortByPath)); +} + +void XmlNodeMap::Dump(std::ostream &os, int stop_priority) const +{ + const_iterator i = begin(); + for( ; i != end(); ++i ) { + if( i->Priority() >= stop_priority ) + return; + i->Dump(os); + } +} + +XmlNodeMap::iterator XmlNodeMap::priority_end(int stop_priority) +{ + iterator i = begin(); + for( ; i != end(); ++i ) { + if( i->Priority() >= stop_priority ) + return i; + } + return i; +} + +void XmlNodeMap::clear() +{ + for_each(begin(), end(), mem_fun_ref(&XmlNodeMapping::clear)); +} + +XmlNodeMap& XmlNodeMap::operator=(const XmlNodeMap &other) +{ + const_iterator i = other.begin(); + for( ; i != other.end(); ++i ) { + ptr_type p( new XmlNodeMapping(*i) ); + p->clear(); + push_back(p); + } + return *this; +} + +#ifdef XMLMAP +#include +#include +#include +using namespace std::tr1; +using namespace std::tr1::placeholders; + +int main(int argc, char *argv[]) +{ + try { + locale loc(""); + cin.imbue( loc ); + cout.imbue( loc ); + + xmlpp::DomParser parser; + parser.parse_stream(cin); + + XmlNodeMap np("Contact", "0.22/xmlmap"); + np.ImportNodes(parser.get_document()->get_root_node()); + np.Dump(cout, 99); + + np.SortBySummary(); + cout << "\n\nCute summary:\n"; + for_each(np.begin(), np.priority_end(), + bind( mem_fn(&XmlNodeMapping::DumpSummaries), + _1, ref(cout))); + + np.SortByPath(); + cout << "\n\nCute summary:\n"; + for_each(np.begin(), np.priority_end(), + bind( mem_fn(&XmlNodeMapping::DumpSummaries), + _1, ref(cout))); + } + catch( Glib::ConvertError &e ) { + cerr << e.what() << endl; + return 1; + } + catch( std::exception &e ) { + cerr << e.what() << endl; + return 1; + } +} +#endif + diff -Nru barry-0.14/desktop/src/xmlmap.h barry-0.0.20110506/desktop/src/xmlmap.h --- barry-0.14/desktop/src/xmlmap.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/src/xmlmap.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,170 @@ +/// +/// \file xmlmap.h +/// Map an XML node tree according to an XML map file. +/// The map is not fully nested, and provides mostly a +/// flat view, based on the map. +/// + +/* + Copyright (C) 2010-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __XMLMAP_H__ +#define __XMLMAP_H__ + +#include +#include +#include +#include +#include + +class XmlNodeMapping; + +class XmlNodeSummary +{ + xmlpp::Node *m_node; + XmlNodeMapping *m_mapping; + Glib::ustring m_name; + Glib::ustring m_summary; + +protected: + void CreateSummary(); + void ProcessListKey(std::ostream &os, const Glib::ustring &name); + void ProcessKey(std::ostream &os, const Glib::ustring &key); + +public: + XmlNodeSummary(xmlpp::Node *node, XmlNodeMapping *mapping); + + Glib::ustring Path() const { return m_node ? m_node->get_path(): Glib::ustring(); } + const Glib::ustring& Name() const { return m_name; } + const Glib::ustring& Summary() const { return m_summary; } + + Glib::ustring GetContent(const Glib::ustring &child_name) const; + Glib::ustring GetContent(xmlpp::Node *node) const; + + static bool SummaryCompare(const XmlNodeSummary &a, + const XmlNodeSummary &b); + static bool PathCompare(const XmlNodeSummary &a, + const XmlNodeSummary &b); +}; + +class XmlNodeMapping +{ +public: + typedef std::vector compare_list; + typedef std::vector summary_list; + +private: + Glib::ustring m_node_key_name; // "/contact/Address" excluding any + // [1] and [2] offsets + // This is is from the friendly map + // definition file. + int m_priority; + Glib::ustring m_format; + compare_list m_compare_node_names; + summary_list m_summaries; + +protected: + static void SplitCompareName(const Glib::ustring &compare_name, + Glib::ustring &name, Glib::ustring &type); + +public: + XmlNodeMapping(const Glib::ustring &node_name, int priority, + const Glib::ustring &format); + + // data access + const Glib::ustring& KeyName() const { return m_node_key_name; } + Glib::ustring ShortName() const + { return size() ? m_summaries[0].Name() : Glib::ustring(); } + int Priority() const { return m_priority; } + const Glib::ustring& Format() const { return m_format; } + bool IsEmpty() const { return size() == 0; } + + // operations + void AddCompareName(const Glib::ustring &node_name); + void AddNode(xmlpp::Node *node); + void SortBySummary(); + void SortByPath(); + + const XmlNodeSummary& operator[] (int index) const; + size_t size() const { return m_summaries.size(); } + void clear() { m_summaries.clear(); } + + bool operator== (const XmlNodeMapping &other) const; + bool operator!= (const XmlNodeMapping &other) const + { return !operator==(other); } + + void Dump(std::ostream &os) const; + void DumpSummaries(std::ostream &os) const; +}; + +class XmlNodeMap + : public std::vector > +{ + // we use a vector of shared_ptr's here because the Summary + // objects store pointers to the Mappings, and must remain stable +public: + typedef std::tr1::shared_ptr ptr_type; + typedef std::vector base_type; + + // helps to hide the shared_ptr complexity when the + // user iterates through the vector + template + class deref_iterator : public BaseT + { + public: + explicit deref_iterator(BaseT it) + : BaseT(it) + {} + TargetT& operator*() const + { return *BaseT::operator*(); } + TargetT* operator->() const + { return &(*BaseT::operator*()); } + }; + + typedef deref_iterator iterator; + typedef deref_iterator const_iterator; + +private: + void LoadMap(const std::string &type_name, + const std::string &map_filename); + +public: + XmlNodeMap(const std::string &type_name, + const std::string &map_filename); + XmlNodeMap(const std::string &map_filename); + XmlNodeMap(const XmlNodeMap &other); + + void ImportNodes(xmlpp::Node *node, bool purge = false); + void PurgeEmpties(); + XmlNodeMapping* Find(const Glib::ustring &node_name); + + void SortBySummary(); + void SortByPath(); + + void Dump(std::ostream &os, int stop_priority = 1) const; + + iterator begin() { return iterator(base_type::begin()); } + iterator end() { return iterator(base_type::end()); } + const_iterator begin() const { return const_iterator(base_type::begin()); } + const_iterator end() const { return const_iterator(base_type::end()); } + iterator priority_end(int stop_priority = 1); + void clear(); + + XmlNodeMap& operator=(const XmlNodeMap &other); +}; + +#endif + diff -Nru barry-0.14/desktop/TODO barry-0.0.20110506/desktop/TODO --- barry-0.14/desktop/TODO 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/desktop/TODO 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,45 @@ +Release TODO List: +================== +- package barrydesktop so that all .o files are included, to comply with + the LGPL (wxWidgets) + +Feature TODO List: +================== +- menu item: reset current device, wait, and rescan + +Sync: +----- +- test 0.4x, and see if it is possible to do a clean one-way + sync without deleting all 4 databases... on 0.22 this + seems to cause opensync to go into a stupendously long + busy loop... maybe 0.4x is better +- 0.4x has a CheckSummary state, that shows what changes are going + to happen just before the sync happens... in the command line + version, this is shown in a text table... should create a dialog + for the user to approve first... perhaps make this a config + option, so that the user doesn't have to confirm on each + sync if he doesn't want to + +Wishlist TODO List: +=================== +- menu item: direct logging to a file + - or, log to a stringstream... this can always be added later if + grabbing the verbose data from stderr is not enough +- hook into HAL or inotify or udev somehow, to automatically detect when + a new device has been unplugged or plugged in, and do a usb scan + immediately, and update the lists, in the main screen, and in sync + +Dieter Rams' ten principles to "good design" +============================================ +* Good design is innovative +* Good design makes a product useful +* Good design is aesthetic +* Good design makes a product understandable +* Good design is unobtrusive +* Good design is honest +* Good design is long-lasting +* Good design is thorough down to the last detail +* Good design is environmentally friendly +* Good design is as little design as possible + http://en.wikipedia.org/wiki/Dieter_Rams + diff -Nru barry-0.14/doc/0001-Snoop-limit-and-endpoint-patch.patch barry-0.0.20110506/doc/0001-Snoop-limit-and-endpoint-patch.patch --- barry-0.14/doc/0001-Snoop-limit-and-endpoint-patch.patch 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/0001-Snoop-limit-and-endpoint-patch.patch 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,75 @@ +From 97beaf75f426ed04e4cc20dd2f65f7e2ce65ece7 Mon Sep 17 00:00:00 2001 +From: Chris Frey +Date: Fri, 31 Oct 2008 03:44:35 -0400 +Subject: [PATCH] Snoop limit and endpoint patch + +Puts a limit on the amount of data pushed into the printk log, +limiting it to the actual size of the USB urbs, not the whole +buffer. + +This patch also adds some missed endpoint values to the logs. +--- + drivers/usb/core/devio.c | 19 +++++++++++++------ + 1 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c +index de17738..aca73ae 100644 +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -288,7 +288,7 @@ static inline struct async *async_getpending(struct dev_state *ps, + + static void snoop_urb(struct urb *urb, void __user *userurb) + { +- int j; ++ int j, len; + unsigned char *data = urb->transfer_buffer; + + if (!usbfs_snoop) +@@ -301,7 +301,12 @@ static void snoop_urb(struct urb *urb, void __user *userurb) + urb->transfer_buffer_length); + dev_info(&urb->dev->dev, "actual_length=%d\n", urb->actual_length); + dev_info(&urb->dev->dev, "data: "); +- for (j = 0; j < urb->transfer_buffer_length; ++j) ++ ++ len = urb->actual_length; ++ if( len > urb->transfer_buffer_length ) ++ len = urb->transfer_buffer_length; ++ ++ for (j = 0; j < len; ++j) + printk("%02x ", data[j]); + printk("\n"); + } +@@ -759,8 +764,8 @@ static int proc_bulk(struct dev_state *ps, void __user *arg) + kfree(tbuf); + return -EINVAL; + } +- snoop(&dev->dev, "bulk read: len=0x%02x timeout=%04d\n", +- bulk.len, bulk.timeout); ++ snoop(&dev->dev, "bulk read: ep=0x%02x, len=0x%02x timeout=%04d\n", ++ bulk.ep, bulk.len, bulk.timeout); + usb_unlock_device(dev); + i = usb_bulk_msg(dev, pipe, tbuf, len1, &len2, tmo); + usb_lock_device(dev); +@@ -783,8 +788,8 @@ static int proc_bulk(struct dev_state *ps, void __user *arg) + return -EFAULT; + } + } +- snoop(&dev->dev, "bulk write: len=0x%02x timeout=%04d\n", +- bulk.len, bulk.timeout); ++ snoop(&dev->dev, "bulk write: ep=0x%02x, len=0x%02x timeout=%04d\n", ++ bulk.ep, bulk.len, bulk.timeout); + if (usbfs_snoop) { + dev_info(&dev->dev, "bulk write: data: "); + for (j = 0; j < len1; ++j) +@@ -1161,6 +1166,8 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, + return -EFAULT; + } + } ++ snoop(&ps->dev->dev, "submit urb: bEndpoint %02x\n", ++ uurb->endpoint); + snoop_urb(as->urb, as->userurb); + async_newpending(as); + if ((ret = usb_submit_urb(as->urb, GFP_KERNEL))) { +-- +1.6.0.3 + diff -Nru barry-0.14/doc/autotext-format.txt barry-0.0.20110506/doc/autotext-format.txt --- barry-0.14/doc/autotext-format.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/autotext-format.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,52 @@ +Date: Thu, 28 Sep 2006 20:40:13 -0500 +From: Ron Gage +User-Agent: Thunderbird 1.5.0.7 (X11/20060909) +To: barry-devel-bounces@lists.sourceforge.net +Subject: Partial decoding autotext database + +Just picking on the low hanging fruit... + +This is an autotext entry that translates 'eyt' with yet using AutoCase, +english language... + + 00000000: 06 00 32 00 40 03 44 02 6d 00 c2 1a e1 72 01 04 ..2.@.D.m....r.. + 00000010: 00 01 65 79 74 00 04 00 02 79 65 74 00 04 00 04 ..eyt....yet.... + 00000020: 00 00 00 00 04 00 05 00 00 00 00 04 00 06 00 00 ................ + 00000030: 6e 65 ne + +Same database with AutoCase changed to Specified Case: + + 00000000: 06 00 32 00 40 03 44 02 6c 00 64 02 66 18 01 04 ..2.@.D.l.d.f... + 00000010: 00 01 65 79 74 00 04 00 02 79 65 74 00 04 00 04 ..eyt....yet.... + 00000020: 00 00 00 00 04 00 05 01 00 00 00 04 00 06 00 00 ................ + 00000030: 6e 65 ne + +From here, we can see field type 1 is the "from" entry, field 2 is the +"to" entry, don't know about field 4 yet or field 6, but field 5 +represents the AutoCase option (1 == on). + +Field type 4 is the language field - 0xffffffff == All Locales, 0x0 == +English. Field type 6 appears to be a locale modifier in byte-reversed +order. This shows the language record set to "English(US)". + + 00000000: 06 00 32 00 40 03 44 02 6c 00 66 02 66 18 01 04 ..2.@.D.l.f.f... + 00000010: 00 01 65 79 74 00 04 00 02 79 65 74 00 04 00 04 ..eyt....yet.... + 00000020: 00 00 00 00 04 00 05 01 00 00 00 04 00 06 53 55 ..............SU + 00000030: 6e 65 ne + +The last 2 characters are part of the locale definition - giving a +locale string of US-en. + +Note that when the language (field 4) is set to "All Locales", field 6 +is entirely null: + + 00000000: 06 00 36 00 40 03 44 02 03 00 6f 1a e1 72 01 06 ..6.@.D...o..r.. + 00000010: 00 01 68 74 74 70 73 00 06 00 02 68 74 74 70 73 ..https....https + 00000020: 00 04 00 04 ff ff ff ff 04 00 05 01 00 00 00 04 ................ + 00000030: 00 06 00 00 00 00 ...... + + +That's it for tonight - got other things to do for the night. + +Ron Gage + Binary files /tmp/hrabAk_zAl/barry-0.14/doc/barry-research.ods and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/barry-research.ods differ diff -Nru barry-0.14/doc/bb_sms_format.txt barry-0.0.20110506/doc/bb_sms_format.txt --- barry-0.14/doc/bb_sms_format.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bb_sms_format.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,134 @@ +BlackBerry SMS Messages Record Format + +This information is result of over 9000 btool -d Tasks dumps from a *single* BB 8800. + +RIM 8800 Series Colour GPRS Handheld +App Version v4.5.0.81(108), platform 2.7.0.78 + +There are several cases not tested yet, which are hard to catch, i.e. `Pending', etc. +information on these incidents is welcomed. Incidentally, some listings here may be inaccurate. + +==Header== +Length = const 0x0f bytes + +00000000: 04 00 x0 x1 40 ?? 44 05 01 00 x2 x3 x4 x5 00 ....@.D........ + _____ _____ ___________ _____ ___________ __ + type len var0 index uniqueID + +type - always 04 00, perhaps SMS uses this but others also do +len - length of this record in bytes, including header. +var0 - 40 02 44 05/40 01 44 05(according to my 9000+ messages), change but all records keep the same. +index - the record number within the data base. + determines posting order in the device (That is, if you + change sort order, the indices of tasks will be modified. + Similarly, if you change the priority or due date of a task + the ordinal might change as well. +uniqueID - 32byte Integer, unique for each task, + generated by time. + +==Content Fields== + +The content is divided into 7+ parts, each with a 3byte header: +id# format meaning +--- ------ ------- +00 2byte size(excluding this header) +01 1byte field type + +The field type has 7 possible values, ordered as their appearances: + +===Field Type 01=== +Meaning: Metadata +Size: 0x40 +Repeat Count: 1 +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes byte yes 00=SENT/DRAFT, 01=RECV +01 yes byte yes status flags, 80=SEND ERROR, 40=DELIVERY REPORT ON(!not sure), + 20=START NEW CONVERSATION, 10=SAVED, 08=DELETED, 01=OPENED +02 yes byte yes 00=OLD, 01=NEW +03 no 2byte yes 00 00 +04 yes 4byte yes ff 07 00 00=RECV, ff 1f 00 00=SEND ERROR, ff ff 3f 00=DELIVERY SUCCEDDED + ff ff ff 01=SENT, ff ff ff 07=WAITING, ff ff ff 7f=DRAFT +05 yes 4byte no error id, 00 00 00 00=NO ERROR, 84 34 00 00=Unidentified Subscriber +06 yes 8byte yes 8byteInt representing UNIX time(in milliseconds), first 4 bytes=uniqueID +07 yes 8byte yes representing sent time(like #06), probably not in UTC. +08 yes byte yes Data Coding Scheme: 00=7bit, 01=VCARD, 02=UCS2 +09 yes 2byte no 00 00=SENT/DRAFT, 04 00=RECV, sometimes all 04 00, probably garbage information +0a yes 4byte yes 00 00 00 00=TEXT, 02 00 00 04=SEND AS FAX3, 03 00 00 04=SEND AS FAX4, + 04 00 00 04=SEND AS VOICE, 05 00 00 04=SEND AS ERMES +0b yes 28byte yes 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 + 00 00 00 00 + +===Field Type 09=== +Meaning: Unknown +Size: Multiple of 0x8(The multiplier is probably send_times) +Repeat Count: 1 +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes unknonwn no Unknown + + +===Field Type 0B=== +Meaning: Unknown +Size: Half of the size of field type 09 +Repeat Count: 1 +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes unknown no Unknown + +===Field Type 02=== +Meaning: Phone Number +Size: pn_length + 0x5 +Repeat Count: recipient_num +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes 4byte no 00 00 00 00/01 00 00 00/03 00 00 00 +01 yes string yes current recipient's number +02 no byte yes trailing NULL + +===Field Type 04=== +Meaning: SMS Content +Size: content_length +Repeat Count: 1 +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes string yes content + +===Field Type 07=== +Meaning: Unknown +Size: 0xf +Repeat Count: 1 +Content(May be very inaccurate): + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 yes 3byte no Unknown +01 yes byte yes `Sent As', 00=TEXT, 02=FAX3, 03=FAX4, 04=VOICE, 05=ERMES +02 no 2byte yes 00 00 +03 yes byte yes 00=DEFAULT, 04=SEND AS NON-TEXT +04 yes 4byte yes 00 00 00 00=SEND AS NON-TEXT, 00 00 00 01=DEFAULT +06 no byte yes 01 +07 yes byte yes 00=DELIVERY REPORT OFF, 01=DELIVERY REPORT ON +08 no 2byte yes 00 00 + +===Field Type 0c=== +Meaning: Possibly Footer +Size: 0x8 +Repeat Count: 1 +Content: + +id# var format worked-out meaning(variable)/value(constant) +---- --- ------- ---------- --------------------------------------- +00 no 8byte yes 00 00 00 00 ff ff ff ff diff -Nru barry-0.14/doc/bb_task_format.txt barry-0.0.20110506/doc/bb_task_format.txt --- barry-0.14/doc/bb_task_format.txt 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/bb_task_format.txt 2011-05-06 12:20:16.000000000 +0000 @@ -4,25 +4,25 @@ This information is result of many btool -d Tasks dumps from a single BB 8700R. firmware v4.1.0.351 (platform 2.0.0.143) -It would be interesting to receive btool -d Tasks dumps from other blackberries +It would be interesting to receive btool -d Tasks dumps from other blackberries to see if strings which appear constant, really are. Task Header, fixed length, 0xe bytes long. 00000000: 09 00 43 00 40 03 44 02 01 00 53 32 2f 0a 01 01 ..C.@.D...S2/... - _____ _____ ??????????? _____ ??????????? __ __ + _____ _____ ??????????? _____ ??????????? __ __ rec rec task type len index# u1 UniqueID? u2 -00000010: 00 01 74 - ???????? +00000010: 00 01 74 + ???????? + - rec type - always 09 00 I guess this is a 'Task' Record type? rec len - length of this record in bytes, including header. -u1 - always 40 03 44 02 unknown... +u1 - always 40 03 44 02 unknown... task index - the record number within the data base. determines posting order in the device (That is, if you change sort order, the indices of tasks will be modified. @@ -41,7 +41,7 @@ Field Header 04 00 sz - size in bytes (2 bytes), excluding header. 09 field type (1 byte) - sz bytes, in the value format. + sz bytes, in the value format. field types: type value Meaning of field @@ -50,13 +50,13 @@ 11 string Categories, comma separated. 10 4tz timezone for deadlines, reminders etc... 0f min1900_t reminder by date (the minute when to remind.) -0e 4byte relative reminder flag 2 = true?, +0e 4byte relative reminder flag 2 = true?, this field is absent if reminder is not relative. 0a 4byte priority (0-high,1-normal,2-low) 09 4byte status (0-not started, 1-in progress, 2-completed, 3-Waiting, 4-Defered) 08 4boolean 0-no due date, 1 there is a due date. 06 min1900_t ??? -05 min1900_t due date +05 min1900_t due date 03 string Note: (value of notes.) 02 string Title (the name of the task.) 01 byte always 0x74, unknown... @@ -71,7 +71,7 @@ -- null terminated string. 4tz: - -- 32-bit LSB integer, values documented in doc/TimeZones.txt. + -- 32-bit LSB integer, values documented in doc/TimeZones.txt. ie. 0x23 is eastern time. min1900_t: @@ -85,9 +85,9 @@ -- Recurrence is systematically mis-spelled in the protocol description document Order of fields... as observed in dump, do not know if it is significant, given fields -are so self-descriptive. +are so self-descriptive. -
<2-title> <9-status> <10-timezone> <6-??> <8-due_flag> - [ <5-due_date> ] [ [ ] ] +
<2-title> <9-status> <10-timezone> <6-??> <8-due_flag> + [ <5-due_date> ] [ [ ] ] [ <11-categories> ] <3-Note> - + diff -Nru barry-0.14/doc/bjdwp/jdwp-class.txt barry-0.0.20110506/doc/bjdwp/jdwp-class.txt --- barry-0.14/doc/bjdwp/jdwp-class.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-class.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,77 @@ +.: JDB command :. +================= + +jdb> class com.rim.resources.net_rim_rimsecuridlibRIMResources + + +.: Dump :. +========== + +Legend : + <<< : Data received from JDB + >>> : Data sent by wrapper JDWP + + +---- command class com.rim.resources.net_rim_rimsecuridlibRIMResources ---- + +<<< 00 00 00 0f 00 00 00 16 00 03 01 00 00 00 01 ........ ....... +>>> 00 00 00 0f 00 00 00 16 80 00 00 ........ ... + 00 00 00 0a .... + +<<< 00 00 00 0f 00 00 00 18 00 02 01 00 00 00 0a ........ ....... +>>> 00 00 00 32 00 00 00 18 80 00 00 ...2.... ... + 00 00 00 23 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 ...#Lnet /rim/dev + 69 63 65 2f 72 65 73 6f 75 72 63 65 73 2f 52 65 ice/reso urces/Re + 73 6f 75 72 63 65 3b source; + +<<< 00 00 00 0f 00 00 00 1a 00 02 0a 00 00 00 01 ........ ....... +>>> 00 00 00 0f 00 00 00 1a 80 00 00 ........ ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 1c 00 03 01 00 00 00 02 ........ ....... +>>> 00 00 00 0f 00 00 00 1c 80 00 00 ........ ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 1e 00 02 01 00 00 00 0b ........ ....... +>>> 00 00 00 24 00 00 00 1e 80 00 00 ...$.... ... + 00 00 00 15 4c 6a 61 76 61 2f 6c 61 6e 67 2f 45 ....Ljav a/lang/E + 78 63 65 70 74 69 6f 6e 3b xception ; + +<<< 00 00 00 0f 00 00 00 20 00 03 01 00 00 00 03 ........ ....... +>>> 00 00 00 0f 00 00 00 20 80 00 00 ........ ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 22 00 03 01 00 00 00 04 ......." ....... +>>> 00 00 00 0f 00 00 00 22 80 00 00 ......." ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 24 00 03 01 00 00 00 05 .......$ ....... +>>> 00 00 00 0f 00 00 00 24 80 00 00 .......$ ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 26 00 03 01 00 00 00 06 .......& ....... +>>> 00 00 00 0f 00 00 00 26 80 00 00 .......& ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 28 00 03 01 00 00 00 07 .......( ....... +>>> 00 00 00 0f 00 00 00 28 80 00 00 .......( ... + 00 00 00 0c .... + +<<< 00 00 00 0f 00 00 00 2a 00 02 01 00 00 00 0c .......* ....... +>>> 00 00 00 21 00 00 00 2a 80 00 00 ...!...* ... + 00 00 00 12 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f ....Ljav a/lang/O + 62 6a 65 63 74 3b bject; + +<<< 00 00 00 0f 00 00 00 2c 00 03 01 00 00 00 08 ......., ....... +>>> 00 00 00 0f 00 00 00 2c 80 00 00 ........ ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 2e 00 03 01 00 00 00 09 ........ ....... +>>> 00 00 00 0f 00 00 00 2e 80 00 00 ........ ... + 00 00 00 0b .... + +<<< 00 00 00 0f 00 00 00 30 00 03 01 00 00 00 0a .......0 ....... +>>> 00 00 00 0f 00 00 00 30 80 00 00 .......0 ... + 00 00 00 00 .... + + diff -Nru barry-0.14/doc/bjdwp/jdwp-connection.txt barry-0.0.20110506/doc/bjdwp/jdwp-connection.txt --- barry-0.14/doc/bjdwp/jdwp-connection.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-connection.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,149 @@ +.: Dump :. +========== + +Legend : + <<< : Data received from JDB + >>> : Data sent by wrapper JDWP + + +---- Connection ---- + +<<< 4a 44 57 50 2d 48 61 6e 64 73 68 61 6b 65 JDWP-Han dshake +>>> 4a 44 57 50 2d 48 61 6e 64 73 68 61 6b 65 JDWP-Han dshake +>>> 00 00 00 19 00 00 00 01 00 40 64 00 00 00 00 01 ........ .@d...... + 5a 00 00 00 00 00 00 00 00 Z....... . + + +<<< 00 00 00 0b 00 00 00 02 00 01 07 ........ ... +>>> 00 00 99 1f 00 00 00 02 80 00 00 ........ ... + 00 00 00 04 00 00 00 04 00 00 00 04 00 00 00 04 ........ ........ + 00 00 00 04 ..... + + +<<< 00 00 00 11 00 00 00 04 00 0f 01 08 00 00 00 00 ........ ........ + 00 . +>>> 00 00 00 0f 00 00 00 04 80 00 00 ........ ... + 00 00 00 02 .... + + +<<< 00 00 00 11 00 00 00 06 00 0f 01 09 00 00 00 00 ........ ........ + 00 . +>>> 00 00 00 0f 00 00 00 06 80 00 00 ........ ....... + 00 00 00 03 .... + + +<<< 00 00 00 2e 00 00 00 08 00 0f 01 08 02 00 00 00 ........ ........ + 02 05 00 00 00 13 6a 61 76 61 2e 6c 61 6e 67 2e ......ja va.lang. + 54 68 72 6f 77 61 62 6c 65 01 00 00 00 01 Throwabl e..... +>>> 00 00 00 0f 00 00 00 08 80 00 00 ........ ... + 00 00 00 04 .... + + +<<< 00 00 00 0b 00 00 00 0a 00 01 01 ........ ... +>>> 00 00 00 30 00 00 00 0a 80 00 00 ...0.... ... + 00 00 00 07 52 49 4d 20 4a 56 4d 00 00 00 01 00 ....RIM JVM..... + 00 00 04 00 00 00 03 31 2e 34 00 00 00 07 52 49 .......1 .4....RI + 4d 20 4a 56 4d M JVM + + +<<< 00 00 00 0b 00 00 00 0c 00 01 03 ........ ... + + +(( + I think that this part is gotten from BarryDemo.debug file + + 000000AE 00 00 00 0c 01 00 00 00 01 00 00 00 25 4c 63 6f ........ ....%Lco + 000000BE 6d 2f 62 61 72 72 79 2f 74 65 73 74 73 2f 62 61 m/barry/ tests/ba + 000000CE 72 72 79 64 65 6d 6f 2f 42 61 72 72 79 44 65 6d rrydemo/ BarryDem + 000000DE 6f 3b 00 00 00 04 01 00 00 00 02 00 00 00 27 4c o;...... ......'L + 000000EE 63 6f 6d 2f 62 61 72 72 79 2f 74 65 73 74 73 2f com/barr y/tests/ + 000000FE 62 61 72 72 79 64 65 6d 6f 2f 42 61 72 72 79 53 barrydem o/BarryS + 0000010E 63 72 65 65 6e 3b 00 00 00 04 01 00 00 00 03 00 creen;.. ........ + 0000011E 00 00 29 4c 63 6f 6d 2f 72 69 6d 2f 72 65 73 6f ..)Lcom/ rim/reso + 0000012E 75 72 63 65 73 2f 42 61 72 72 79 44 65 6d 6f 52 urces/Ba rryDemoR + 0000013E 49 4d 52 65 73 6f 75 72 63 65 73 3b 00 00 00 04 IMResour ces;.... + + Lcom/barry/tests/barrydemo/BarryDemo; + Lcom/barry/tests/barrydemo/BarryScreen; + Lcom/rim/resources/BarryDemoRIMResources; +)) + +>>> 00 00 03 a8 00 00 00 0c 80 00 00 ........ ... + 00 00 00 09 01 00 00 00 01 00 00 00 35 4c 63 6f ........ ....5Lco + 6d 2f 72 69 6d 2f 72 65 73 6f 75 72 63 65 73 2f m/rim/re sources/ + 6e 65 74 5f 72 69 6d 5f 72 69 6d 73 65 63 75 72 net_rim_ rimsecur + 69 64 6c 69 62 52 49 4d 52 65 73 6f 75 72 63 65 idlibRIM Resource + 73 3b 00 00 00 04 01 00 00 00 02 00 00 00 4b 4c s;...... ......KL + 6e 65 74 2f 72 69 6d 2f 64 65 76 69 63 65 2f 63 net/rim/ device/c + 6c 64 63 2f 69 6d 70 6c 2f 73 6f 66 74 74 6f 6b ldc/impl /softtok + 65 6e 2f 72 69 6d 73 65 63 75 72 69 64 6c 69 62 en/rimse curidlib + 2f 52 69 6d 44 61 74 61 62 61 73 65 46 75 6c 6c /RimData baseFull + 45 78 63 65 70 74 69 6f 6e 3b 00 00 00 04 01 00 Exceptio n;...... + 00 00 03 00 00 00 4a 4c 6e 65 74 2f 72 69 6d 2f ......JL net/rim/ + 64 65 76 69 63 65 2f 63 6c 64 63 2f 69 6d 70 6c device/c ldc/impl + 2f 73 6f 66 74 74 6f 6b 65 6e 2f 72 69 6d 73 65 /softtok en/rimse + 63 75 72 69 64 6c 69 62 2f 52 69 6d 44 65 63 72 curidlib /RimDecr + 79 70 74 46 61 69 6c 45 78 63 65 70 74 69 6f 6e yptFailE xception + 3b 00 00 00 04 01 00 00 00 04 00 00 00 4c 4c 6e ;....... .....LLn + 65 74 2f 72 69 6d 2f 64 65 76 69 63 65 2f 63 6c et/rim/d evice/cl + 64 63 2f 69 6d 70 6c 2f 73 6f 66 74 74 6f 6b 65 dc/impl/ softtoke + 6e 2f 72 69 6d 73 65 63 75 72 69 64 6c 69 62 2f n/rimsec uridlib/ + 52 69 6d 44 75 70 6c 69 63 61 74 65 4e 61 6d 65 RimDupli cateName + 45 78 63 65 70 74 69 6f 6e 3b 00 00 00 04 01 00 Exceptio n;...... + 00 00 05 00 00 00 4d 4c 6e 65 74 2f 72 69 6d 2f ......ML net/rim/ + 64 65 76 69 63 65 2f 63 6c 64 63 2f 69 6d 70 6c device/c ldc/impl + 2f 73 6f 66 74 74 6f 6b 65 6e 2f 72 69 6d 73 65 /softtok en/rimse + 63 75 72 69 64 6c 69 62 2f 52 69 6d 44 75 70 6c curidlib /RimDupl + 69 63 61 74 65 54 6f 6b 65 6e 45 78 63 65 70 74 icateTok enExcept + 69 6f 6e 3b 00 00 00 04 01 00 00 00 06 00 00 00 ion;.... ........ + 4b 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 69 63 65 KLnet/ri m/device + 2f 63 6c 64 63 2f 69 6d 70 6c 2f 73 6f 66 74 74 /cldc/im pl/softt + 6f 6b 65 6e 2f 72 69 6d 73 65 63 75 72 69 64 6c oken/rim securidl + 69 62 2f 52 69 6d 49 6e 76 61 6c 69 64 50 61 72 ib/RimIn validPar + 61 6d 45 78 63 65 70 74 69 6f 6e 3b 00 00 00 04 amExcept ion;.... + 01 00 00 00 07 00 00 00 40 4c 6e 65 74 2f 72 69 ........ @Lnet/ri + 6d 2f 64 65 76 69 63 65 2f 63 6c 64 63 2f 69 6d m/device /cldc/im + 70 6c 2f 73 6f 66 74 74 6f 6b 65 6e 2f 72 69 6d pl/softt oken/rim + 73 65 63 75 72 69 64 6c 69 62 2f 52 69 6d 53 65 securidl ib/RimSe + 63 75 72 49 44 4c 69 62 3b 00 00 00 04 01 00 00 curIDLib ;....... + 00 08 00 00 00 4c 4c 6e 65 74 2f 72 69 6d 2f 64 .....LLn et/rim/d + 65 76 69 63 65 2f 63 6c 64 63 2f 69 6d 70 6c 2f evice/cl dc/impl/ + 73 6f 66 74 74 6f 6b 65 6e 2f 72 69 6d 73 65 63 softtoke n/rimsec + 75 72 69 64 6c 69 62 2f 52 69 6d 57 72 6f 6e 67 uridlib/ RimWrong + 44 65 76 69 63 65 49 44 45 78 63 65 70 74 69 6f DeviceID Exceptio + 6e 3b 00 00 00 04 01 00 00 00 09 00 00 00 4e 4c n;...... ......NL + 6e 65 74 2f 72 69 6d 2f 64 65 76 69 63 65 2f 63 net/rim/ device/c + 6c 64 63 2f 69 6d 70 6c 2f 73 6f 66 74 74 6f 6b ldc/impl /softtok + 65 6e 2f 72 69 6d 73 65 63 75 72 69 64 6c 69 62 en/rimse curidlib + 2f 52 69 6d 57 72 6f 6e 67 46 6f 72 6d 46 61 63 /RimWron gFormFac + 74 6f 72 45 78 63 65 70 74 69 6f 6e 3b 00 00 00 torExcep tion;... + 04 . + + + +<<< 00 00 00 11 00 00 00 0e 00 0f 01 06 02 00 00 00 ........ ........ +>>> 00 00 00 0f 00 00 00 0e 80 00 00 ........ ... + 00 00 00 05 .... + +<<< 00 00 00 11 00 00 00 10 00 0f 01 07 02 00 00 00 ........ ........ +>>> 00 00 00 0f 00 00 00 10 80 00 00 ........ ... + 00 00 00 06 .... + + +<<< 00 00 00 2e 00 00 00 12 00 0f 01 08 02 00 00 00 ........ ........ + 02 05 00 00 00 13 6a 61 76 61 2e 6c 61 6e 67 2e ......ja va.lang. + 54 68 72 6f 77 61 62 6c 65 01 00 00 00 01 Throwabl e..... +>>> 00 00 00 0f 00 00 00 12 80 00 00 ........ ... + 00 00 00 07 .... + + +<<< 00 00 00 0b 00 00 00 14 00 01 0d ........ ... +>>> 00 00 00 17 00 00 00 14 80 00 00 ........ ... + 00 00 00 00 00 00 00 00 00 00 00 00 ........ .... + + + +---- Disconnection (command exit) ---- + +<<< 00 00 00 0b 00 00 00 16 00 01 06 ........ ... + diff -Nru barry-0.14/doc/bjdwp/jdwp-methods-and-fields.txt barry-0.0.20110506/doc/bjdwp/jdwp-methods-and-fields.txt --- barry-0.14/doc/bjdwp/jdwp-methods-and-fields.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-methods-and-fields.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,212 @@ +VM Started: > classes +** classes list ** +0x1 com.barry.tests.barrydemo.BarryDemo +0x2 com.barry.tests.barrydemo.BarryScreen +0x3 com.rim.resources.BarryDemoRIMResources +0x4 com.rim.resources.net_rim_rimsecuridlibRIMResources +0x5 net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimDatabaseFullException +0x6 net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimDecryptFailException +0x7 net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimDuplicateNameException +0x8 net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimDuplicateTokenException +0x9 net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimInvalidParamException +0xA net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimSecurIDLib +0xB net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimWrongDeviceIDException +0xC net.rim.device.cldc.impl.softtoken.rimsecuridlib.RimWrongFormFactorException + +> class com.barry.tests.barrydemo.BarryDemo +Class: com.barry.tests.barrydemo.BarryDemo +extends: net.rim.device.api.ui.UiApplication + +> methods com.barry.tests.barrydemo.BarryDemo +** methods list ** +com.barry.tests.barrydemo.BarryDemo main(java.lang.String[]) +com.barry.tests.barrydemo.BarryDemo () + +> fields com.barry.tests.barrydemo.BarryDemo +** fields list ** + +> class com.barry.tests.barrydemo.BarryScreen +Class: com.barry.tests.barrydemo.BarryScreen +extends: net.rim.device.api.ui.container.MainScreen + +> methods com.barry.tests.barrydemo.BarryScreen +** methods list ** +com.barry.tests.barrydemo.BarryScreen () +com.barry.tests.barrydemo.BarryScreen close() + +> fields com.barry.tests.barrydemo.BarryScreen +** fields list ** +> exit + + + +---- command class com.barry.tests.barrydemo.BarryDemo ---- + +<<< 00 00 00 0f 00 00 00 16 00 03 01 00 00 00 01 ........ ....... +>>> 00 00 00 0f 00 00 00 16 80 00 00 ........ ... + 00 00 00 0d .... +<= 0x0000000d is a new ID since, we have to load a new class + +<<< 00 00 00 0f 00 00 00 18 00 02 01 00 00 00 0d ........ ....... + 00 00 00 34 00 00 00 18 80 00 00 ...4.... ... + 00 00 00 25 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 ...%Lnet /rim/dev + 69 63 65 2f 61 70 69 2f 75 69 2f 55 69 41 70 70 ice/api/ ui/UiApp + 6c 69 63 61 74 69 6f 6e 3b lication ; + +<<< 00 00 00 0f 00 00 00 1a 00 02 0a 00 00 00 01 ........ ....... +>>> 00 00 00 0f 00 00 00 1a 80 00 00 ........ ... + 00 00 00 00 .... + + + +---- command class com.barry.tests.barrydemo.BarryScreen ---- + +<<< 00 00 00 0f 00 00 00 1c 00 03 01 00 00 00 02 ........ ....... +>>> 00 00 00 0f 00 00 00 1c 80 00 00 ........ ... + 00 00 00 0e .... + +<= 0x0000000e is a new ID since, we have to load a new class + +<<< 00 00 00 0f 00 00 00 1e 00 02 01 00 00 00 0e ........ ....... +>>> 00 00 00 3b 00 00 00 1e 80 00 00 ...;.... ... + 00 00 00 2c 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 ...,Lnet /rim/dev + 69 63 65 2f 61 70 69 2f 75 69 2f 63 6f 6e 74 61 ice/api/ ui/conta + 69 6e 65 72 2f 4d 61 69 6e 53 63 72 65 65 6e 3b iner/Mai nScreen; + +<<< 00 00 00 0f 00 00 00 20 00 03 01 00 00 00 03 ....... ....... +>>> 00 00 00 0f 00 00 00 20 80 00 00 ....... ... + 00 00 00 0f .... + +<<< 00 00 00 0f 00 00 00 22 00 02 01 00 00 00 0f ......." ....... +>>> 00 00 00 32 00 00 00 22 80 00 00 ...2..." ... + 00 00 00 23 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 ...#Lnet /rim/dev + 69 63 65 2f 72 65 73 6f 75 72 63 65 73 2f 52 65 ice/reso urces/Re + 73 6f 75 72 63 65 3b source; + +<<< 00 00 00 0f 00 00 00 24 00 03 01 00 00 00 04 .......$ ....... +>>> 00 00 00 0f 00 00 00 24 80 00 00 .......$ ... + 00 00 00 10 .... + +<<< 00 00 00 0f 00 00 00 26 00 02 01 00 00 00 10 .......& ....... +>>> 00 00 00 32 00 00 00 26 80 00 00 ...2...& ... + 00 00 00 23 4c 6e 65 74 2f 72 69 6d 2f 64 65 76 ...#Lnet /rim/dev + 69 63 65 2f 72 65 73 6f 75 72 63 65 73 2f 52 65 ice/reso urces/Re + 73 6f 75 72 63 65 3b source; + +<<< 00 00 00 0f 00 00 00 28 00 03 01 00 00 00 0d .......( ....... +>>> 00 00 00 0f 00 00 00 28 80 00 00 .......( ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 2a 00 03 01 00 00 00 05 .......* ....... +>>> 00 00 00 0f 00 00 00 2a 80 00 00 .......* ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 2c 00 02 01 00 00 00 11 ......., ....... +>>> 00 00 00 24 00 00 00 2c 80 00 00 ...$.... ... + 00 00 00 15 4c 6a 61 76 61 2f 6c 61 6e 67 2f 45 ...Ljav a/lang/E + 78 63 65 70 74 69 6f 6e 3b xception ; + +<<< 00 00 00 0f 00 00 00 2e 00 03 01 00 00 00 06 ........ ....... +>>> 00 00 00 0f 00 00 00 2e 80 00 00 ........ ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 30 00 03 01 00 00 00 07 .......0 ....... +>>> 00 00 00 0f 00 00 00 30 80 00 00 .......0 ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 32 00 03 01 00 00 00 08 .......2 ....... +>>> 00 00 00 0f 00 00 00 32 80 00 00 .......2 ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 34 00 03 01 00 00 00 09 .......4 ....... +>>> 00 00 00 0f 00 00 00 34 80 00 00 .......4 ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 36 00 03 01 00 00 00 0a .......6 ....... +>>> 00 00 00 0f 00 00 00 36 80 00 00 .......6 ... + 00 00 00 12 .... + +<<< 00 00 00 0f 00 00 00 38 00 02 01 00 00 00 12 .......8 ....... +>>> 00 00 00 21 00 00 00 38 80 00 00 ...!...8 ... + 00 00 00 12 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f ....Ljav a/lang/O + 62 6a 65 63 74 3b bject; + +<<< 00 00 00 0f 00 00 00 3a 00 03 01 00 00 00 0b .......: ....... +>>> 00 00 00 0f 00 00 00 3a 80 00 00 .......: ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 3c 00 03 01 00 00 00 0c .......< ....... +>>> 00 00 00 0f 00 00 00 3c 80 00 00 .......< ... + 00 00 00 11 .... + +<<< 00 00 00 0f 00 00 00 3e 00 02 05 00 00 00 01 .......> ....... +>>> 00 00 00 52 00 00 00 3e 80 00 00 ...R...> ... + 00 00 00 02 00 00 00 13 00 00 00 04 6d 61 69 6e ........ ....main + 00 00 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67 ....([Lj ava/lang + 2f 53 74 72 69 6e 67 3b 29 56 00 00 00 19 00 00 /String; )V...... + 00 14 00 00 00 06 3c 69 6e 69 74 3e 00 00 00 03 .......... + 28 29 56 00 00 00 02 ()V.... + +<<< 00 00 00 0f 00 00 00 40 00 02 05 00 00 00 0d .......@ ....... +>>> 00 00 00 0f 00 00 00 40 80 00 00 .......@ ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 42 00 02 0a 00 00 00 0d .......B ....... +>>> 00 00 00 0f 00 00 00 42 80 00 00 .......B ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 44 00 02 04 00 00 00 01 .......D ....... +>>> 00 00 00 0f 00 00 00 44 80 00 00 .......D ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 46 00 02 04 00 00 00 0d .......F ....... +>>> 00 00 00 0f 00 00 00 46 80 00 00 .......F ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 48 00 02 0a 00 00 00 02 .......H ....... +>>> 00 00 00 0f 00 00 00 48 80 00 00 .......H ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 4a 00 03 01 00 00 00 11 .......J ....... +>>> 00 00 00 0f 00 00 00 4a 80 00 00 .......J ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 4c 00 03 01 00 00 00 12 .......L ....... +>>> 00 00 00 0f 00 00 00 4c 80 00 00 .......L ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 4e 00 03 01 00 00 00 0e .......N ....... +>>> 00 00 00 0f 00 00 00 4e 80 00 00 .......N ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 50 00 03 01 00 00 00 0f .......P ....... +>>> 00 00 00 0f 00 00 00 50 80 00 00 .......P ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 52 00 03 01 00 00 00 10 .......R ....... +>>> 00 00 00 0f 00 00 00 52 80 00 00 .......R ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 54 00 02 05 00 00 00 02 .......T ....... +>>> 00 00 00 40 00 00 00 54 80 00 00 ...@...T ... + 00 00 00 02 00 00 00 15 00 00 00 06 3c 69 6e 69 ........ ........() V....... + 16 00 00 00 05 63 6c 6f 73 65 00 00 00 03 28 29 .....clo se....() + 56 00 00 00 11 V.... + +<<< 00 00 00 0f 00 00 00 56 00 02 05 00 00 00 0e .......V ....... +>>> 00 00 00 0f 00 00 00 56 80 00 00 .......V ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 58 00 02 0a 00 00 00 0e .......X ....... +>>> 00 00 00 0f 00 00 00 58 80 00 00 .......X ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 5a 00 02 04 00 00 00 02 .......Z ....... +>>> 00 00 00 0f 00 00 00 5a 80 00 00 .......Z ... + 00 00 00 00 .... + +<<< 00 00 00 0f 00 00 00 5c 00 02 04 00 00 00 0e .......\ ....... +>>> 00 00 00 0f 00 00 00 5c 80 00 00 .......\ ... + 00 00 00 00 .... + diff -Nru barry-0.14/doc/bjdwp/jdwp-protocol.txt barry-0.0.20110506/doc/bjdwp/jdwp-protocol.txt --- barry-0.14/doc/bjdwp/jdwp-protocol.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-protocol.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,28 @@ +.: Test to get traces :. +======================== + +1°) Scheme + + +-------+ +--------+ +------------+ + | | | | | BlackBerry | + | JDB |== TCP / IP ==| JDWP |== USB ==| | + | | | | | device | + +-------+ +--------+ +------------+ + +2°) Plug your BlackBerry device + +3°) Install the BarryDemo application on your device (in using javaloader / bjavaloader) + +4°) Run tcpdump on the local interface + +5°) Run JDWP provided by RIM's tools (listen to port 8080) + +6°) Run JDB : + + $ jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8080 + + $ jdb> resume + + $ jdb> exit + + diff -Nru barry-0.14/doc/bjdwp/jdwp-resume.txt barry-0.0.20110506/doc/bjdwp/jdwp-resume.txt --- barry-0.14/doc/bjdwp/jdwp-resume.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-resume.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,53 @@ +.: JDB command :. +================= + +jdb> resume + + + +.: Dump :. +========== + +Legend : + <<< : Data received from JDB + >>> : Data sent by wrapper JDWP + + +---- command resume ---- + +<<< 00 00 00 0b 00 00 00 16 00 01 04 ........ ... +>>> 00 00 01 cb 00 00 00 16 80 00 00 ........ ... + 00 00 00 6f e6 a1 e0 00 db f9 20 00 7e 38 40 00 ...o.... .. .~8@. + 7b 6d a0 00 4f aa 80 00 4f ab a0 00 4f ad 40 00 {m..O... O...O.@. + 53 05 60 00 35 ee 40 00 35 ee c0 00 36 00 a0 00 S.`.5.@. 5...6... + 41 b0 40 00 41 ca e0 00 4a 41 20 00 4a c7 20 00 A.@.A... JA .J. . + 4a df 80 00 2d 47 c0 00 e2 5c 20 00 3a 5d 60 00 J...-G.. .\ .:]`. + 3e 30 a0 00 3b 84 c0 00 38 b5 40 00 38 16 c0 00 >0..;... 8.@.8... + 35 70 a0 00 33 26 a0 00 31 1c 00 00 34 61 00 00 5p..3&.. 1...4a.. + 34 5e e0 00 32 a6 80 00 32 92 a0 00 32 b4 60 00 4^..2... 2...2.`. + 32 35 c0 00 6d ef 60 00 6d ef 00 00 6c 9e c0 00 25..m.`. m...l... + 66 51 a0 00 60 05 20 00 5f 5f c0 00 5f 5f a0 00 fQ..`. . __..__.. + 5f 1a c0 00 5f 2a 80 00 5d 76 a0 00 39 46 00 00 _..._*.. ]v..9F.. + 30 65 e0 00 2e 35 40 00 30 7a 80 00 30 27 40 00 0e...5@. 0z..0'@. + 30 29 20 00 2f c1 80 00 2f 57 20 00 2f 57 00 00 0) ./... /W ./W.. + 2f 17 c0 00 2e 95 00 00 29 ab 40 00 28 eb e0 00 /....... ).@.(... + 28 eb 40 00 0c f6 60 00 0c f9 a0 00 0c f8 80 00 (.@...`. ........ + 02 4d 60 00 17 10 60 00 16 04 60 00 11 45 c0 00 .M`...`. ..`..E.. + 11 46 60 00 12 46 60 00 10 09 60 00 0e 3f a0 00 .F`..F`. ..`..?.. + 0d 11 00 00 0c b1 40 00 0d 04 20 00 0d 05 c0 00 ......@. .. ..... + 0d 08 40 00 02 b1 a0 00 02 ab e0 00 02 a9 80 00 ..@..... ........ + 02 a3 00 00 08 02 c0 00 08 56 a0 00 e0 e5 20 00 ........ .V.... . + 00 3b a0 00 00 9f 40 00 43 b4 c0 00 43 bd a0 00 .;....@. C...C... + 43 ba e0 00 43 8f 40 00 0a fa e0 00 18 a8 20 00 C...C.@. ...... . + 2e e2 00 00 0b aa 20 00 16 04 20 00 15 ce c0 00 ...... . .. ..... + 15 a2 a0 00 15 8e 00 00 7b f4 80 00 7f 99 40 00 ........ {.....@. + 7f 9a 00 00 81 75 20 00 85 8d c0 00 90 3e 20 00 .....u . .....> . + 91 e9 80 00 e1 04 40 00 df 87 40 00 73 f3 60 00 ......@. ..@.s.`. + 90 27 00 00 91 91 e0 00 cd ec 80 00 0b 09 40 00 .'...... ......@. + 40 cb 40 00 40 ac 80 00 3f 5e e0 00 c9 b6 60 00 @.@.@... ?^....`. + + +>>> 00 00 00 0b 00 00 00 18 00 01 09 ........ ... +<<< 00 00 00 0b 00 00 00 18 80 00 00 ........ ... + + diff -Nru barry-0.14/doc/bjdwp/jdwp-suspend.txt barry-0.0.20110506/doc/bjdwp/jdwp-suspend.txt --- barry-0.14/doc/bjdwp/jdwp-suspend.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/jdwp-suspend.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,19 @@ +.: JDB command :. +================= + +jdb> suspend + + +.: Dump :. +========== + +Legend : + <<< : Data received from JDB + >>> : Data sent by wrapper JDWP + + +---- command suspend ---- + +<<< 00 00 00 0b 00 00 00 16 00 01 08 ........ ... +<<< 00 00 00 0b 00 00 00 16 80 00 00 ........ ... + diff -Nru barry-0.14/doc/bjdwp/README barry-0.0.20110506/doc/bjdwp/README --- barry-0.14/doc/bjdwp/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,99 @@ + BJDWP Readme + ============== + +Introduction +------------ + +With bjdwp you can debug with JDB your Java applications on your BlackBerry device. +bjdwp is a wrapper between JDB and the JVM embedded in your device. +bjdwp uses the barry library to comminucate with your device. + + +Table of contents +----------------- + +1. Note + +2. Requirements + +3. Compilation + +4. Usage + 4.1 Command line + 4.2 Options + +5. Status + +6. Licence + + + + ========================== + + +1. Note +------- + +The JDWP application to debug Java applications for BlackBerry is currently being developed +on Linux. This driver can do damages. Use this application only if you know what you are doing. + + +2. Requirements +--------------- + + - Barry and libbarry 0.15 or higher (with JavaDebug mode support) + - cmake + + +3. Compilation +-------------- + + $ ./configure + $ make + + To run the application, launch the binary in the "bin" directory + + $ cd bin + $ ./bjdwp + + +4. Usage +-------- + +4.1 Command line + + 1°) Plug your BlackBerry device + + 2°) Run bjdwp wrapper + + $ bjdwp localhost 8000 + + 3°) Run JDB + + $ jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000 + + +4.2 Options + + bjdwp accepts the same options that the tools btool, bjavaloader... + + bjdwp [hpPv]
+ + -h This help\n" + -p pin PIN of device to talk with\n" + If only one device is plugged in, this flag is optional\n" + -P pass Simplistic method to specify device password\n" + -v Dump protocol data during operation\n" + + +5. Status +--------- + + bjdwp isn't usable. + + +6. Licence +---------- + + bjdwp application is distributed under the licence GPL. + Binary files /tmp/hrabAk_zAl/barry-0.14/doc/bjdwp/sample/BarryDemo.cod and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.cod differ diff -Nru barry-0.14/doc/bjdwp/sample/BarryDemo.cso barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.cso --- barry-0.14/doc/bjdwp/sample/BarryDemo.cso 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.cso 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,5 @@ +33000000=RIMAPPSA2 +52424200=RIM Blackberry Apps API +52434300=RIM Crypto API - Certicom +52434900=RIM Crypto API - Internal +52435200=RIM Crypto API - RIM Binary files /tmp/hrabAk_zAl/barry-0.14/doc/bjdwp/sample/BarryDemo.debug and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.debug differ diff -Nru barry-0.14/doc/bjdwp/sample/BarryDemo.debug.txt barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.debug.txt --- barry-0.14/doc/bjdwp/sample/BarryDemo.debug.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.debug.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,338 @@ +00000000 00 00 00 08 4A 77 F4 BE 00 00 00 00 00 00 00 09 00 42 00 61 ....Jw...........B.a + ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ <---------- + Unique ID len +00000014 00 72 00 72 00 79 00 44 00 65 00 6D 00 6F 00 00 00 0E 00 00 .r.r.y.D.e.m.o...... + -------------------------------------------> ^^^^^^^^^^^^ ^^^^^ + string 0xE types [[ +00000028 00 07 00 00 00 09 00 42 00 61 00 72 00 72 00 79 00 44 00 65 .......B.a.r.r.y.D.e + ^^^^^ ^^^^^^^^^^^^ <------------------------------------------- + len string +0000003C 00 6D 00 6F 00 00 08 24 00 00 00 00 00 00 00 00 00 00 00 00 .m.o...$............ + ----------> ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ + Type ID +00000050 00 00 00 00 00 00 00 31 00 2F 00 68 00 6F 00 6D 00 65 00 2F .......1./.h.o.m.e./ + ^^^^^^^^^^^ ^^^^^^^^^^^ <------------------------------------ + len len string +00000064 00 6E 00 69 00 63 00 6F 00 6C 00 61 00 73 00 2F 00 50 00 72 .n.i.c.o.l.a.s./.P.r +00000078 00 6F 00 6A 00 65 00 63 00 74 00 2F 00 62 00 6A 00 64 00 77 .o.j.e.c.t./.b.j.d.w +0000008C 00 70 00 2F 00 73 00 61 00 6D 00 70 00 6C 00 65 00 2F 00 42 .p./.s.a.m.p.l.e./.B +000000A0 00 61 00 72 00 72 00 79 00 44 00 65 00 6D 00 6F 00 2E 00 6A .a.r.r.y.D.e.m.o...j +000000B4 00 61 00 76 00 61 00 00 00 00 00 00 00 00 00 00 00 02 00 00 .a.v.a.............. + -----------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +000000C8 00 00 00 00 00 07 00 00 00 0D 00 55 00 69 00 41 00 70 00 70 ...........U.i.A.p.p + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <------------------------------ + len string +000000DC 00 6C 00 69 00 63 00 61 00 74 00 69 00 6F 00 6E 00 00 20 44 .l.i.c.a.t.i.o.n.. D + -------------------------------------------------> ^^^^^^^^^^^ +000000F0 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 15 00 6E 00 65 .................n.e + ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ <---------- + len +00000104 00 74 00 2E 00 72 00 69 00 6D 00 2E 00 64 00 65 00 76 00 69 .t...r.i.m...d.e.v.i +00000118 00 63 00 65 00 2E 00 61 00 70 00 69 00 2E 00 75 00 69 00 00 .c.e...a.p.i...u.i.. + --------------------------------------------------------> ^^^^^ + string +0000012C 00 35 00 2F 00 6F 00 70 00 74 00 2F 00 52 00 49 00 4D 00 2F .5./.o.p.t./.R.I.M./ + ^^^^^ <-------------------------------------------------------- + len string +00000140 00 73 00 64 00 6B 00 2F 00 6C 00 69 00 62 00 2F 00 6E 00 65 .s.d.k./.l.i.b./.n.e +00000154 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 61 00 70 00 69 00 2E .t._.r.i.m._.a.p.i.. +00000168 00 6A 00 61 00 72 00 28 00 6E 00 65 00 74 00 5F 00 72 00 69 .j.a.r.(.n.e.t._.r.i +0000017C 00 6D 00 5F 00 63 00 6C 00 64 00 63 00 2D 00 31 00 30 00 2E .m._.c.l.d.c.-.1.0.. +00000190 00 63 00 6F 00 64 00 29 00 00 00 00 00 00 00 00 00 00 00 00 .c.o.d.)............ + -----------------------> +000001A4 00 00 00 00 00 00 00 07 00 00 00 15 00 42 00 61 00 72 00 72 .............B.a.r.r + ^^^^^^^^^^^ ^^^^^^^^^^^ <----------------------- + len string +000001B8 00 79 00 44 00 65 00 6D 00 6F 00 52 00 49 00 4D 00 52 00 65 .y.D.e.m.o.R.I.M.R.e +000001CC 00 73 00 6F 00 75 00 72 00 63 00 65 00 73 00 00 00 64 00 00 .s.o.u.r.c.e.s...d.. + -------------------------------------------> ^^^^^^^^^^^^ +000001E0 00 00 00 00 00 00 00 00 00 01 00 00 00 11 00 63 00 6F 00 6D ...............c.o.m + ^^^^^^^^^^^^ <----------------- + len string +000001F4 00 2E 00 72 00 69 00 6D 00 2E 00 72 00 65 00 73 00 6F 00 75 ...r.i.m...r.e.s.o.u +00000208 00 72 00 63 00 65 00 73 00 00 00 20 00 2F 00 6F 00 70 00 74 .r.c.e.s... ./.o.p.t + -----------------------> ^^^^^^^^^^^ <----------------------- + len string +0000021C 00 2F 00 52 00 49 00 4D 00 2F 00 73 00 64 00 6B 00 2F 00 6C ./.R.I.M./.s.d.k./.l +00000230 00 69 00 62 00 2F 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .i.b./.n.e.t._.r.i.m +00000244 00 5F 00 61 00 70 00 69 00 2E 00 6A 00 61 00 72 00 00 00 00 ._.a.p.i...j.a.r.... + -------------------------------------------------> +00000258 00 00 00 0A 00 00 00 02 00 00 00 00 00 00 00 07 00 00 00 08 .................... + ^^^^^^^^^^^ ^^^^^^^^^^^ +0000026C 00 52 00 65 00 73 00 6F 00 75 00 72 00 63 00 65 00 00 20 44 .R.e.s.o.u.r.c.e.. D + <------------------------------------------------> ^^^^^^^^^^^ +00000280 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 18 00 6E 00 65 .................n.e + ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ <---------- +00000294 00 74 00 2E 00 72 00 69 00 6D 00 2E 00 64 00 65 00 76 00 69 .t...r.i.m...d.e.v.i +000002A8 00 63 00 65 00 2E 00 72 00 65 00 73 00 6F 00 75 00 72 00 63 .c.e...r.e.s.o.u.r.c +000002BC 00 65 00 73 00 00 00 35 00 2F 00 6F 00 70 00 74 00 2F 00 52 .e.s...5./.o.p.t./.R + ----------> ^^^^^^^^^^^ <------------------------------------ +000002D0 00 49 00 4D 00 2F 00 73 00 64 00 6B 00 2F 00 6C 00 69 00 62 .I.M./.s.d.k./.l.i.b +000002E4 00 2F 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 61 ./.n.e.t._.r.i.m._.a +000002F8 00 70 00 69 00 2E 00 6A 00 61 00 72 00 28 00 6E 00 65 00 74 .p.i...j.a.r.(.n.e.t +0000030C 00 5F 00 72 00 69 00 6D 00 5F 00 63 00 6C 00 64 00 63 00 2D ._.r.i.m._.c.l.d.c.- +00000320 00 32 00 31 00 2E 00 63 00 6F 00 64 00 29 00 00 00 00 00 00 .2.1...c.o.d.)...... + -------------------------------------------> +00000334 00 00 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 0B 00 42 ...................B + ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + ] [ len +00000348 00 61 00 72 00 72 00 79 00 53 00 63 00 72 00 65 00 65 00 6E .a.r.r.y.S.c.r.e.e.n + --------------------------------------------------------------> + string +0000035C 00 00 08 24 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 ...$................ +00000370 00 00 00 31 00 2F 00 68 00 6F 00 6D 00 65 00 2F 00 6E 00 69 ...1./.h.o.m.e./.n.i + ^^^^^^^^^^^ <------------------------------------------------- + len string +00000384 00 63 00 6F 00 6C 00 61 00 73 00 2F 00 50 00 72 00 6F 00 6A .c.o.l.a.s./.P.r.o.j +00000398 00 65 00 63 00 74 00 2F 00 62 00 6A 00 64 00 77 00 70 00 2F .e.c.t./.b.j.d.w.p./ +000003AC 00 73 00 61 00 6D 00 70 00 6C 00 65 00 2F 00 42 00 61 00 72 .s.a.m.p.l.e./.B.a.r +000003C0 00 72 00 79 00 44 00 65 00 6D 00 6F 00 2E 00 6A 00 61 00 76 .r.y.D.e.m.o...j.a.v +000003D4 00 61 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 .a.................. + ----> ^^^^^ +000003E8 00 07 00 00 00 0A 00 4D 00 61 00 69 00 6E 00 53 00 63 00 72 .......M.a.i.n.S.c.r + ^^^^^ ^^^^^^^^^^^^ <------------------------------------------- +000003FC 00 65 00 65 00 6E 00 00 20 44 00 00 00 00 00 00 00 00 FF FF .e.e.n.. D.......... + -----------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000410 FF FF 00 00 00 1F 00 6E 00 65 00 74 00 2E 00 72 00 69 00 6D .......n.e.t...r.i.m + ^^^^^ ^^^^^^^^^^^^ <------------------------------------------- +00000424 00 2E 00 64 00 65 00 76 00 69 00 63 00 65 00 2E 00 61 00 70 ...d.e.v.i.c.e...a.p +00000438 00 69 00 2E 00 75 00 69 00 2E 00 63 00 6F 00 6E 00 74 00 61 .i...u.i...c.o.n.t.a +0000044C 00 69 00 6E 00 65 00 72 00 00 00 35 00 2F 00 6F 00 70 00 74 .i.n.e.r...5./.o.p.t + -----------------------> ^^^^^^^^^^^ <----------------------- +00000460 00 2F 00 52 00 49 00 4D 00 2F 00 73 00 64 00 6B 00 2F 00 6C ./.R.I.M./.s.d.k./.l +00000474 00 69 00 62 00 2F 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .i.b./.n.e.t._.r.i.m +00000488 00 5F 00 61 00 70 00 69 00 2E 00 6A 00 61 00 72 00 28 00 6E ._.a.p.i...j.a.r.(.n +0000049C 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 63 00 6C 00 64 .e.t._.r.i.m._.c.l.d +000004B0 00 63 00 2D 00 31 00 33 00 2E 00 63 00 6F 00 64 00 29 00 00 .c.-.1.3...c.o.d.).. + --------------------------------------------------------> +000004C4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 .................... + ^^^^^^^^^^^^ ^^^^^ + ] [ +000004D8 00 04 00 76 00 6F 00 69 00 64 00 00 00 07 00 00 00 06 00 53 ...v.o.i.d.........S + ^^^^^ <-----------------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + ] [ +000004EC 00 74 00 72 00 69 00 6E 00 67 00 00 20 64 00 00 00 00 00 00 .t.r.i.n.g.. d...... + ------------------------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000500 00 00 FF FF FF FF 00 00 00 09 00 6A 00 61 00 76 00 61 00 2E ...........j.a.v.a.. + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <------------------------------ +00000514 00 6C 00 61 00 6E 00 67 00 00 00 32 00 2F 00 6F 00 70 00 74 .l.a.n.g...2./.o.p.t + -----------------------> ^^^^^^^^^^^ <----------------------- +00000528 00 2F 00 52 00 49 00 4D 00 2F 00 73 00 64 00 6B 00 2F 00 6C ./.R.I.M./.s.d.k./.l +0000053C 00 69 00 62 00 2F 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .i.b./.n.e.t._.r.i.m +00000550 00 5F 00 61 00 70 00 69 00 2E 00 6A 00 61 00 72 00 28 00 6E ._.a.p.i...j.a.r.(.n +00000564 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 63 00 6C 00 64 .e.t._.r.i.m._.c.l.d +00000578 00 63 00 2E 00 63 00 6F 00 64 00 29 00 00 00 00 00 00 00 00 .c...c.o.d.)........ + ------------------------------------> ^^^^^^^^^^^ ^^^^^^^^^^^ +0000058C 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 08 00 53 00 74 .................S.t + ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ <---------- + ]  [ +000005A0 00 72 00 69 00 6E 00 67 00 5B 00 5D 00 00 00 07 00 00 00 09 .r.i.n.g.[.]........ + ------------------------------------> ^^^^^^^^^^^ ^^^^^^^^^^^ + ] [ +000005B4 00 48 00 61 00 73 00 68 00 74 00 61 00 62 00 6C 00 65 00 00 .H.a.s.h.t.a.b.l.e.. + <-------------------------------------------------------> ^^^^^ +000005C8 20 44 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 09 00 6A D.................j + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- +000005DC 00 61 00 76 00 61 00 2E 00 75 00 74 00 69 00 6C 00 00 00 32 .a.v.a...u.t.i.l...2 + -------------------------------------------------> ^^^^^^^^^^^ +000005F0 00 2F 00 6F 00 70 00 74 00 2F 00 52 00 49 00 4D 00 2F 00 73 ./.o.p.t./.R.I.M./.s + <-------------------------------------------------------------- +00000604 00 64 00 6B 00 2F 00 6C 00 69 00 62 00 2F 00 6E 00 65 00 74 .d.k./.l.i.b./.n.e.t +00000618 00 5F 00 72 00 69 00 6D 00 5F 00 61 00 70 00 69 00 2E 00 6A ._.r.i.m._.a.p.i...j +0000062C 00 61 00 72 00 28 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .a.r.(.n.e.t._.r.i.m +00000640 00 5F 00 63 00 6C 00 64 00 63 00 2E 00 63 00 6F 00 64 00 29 ._.c.l.d.c...c.o.d.) + --------------------------------------------------------------> +00000654 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 .................... + ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ +00000668 00 00 00 04 00 62 00 79 00 74 00 65 00 00 00 08 00 00 00 06 .....b.y.t.e........ + ^^^^^^^^^^^  <----------------------> ^^^^^^^^^^^ ^^^^^^^^^^^ + ] [ +0000067C 00 62 00 79 00 74 00 65 00 5B 00 5D 00 00 00 07 00 00 00 0A .b.y.t.e.[.]........ + <-----------------------------------> ^^^^^^^^^^^ ^^^^^^^^^^^ + ] [ +00000690 00 4C 00 61 00 62 00 65 00 6C 00 46 00 69 00 65 00 6C 00 64 .L.a.b.e.l.F.i.e.l.d + <-------------------------------------------------------------> +000006A4 00 00 20 44 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 1F .. D................ + ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ + len +000006B8 00 6E 00 65 00 74 00 2E 00 72 00 69 00 6D 00 2E 00 64 00 65 .n.e.t...r.i.m...d.e + <-------------------------------------------------------------- +000006CC 00 76 00 69 00 63 00 65 00 2E 00 61 00 70 00 69 00 2E 00 75 .v.i.c.e...a.p.i...u +000006E0 00 69 00 2E 00 63 00 6F 00 6D 00 70 00 6F 00 6E 00 65 00 6E .i...c.o.m.p.o.n.e.n +000006F4 00 74 00 00 00 35 00 2F 00 6F 00 70 00 74 00 2F 00 52 00 49 .t...5./.o.p.t./.R.I + ----> ^^^^^^^^^^^^ <------------------------------------------- + len string +00000708 00 4D 00 2F 00 73 00 64 00 6B 00 2F 00 6C 00 69 00 62 00 2F .M./.s.d.k./.l.i.b./ +0000071C 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 61 00 70 .n.e.t._.r.i.m._.a.p +00000730 00 69 00 2E 00 6A 00 61 00 72 00 28 00 6E 00 65 00 74 00 5F .i...j.a.r.(.n.e.t._ +00000744 00 72 00 69 00 6D 00 5F 00 63 00 6C 00 64 00 63 00 2D 00 31 .r.i.m._.c.l.d.c.-.1 +00000758 00 31 00 2E 00 63 00 6F 00 64 00 29 00 00 00 00 00 00 00 00 .1...c.o.d.)........ + ------------------------------------> +0000076C 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 03 00 69 00 6E .................i.n + ^^^^^^^^^^^  ^^^^^^^^^^^ <---------- + ] [ type len string +00000780 00 74 00 00 00 00 00 00 00 0E .t........ + ----> ^^^^^^^^^^^^ ^^^^^^^^^^^^ + ]] + + + + + + + + +00000780 00 00 00 00 00 00 00 01 + ^^^^^^^^^^^^ ^^^^^^^^^^^^ + [[ ]] + + +00000780 00 00 .......... + ^^^^^ + [[ +00000794 00 00 00 00 00 00 00 00 00 02 00 00 00 04 00 6D 00 61 00 69 ...............m.a.i + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <----------------- + [ len string +000007A8 00 6E 00 00 00 06 00 00 00 6A 00 00 00 0E 00 00 00 0E 00 00 .n.......j.......... + ----> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +000007BC 00 1D 00 00 00 01 00 00 00 08 00 00 00 02 00 00 00 04 00 61 ...................a + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + ] [ len +000007D0 00 72 00 67 00 73 00 00 00 08 00 00 00 00 00 00 00 0E 00 00 .r.g.s.............. + -----------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ + string +000007E4 00 1D 00 00 00 06 00 74 00 68 00 65 00 41 00 70 00 70 00 00 .......t.h.e.A.p.p.. + ^^^^^ ^^^^^^^^^^^^ <------------------------------------> ^^^^^ + len string +000007F8 00 00 00 00 00 01 00 00 00 17 00 00 00 1D 00 00 00 03 00 00 .................... + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +0000080C 00 0F 00 00 00 0D 00 00 00 17 00 00 00 0F 00 00 00 1C 00 00 .................... + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000820 00 10 00 00 00 06 00 3C 00 69 00 6E 00 69 00 74 00 3E 00 00 .......<.i.n.i.t.>.. + ^^^^^ ^^^^^^^^^^^^ <------------------------------------> ^^^^^ +00000834 00 06 00 00 01 1C 00 00 00 26 00 00 00 26 00 00 00 3A 00 00 .........&...&...:.. + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000848 00 01 00 00 00 00 00 00 00 01 00 00 00 04 00 74 00 68 00 69 ...............t.h.i + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <----------------- +0000085C 00 73 00 00 00 00 00 00 00 00 00 00 00 26 00 00 00 3A 00 00 .s...........&...:.. + ----> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000870 00 03 00 00 00 27 00 00 00 13 00 00 00 2D 00 00 00 14 00 00 .....'.......-...... + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000884 00 39 00 00 00 15 00 00 00 00 00 00 00 00 00 00 00 01 00 00 .9.................. + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +00000898 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ +000008AC 00 03 + ^^^^^ + ]] + + + +000008AC 00 00 00 00 00 00 00 0A 00 00 00 01 00 00 00 0A 00 5F ..................._ +  ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + [[ sep type [ len +000008C0 00 72 00 65 00 73 00 6F 00 75 00 72 00 63 00 65 00 73 00 00 .r.e.s.o.u.r.c.e.s.. + --------------------------------------------------------> ^^^^^ + string +000008D4 00 09 00 00 00 42 00 00 00 04 00 00 00 01 00 00 00 0B 00 5F .....B............._ + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + variable variable ] [ len +000008E8 00 70 00 72 00 6F 00 70 00 65 00 72 00 74 00 69 00 65 00 73 .p.r.o.p.e.r.t.i.e.s + --------------------------------------------------------------> + string +000008FC 00 00 00 09 00 00 00 42 00 00 00 05 00 00 00 01 00 00 00 09 .......B............ + ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ + variable variable ] [ len +00000910 00 5F 00 61 00 70 00 70 00 49 00 63 00 6F 00 6E 00 73 00 00 ._.a.p.p.I.c.o.n.s.. + <-------------------------------------------------------> ^^^^^ + string +00000924 00 0B 00 00 00 42 00 00 00 06 00 00 00 01 00 00 00 0C 00 5F .....B............._ + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + variable variable ] [ len +00000938 00 61 00 70 00 70 00 45 00 78 00 74 00 49 00 63 00 6F 00 6E .a.p.p.E.x.t.I.c.o.n +0000094C 00 73 00 00 00 0B 00 00 00 42 00 00 00 07 00 00 00 01 00 00 .s.......B.......... + ----> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ + variable variable ] [ len +00000960 00 09 00 5F 00 61 00 70 00 70 00 43 00 6F 00 75 00 6E 00 74 ..._.a.p.p.C.o.u.n.t + ^^^^^ <-------------------------------------------------------> + string +00000974 00 00 00 0B 00 00 00 42 00 00 00 08 00 00 00 01 00 00 00 13 .......B............ + ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ + variable variable ] [ len +00000988 00 5F 00 72 00 65 00 73 00 6F 00 75 00 72 00 63 00 65 00 45 ._.r.e.s.o.u.r.c.e.E + <-------------------------------------------------------------- +0000099C 00 78 00 74 00 65 00 6E 00 73 00 69 00 6F 00 6E 00 73 00 00 .x.t.e.n.s.i.o.n.s.. + --------------------------------------------------------> ^^^^^ +000009B0 00 0B 00 00 00 42 00 00 00 09 00 00 00 01 00 00 00 09 00 5F .....B............._ + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <---- + variable variable ] [ len +000009C4 00 61 00 70 00 70 00 4E 00 61 00 6D 00 65 00 73 00 00 00 0B .a.p.p.N.a.m.e.s.... + -------------------------------------------------> ^^^^^^^^^^^ + variable +000009D8 00 00 00 42 00 00 00 0A 00 00 00 01 00 00 00 09 00 5F 00 61 ...B............._.a + ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ <---------- + variable ] [ len +000009EC 00 70 00 70 00 46 00 6C 00 61 00 67 00 73 00 00 00 0B 00 00 .p.p.F.l.a.g.s...... + -------------------------------------------> ^^^^^^^^^^^^ ^^^^^ + string variable +00000A00 00 42 00 00 00 0B 00 00 00 01 00 00 00 08 00 5F 00 76 00 65 .B............._.v.e + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <----------------- + variable ] [ len +00000A14 00 72 00 73 00 69 00 6F 00 6E 00 00 00 0B 00 00 00 42 00 00 .r.s.i.o.n.......B.. + ------------------------------> ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^ + string variable variable +00000A28 00 0C 00 00 00 01 00 00 00 07 00 5F 00 76 00 65 00 6E 00 64 ..........._.v.e.n.d + ^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ <------------------------------ + ] [ len string +00000A3C 00 6F 00 72 00 00 00 0B 00 00 00 42 00 00 00 0D 00 00 00 02 .o.r.......B........ + ----------> ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ + variable variable ] [ +00000A50 00 00 00 06 00 3C 00 69 00 6E 00 69 00 74 00 3E 00 00 00 06 .....<.i.n.i.t.>.... + ^^^^^^^^^^^ <-----------------------------------> ^^^^^^^^^^^ + len string variable +00000A64 00 00 00 5C 00 00 00 48 00 00 00 48 00 00 00 5C 00 00 00 01 ...\...H...H...\.... + ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ + variable variable variable +00000A78 00 00 00 02 00 00 00 01 00 00 00 04 00 74 00 68 00 69 00 73 .............t.h.i.s + ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ <----------------------> + variable ] [ len +00000A8C 00 00 00 02 00 00 00 00 00 00 00 48 00 00 00 5C 00 00 00 00 ...........H...\.... + ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^ + variable variable variable +00000AA0 00 00 00 08 00 3C 00 63 00 6C 00 69 00 6E 00 69 00 74 00 3E .....<.c.l.i.n.i.t.> + ^^^^^^^^^^^ <------------------------------------------------> + len +00000AB4 00 00 00 06 00 00 40 2A 00 00 00 6A 00 00 00 6A 00 00 00 C2 ......@*...j...j.... + ^^^^^^^^^^^  ^^^^^^^^^^^ ^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^ + + + +00000AC8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000ADC 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000AF0 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 02 .................... +00000B04 00 00 00 06 00 3C 00 69 00 6E 00 69 00 74 00 3E 00 00 00 06 .....<.i.n.i.t.>.... +00000B18 00 00 00 1C 00 00 00 EB 00 00 00 EB 00 00 01 57 00 00 00 01 ...............W.... +00000B2C 00 00 00 04 00 00 00 04 00 00 00 04 00 74 00 68 00 69 00 73 .............t.h.i.s +00000B40 00 00 00 04 00 00 00 00 00 00 00 EB 00 00 01 57 00 00 00 05 ...............W.... +00000B54 00 74 00 69 00 74 00 6C 00 65 00 00 00 0C 00 00 00 01 00 00 .t.i.t.l.e.......... +00000B68 01 08 00 00 01 57 00 00 00 01 00 69 00 00 00 0D 00 00 00 02 .....W.....i........ +00000B7C 00 00 01 1C 00 00 01 4A 00 00 00 03 00 73 00 74 00 72 00 00 .......J.....s.t.r.. +00000B90 00 07 00 00 00 03 00 00 01 25 00 00 01 45 00 00 00 0B 00 00 .........%...E...... +00000BA4 00 EC 00 00 00 1C 00 00 00 F2 00 00 00 1D 00 00 01 08 00 00 .................... +00000BB8 00 1E 00 00 01 0E 00 00 00 20 00 00 01 1A 00 00 00 22 00 00 ......... .......".. +00000BCC 01 21 00 00 00 23 00 00 01 25 00 00 00 25 00 00 01 3B 00 00 .!...#...%...%...;.. +00000BE0 00 27 00 00 01 45 00 00 00 22 00 00 01 4A 00 00 00 2A 00 00 .'...E..."...J...*.. +00000BF4 01 56 00 00 00 2B 00 00 00 05 00 63 00 6C 00 6F 00 73 00 65 .V...+.....c.l.o.s.e +00000C08 00 00 00 06 00 00 00 6C 00 00 00 CB 00 00 00 CB 00 00 00 D9 .......l............ +00000C1C 00 00 00 01 00 00 00 04 00 00 00 01 00 00 00 04 00 74 00 68 .................t.h +00000C30 00 69 00 73 00 00 00 04 00 00 00 00 00 00 00 CB 00 00 00 D9 .i.s................ +00000C44 00 00 00 03 00 00 00 CC 00 00 00 30 00 00 00 D2 00 00 00 32 ...........0.......2 +00000C58 00 00 00 D8 00 00 00 33 00 00 00 00 00 00 00 00 00 00 00 05 .......3............ +00000C6C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000C80 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000C94 00 00 00 00 00 00 00 04 00 00 00 07 00 00 00 01 00 00 00 00 .................... +00000CA8 00 00 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000CBC 00 00 00 01 00 00 00 04 00 00 00 0A 00 00 00 01 00 00 00 00 .................... +00000CD0 00 00 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .................... +00000CE4 00 00 00 04 .... + diff -Nru barry-0.14/doc/bjdwp/sample/BarryDemo.jad barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.jad --- barry-0.14/doc/bjdwp/sample/BarryDemo.jad 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.jad 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +RIM-COD-Module-Name: BarryDemo +RIM-COD-Module-Dependencies: net_rim_cldc +MIDlet-Jar-Size: 3202 +MIDlet-1: BarryDemo,, +RIM-COD-Creation-Time: 1249375422 +MIDlet-Jar-URL: BarryDemo.jar +RIM-COD-URL: BarryDemo.cod +RIM-COD-SHA1: 05 27 b5 ff 5c cb c9 2f 23 53 83 cd de f2 69 94 83 7e ae b1 +RIM-COD-Size: 1600 +MicroEdition-Configuration: CLDC-1.1 +MIDlet-Version: 1.0 +MIDlet-Name: BarryDemo +MIDlet-Vendor: Nicolas VIVIEN +MicroEdition-Profile: MIDP-2.0 +RIM-MIDlet-Flags-1: 0 Binary files /tmp/hrabAk_zAl/barry-0.14/doc/bjdwp/sample/BarryDemo.jar and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.jar differ diff -Nru barry-0.14/doc/bjdwp/sample/BarryDemo.java barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.java --- barry-0.14/doc/bjdwp/sample/BarryDemo.java 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.java 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,52 @@ +import net.rim.device.api.ui.UiApplication; +import net.rim.device.api.ui.container.MainScreen; +import net.rim.device.api.ui.Field; +import net.rim.device.api.ui.component.Dialog; +import net.rim.device.api.ui.component.LabelField; +import net.rim.device.api.ui.component.RichTextField; + + +class BarryDemo extends UiApplication +{ + public static void main(String[] args) + { + BarryDemo theApp = new BarryDemo(); + + theApp.enterEventDispatcher(); + } + + private BarryDemo() + { + pushScreen(new BarryScreen()); + } +} + + +final class BarryScreen extends MainScreen +{ + BarryScreen() + { + LabelField title = new LabelField("BarryDemo" , LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); + setTitle(title); + + System.out.println("Start test..."); + + for (int i=0; i<10; i++) { + String str = "Test number "; + + str = str + i; + + System.out.println(str); + } + + System.out.println("End test..."); + } + + + public void close() + { + System.exit(0); + + super.close(); + } +} diff -Nru barry-0.14/doc/bjdwp/sample/BarryDemo.rapc barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.rapc --- barry-0.14/doc/bjdwp/sample/BarryDemo.rapc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/BarryDemo.rapc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,9 @@ +MIDlet-Name: BarryDemo +MIDlet-Version: 1.0 +MIDlet-Vendor: Nicolas VIVIEN +MIDlet-Jar-URL: BarryDemo.jar +MIDlet-Jar-Size: 0 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.1 +MIDlet-1: BarryDemo,, +RIM-MIDlet-Flags-1: 0 diff -Nru barry-0.14/doc/bjdwp/sample/build.sh barry-0.0.20110506/doc/bjdwp/sample/build.sh --- barry-0.14/doc/bjdwp/sample/build.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/build.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,13 @@ +#!/bin/bash + + +SDK=/opt/RIM/sdk +PREVERIFY=/opt/RIM/WTK2.5.2/bin + + +PATH=$PATH:$PREVERIFY java -jar $SDK/bin/rapc.jar \ + import=$SDK/lib/net_rim_api.jar \ + codename=$1 \ + $1.rapc \ + *.java + diff -Nru barry-0.14/doc/bjdwp/sample/test.txt barry-0.0.20110506/doc/bjdwp/sample/test.txt --- barry-0.14/doc/bjdwp/sample/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bjdwp/sample/test.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,88 @@ +00000000 00 00 00 08 49 D7 8E 6C 00 00 00 00 00 00 00 0B 00 76 00 43 ....I..l.........v.C + * * * * +00000014 00 61 00 72 00 64 00 49 00 6D 00 70 00 6F 00 72 00 74 00 00 .a.r.d.I.m.p.o.r.t.. + *----- +00000028 00 19 00 00 00 07 00 00 00 06 00 4C 00 6F 00 67 00 67 00 65 ...........L.o.g.g.e + -----* * * +0000003C 00 72 00 00 08 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .r...d.............. + * * * * * +00000050 00 00 00 00 00 45 00 43 00 3A 00 5C 00 55 00 74 00 69 00 6C .....E.C.:.\.U.t.i.l + * * +00000064 00 69 00 74 00 61 00 69 00 72 00 65 00 73 00 5C 00 42 00 6C .i.t.a.i.r.e.s.\.B.l +00000078 00 61 00 63 00 6B 00 42 00 65 00 72 00 72 00 79 00 20 00 4A .a.c.k.B.e.r.r.y. .J +0000008C 00 44 00 45 00 20 00 34 00 2E 00 37 00 2E 00 30 00 5C 00 77 .D.E. .4...7...0.\.w +000000A0 00 6F 00 72 00 6B 00 73 00 70 00 61 00 63 00 65 00 5C 00 76 .o.r.k.s.p.a.c.e.\.v +000000B4 00 43 00 61 00 72 00 64 00 49 00 6D 00 70 00 6F 00 72 00 74 .C.a.r.d.I.m.p.o.r.t +000000C8 00 5C 00 4C 00 6F 00 67 00 67 00 65 00 72 00 2E 00 6A 00 61 .\.L.o.g.g.e.r...j.a +000000DC 00 76 00 61 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 .v.a................ + * * * * +000000F0 00 00 00 07 00 00 00 06 00 4F 00 62 00 6A 00 65 00 63 00 74 .........O.b.j.e.c.t + * * +00000104 00 00 20 44 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 09 .. D................ + * * * * +00000118 00 6A 00 61 00 76 00 61 00 2E 00 6C 00 61 00 6E 00 67 00 00 .j.a.v.a...l.a.n.g.. +0000012C 00 28 00 2E 00 2E 00 5C 00 6C 00 69 00 62 00 5C 00 6E 00 65 .(.....\.l.i.b.\.n.e +00000140 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 61 00 70 00 69 00 2E .t._.r.i.m._.a.p.i.. +00000154 00 6A 00 61 00 72 00 28 00 6E 00 65 00 74 00 5F 00 72 00 69 .j.a.r.(.n.e.t._.r.i +00000168 00 6D 00 5F 00 63 00 6C 00 64 00 63 00 2E 00 63 00 6F 00 64 .m._.c.l.d.c...c.o.d +0000017C 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .).................. + * +00000190 00 07 00 00 00 10 00 53 00 6C 00 69 00 64 00 65 00 42 00 75 .......S.l.i.d.e.B.u + * * +000001A4 00 74 00 74 00 6F 00 6E 00 46 00 69 00 65 00 6C 00 64 00 00 .t.t.o.n.F.i.e.l.d.. +000001B8 08 24 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 .$.................. +000001CC 00 4F 00 43 00 3A 00 5C 00 55 00 74 00 69 00 6C 00 69 00 74 .O.C.:.\.U.t.i.l.i.t +000001E0 00 61 00 69 00 72 00 65 00 73 00 5C 00 42 00 6C 00 61 00 63 .a.i.r.e.s.\.B.l.a.c +000001F4 00 6B 00 42 00 65 00 72 00 72 00 79 00 20 00 4A 00 44 00 45 .k.B.e.r.r.y. .J.D.E +00000208 00 20 00 34 00 2E 00 37 00 2E 00 30 00 5C 00 77 00 6F 00 72 . .4...7...0.\.w.o.r +0000021C 00 6B 00 73 00 70 00 61 00 63 00 65 00 5C 00 76 00 43 00 61 .k.s.p.a.c.e.\.v.C.a +00000230 00 72 00 64 00 49 00 6D 00 70 00 6F 00 72 00 74 00 5C 00 53 .r.d.I.m.p.o.r.t.\.S +00000244 00 6C 00 69 00 64 00 65 00 42 00 75 00 74 00 74 00 6F 00 6E .l.i.d.e.B.u.t.t.o.n +00000258 00 46 00 69 00 65 00 6C 00 64 00 2E 00 6A 00 61 00 76 00 61 .F.i.e.l.d...j.a.v.a +0000026C 00 00 00 07 00 00 00 00 00 00 00 0D 00 00 00 00 00 00 00 07 .................... +00000280 00 00 00 05 00 46 00 69 00 65 00 6C 00 64 00 00 20 44 00 00 .....F.i.e.l.d.. D.. +00000294 00 00 00 00 00 00 FF FF FF FF 00 00 00 15 00 6E 00 65 00 74 ...............n.e.t +000002A8 00 2E 00 72 00 69 00 6D 00 2E 00 64 00 65 00 76 00 69 00 63 ...r.i.m...d.e.v.i.c +000002BC 00 65 00 2E 00 61 00 70 00 69 00 2E 00 75 00 69 00 00 00 2A .e...a.p.i...u.i...* +000002D0 00 2E 00 2E 00 5C 00 6C 00 69 00 62 00 5C 00 6E 00 65 00 74 .....\.l.i.b.\.n.e.t +000002E4 00 5F 00 72 00 69 00 6D 00 5F 00 61 00 70 00 69 00 2E 00 6A ._.r.i.m._.a.p.i...j +000002F8 00 61 00 72 00 28 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .a.r.(.n.e.t._.r.i.m +0000030C 00 5F 00 63 00 6C 00 64 00 63 00 2D 00 38 00 2E 00 63 00 6F ._.c.l.d.c.-.8...c.o +00000320 00 64 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .d.)................ +00000334 00 00 00 07 00 00 00 0B 00 76 00 43 00 61 00 72 00 64 00 49 .........v.C.a.r.d.I +00000348 00 6D 00 70 00 6F 00 72 00 74 00 00 08 24 00 00 00 00 00 00 .m.p.o.r.t...$...... +0000035C 00 00 00 00 00 02 00 00 00 00 00 00 00 4A 00 43 00 3A 00 5C .............J.C.:.\ +00000370 00 55 00 74 00 69 00 6C 00 69 00 74 00 61 00 69 00 72 00 65 .U.t.i.l.i.t.a.i.r.e +00000384 00 73 00 5C 00 42 00 6C 00 61 00 63 00 6B 00 42 00 65 00 72 .s.\.B.l.a.c.k.B.e.r +00000398 00 72 00 79 00 20 00 4A 00 44 00 45 00 20 00 34 00 2E 00 37 .r.y. .J.D.E. .4...7 +000003AC 00 2E 00 30 00 5C 00 77 00 6F 00 72 00 6B 00 73 00 70 00 61 ...0.\.w.o.r.k.s.p.a +000003C0 00 63 00 65 00 5C 00 76 00 43 00 61 00 72 00 64 00 49 00 6D .c.e.\.v.C.a.r.d.I.m +000003D4 00 70 00 6F 00 72 00 74 00 5C 00 76 00 43 00 61 00 72 00 64 .p.o.r.t.\.v.C.a.r.d +000003E8 00 49 00 6D 00 70 00 6F 00 72 00 74 00 2E 00 6A 00 61 00 76 .I.m.p.o.r.t...j.a.v +000003FC 00 61 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 .a.................. +00000410 00 07 00 00 00 0D 00 55 00 69 00 41 00 70 00 70 00 6C 00 69 .......U.i.A.p.p.l.i +00000424 00 63 00 61 00 74 00 69 00 6F 00 6E 00 00 20 44 00 00 00 00 .c.a.t.i.o.n.. D.... +00000438 00 00 00 00 FF FF FF FF 00 00 00 15 00 6E 00 65 00 74 00 2E .............n.e.t.. +0000044C 00 72 00 69 00 6D 00 2E 00 64 00 65 00 76 00 69 00 63 00 65 .r.i.m...d.e.v.i.c.e +00000460 00 2E 00 61 00 70 00 69 00 2E 00 75 00 69 00 00 00 2B 00 2E ...a.p.i...u.i...+.. +00000474 00 2E 00 5C 00 6C 00 69 00 62 00 5C 00 6E 00 65 00 74 00 5F ...\.l.i.b.\.n.e.t._ +00000488 00 72 00 69 00 6D 00 5F 00 61 00 70 00 69 00 2E 00 6A 00 61 .r.i.m._.a.p.i...j.a +0000049C 00 72 00 28 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F .r.(.n.e.t._.r.i.m._ +000004B0 00 63 00 6C 00 64 00 63 00 2D 00 31 00 30 00 2E 00 63 00 6F .c.l.d.c.-.1.0...c.o +000004C4 00 64 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .d.)................ +000004D8 00 00 00 07 00 00 00 17 00 76 00 43 00 61 00 72 00 64 00 49 .........v.C.a.r.d.I +000004EC 00 6D 00 70 00 6F 00 72 00 74 00 52 00 49 00 4D 00 52 00 65 .m.p.o.r.t.R.I.M.R.e +00000500 00 73 00 6F 00 75 00 72 00 63 00 65 00 73 00 00 00 64 00 00 .s.o.u.r.c.e.s...d.. +00000514 00 00 00 00 00 00 00 00 00 03 00 00 00 11 00 63 00 6F 00 6D ...............c.o.m +00000528 00 2E 00 72 00 69 00 6D 00 2E 00 72 00 65 00 73 00 6F 00 75 ...r.i.m...r.e.s.o.u +0000053C 00 72 00 63 00 65 00 73 00 00 00 16 00 2E 00 2E 00 5C 00 6C .r.c.e.s.........\.l +00000550 00 69 00 62 00 5C 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D .i.b.\.n.e.t._.r.i.m +00000564 00 5F 00 61 00 70 00 69 00 2E 00 6A 00 61 00 72 00 00 00 00 ._.a.p.i...j.a.r.... +00000578 00 00 00 09 00 00 00 02 00 00 00 00 00 00 00 07 00 00 00 08 .................... +0000058C 00 52 00 65 00 73 00 6F 00 75 00 72 00 63 00 65 00 00 20 44 .R.e.s.o.u.r.c.e.. D +000005A0 00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 18 00 6E 00 65 .................n.e +000005B4 00 74 00 2E 00 72 00 69 00 6D 00 2E 00 64 00 65 00 76 00 69 .t...r.i.m...d.e.v.i +000005C8 00 63 00 65 00 2E 00 72 00 65 00 73 00 6F 00 75 00 72 00 63 .c.e...r.e.s.o.u.r.c +000005DC 00 65 00 73 00 00 00 2B 00 2E 00 2E 00 5C 00 6C 00 69 00 62 .e.s...+.....\.l.i.b +000005F0 00 5C 00 6E 00 65 00 74 00 5F 00 72 00 69 00 6D 00 5F 00 61 .\.n.e.t._.r.i.m._.a + diff -Nru barry-0.14/doc/bookmark.txt barry-0.0.20110506/doc/bookmark.txt --- barry-0.14/doc/bookmark.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/bookmark.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,259 @@ +Browser Bookmarks Documentation + +1°/ + + 00000000: 07 00 b2 00 40 02 44 01 02 00 ff 5d ac 11 00 5c ....@.D....]...\ + ^^^^^ ^^^^^ ^^ ^^^^^ ^^^^^^^^^^^ + socket size index uniqueID + command + 00000010: 00 11 81 8d b1 bb 7f 01 04 01 00 14 44 61 20 4c ............Da L + <------------> RR RR SS ^^ <----- + unknown title size + 00000020: 69 6e 75 78 20 46 72 65 6e 63 68 20 50 61 67 65 inux French Page + title -----> + 00000030: 81 ff ff ff ff f8 d0 df cc 02 00 05 01 00 25 68 ..............%h + ^^ ^^^^^^^^^^^ RR RR ^^^^^ <- + size + 00000040: 74 74 70 3a 2f 2f 6c 69 6e 75 78 66 72 2e 6f 72 ttp://linuxfr.or + 00000050: 67 2f 69 6d 61 67 65 73 2f 66 61 76 69 63 6f 6e g/images/favicon + URL favicon + 00000060: 2e 69 63 6f 00 a3 fb b5 9a ff 65 00 00 00 41 00 .ico......e...A. + ------> SS ^^ ^^ ^^ RR + display mode browser ident. + javascript mode + 00000070: 12 00 17 68 74 74 70 3a 2f 2f 6c 69 6e 75 78 66 ...http://linuxf + RR SS ^^ <---- + size URL + 00000080: 72 2e 6f 72 67 2f 70 75 62 2f 01 c2 21 00 00 00 r.org/pub/..!... + ----> + 00000090: 00 00 01 00 11 57 41 50 20 42 72 6f 77 73 65 72 .....WAP Browser + ^^ RR ^^^^^ <--- + size + 000000a0: 43 6f 6e 66 69 67 00 04 00 01 00 05 57 50 54 43 Config......WPTC + -------> RR RR RR RR SS ^^ <---------- + size + 000000b0: 50 07 P. + -> ^^ + + 00000000: 07 00 ad 00 40 02 44 01 04 00 9d 13 85 7e 00 57 ....@.D......~.W + 00000010: 00 11 87 f4 94 a7 1d 01 04 01 00 14 44 61 20 4c ............Da L + 00000020: 69 6e 75 78 20 46 72 65 6e 63 68 20 50 61 67 65 inux French Page + 00000030: 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 01 00 25 68 ..............%h + 00000040: 74 74 70 3a 2f 2f 6c 69 6e 75 78 66 72 2e 6f 72 ttp://linuxfr.or + 00000050: 67 2f 69 6d 61 67 65 73 2f 66 61 76 69 63 6f 6e g/images/favicon + 00000060: 2e 69 63 6f 00 00 00 00 00 41 00 12 00 17 68 74 .ico.....A....ht + 00000070: 74 70 3a 2f 2f 6c 69 6e 75 78 66 72 2e 6f 72 67 tp://linuxfr.org + 00000080: 2f 70 75 62 2f 01 c2 21 00 00 00 00 00 01 00 11 /pub/..!........ + 00000090: 57 41 50 20 42 72 6f 77 73 65 72 43 6f 6e 66 69 WAP BrowserConfi + 000000a0: 67 00 04 00 01 00 05 57 50 54 43 50 07 g......WPTCP. + + RR : reserved / unknown + + SS : separator + + brower identification : 00 - Auto + 01 - BlackBerry + 02 - FireFox + 03 - Internet Explorer + + display mode : 00 - Automatique + 01 - colomn + 02 - page + + javascript mode : 00 - Automatique + 01 - Enabled + 02 - Disabled + +2°/ + + Synchro : Jamais + + 00000000: 07 00 86 00 40 02 44 01 01 00 bc a0 a1 65 00 2f ....@.D......e./ + ^^^^^ ^^^^^^^^^^^ + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + ^^^^^ <---- + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + -----> ^^ ^^^^^^^^^^^ + 00000030: d0 df cc 02 01 05 00 00 a3 f7 db d4 d8 2f 00 00 ............./.. + ^^ + 00000040: 01 42 00 12 00 18 68 74 74 70 3a 2f 2f 6c 69 76 .B....http://liv + ^^^^^ <---- + 00000050: 65 2e 76 6f 64 61 66 6f 6e 65 2e 63 6f 6d 01 c2 e.vodafone.com.. + ----> + 00000060: 21 00 00 00 00 01 01 00 11 57 41 50 20 42 72 6f !........WAP Bro + ^^^^^ <----------- + 00000070: 77 73 65 72 43 6f 6e 66 69 67 00 04 00 01 00 05 wserConfig...... + --------> ^^^^^ + 00000080: 57 50 54 43 50 07 WPTCP. + <------------> + + + Synchro : 24 hours - start : 8:00 + + 00000000: 07 00 89 00 40 02 44 01 01 00 bc a0 a1 65 00 32 ....@.D......e.2 + -- + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + 00000030: d0 df cc 02 01 05 00 01 01 8d dd e8 00 85 a3 00 ................ + -------------------------- + 00000040: 00 00 00 01 42 00 12 00 18 68 74 74 70 3a 2f 2f ....B....http:// + -------- + 00000050: 6c 69 76 65 2e 76 6f 64 61 66 6f 6e 65 2e 63 6f live.vodafone.co + 00000060: 6d 01 c2 21 00 00 00 00 01 01 00 11 57 41 50 20 m..!........WAP + 00000070: 42 72 6f 77 73 65 72 43 6f 6e 66 69 67 00 04 00 BrowserConfig... + 00000080: 01 00 05 57 50 54 43 50 07 ...WPTCP. + + Synchro : 12 hours - start : 8:00 + + 00000000: 07 00 89 00 40 02 44 01 01 00 bc a0 a1 65 00 32 ....@.D......e.2 + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + 00000030: d0 df cc 02 01 05 00 01 01 8d dd e8 00 82 d1 40 ...............@ + -------- + 00000040: 00 00 02 01 42 00 12 00 18 68 74 74 70 3a 2f 2f ....B....http:// + 00000050: 6c 69 76 65 2e 76 6f 64 61 66 6f 6e 65 2e 63 6f live.vodafone.co + 00000060: 6d 01 c2 21 00 00 00 00 01 01 00 11 57 41 50 20 m..!........WAP + 00000070: 42 72 6f 77 73 65 72 43 6f 6e 66 69 67 00 04 00 BrowserConfig... + 00000080: 01 00 05 57 50 54 43 50 07 ...WPTCP. + + Synchro : 8 hours - start : 8:00 + + 00000000: 07 00 89 00 40 02 44 01 01 00 bc a0 a1 65 00 32 ....@.D......e.2 + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + 00000030: d0 df cc 02 01 05 00 01 01 8d dd e8 00 81 e1 00 ................ + -------- + 00000040: 00 00 02 01 42 00 12 00 18 68 74 74 70 3a 2f 2f ....B....http:// + 00000050: 6c 69 76 65 2e 76 6f 64 61 66 6f 6e 65 2e 63 6f live.vodafone.co + 00000060: 6d 01 c2 21 00 00 00 00 01 01 00 11 57 41 50 20 m..!........WAP + 00000070: 42 72 6f 77 73 65 72 43 6f 6e 66 69 67 00 04 00 BrowserConfig... + 00000080: 01 00 05 57 50 54 43 50 07 ...WPTCP. + + Synchro : 4 hours - start : 8:00 + + 00000000: 07 00 88 00 40 02 44 01 01 00 bc a0 a1 65 00 31 ....@.D......e.1 + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + 00000030: d0 df cc 02 01 05 00 01 01 8d dd e8 00 f0 40 00 ..............@. + < 8:00 > + d0 df cc 02 01 05 00 01 01 a9 95 e3 20 f0 40 00 + < 23:59 > + 00000040: 00 00 01 42 00 12 00 18 68 74 74 70 3a 2f 2f 6c ...B....http://l + 00000050: 69 76 65 2e 76 6f 64 61 66 6f 6e 65 2e 63 6f 6d ive.vodafone.com + 00000060: 01 c2 21 00 00 00 00 01 01 00 11 57 41 50 20 42 ..!........WAP B + 00000070: 72 6f 77 73 65 72 43 6f 6e 66 69 67 00 04 00 01 rowserConfig.... + 00000080: 00 05 57 50 54 43 50 07 ..WPTCP. + + + + Synchro : Never (after 24 hours test) + Indentification : BlackBerry + + 00000000: 07 00 81 00 40 02 44 01 01 00 bc a0 a1 65 00 2a ....@.D......e.* + -- + 00000010: 00 11 86 ad 86 c1 3c 00 04 01 00 0e 50 61 67 65 ......<.....Page + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 ff ff ff ff f8 d'accueil...... + 00000030: d0 df cc 02 01 05 00 00 00 00 00 01 42 00 12 00 ............B... + ----------- + 00000040: 18 68 74 74 70 3a 2f 2f 6c 69 76 65 2e 76 6f 64 .http://live.vod + 00000050: 61 66 6f 6e 65 2e 63 6f 6d 01 c2 21 00 00 00 00 afone.com..!.... + 00000060: 01 01 00 11 57 41 50 20 42 72 6f 77 73 65 72 43 ....WAP BrowserC + 00000070: 6f 6e 66 69 67 00 04 00 01 00 05 57 50 54 43 50 onfig......WPTCP + 00000080: 07 . + + + +3°/ + + 00000000: 07 00 82 00 40 02 44 01 04 00 bb a0 a1 65 00 2f ....@.D......e./ + ^^^^^ ^^^^^^^^^^^ + 00000010: 00 11 86 ad 86 c1 3b 00 04 01 00 0e 50 61 67 65 ......;.....Page + ^^^^^ <---- + 00000020: 20 64 27 61 63 63 75 65 69 6c 81 b9 fc f8 f6 c2 d'accueil...... + -------> ^^ ^^^^^^^^^^^ + 00000030: e3 a4 d5 08 01 05 00 00 a3 f9 f7 f8 e6 6e 00 00 .............n.. + 00000040: 01 3e 00 12 00 1d 68 74 74 70 3a 2f 2f 6d 6f 62 .>....http://mob + ^^^^^ <----------- + 00000050: 69 6c 65 2e 62 6c 61 63 6b 62 65 72 72 79 2e 63 ile.blackberry.c + 00000060: 6f 6d 2f 01 c2 21 00 00 00 00 01 01 00 09 47 50 om/..!........GP + -----> ^^^^^ <---- + 00000070: 4d 44 53 45 55 30 31 00 04 00 01 00 04 49 50 50 MDSEU01......IPP + --------> ^^^^^ <------- + 00000080: 50 04 P. + -> + + + +----------------------------------------------------------------------------- + +Further notes from Chris Frey's test devices: + + +Section 0x11: + Starts with 0x85 or 0x87 + - 4 byte record ID? + - 1 byte record index (00, 01, 02, 03, 04) + Code: 0x04 + - 1 byte "present" flag... always 1 for 0x04, I think + - 2 byte big endian size + - string, no null terminator + Code? 0x81 always seems to follow + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 00 (no icon) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 00 (no icon) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 01 (icon url) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 00 (no icon) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 00 (no icon) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 00 (no icon) + - 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 01 (icon url) + - so: + - 4 byte ID + - another 4 byte ID + - 1 byte unknown + - 1 byte flag (seen 1 or 0) + Code: 0x05 (on older devices, this is code 01 as a terminator?) + - 1 byte "present" flag + - if 0, then size could be 0x00a5 which adds + 5 unknown bytes + - if 1, then size is length of string + - 2 byte big endian size + - string here (may be no bytes) + - 3 byte flags for display mode, javascript mode, and browser id + +Raw record dump for record: e2416731 + 00000000: 06 00 27 00 40 03 44 01 03 00 31 67 41 e2 00 15 ..'.@.D...1gA... + 00000010: 00 00 82 e3 a4 d5 08 00 0e 73 75 62 66 6f 6c 64 .........subfold + 00000020: 65 72 20 6e 61 6d 65 er name + + + Type: 0x11 Data: + 00000000: 85 9b ed ca 13 00 04 01 00 09 48 6f 6d 65 20 50 ..........Home P + 00000010: 61 67 65 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 00 age............. + 00000020: 00 a5 b8 f0 97 e4 3a 00 00 01 ......:... + Type: 0x12 Data: + 00000000: 00 1c 68 74 74 70 3a 2f 2f 6d 6f 62 69 6c 65 2e ..http://mobile. + 00000010: 62 6c 61 63 6b 62 65 72 72 79 2e 63 6f 6d 01 c2 blackberry.com.. + 00000020: 21 00 00 00 00 01 01 00 09 53 20 54 43 50 2d 57 !........S TCP-W + 00000030: 42 43 00 04 00 01 00 05 57 50 54 43 50 03 BC......WPTCP. + + + Type: 0x11 Data: + 00000000: 85 9b ed ca 13 00 04 01 00 0a 48 6f 6d 65 20 50 ..........Home P + 00000010: 61 67 65 3f 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 age?............ + 00000020: 00 00 00 00 00 01 ...... + Type: 0x12 Data: + 00000000: 00 1c 68 74 74 70 3a 2f 2f 6d 6f 62 69 6c 65 2e ..http://mobile. + 00000010: 62 6c 61 63 6b 62 65 72 72 79 2e 63 6f 6d 01 c2 blackberry.com.. + 00000020: 21 00 00 00 00 01 01 00 09 53 20 54 43 50 2d 57 !........S TCP-W + 00000030: 42 43 00 04 00 01 00 05 57 50 54 43 50 03 BC......WPTCP. + + Type: 0x11 Data: + 00000000: 87 f4 f2 ce 67 04 04 01 00 08 53 70 65 63 69 61 ....g.....Specia + 00000010: 6c 3f 81 b9 fc f8 f6 c2 e3 a4 d5 08 00 05 00 00 l?.............. + 00000020: 00 00 00 00 .... + Type: 0x12 Data: + 00000000: 00 1c 68 74 74 70 3a 2f 2f 6d 6f 62 69 6c 65 2e ..http://mobile. + 00000010: 62 6c 61 63 6b 62 65 72 72 79 2e 63 6f 6d 01 c2 blackberry.com.. + 00000020: 21 00 00 00 00 00 01 00 09 53 20 54 43 50 2d 57 !........S TCP-W + 00000030: 42 43 00 04 00 01 00 05 57 50 54 43 50 03 BC......WPTCP. + + diff -Nru barry-0.14/doc/cod-format barry-0.0.20110506/doc/cod-format --- barry-0.14/doc/cod-format 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/cod-format 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,137 @@ +COD file structure +================== + +To write the javeloader application, I need to understand the format of COD file. + + +C structures : +-------------- + +typedef struct { + +} codfile_header_t; + +typedef struct { + int flashid; + uint section_number; //always 0 + uint vtable_pointer; //always 0 + time_t timestamp; + uint user_version; + uint fieldref_pointer; + ushort maxtype_list_size; + short reserved; //always 0xFF + int data_section; //always 0xFFFF + int module_info; //always 0xFFFF + ushort version; + ushort code_size; + ushort data_size; + ushort flags; +} code_header_t; + +sizeof(code_header_t) = 0x2C; + + +typedef struct { + ubyte flags; + ubyte version; + ushort num_icalls; + ubyte num_modules; + ubyte num_classes ; + ushort exported_string_offset; + ushort data_bytes_offset; + ushort empty_field; + ushort class_definitions; + ushort array_of_unknow_fields[14]; + ushort aliases; + ushort array_of_unknow_fields[22]; +} data_header_t; + +sizeof(data_header_t) = 0x34; + + +Scheme : +-------- + ++------------------------------------------+ +| COD file header (1) | ++------------------------------------------+ +| Code segment header | +| size = sizeof(code_header_t) = 0x2C | ++------------------------------------------+ +| Code segment | +| size = code_header_t.code_size | ++------------------------------------------+ +| Data segment header | +| size = sizeof(data_header_t) = 0x34 | ++------------------------------------------+ +| Data segment | +| size = code_header_t.data_size | ++------------------------------------------+ ++------------------------------------------+ +| COD file header (2) | ++------------------------------------------+ +| Code segment header | +. . +. . +. . ++------------------------------------------+ + + +Sample (from Opera.cod) : +------------------------- + +00000000 50 4B 03 04 0A 00 00 00 00 00-AB 5C 6A 39-BE 5C 58 D1 CC 0D PK.........\j9.\X... + COD size ^^^^^ +00000014 01 00 CC 0D 01 00 19 00 04 00 .......... + ^^^^^ ^^^^^^^^^^^^ ^^ empty byte (after the string) + COD size ^^ size of string +00000014 6F 70 65 72 65 74 74 65 2D 68 operette-h + [.............................. +00000028 69 66 69 2D 34 2E 32 62 65 74 61 2E 63 6F 64 FE CA 00 00 ifi-4.2beta.cod.... + ................string........................] [..........] empty +00000028 DE . +0000003C C0 FF FF 00 00 00 00 00 00 00 00 E0 0E 18 49 00 00 00 00 00 ..............I..... +00000050 00 00 00 22 00 FF FF FF FF FF FF FF FF FF FF 4E 00 08 DC 98 ..."...........N.... + +[...] + +00010DD8 A2 03 0C 0E 08 02 04 FD A2 03 4E 08 00 07 96 A3 03 1D 48 34 ..........N.......H4 +00010DEC 12 08 01 03 B5 A3 03 08 04 04 E8 A3 03 25 08 05 03 A7 A4 03 .............%...... +00010E00 00 00 00 00 00 00 00 ....... +00010E00 50 4B 03 04 0A 00 00 00 00 00 AB 5C 6A PK.........\j +00010E14 39-D1 BD FC C9-1C DD 00 00-1C DD 00 00-1B 00 00 00 9................ + ^^ size of string +00010E14 6F 70 65 ope +00010E28 72 65 74 74 65 2D 68 69 66 69 2D 34 2E 32 62 65 74 61 2D 31 rette-hifi-4.2beta-1 +00010E3C 2E 63 6F 64 .cod +00010E3C DE C0 FF FF 00 00 00 00 00 00 00 00 E0 0E 18 49 ...............I +00010E50 00 00 00 00 00 00 00 00 1F 00 FF FF FF FF FF FF FF FF FF FF .................... +00010E64 4E 00 D8 A1 18 3B 01 00 50 29 DE 29 06 80 F8 01 15 0D FF 00 N....;..P).)........ +00010E78 00 20 0C FF FF 4D 0C 46 2F 15 0D FF FF 79 0E FF FF 82 0E FF . ...M.F/....y...... +00010E8C FF 62 07 50 29 50 29 23 11 18 00 05 13 00 08 0E 6E 02 01 0A .b.P)P)#........n... +00010EA0 00 28 CC 0C 01 FF FF 02 69 00 03 00 6D 00 03 00 A0 04 DF A1 .(......i...m....... +00010EB4 0A 6D 00 03 00 04 FF 01 00 01 55 28 1C 17 07 00 AE 11 CF 56 .m........U(.......V + +[...] + +0001EB54 00 00 00 00 00 00 00 00 50 4B 03 04 0A 00 00 00 00 00 AB 5C ........PK.........\ +0001EB68 6A 39-24 41 BE 50 5C B0 00 00 5C B0 00-00-1B-00- 00-00 6F 70 j9$A.P\...\.......op +0001EB7C 65 72 65 74 74 65 2D 68 69 66 69 2D 34 2E 32 62 65 74 61 2D erette-hifi-4.2beta- +0001EB90 32 2E 63 6F 64 DE C0 FF FF 00 00 00 00 00 00 00 00 E0 0E 18 2.cod............... + + +Sample (from Metro.cod) : +------------------------- + +00000000 50 4B 03 04 0A 00 00 00 00 00-A0 00 51 35-BA 9F 99 5D-30 CE PK..........Q5...]0. +00000014 00 00-30 CE 00-00-15-00--04-00-4D 65 74 72 6F 56 69 65 77 65 ..0.......MetroViewe +00000028 72 2E 50 61 72 69 73 2E 63 6F 64 FE CA 00 00 DE C0 FF FF 00 r.Paris.cod......... +0000003C 00 00 00 00 00 00 00 0F 10 34 45 00 00 00 00 00 00 00 00 21 .........4E........! + + +0000CE54 6F 90 02 03 0F 03 A8 0F 03 04 00 02 AA 10 00 00 00 00 00 50 o..................P +0000CE68 4B 03 04 0A 00 00 00 00 00 A0 00 51 35 7A C4 FE 22-34 B3-00 K..........Q5z.."4.. +0000CE7C 00-34 B3-00--00-17-00-00--00-4D 65 74 72 6F 56 69 65 77 65 72 .4.......MetroViewer +0000CE90 2E 50 61 72 69 73 2D 31 2E 63 6F 64 DE C0 FF FF 00 00 00 00 .Paris-1.cod........ +0000CEA4 00 00 00 00 0F 10 34 45 00 00 00 00 00 00 00 00 05 00 FF FF ......4E............ + diff -Nru barry-0.14/doc/CommitPolicy.txt barry-0.0.20110506/doc/CommitPolicy.txt --- barry-0.14/doc/CommitPolicy.txt 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/CommitPolicy.txt 2011-05-06 12:20:16.000000000 +0000 @@ -1,3 +1,20 @@ +2009/12/15 + +Note: now that we primarily use git for version control, and CVS is +just a backup, git supports specific authors per commit. When accepting +patches from others, I still use the "applied" language where appropriate, +but also try to add people's names and email addresses directly into the +commit, along with their exact patch. + +Of course, if I pull from a git repo, this happens automatically as well. + +- Chris + + + + + + Date: Fri, 25 May 2007 17:39:27 -0400 From: Chris Frey To: barry-devel@lists.sourceforge.net diff -Nru barry-0.14/doc/Exceptions barry-0.0.20110506/doc/Exceptions --- barry-0.14/doc/Exceptions 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/Exceptions 2011-05-06 12:20:16.000000000 +0000 @@ -8,9 +8,20 @@ - Usb::Error - Usb::Timeout - Barry::BadPassword + - Barry::SocketCloseOnOpen - Barry::BadData - Barry::BadSize + - Barry::ConfigFileError - Barry::ErrnoError + - Barry::ConfigFileError + - Barry::BadPackedFormat + - Barry::BadPacket + - Barry::ConvertError + - Barry::BackupError + - Barry::RestoreError + - Barry::JDWP::Error + - Barry::JDWP::Timeout + - Barry::PinNotFound Usb::Error All specific USB error exceptions will be derived from diff -Nru barry-0.14/doc/javaloader barry-0.0.20110506/doc/javaloader --- barry-0.14/doc/javaloader 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/javaloader 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,731 @@ +JavaLoader reverse +================== + +After Probe process, we have the JavaLoader command + +Legend : + >>> : Sent + <<< : Received + +Open Socket with BlackBerry device, then select the JavaLoader mode. + +URB 22 : >>> + 00000000: 00 00 0c 00 05 ff 00 07 04 00 0a 00 ............ + +URB 23 : <<< + 00000000: 00 00 10 00 06 ff 00 07 04 00 0a 00 20 f9 04 80 ............ ... + +URB 25 : >>> + 00000000: 00 00 0c 00 05 ff 00 08 04 00 0b 00 ............ + +URB 24 : <<< + 00000000: 00 00 10 00 06 ff 00 08 04 00 0b 00 00 00 00 00 ................ + +URB 27 : >>> + 00000000: 00 00 18 00 07 ff 00 09 52 49 4d 5f 4a 61 76 61 ........RIM_Java + 00000010: 4c 6f 61 64 65 72 00 00 Loader.. + +URB 26 : <<< + 00000000: 00 00 30 00 08 04 00 09 52 49 4d 5f 4a 61 76 61 ..0.....RIM_Java + 00000010: 4c 6f 61 64 65 72 00 00 00 00 00 00 01 00 08 00 Loader.......... + 00000020: 02 00 08 00 03 01 00 00 04 01 00 00 05 10 01 00 ................ + +URB 29 : >>> + 00000000: 00 00 0c 00 0a 04 00 0a 10 03 00 00 ............ + +URB 28 : <<< + 00000000: 00 00 08 00 10 04 00 0a ........ + +URB 30 : <<< + 00000000: 00 00 0c 00 13 04 01 00 00 00 00 00 ............ + +URB 31 : <<< + 00000000: 04 00 05 00 01 ..... + + +Specific command for JavaLoder. + +URB 33 : >>> + 00000000: 04 00 08 00 64 00 00 00 ....d... + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 32 : <<< + 00000000: 00 00 0c 00 13 04 01 00 01 00 00 00 ............ + +URB 34 : <<< + 00000000: 04 00 08 00 65 00 00 00 ....e... + +URB 36 : >>> + 00000000: 04 00 08 00 70 00 01 00 ....p... + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 35 : <<< + 00000000: 00 00 0c 00 13 04 01 00 02 00 00 00 ............ + +URB 38 : >>> + 00000000: 04 00 05 00 00 ..... + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 37 : <<< + 00000000: 00 00 0c 00 13 04 01 00 03 00 00 00 ............ + +URB 39 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +SendStream command. + +URB 41 : >>> + 00000000: 04 00 08 00 67 01 04 00 ....g... + ^^ : command to send the stream total size + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 40 : <<< + 00000000: 00 00 0c 00 13 04 01 00 04 00 00 00 ............ + +Start of data stream. + +URB 43 : >>> + 00000000: 04 00 08 00 00 00 1e d0 ........ + ^^^^^^^^^^^ : Application size (maybe 4 bytes) + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 42 : <<< + 00000000: 00 00 0c 00 13 04 01 00 05 00 00 00 ............ + +URB 44 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +Data header packet. + +URB 46 : >>> + 00000000: 04 00 08 00 68 00 f8 07 ....h... + ^^^^^ : data size for the next packet + ^^ : always 0x00 + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 45 : <<< + 00000000: 00 00 0c 00 13 04 01 00 06 00 00 00 ............ + +Data packet. + +URB 48 : >>> + 00000000: 04 00 fc 07 de c0 ff ff 00 00 00 00 00 00 00 00 ................ + ^^ ..... : content of file + ^^^^^ : packet size (0x07F8 = 0x07FC - 0x02) + ^^^^^ : socket ID + 00000010: c8 fe 59 49 00 00 00 00 00 00 00 00 08 00 ff ff ..YI............ + 00000020: ff ff ff ff ff ff ff ff 4e 00 8c 01 18 1d 00 00 ........N....... + 00000030: 93 19 7b 1b 58 1b 0f 00 19 00 00 02 01 02 0e b8 ..{.X........... + 00000040: 00 cf 05 26 00 01 56 40 01 ff ff 01 1f 58 1b 60 ...&..V@.....X.` + 00000050: 1b 16 82 48 18 17 dd 3f 06 ff ff ff 01 3f b8 03 ...H...?.....?.. + 00000060: cf 05 4b 01 01 01 ff ff 02 1f 48 18 66 1b 58 1b ..K.......H.f.X. + 00000070: 14 00 81 00 00 01 01 04 0e 3f 6d 01 04 00 6d 01 .........?m...m. + 00000080: 05 00 6d 01 06 00 06 ff ff ff 04 1f 4a 18 58 1b ..m.........J.X. + 00000090: 58 1b 6f 00 18 01 00 00 00 03 0e bb ff ff 13 01 X.o............. + 000000a0: 14 b9 ff ff cf 24 09 06 ff ff ff 02 69 01 04 00 .....$......i... + 000000b0: 2d 02 01 00 c8 00 69 01 08 00 2d 02 05 00 88 0c -.....i...-..... + 000000c0: 69 01 09 00 2d 02 12 00 90 00 69 01 0a 00 2d 02 i...-.....i...-. + 000000d0: b4 0b d0 00 69 01 06 00 2d 02 02 00 7c 00 69 01 ....i...-...|.i. + 000000e0: 07 00 2d 02 01 00 74 00 69 01 0b 00 2d 02 05 00 ..-...t.i...-... + 000000f0: 84 00 69 01 0c 00 2d 02 19 00 a8 00 69 01 0d 00 ..i...-.....i... + 00000100: 6d 01 04 00 07 02 e2 00 20 58 1b 5d 1b 3e 18 a2 m....... X.].>.. + 00000110: 19 27 dd 2d 02 b0 0b 94 0c 56 3f 28 28 1a 40 01 .'.-.....V?((.@. + 00000120: ff ff 03 cd 3f 28 40 1a 40 01 ff ff 03 cd b9 ff ....?(@.@....... + 00000130: ff cf 23 06 ff ff ff 02 56 3f 28 28 1a 40 01 ff ..#.....V?((.@.. + 00000140: ff 03 cd 3f 28 40 1a 40 01 ff ff 03 cd 1f 58 1b ...?(@.@......X. + 00000150: 63 1b 18 09 44 18 15 dd 28 e0 19 08 ff ff ff ff c...D...(....... + 00000160: 23 08 ff ff ff ff 3f 06 ff ff ff 01 1f 48 18 63 #.....?......H.c + 00000170: 1b 58 1b 3e 00 80 00 00 02 01 06 0e 3f 06 ff ff .X.>........?... + 00000180: ff 01 b9 ff ff cf 28 f0 19 27 40 00 00 00 00 00 ......(..'@..... + 00000190: 00 10 06 ff ff ff 04 56 3f 40 01 ff ff 02 3f b9 .......V?@....?. + 000001a0: ff ff cf 28 08 1a 27 00 00 00 00 00 00 80 00 06 ...(..'......... + 000001b0: ff ff ff 04 01 ff ff 02 1f 00 00 00 00 06 00 00 ................ + 000001c0: 02 04 46 00 70 00 64 1a 64 1a 58 1b c0 1b c0 1b ..F.p.d.d.X..... + 000001d0: 40 1c 9c 1c b6 1c f2 1c 46 00 0e 1d 10 1d 12 1d @.......F....... + 000001e0: 14 1d 12 00 c0 1b 93 19 7b 1b 00 00 00 00 00 00 ........{....... + 000001f0: 64 1a 90 1a 02 1b 2c 1b 15 1a 57 1a ce 19 d2 19 d.....,...W..... + 00000200: 15 1a 4a 19 05 00 88 0c 57 19 01 00 74 00 5f 19 ..J.....W...t._. + 00000210: b4 0b d0 00 67 19 12 00 90 00 6f 19 02 00 7c 00 ....g.....o...|. + 00000220: 79 19 01 00 c8 00 8e 19 19 00 a8 00 01 00 04 d0 y............... + 00000230: 00 00 00 00 02 00 04 d0 00 00 00 00 05 00 04 d0 ................ + 00000240: 00 03 30 2e 39 00 00 00 12 00 04 d0 00 10 48 65 ..0.9.........He + 00000250: 6c 6c 6f 20 57 6f 72 6c 64 20 44 65 6d 6f 00 00 llo World Demo.. + 00000260: 19 00 04 d0 00 17 52 65 73 65 61 72 63 68 20 49 ......Research I + 00000270: 6e 20 4d 6f 74 69 6f 6e 20 4c 74 64 2e 00 00 00 n Motion Ltd.... + 00000280: 01 00 04 d0 01 00 00 00 b4 0b 04 d0 0b b2 0b b0 ................ + 00000290: 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 .PNG........IHDR + 000002a0: 00 00 00 30 00 00 00 24 08 06 00 00 00 cf 45 b9 ...0...$......E. + 000002b0: 0a 00 00 00 09 70 48 59 73 00 00 0b 13 00 00 0b .....pHYs....... + 000002c0: 13 01 00 9a 9c 18 00 00 00 04 67 41 4d 41 00 00 ..........gAMA.. + 000002d0: b1 8e 7c fb 51 93 00 00 00 20 63 48 52 4d 00 00 ..|.Q.... cHRM.. + 000002e0: 7a 25 00 00 80 83 00 00 f9 ff 00 00 80 e9 00 00 z%.............. + 000002f0: 75 30 00 00 ea 60 00 00 3a 98 00 00 17 6f 92 5f u0...`..:....o._ + 00000300: c5 46 00 00 0b 26 49 44 41 54 78 da d4 99 7b 70 .F...&IDATx...{p + 00000310: 56 e5 9d c7 3f cf 39 e7 7d df e4 7d 73 83 37 17 V...?.9.}..}s.7. + 00000320: de 84 04 12 88 20 01 22 b8 08 52 14 a5 0a d2 2e ..... ."..R..... + 00000330: 5e a8 2c 14 44 d1 16 84 ca ba 45 f7 a6 5b 76 70 ^.,.D.....E..[vp + 00000340: 57 b7 33 76 d8 11 2c d6 e2 14 58 cb 00 4a a1 5d W.3v..,...X..J.] + 00000350: d8 41 83 8c 5a 5b 45 a1 24 c4 00 11 04 42 6e e4 .A..Z[E.$....Bn. + 00000360: 9e 37 c9 7b 3d b7 e7 d9 3f 88 19 9d ce 8e 44 e2 .7.{=...?.....D. + 00000370: 3a fd ce 3c 33 e7 f2 3b e7 f9 7d cf 73 7e d7 47 :..<3..;..}.s~.G + 00000380: 28 a5 f8 4b 86 71 35 42 42 88 cf 0e d3 7c 3e df (..K.q5BB....|>. + 00000390: 82 89 13 27 7e 37 14 0a e5 65 67 67 67 e8 ba ae ...'~7...eggg... + 000003a0: 0d e6 23 b8 ae 2b 3b 3b 3b 7b 5b 5b 5b db 6a 6a ..#..+;;;{[[[.jj + 000003b0: 6a fe db b2 ac 43 40 fc 6a 9f ff b3 b9 94 52 5f j....C@.j.....R_ + 000003c0: 3a 00 bc 5e ef b2 b5 6b d7 d6 54 57 57 ab a1 42 :..^...k..TWW..B + 000003d0: 75 75 b5 5a bd 7a f5 29 c3 30 16 0d 86 c0 e7 87 uu.Z.z.).0...... + 000003e0: b8 9a af e7 f3 f9 16 6c df be fd c0 d2 a5 4b 01 .......l......K. + 000003f0: 78 f6 d9 67 59 b2 64 09 a7 4e 9d 42 08 41 4d 4d x..gY.d..N.B.AMM + 00000400: 0d 00 b9 b9 b9 dc 73 cf 3d bc f0 c2 0b ac 5e bd ......s.=.....^. + 00000410: 9a 51 a3 46 b1 7b f7 6e 5c d7 e5 81 07 1e 00 e0 .Q.F.{.n\....... + 00000420: d5 57 5f e5 dc b9 73 a4 a6 a6 f2 e4 93 4f 92 92 .W_...s......O.. + 00000430: 92 c2 f6 ed db 9d 95 2b 57 ce 77 5d f7 c8 60 57 .......+W.w]..`W + 00000440: 40 bb 1a d6 f3 e7 cf 7f e2 33 e5 01 ce 9c 39 c3 @........3....9. + 00000450: b6 6d db d8 bd 7b 37 ed ed ed d4 d6 d6 22 a5 24 .m...{7......".$ + 00000460: 14 0a 91 96 96 46 75 75 35 b1 58 0c 80 86 86 06 .....Fuu5.X..... + 00000470: 1a 1a 1a 00 b8 78 f1 22 7b f7 ee 65 c3 86 0d 04 .....x."{..e.... + 00000480: 02 01 b6 6c d9 02 c0 c3 0f 3f 6c dc 79 e7 9d 7f ...l.....?l.y... + 00000490: ff b5 d9 40 71 71 71 c1 17 58 6b 1a e3 c6 8d c3 ...@qqq..Xk..... + 000004a0: b6 6d 94 52 e8 ba ce e4 c9 93 99 3a 75 2a 1e 8f .m.R.......:u*.. + 000004b0: 07 5d d7 f1 fb fd 03 b2 1e 8f 07 00 29 25 52 4a .]..........)%RJ + 000004c0: 0c c3 20 10 08 d0 d6 d6 36 f0 ce d1 a3 47 17 01 .. .....6....G.. + 000004d0: 02 18 94 57 b9 aa 15 a8 a8 a8 38 dc d7 d7 37 70 ...W......8...7p + 000004e0: 9e 9b 9b 4b 79 79 39 13 27 4e 24 2d 2d 8d 9c 9c ...Kyy9.'N$--... + 000004f0: 1c aa aa aa 38 78 f0 20 cd cd cd 04 83 41 76 ec ....8x. .....Av. + 00000500: d8 c1 be 7d fb 08 06 83 54 56 56 b2 79 f3 66 02 ...}....TVV.y.f. + 00000510: 81 00 77 dc 71 07 eb d7 af a7 b6 b6 96 15 2b 56 ..w.q.........+V + 00000520: 00 10 0e 87 39 7c f8 f0 a1 c1 2a 3f 18 23 ce 5f ....9|....*?.#._ + 00000530: b0 60 41 55 63 63 e3 ff 69 90 1d 1d 1d aa b5 b5 .`AUcc..i....... + 00000540: 55 99 a6 a9 a4 94 2a 12 89 a8 78 3c ae 94 52 2a U.....*...x<..R* + 00000550: 99 4c aa 9e 9e 9e 01 d9 68 34 3a 70 5c 57 57 a7 .L......h4:p\WW. + 00000560: e6 cd 9b 77 14 c8 f9 da 8c b8 df 8d 66 14 14 14 ...w........f... + 00000570: ac 5b bc 78 f1 b2 b9 73 e7 96 86 42 21 7c 3e 1f .[.x...s...B!|>. + 00000580: 8e e3 90 97 97 47 76 76 f6 80 7c 32 99 a4 be be .....Gvv..|2.... + 00000590: 7e 60 42 4d d3 3e 73 a1 08 21 b0 6d 9b a6 a6 26 ~`BM.>s..!.m...& + 000005a0: bb a2 a2 e2 e2 eb af bf be ab a5 a5 e5 e7 40 f7 ..............@. + 000005b0: 57 71 a3 83 21 f0 19 02 c0 44 21 44 c8 e7 f3 a5 Wq..!....D!D.... + 000005c0: 39 8e 63 af 5a b5 ea a7 5b b6 6c 29 06 d8 b5 6b 9.c.Z...[.l)...k + 000005d0: 57 df 73 cf 3d b7 eb fc f9 f3 ef 02 b6 74 a5 e3 W.s.=........t.. + 000005e0: ba 6e 86 80 91 42 88 a0 10 9a df 91 4e 3b 50 05 .n...B......N;P. + 000005f0: 1c 02 9c c1 fe 31 d7 4a e0 cf 30 61 c2 84 97 4e .....1.J..0a...N + 00000600: 9f 3e bd e6 d4 a9 53 4c 9a 34 69 39 b0 b3 ff 56 .>....SL.4i9...V + 00000610: 61 6a 66 60 61 e1 f8 d1 0b f3 c7 8d 2a 0c 04 03 ajf`a.......*... + 00000620: 59 7a 8a ee b3 93 66 32 d9 95 08 db 75 89 8b 27 Yz....f2....u..' + 00000630: ab 2a 7f 1b 8d 46 f6 03 6d df 18 01 60 cc c6 8d .*...F..m...`... + 00000640: 1b 4f 2e 5f be 3c ad a4 a4 64 6d 34 1a dd 93 95 .O._.<...dm4.... + 00000650: 17 7c e6 96 fb ee 7c a8 fc d6 69 69 c3 f2 82 a0 .|....|...ii.... + 00000660: 49 4c 27 41 c2 49 10 b3 a3 cc 1b ff 5d a6 87 6e IL'A.I......]..n + 00000670: a4 b6 f6 0c af ed f9 75 cb 8e 6d 5b 5f ec e9 09 .......u..m[_... + 00000680: 6f 04 ac 6f 82 00 42 88 65 9b 37 6f da a4 83 ef o..o..B.e.7o.... + 00000690: a7 9b 5e 6a 59 fc 4f 3f 2c 9d 34 b9 0c af d0 71 ..^jY.O?,.4....q + 000006a0: 1c 9b b8 15 23 66 47 e8 88 b5 33 26 78 1d f7 4e ....#fG...3&x..N + 000006b0: 5c 88 d0 c0 9f 0a 29 1e 38 76 fc 63 9e 78 e2 ef \.....).8v.c.x.. + 000006c0: de 78 ff 8f ef ae 02 9a fe df 09 f4 e3 be 15 2b .x.............+ + 000006d0: d7 ee cf 4c 4f 21 e9 17 dc fe ed f9 14 8c 08 11 ...LO!.......... + 000006e0: b7 62 84 13 5d 74 c4 da 89 db 09 ee 9d b8 84 e1 .b..]t.......... + 000006f0: fe 74 84 00 a9 1c fc 5e 83 40 00 c2 3d 71 d6 ac .t.....^.@..=q.. + 00000700: 79 b4 f1 b5 3d 3b e7 00 e7 af 86 80 c1 d0 21 af y...=;........!. + 00000710: ec a6 79 ff 12 9a f2 20 66 ef 39 ac cb 1f 92 22 ..y.... f.9...." + 00000720: 7d 14 66 15 d1 1e 69 25 6e c7 70 95 64 6c f0 7a }.f...i%n.p.dl.z + 00000730: 86 a7 a6 a3 09 78 f3 93 43 9c ed aa a5 20 23 9f .....x..C.... #. + 00000740: c2 ac 91 dc 5a 3a 93 57 b6 be 52 d8 de de b6 f5 ....Z:.W..R..... + 00000750: 9d b7 df fa eb ab 49 f2 86 6c 05 86 e5 8c dc f2 ......I..l...... + 00000760: c8 53 ff f5 a3 8c 60 3a 26 67 29 ca 1b ce f8 50 .S....`:&g)....P + 00000770: 29 39 e9 59 f4 58 61 9a 7b 9b 68 ee 6b a6 2f d9 )9.Y.Xa.{.h.k./. + 00000780: 87 26 74 e2 76 94 fa 9e 3a 7c ba 81 d7 f0 32 6a .&t.v...:|....2j + 00000790: 78 11 ab 66 ac 62 58 86 8f da 33 17 98 33 e7 5b x..f.bX...3..3.[ + 000007a0: ff d8 de de f6 b3 21 c9 85 ae 02 b3 a6 df b1 ec ......!......... + 000007b0: d1 cc cc 1c 2e 5c 7e 9b 96 ee 5a 7a a2 61 2e f7 .....\~...Zz.a.. + 000007c0: 36 71 29 7c 89 b6 48 2b bd 89 3e a2 56 8c d6 48 6q)|..H+..>.V..H + 000007d0: 2b c7 1b 3f e2 68 fd 51 22 c9 08 09 c7 22 6a 46 +..?.h.Q"...."jF + 000007e0: 31 84 87 14 c3 47 3c 0e 65 65 63 78 ec b1 75 1b 1....G<.eecx..u. + 000007f0: 80 e2 21 49 25 be 0c 59 d9 05 cb c6 ..!I%..Y.... + +URB 47 : <<< + 00000000: 00 00 0c 00 13 04 01 00 07 00 00 00 ............ + +URB 49 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + ^^ : error code (0x64 == good / 0x68 == bad) + ^^^^ : packet size + ^^^^^ : socket ID + +The returned code permits you to know if the device has accepted the last data packet. +0x64 : OK +0x68 : NOK ; You have got an error. (COD file is corrupted ?) + +Data header packet. + +URB 51 : >>> + 00000000: 04 00 08 00 68 00 f8 07 ....h... + ^^^^^ : data size for the next packet + ^^ : always 0x00 + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 50 : <<< + 00000000: 00 00 0c 00 13 04 01 00 08 00 00 00 ............ + +Data packet. + +URB 53 : >>> + 00000000: 04 00 fc 07 94 cd d4 5d 2b 89 df 3b 8c 88 19 a5 .......]+..;.... + ^^ ..... : content of file + ^^^^^ : packet size (0x07F8 = 0x07FC - 0x02) + ^^^^^ : socket ID + 00000010: 3b de c1 e5 de 66 ea c3 f5 34 f7 36 d3 16 6d a5 ;....f...4.6..m. + 00000020: 2b da 49 6f a2 97 b8 95 40 4a 45 cc 8c d3 d2 d7 +.Io....@JE..... + 00000030: 42 c4 8c 31 21 af 0c 4d 80 52 e0 3a b0 7c d9 c3 B..1!..M.R.:.|.. + 00000040: fe ec ec 9c bf 19 92 64 ee 4b 90 31 ea ba bf 9a .......d.K.1.... + 00000050: ef 4b 4d 47 3a 26 79 e9 45 34 b4 1e a7 3d da 8a .KMG:&y.E4...=.. + 00000060: ad 27 49 31 bd 48 5c a2 56 94 70 a2 87 ce 58 17 .'I1.H\.V.p...X. + 00000070: 31 2b 8a 54 12 5b 68 2c 28 bb 9b 1b 0a ca b9 a5 1+.T.[h,(....... + 00000080: 78 3a 96 03 1e 1d 3a 23 71 6a dd 06 4a 67 95 3f x:....:#qj..Jg.? + 00000090: da f9 bb 23 2f 03 bd 5f 27 81 e9 23 0a c7 17 29 ...#/.._'..#...) + 000000a0: 25 91 ca 26 27 90 87 c7 48 a5 a9 af 81 a4 88 e3 %..&'...H....... + 000000b0: f1 19 48 25 89 3b 71 22 c9 3e a2 fd ca f7 26 7a ..H%.;q".>....&z + 000000c0: 79 e4 a6 1f f0 f8 ac 47 70 24 d8 0e e8 06 f4 24 y......Gp$.....$ + 000000d0: 62 6c 3f f9 1b ba dc 30 05 53 c6 16 f3 bb 23 e5 bl?....0.S....#. + 000000e0: c0 7b 5f 1b 01 8f 2f 75 74 66 30 24 70 5d 04 82 .{_.../utf0$p].. + 000000f0: 14 c3 c7 f5 23 a6 70 e0 dc 76 2c 61 62 78 0d 14 ....#.p..v,abx.. + 00000100: 92 a4 93 a4 cf ec 43 2a 17 cb b6 b8 bd 74 0e 2b ......C*.....t.+ + 00000110: a6 3d 48 dc 02 a9 40 d3 40 57 10 4e f4 d1 d0 d3 .=H...@.@W.N.... + 00000120: 8c 3f d5 8f 3f 3b 03 c3 eb 29 71 2c 7b 88 08 dc .?..?;...)q,{... + 00000130: bf 69 29 70 17 30 09 88 02 27 a8 dc 13 17 9a 86 .i)p.0...'...... + 00000140: 42 02 0a cb 4d 32 a3 68 36 f5 b1 53 54 77 1c 27 B...M2.h6..STw.' + 00000150: 20 03 28 a1 d0 35 9d b9 a5 f3 48 f3 05 08 78 02 .(..5....H...x. + 00000160: 2c 2a 5f 8c 47 33 70 5c 10 fd 96 e8 2a 08 78 fc ,*_.G3p\....*.x. + 00000170: 08 a1 13 31 63 48 8f 86 66 e8 59 58 f6 35 da c0 ...1cH..f.YX.5.. + 00000180: fd 9b 16 03 6b 16 df 3c 76 f6 dc f2 42 26 15 05 ....k......'~7.. + 00000760: e5 65 67 67 67 e8 ba ae 0d e6 23 b8 ae 2b 3b 3b .eggg.....#..+;; + 00000770: 3b 7b 5b 5b 5b db 6a 6a 6a fe db b2 ac 43 40 fc ;{[[[.jjj....C@. + 00000780: 6a 9f ff b3 b9 94 52 5f 3a 00 bc 5e ef b2 b5 6b j.....R_:..^...k + 00000790: d7 d6 54 57 57 ab a1 42 75 75 b5 5a bd 7a f5 29 ..TWW..Buu.Z.z.) + 000007a0: c3 30 16 0d 86 c0 e7 87 b8 9a af e7 f3 f9 16 6c .0.............l + 000007b0: df be fd c0 d2 a5 4b 01 78 f6 d9 67 59 b2 64 09 ......K.x..gY.d. + 000007c0: a7 4e 9d 42 08 41 4d 4d 0d 00 b9 b9 b9 dc 73 cf .N.B.AMM......s. + 000007d0: 3d bc f0 c2 0b ac 5e bd 9a 51 a3 46 b1 7b f7 6e =.....^..Q.F.{.n + 000007e0: 5c d7 e5 81 07 1e 00 e0 d5 57 5f e5 dc b9 73 a4 \........W_...s. + 000007f0: a6 a6 f2 e4 93 4f 92 92 92 c2 f6 ed .....O...... + +URB 52 : <<< + 00000000: 00 00 0c 00 13 04 01 00 09 00 00 00 ............ + +URB 54 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +Data header packet. + +URB 56 : >>> + 00000000: 04 00 08 00 68 00 f8 07 ....h... + ^^^^^ : data size for the next packet + ^^ : always 0x00 + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 55 : <<< + 00000000: 00 00 0c 00 13 04 01 00 0a 00 00 00 ............ + +Data packet. + +URB 58 : >>> + 00000000: 04 00 fc 07 db 9d 95 2b 57 ce 77 5d f7 c8 60 57 .......+W.w]..`W + ^^ ..... : content of file + ^^^^^ : packet size (0x07F8 = 0x07FC - 0x02) + ^^^^^ : socket ID + 00000010: 40 bb 1a d6 f3 e7 cf 7f e2 33 e5 01 ce 9c 39 c3 @........3....9. + 00000020: b6 6d db d8 bd 7b 37 ed ed ed d4 d6 d6 22 a5 24 .m...{7......".$ + 00000030: 14 0a 91 96 96 46 75 75 35 b1 58 0c 80 86 86 06 .....Fuu5.X..... + 00000040: 1a 1a 1a 00 b8 78 f1 22 7b f7 ee 65 c3 86 0d 04 .....x."{..e.... + 00000050: 02 01 b6 6c d9 02 c0 c3 0f 3f 6c dc 79 e7 9d 7f ...l.....?l.y... + 00000060: ff b5 d9 40 71 71 71 c1 17 58 6b 1a e3 c6 8d c3 ...@qqq..Xk..... + 00000070: b6 6d 94 52 e8 ba ce e4 c9 93 99 3a 75 2a 1e 8f .m.R.......:u*.. + 00000080: 07 5d d7 f1 fb fd 03 b2 1e 8f 07 00 29 25 52 4a .]..........)%RJ + 00000090: 0c c3 20 10 08 d0 d6 d6 36 f0 ce d1 a3 47 17 01 .. .....6....G.. + 000000a0: 02 18 94 57 b9 aa 15 a8 a8 a8 38 dc d7 d7 37 70 ...W......8...7p + 000000b0: 9e 9b 9b 4b 79 79 39 13 27 4e 24 2d 2d 8d 9c 9c ...Kyy9.'N$--... + 000000c0: 1c aa aa aa 38 78 f0 20 cd cd cd 04 83 41 76 ec ....8x. .....Av. + 000000d0: d8 c1 be 7d fb 08 06 83 54 56 56 b2 79 f3 66 02 ...}....TVV.y.f. + 000000e0: 81 00 77 dc 71 07 eb d7 af a7 b6 b6 96 15 2b 56 ..w.q.........+V + 000000f0: 00 10 0e 87 39 7c f8 f0 a1 c1 2a 3f 18 23 ce 5f ....9|....*?.#._ + 00000100: b0 60 41 55 63 63 e3 ff 69 90 1d 1d 1d aa b5 b5 .`AUcc..i....... + 00000110: 55 99 a6 a9 a4 94 2a 12 89 a8 78 3c ae 94 52 2a U.....*...x<..R* + 00000120: 99 4c aa 9e 9e 9e 01 d9 68 34 3a 70 5c 57 57 a7 .L......h4:p\WW. + 00000130: e6 cd 9b 77 14 c8 f9 da 8c b8 df 8d 66 14 14 14 ...w........f... + 00000140: ac 5b bc 78 f1 b2 b9 73 e7 96 86 42 21 7c 3e 1f .[.x...s...B!|>. + 00000150: 8e e3 90 97 97 47 76 76 f6 80 7c 32 99 a4 be be .....Gvv..|2.... + 00000160: 7e 60 42 4d d3 3e 73 a1 08 21 b0 6d 9b a6 a6 26 ~`BM.>s..!.m...& + 00000170: bb a2 a2 e2 e2 eb af bf be ab a5 a5 e5 e7 40 f7 ..............@. + 00000180: 57 71 a3 83 21 f0 19 02 c0 44 21 44 c8 e7 f3 a5 Wq..!....D!D.... + 00000190: 39 8e 63 af 5a b5 ea a7 5b b6 6c 29 06 d8 b5 6b 9.c.Z...[.l)...k + 000001a0: 57 df 73 cf 3d b7 eb fc f9 f3 ef 02 b6 74 a5 e3 W.s.=........t.. + 000001b0: ba 6e 86 80 91 42 88 a0 10 9a df 91 4e 3b 50 05 .n...B......N;P. + 000001c0: 1c 02 9c c1 fe 31 d7 4a e0 cf 30 61 c2 84 97 4e .....1.J..0a...N + 000001d0: 9f 3e bd e6 d4 a9 53 4c 9a 34 69 39 b0 b3 ff 56 .>....SL.4i9...V + 000001e0: 61 6a 66 60 61 e1 f8 d1 0b f3 c7 8d 2a 0c 04 03 ajf`a.......*... + 000001f0: 59 7a 8a ee b3 93 66 32 d9 95 08 db 75 89 8b 27 Yz....f2....u..' + 00000200: ab 2a 7f 1b 8d 46 f6 03 6d df 18 01 60 cc c6 8d .*...F..m...`... + 00000210: 1b 4f 2e 5f be 3c ad a4 a4 64 6d 34 1a dd 93 95 .O._.<...dm4.... + 00000220: 17 7c e6 96 fb ee 7c a8 fc d6 69 69 c3 f2 82 a0 .|....|...ii.... + 00000230: 49 4c 27 41 c2 49 10 b3 a3 cc 1b ff 5d a6 87 6e IL'A.I......]..n + 00000240: a4 b6 f6 0c af ed f9 75 cb 8e 6d 5b 5f ec e9 09 .......u..m[_... + 00000250: 6f 04 ac 6f 82 00 42 88 65 9b 37 6f da a4 83 ef o..o..B.e.7o.... + 00000260: a7 9b 5e 6a 59 fc 4f 3f 2c 9d 34 b9 0c af d0 71 ..^jY.O?,.4....q + 00000270: 1c 9b b8 15 23 66 47 e8 88 b5 33 26 78 1d f7 4e ....#fG...3&x..N + 00000280: 5c 88 d0 c0 9f 0a 29 1e 38 76 fc 63 9e 78 e2 ef \.....).8v.c.x.. + 00000290: de 78 ff 8f ef ae 02 9a fe df 09 f4 e3 be 15 2b .x.............+ + 000002a0: d7 ee cf 4c 4f 21 e9 17 dc fe ed f9 14 8c 08 11 ...LO!.......... + 000002b0: b7 62 84 13 5d 74 c4 da 89 db 09 ee 9d b8 84 e1 .b..]t.......... + 000002c0: fe 74 84 00 a9 1c fc 5e 83 40 00 c2 3d 71 d6 ac .t.....^.@..=q.. + 000002d0: 79 b4 f1 b5 3d 3b e7 00 e7 af 86 80 c1 d0 21 af y...=;........!. + 000002e0: ec a6 79 ff 12 9a f2 20 66 ef 39 ac cb 1f 92 22 ..y.... f.9...." + 000002f0: 7d 14 66 15 d1 1e 69 25 6e c7 70 95 64 6c f0 7a }.f...i%n.p.dl.z + 00000300: 86 a7 a6 a3 09 78 f3 93 43 9c ed aa a5 20 23 9f .....x..C.... #. + 00000310: c2 ac 91 dc 5a 3a 93 57 b6 be 52 d8 de de b6 f5 ....Z:.W..R..... + 00000320: 9d b7 df fa eb ab 49 f2 86 6c 05 86 e5 8c dc f2 ......I..l...... + 00000330: c8 53 ff f5 a3 8c 60 3a 26 67 29 ca 1b ce f8 50 .S....`:&g)....P + 00000340: 29 39 e9 59 f4 58 61 9a 7b 9b 68 ee 6b a6 2f d9 )9.Y.Xa.{.h.k./. + 00000350: 87 26 74 e2 76 94 fa 9e 3a 7c ba 81 d7 f0 32 6a .&t.v...:|....2j + 00000360: 78 11 ab 66 ac 62 58 86 8f da 33 17 98 33 e7 5b x..f.bX...3..3.[ + 00000370: ff d8 de de f6 b3 21 c9 85 ae 02 b3 a6 df b1 ec ......!......... + 00000380: d1 cc cc 1c 2e 5c 7e 9b 96 ee 5a 7a a2 61 2e f7 .....\~...Zz.a.. + 00000390: 36 71 29 7c 89 b6 48 2b bd 89 3e a2 56 8c d6 48 6q)|..H+..>.V..H + 000003a0: 2b c7 1b 3f e2 68 fd 51 22 c9 08 09 c7 22 6a 46 +..?.h.Q"...."jF + 000003b0: 31 84 87 14 c3 47 3c 0e 65 65 63 78 ec b1 75 1b 1....G<.eecx..u. + 000003c0: 80 e2 21 49 25 be 0c 59 d9 05 cb c6 94 cd d4 5d ..!I%..Y.......] + 000003d0: 2b 89 df 3b 8c 88 19 a5 3b de c1 e5 de 66 ea c3 +..;....;....f.. + 000003e0: f5 34 f7 36 d3 16 6d a5 2b da 49 6f a2 97 b8 95 .4.6..m.+.Io.... + 000003f0: 40 4a 45 cc 8c d3 d2 d7 42 c4 8c 31 21 af 0c 4d @JE.....B..1!..M + 00000400: 80 52 e0 3a b0 7c d9 c3 fe ec ec 9c bf 19 92 64 .R.:.|.........d + 00000410: ee 4b 90 31 ea ba bf 9a ef 4b 4d 47 3a 26 79 e9 .K.1.....KMG:&y. + 00000420: 45 34 b4 1e a7 3d da 8a ad 27 49 31 bd 48 5c a2 E4...=...'I1.H\. + 00000430: 56 94 70 a2 87 ce 58 17 31 2b 8a 54 12 5b 68 2c V.p...X.1+.T.[h, + 00000440: 28 bb 9b 1b 0a ca b9 a5 78 3a 96 03 1e 1d 3a 23 (.......x:....:# + 00000450: 71 6a dd 06 4a 67 95 3f da f9 bb 23 2f 03 bd 5f qj..Jg.?...#/.._ + 00000460: 27 81 e9 23 0a c7 17 29 25 91 ca 26 27 90 87 c7 '..#...)%..&'... + 00000470: 48 a5 a9 af 81 a4 88 e3 f1 19 48 25 89 3b 71 22 H.........H%.;q" + 00000480: c9 3e a2 fd ca f7 26 7a 79 e4 a6 1f f0 f8 ac 47 .>....&zy......G + 00000490: 70 24 d8 0e e8 06 f4 24 62 6c 3f f9 1b ba dc 30 p$.....$bl?....0 + 000004a0: 05 53 c6 16 f3 bb 23 e5 c0 7b 5f 1b 01 8f 2f 75 .S....#..{_.../u + 000004b0: 74 66 30 24 70 5d 04 82 14 c3 c7 f5 23 a6 70 e0 tf0$p]......#.p. + 000004c0: dc 76 2c 61 62 78 0d 14 92 a4 93 a4 cf ec 43 2a .v,abx........C* + 000004d0: 17 cb b6 b8 bd 74 0e 2b a6 3d 48 dc 02 a9 40 d3 .....t.+.=H...@. + 000004e0: 40 57 10 4e f4 d1 d0 d3 8c 3f d5 8f 3f 3b 03 c3 @W.N.....?..?;.. + 000004f0: eb 29 71 2c 7b 88 08 dc bf 69 29 70 17 30 09 88 .)q,{....i)p.0.. + 00000500: 02 27 a8 dc 13 17 9a 86 42 02 0a cb 4d 32 a3 68 .'......B...M2.h + 00000510: 36 f5 b1 53 54 77 1c 27 20 03 28 a1 d0 35 9d b9 6..STw.' .(..5.. + 00000520: a5 f3 48 f3 05 08 78 02 2c 2a 5f 8c 47 33 70 5c ..H...x.,*_.G3p\ + 00000530: 10 fd 96 e8 2a 08 78 fc 08 a1 13 31 63 48 8f 86 ....*.x....1cH.. + 00000540: 66 e8 59 58 f6 35 da c0 fd 9b 16 03 6b 16 df 3c f.YX.5......k..< + 00000550: 76 f6 dc f2 42 26 15 05 89 99 0e 55 75 9d b3 b6 v...B&.....Uu... + 00000560: 15 05 a9 ec e8 e2 b6 3c 9b 34 9f 8e eb d8 08 a5 .......<.4...... + 00000570: f3 fd 1b 1e e1 c2 ef cf e2 48 93 a4 6b f2 83 e9 .........H..k... + 00000580: 3f 64 cd cd 0f e2 c8 2b af b4 5c ae 28 df 5f c2 ?d.....+..\.(._. + 00000590: 28 ae 18 b0 10 06 4a 2a a2 6e 02 33 11 43 4a 99 (.....J*.n.3.CJ. + 000005a0: bc 26 23 16 8b 36 af 19 39 3c f0 d2 2b ab 66 73 .&#..6..9<..+.fs + 000005b0: eb f5 f9 08 21 10 42 a0 69 1a df 1a 17 e2 47 f3 ....!.B.i.....G. + 000005c0: 26 f1 fc 81 4a 9e d9 7b 8c d5 53 8a c9 72 5c 62 &...J..{..S..r\b + 000005d0: 66 9c c2 ac 6c 0a 33 8b 38 d5 51 85 ae 1b d8 ae f...l.3.8.Q..... + 000005e0: 8d 54 90 b0 af 94 5d 88 fe f1 39 98 2e 48 95 8a .T....]...9..H.. + 000005f0: 47 4b 25 9a 68 27 da d9 8d 6b 39 2d 5f 99 80 58 GK%.h'...k9-_..X + 00000600: b4 39 2d c5 a3 bf f4 fa e3 df c6 55 92 07 5e 3c .9-........U..^< + 00000610: 84 10 82 19 a5 21 fe 76 fe 54 34 4d 43 13 82 a7 .....!.v.T4MC... + 00000620: ee bd 11 5d d3 d8 ff 4e 2d f9 c3 d2 89 27 93 98 ...]...N-....'.. + 00000630: a6 cb c2 09 4b b8 f4 fe 05 fa ec 1e de fc e4 10 ....K........... + 00000640: f7 94 dd 4b f1 f0 20 49 07 2c 47 7d 16 25 11 80 ...K.. I.,G}.%.. + 00000650: 2d 21 62 2a 6c 57 c3 d0 fc f4 58 bd 84 2f 5d 46 -!b*lW....X../]F + 00000660: 49 79 fe 5a e2 c0 9a 95 b7 8f 63 7c 7e 26 87 aa Iy.Z......c|~&.. + 00000670: ea f8 ed f1 f3 ec 3f f6 29 bf 3c f2 31 4a 29 a4 ......?.).<.1J). + 00000680: 94 03 95 d1 8f bf 53 4e b7 94 b4 f7 c5 88 c7 4d ......SN.......M + 00000690: 3a 7b 7b 29 ce 28 63 fd 9c ff a0 64 d8 58 ea 3a :{{).(c....d.X.: + 000006a0: eb 78 f6 ad 67 f8 d5 b1 3d 9c 69 3d 07 08 a4 94 .x..g...=.i=.... + 000006b0: b8 ae 4b dc 96 84 13 6e ff 80 a0 bf 14 69 7b 68 ..K....n.....i{h + 000006c0: ad be 70 11 a8 bf 96 5f 68 e9 f7 a6 8d 46 29 45 ..p...._h....F)E + 000006d0: a6 df cb dc c9 45 a4 78 3c 3c 36 af 9c 7d 1f 9d .....E.x<<6..}.. + 000006e0: 63 e3 ff 9c 00 60 d1 cd e3 f8 87 bb 6f 62 e1 f4 c....`......ob.. + 000006f0: 31 9c a8 6e 24 2f c3 8f cf 67 d0 62 74 32 32 bb 1..n$/...g.bt22. + 00000700: 98 a7 67 3f c7 f3 bf df c0 db 9f 1c e1 ad da 0a ..g?............ + 00000710: f2 33 0b d8 b6 78 27 05 99 f9 84 13 16 7d a6 4b .3...x'......}.K + 00000720: c4 94 c4 4c 45 d4 81 92 e0 6d 8c fb 53 13 47 4f ...LE....m..S.GO + 00000730: 6f fd 49 bf b3 f8 ca 04 26 8c cd 4b 47 29 45 71 o.I.....&..KG)Eq + 00000740: 4e 06 8b a6 97 12 4c 4f 65 c6 d8 11 7c ff c5 37 N.....LOe...|..7 + 00000750: 38 79 a9 fd 4a d7 22 37 13 a5 14 d7 85 32 a9 f8 8y..J."7.....2.. + 00000760: f0 02 b1 a4 89 de a7 21 10 b8 52 32 22 6b 18 2b .......!..R2"k.+ + 00000770: a7 ae e3 97 d6 7f 82 50 64 a7 e7 10 8b 3b fc a1 .......Pd....;.. + 00000780: e9 63 bc be 0c 30 d2 89 5b 06 31 5b 10 73 20 92 .c...0..[.1[.s . + 00000790: e8 e4 dd 5d 2f 1f c2 55 bb af 35 12 5b 96 e3 7a ...]/..U..5.[..z + 000007a0: bd 86 c6 43 bf 78 8b a4 7d a5 fa 7b f3 a9 fb 58 ...C.x..}..{...X + 000007b0: 30 b5 84 92 dc 4c b2 02 29 3c 34 bb 0c 29 25 a6 0....L..)<4..)%. + 000007c0: ed 62 68 3a 09 d3 42 00 52 29 2c db 26 91 34 c9 .bh:..B.R),.&.4. + 000007d0: f4 a7 b1 66 da 4f d0 35 9d d4 94 74 0e 7f f4 0e ...f.O.5...t.... + 000007e0: 3b 2a b6 91 3b 6c 04 c1 8c 11 a4 a4 66 91 91 59 ;*..;l......f..Y + 000007f0: 40 30 6f 32 27 0e ed ec bc 74 e6 fd @0o2'....t.. + +URB 57 : <<< + 00000000: 00 00 0c 00 13 04 01 00 0b 00 00 00 ............ + +URB 59 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +Data header packet. + +URB 61 : >>> + 00000000: 04 00 08 00 68 00 e8 06 ....h... + ^^^^^ : data size for the next packet + ^^ : always 0x00 + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 60 : <<< + 00000000: 00 00 0c 00 13 04 01 00 0c 00 00 00 ............ + +Data packet. + +URB 63 : >>> + 00000000: 04 00 ec 06 1f 0f 45 5f e8 64 4d 63 78 d6 8c b1 ......E_.dMcx... + ^^ ..... : content of file + ^^^^^ : packet size (0x06E8 = 0x06EC - 0x02) + ^^^^^ : socket ID + 00000010: 39 48 a5 f0 1a 3a 37 8c ca 26 94 99 4a e5 c5 36 9H...:7..&..J..6 + 00000020: 32 fd 5e 82 69 29 64 a4 7a 50 4a 71 aa a1 0b b7 2.^.i)d.zPJq.... + 00000030: bb 1e ad 78 04 89 a4 89 e3 4a 4c cb 26 1a 37 e9 ...x.....JL.&.7. + 00000040: f4 c4 31 0c 2f 68 1e 5c d5 c3 81 f7 0e e2 24 2d ..1./h.\......$- + 00000050: da da 9a 69 69 6d 44 68 a0 7b bd 58 ed 3f a7 ed ...iimDh.{.X.?.. + 00000060: 83 3f 3d 0d 7c 3a 14 04 7e b5 eb 83 0b b3 a6 8f .?=.|:..~....... + 00000070: c9 e6 0f eb 17 22 04 8c 0c a6 73 ba a9 9b a7 5f ....."....s...._ + 00000080: fb 60 40 28 7f 58 80 db ca 8a d8 7f ec 22 3d 87 .`@(.X......."=. + 00000090: b7 fe 7b 8e d9 be ee fa a9 73 d3 2c 09 d1 44 12 ..{......s.,..D. + 000000a0: a1 5b 08 4d 43 d3 3c 18 1e 1f 35 67 df a1 a5 a5 .[.MC.<...5g.... + 000000b0: 01 8f e1 01 0d 0c c3 8b d0 04 d1 8b 4d 4e 77 cd ............MNw. + 000000c0: e9 75 4a ca 57 86 aa 33 f7 eb df 1c af df 7e ff .uJ.W..3......~. + 000000d0: 4d a3 b9 65 5c de 40 0c 38 dd dc 8d cf a3 a3 09 M..e\.@.8....... + 000000e0: c1 e4 a2 6c a6 8d c9 e3 9f 77 7f 48 67 24 f9 33 ...l.....w.Hg$.3 + 000000f0: ba 1a ff f5 ed fd 2f 56 d4 9d ad 7a 7e d2 cc ef ....../V...z~... + 00000100: cd cc ca 2d 01 4d 07 01 ae 8c 73 a1 ee 30 9f 5e ...-.M....s..0.^ + 00000110: fa 23 86 c7 8b 94 57 42 81 15 ee 25 5a 57 57 19 .#....WB...%ZWW. + 00000120: 6f 69 5d 0b 1c 1d 4c 72 f0 a5 05 8d 58 b4 f9 fe oi]...Lr....X... + 00000130: 80 cf d8 bb e5 a1 19 dc 35 b9 e0 0b 81 4c 08 81 ........5....L.. + 00000140: e9 48 36 ec ab 64 eb 1b 27 76 72 f0 e9 4d 40 56 .H6..d..'vr..M@V + 00000150: bf 7b ce d5 3d be 05 a1 e2 29 b3 f2 4a a6 8d 48 .{..=....)..J..H + 00000160: c9 c8 d6 9a db ab 08 f7 d5 63 e8 1e 94 94 b8 89 .........c...... + 00000170: 04 56 77 57 57 b2 a3 e3 3d e5 ba 07 81 16 40 07 .VwWW...=.....@. + 00000180: 62 40 a4 3f 0b ed ed 3f 37 af 98 d5 17 15 be ba b@.?...?7....... + 00000190: 8a 6c d1 e6 bb 80 35 37 8f cd b9 7b 66 69 2e e5 .l....57...{fi.. + 000001a0: 45 c3 e9 49 58 54 d5 77 f3 66 75 33 2d ed 9d 2f E..IXT.w.fu3-../ + 000001b0: f3 c6 bf 6d c5 4e e4 f7 77 d8 32 00 0f e0 02 69 ...m.N..w.2....i + 000001c0: fd d7 72 81 0c a1 eb 06 a0 50 2a a1 a4 ec ec 6f ..r......P*....o + 000001d0: a7 44 01 5f bf f2 36 90 ec 27 d0 06 34 02 cd 40 .D._..6..'..4..@ + 000001e0: 0f 60 2a a5 e4 a0 09 7c 8e c8 6c 60 36 70 63 7f .`*....|..l`6pc. + 000001f0: 27 ed 18 70 40 ed 7d bc f9 9b da a1 11 7f e9 5b '..p@.}........[ + 00000200: 4c ff 3b 00 0a 79 0a c5 3c 71 69 d1 00 00 00 00 L.;..y..>> + 00000000: 04 00 08 00 8d 00 00 00 ........ + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB 65 : <<< + 00000000: 00 00 0c 00 13 04 01 00 0e 00 00 00 ............ + +URB 67 : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +URB 69 : >>> + 00000000: 00 00 08 00 0b 04 00 0b ........ + +URB 68 : <<< + 00000000: 00 00 08 00 0c 04 00 0b ........ + diff -Nru barry-0.14/doc/javaloader-reset.txt barry-0.0.20110506/doc/javaloader-reset.txt --- barry-0.14/doc/javaloader-reset.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/javaloader-reset.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,88 @@ +>>> Send packet +<<< Receive packet + +The following series of packets occur after SB_COMMAND_CLOSE_SOCKET when +either loading or forcefully erasing a module that is in use (busy). This +sequence is strikingly similar to the one used by cfp.exe utility when it +resets the handheld. It also resembles the sequence used to probe for +devices. + +The entire sequence is actually not necessary. The final packet is the +only one required to cause the device to reset. However, this document +helps to serve as documentation for several previously unknown packets. + +The meaning of several packets was discovered by analyzing the debug +logs created by RIM's own USB driver on windows. Debug logging is turned +on by setting two registry keys. + +>>> 00000000: 00 00 10 00 01 ff 00 03 bb 35 2d b9 01 00 00 00 .........5-..... + ^^^^^ socket number + ^^^^^ size of packet + ^^ echo command + this looks to be a simple echo command + ^^^^^ SB_MODE_REQUEST_SOCKET in barry + ^^ socket sequence + ^^^^^^^^^^^^^^^^^^^^^^^ + these 8 bytes seem to always increase with + each execution of javaloader... if the + value is interpreted as a time span in + microseconds it is very close to the + duration since system startup +<<< 00000000: 00 00 10 00 02 ff 00 03 bb 35 2d b9 01 00 00 00 .........5-..... + ^^ echo response + + +>>> 00000000: 00 00 0c 00 05 ff 00 04 14 00 01 00 ............ + ^^ fetch attribute + ^^^^^ SB_MODE_REQUEST_SOCKET + ^^ socket sequence + ^^^^^ SB_OBJECT_INITIAL_UNKNOWN + ^^^^^ SB_ATTR_INITIAL_UNKNOWN +<<< 00000000: 00 00 20 00 06 ff 00 04 14 00 01 00 3c 41 30 3e .. ......... + ^^ begin 20 byte device GUID +<<< 00000010: 1e 47 24 0d 99 92 3f b1 38 d6 a3 6e 75 cd c9 d7 .G$...?.8..nu... + + +>>> 00000000: 00 00 0c 00 05 ff 00 05 08 00 04 00 ............ + ^^^^^ SB_OBJECT_PROFILE + ^^^^^ SB_ATTR_PROFILE_PIN (Network and PPIN?) +<<< 00000000: 00 00 14 00 06 ff 00 05 08 00 04 00 03 00 00 00 ................ +<<< 00000010: 2e 36 61 20 .6a + + +>>> 00000000: 00 00 0c 00 05 ff 00 06 04 00 05 00 ............ + ^^^^^ SB_OBJECT_SOCKET_UNKNOWN + ^^^^^ unknown (Emulator ID?) +<<< 00000000: 00 00 0c 00 06 ff 00 06 00 00 00 00 ............ + + +>>> 00000000: 00 00 0c 00 05 ff 00 07 04 00 06 00 ............ + ^^^^^ SB_OBJECT_SOCKET_UNKNOWN + ^^^^^ unknown (USB Serial Interface Version?) +<<< 00000000: 00 00 0c 00 06 ff 00 07 00 00 00 00 ............ + + +>>> 00000000: 00 00 0c 00 05 ff 00 08 04 00 07 00 ............ + ^^^^^ SB_OBJECT_SOCKET_UNKNOWN + ^^^^^ unknown (MUX Version Successful) +<<< 00000000: 00 00 10 00 06 ff 00 08 04 00 07 00 00 02 00 00 ................ + ^^^^^^^^^^^ MUX version = 200 + + +>>> 00000000: 00 00 0c 00 05 ff 00 09 04 00 08 00 ............ + ^^^^^ SB_OBJECT_SOCKET_UNKNOWN + ^^^^^ unknown (EVDO Modem Version?) +<<< 00000000: 00 00 0c 00 06 ff 00 09 00 00 00 00 ............ + + +>>> 00000000: 00 00 0c 00 05 ff 00 0a 04 00 0a 00 ............ + ^^^^^ SB_OBJECT_SOCKET_UNKNOWN + ^^^^^ unknown (ESN?) +<<< 00000000: 00 00 0c 00 06 ff 00 0a 00 00 00 00 ............ + + +>>> 00000000: 00 00 08 00 03 ff 00 0b ........ + ^^ reset command +<<< 00000000: 00 00 08 00 04 ff 00 0b ........ + ^^ reset response + diff -Nru barry-0.14/doc/jdwp/usb-protocol.txt barry-0.0.20110506/doc/jdwp/usb-protocol.txt --- barry-0.14/doc/jdwp/usb-protocol.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/jdwp/usb-protocol.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,3181 @@ +JavaDebug reverse +================= + +With Java debug, you can communicate with the embedded JVM to debug a Java application + +After probe process, we have the JVM Debug command + +Legend : + >>> : Sent + <<< : Received + + +Protocol summary : +------------------ + +JavaDebug protocol is quiet simple, it's always the same commande : + + >>> + 00000000: AA AA BB BB 00 NN XX XX XX XX XX ... + + AA AA : socket ID + BB BB : size of packet + + NN : Size of data (number of following bytes) + XX XX XX XX ... : bytes (the data) + + So : BB BB = 6 + NN + + + <<< + 00000000: 00 00 AA AA 13 05 01 00 YY YY YY YY + + 00 00 : + AA AA : size of packet + 13 : sequence packet + 05 01 00 : unknown field + YY YY YY YY : sequence id + + + <<< + 00000000: 05 00 AA AA NN NN + + 05 00 : + AA AA : size of packet + NN NN : size of following data + + + <<< + 00000000: 05 00 AA AA XX XX XX XX ... + + 05 00 : + AA AA : sizeof packet + XX XX XX XX ... : data + + So, AA AA = 4 + NN NN + + +List of commands : +------------------ + + *) ???? + 0x53 => 00 00 00 00 00 00 00 02 00 00 00 00 + + + *) ???? + 0x01 => 00 00 00 01 00 00 00 26 00 00 00 02 + + + *) ???? + 0x6f => 00 00 + + + *) ???? + 0x8a => 06 00 14 04 + + + *) ???? + 0x90 => 00 00 + + + *) Get list of java modules + Command : 0x8d + + Param : [aa bb cc dd] = ID of first module + + Return : + ID ; Address ; Module name + 1 ; 0x4a174ab4 ; net_rim_app_manager + 2 ; .... + + + *) ???? + Command : 0x44 + + Param : 00 00 00 00 + + Return : none + + + *) ???? + Command : 0x45 + + Param : 00 00 00 00 + + Return : none + + + *) ???? + Command : 0x54 + + Param : 00 00 00 00 + + Return : none + + + *) ???? + Command : 0x33 + + Param : 00 00 00 09 + + Return : none + + + *) ???? + Command : 0x46 + + Param : 00 00 00 01 + + Return : none + + + *) ???? + Get status ? + Command : 0x06 + + Param : none + + Wait answer... + + Return : + - 8d none, the next command to sent is 0x40 + - 85 ????, the next command to sent is 0x64 + - 86 ????, the next command to sent is 0x64 + + This command is called after an empty message (see GetConsoleMessage) + + We can be suspended on this command. + + + *) GetConsoleMessage - info / comment + Command : 0x40 + + Param : none + + Return : + 00 00 + 00 09 56 4d 3a 2d 44 41 20 30 0a VM:-DA 0 + 00 10 61 74 74 61 63 68 3a 20 73 75 63 63 65 73 73 0a attach: success + <--- : string + ^^ : length of string + ^^ : type = string + + When the JVM is running, we poll the device to get the console message (output of System.out.println). + If you receive an empty message : + 00 02 + 00 00 + We have to call the GET_STATUS command. (see above) + + + *) Go Step Into + + Command : 0x03 + + Param : none + + Wait answer... + + Return : + - 8d none, the next command to sent is 0x40 + - 86 ????, the next command to sent is 0x64 + + + *) Go + Command : 0x02 + + Param : none + + Wait answer... + + Return : + - 8d none, the next command to sent is 0x40 + + + *) ???? + Command : 0x04 + + Param : none + + Wait answer... + + Return : + - 8d none, the next command to sent is 0x40 + - 86 ????, + + + *) ???? + Use to set/remove breakpoint + Command : 0x1a + + Param : [aa bb cc dd] = address of breakpoint desired position + + Return : 07 + 00 00 00 31 <= ID of Java module + 00 00 00 00 + + + *) Set breakpoint + Command : 0x21 + + Param : 00 00 00 31 <= ID of Java module + 00 00 01 8c <= Breakpoint position + + Return : none + + + *) Remove breakpoint + Command : 0x22 + + Param : 00 00 00 31 <= ID of Java module + 00 00 01 8c <= Breakpoint position + + Return : none + + + *) ???? + Command : 0x50 + + Param : 75 c5 00 00 + + Return : 00 00 00 00 + + + *) ???? + Command : 0x57 + + Param : 75 c5 00 00 + + Return : 00 00 00 00 + + + *) ???? + Command : 0x58 + + Param : 75 c5 00 00 + + Return : 00 00 00 00 + + + *) ???? + Command : 0x5e + + Param : 75 bf e0 00 + + Return : 0xcc + + + *) ???? + Seems to be a get status stack pointer, list of varaibles... + Command : 0x64 + + Param : none + + Return : + 0x64 => 77 63 40 00 00 00 00 01 00 00 00 31 00 00 00 0f + 00 00 00 01 b8 00 00 00 00 02 74 bc e0 00 00 00 + 00 00 00 00 00 00 00 00 00 00 0a + 0x64 => 77 63 40 00 00 00 00 01 00 00 00 31 00 00 00 11 + 00 00 00 01 cf 00 00 00 00 02 74 bc e0 00 00 00 + 00 00 00 00 00 00 00 00 00 00 0a + 0x64 => 77 63 40 00 00 00 00 02 00 00 00 31 00 00 00 26 + 00 00 00 01 dd 00 00 00 00 31 00 00 00 15 00 00 + 00 01 01 00 00 00 00 01 77 5b 80 00-00 00 00 00 + ^^ ^^^^^^^^^^^ + 00 00 00 00 0a + 0x64 => 77 63 40 00 00 00 00 03 00 00 00 31 00 00 01 6c + ^^^^^^^^^^^ + Id of Java module + 00 00 00 01 3f 00 00 00 00 31 00 00 00 34 00 00 + ^^^^^^^^^^^ ^^^^^^^^^^^ + context pointer Id of Java module + 00 01 01 00 00 00 00 31 00 00 00 15 00 00 00 01 + ^^^^^^^^^^^ + Id of Java module + 01 00 00 00 00 04 75 c5 00 00 75 bf e0 00 0e dd + ^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^ + nbr this address title address + a0 00 06 8a 20 00-00 00 00 00 00 00 00 00 0a + ^^^^^ ^^^^^^^^^^^ + 0x64 => 77 63 40 00 00 00 00 03 00 00 00 31 00 00 01 a3 + 00 00 00 01 b9 00 00 00 00 31 00 00 00 34 00 00 + 00 01 01 00 00 00 00 31 00 00 00 15 00 00 00 01 + 01 00 00 00 00 04 75 c5 00 00 75 bf e0 00 00 00 + 00 00 74 61 80 00 00 00 00 00 00 00 00 00 0a + ^^^^^^^^^^^ + str address + Then, use the command 0x03 + + + *) ???? + Command : 0x65 + + Param : 00 00 00 00 + + Return : 00 00 00 00 + + + *) Get all threads currently running in the target VM + Command : 0x08 + + Param : none + + Return : + 00 00 00 6f : Number of threads + e6 a1 e0 00 : ID of thread 1 + db f9 20 00 : ID of thread 2 + ... + + +.: USB LOGS :. +============== + +BarryDemo properties : +--------------------------- +ID = 0x31 +Address : 0x4a4383be + + +Details : +--------- + +Open Socket with BlackBerry device, then select JVM Debug mode. + + +>>> URB 50 + 00000000: 00 00 0c 00 05 ff 00 0b 02 00 0c 00 ............ +<<< URB 30 + 00000000: 00 00 0c 00 06 ff 00 0b 00 00 00 00 ............ + +>>> URB 52 + 00000000: 00 00 18 00 07 ff 00 0c 52 49 4d 5f 4a 56 4d 44 ........RIM_JVMD + 00000010: 65 62 75 67 00 00 00 00 ebug.... +<<< URB 32 + 00000000: 00 00 30 00 08 05 00 0c 52 49 4d 5f 4a 56 4d 44 ..0.....RIM_JVMD + 00000010: 65 62 75 67 00 00 00 00 00 00 00 00 01 00 07 00 ebug............ + 00000020: 02 00 07 00 03 01 00 00 04 01 00 00 05 10 01 00 ................ + +>>> URB 54 + 00000000: 00 00 0c 00 0a 05 00 0d 10 03 00 00 ............ + +>>> URB 134 + 00000000: 05 00 07 00 00 01 53 ......S + ^^ + ^^ : size (= 0x01) +<<< URB 139 + 00000000: 00 00 0c 00 13 05 01 00 01 00 00 00 ............ +<<< URB 141 + 00000000: 05 00 06 00 00 0c ...... + ^^^^^ size of next data +<<< URB 142 + 00000000: 05 00 10 00 00 00 00 00 00 00 00 02 00 00 00 00 ................ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = size = 0x000c + +>>> URB 138 + 00000000: 05 00 07 00 00 01 01 ....... + ^^ + ^^ : size (= 0x01) +<<< URB 143 + 00000000: 00 00 0c 00 13 05 01 00 02 00 00 00 ............ +<<< URB 145 + 00000000: 05 00 06 00 00 0c ...... + ^^^^^ size of next data +<<< URB 146 + 00000000: 05 00 10 00 00 00 00 01 00 00 00 26 00 00 00 02 ...........&.... + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ size = 0x000c + +>>> URB 142 + 00000000: 05 00 07 00 00 01 6f ......o + ^^ + ^^ : size (= 0x01) +<<< URB 147 + 00000000: 00 00 0c 00 13 05 01 00 03 00 00 00 ............ + ^^^^^^^^^^^ : sequence id + ^^ ^^ ^^ : unknown field + ^^ : Sequence packet +<<< URB 149 + 00000000: 05 00 06 00 00 02 ...... + ^^^^^ size of next data +<<< URB 150 + 00000000: 05 00 06 00 00 00 ...... + ^^^^^ size of data = 0x0002 + +>>> URB 146 + 00000000: 05 00 07 00 00 01 8a ....... + ^^ + ^^ : size (= 0x01) +<<< URB 151 + 00000000: 00 00 0c 00 13 05 01 00 04 00 00 00 ............ +<<< URB 153 + 00000000: 05 00 06 00 00 04 ...... + ^^^^^ size of next data +<<< URB 154 + 00000000: 05 00 08 00 06 00 14 04 ........ + ^^^^^^^^^^^ size of data = 0x0004 + +>>> URB 150 + 00000000: 05 00 07 00 00 01 90 ....... + ^^ + ^^ : size (= 0x01) +<<< URB 155 + 00000000: 00 00 0c 00 13 05 01 00 05 00 00 00 ............ +<<< URB 157 + 00000000: 05 00 06 00 00 00 ...... + ^^^^^ size of next data + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 153 + 00000000: 05 00 0b 00 00 05 8d 00 00 00 00 ........... + ^^^^^^^^^^^ : ID of first data desired + ^^ : command + ^^ : size (= 0x05) +<<< URB 158 + 00000000: 00 00 0c 00 13 05 01 00 06 00 00 00 ............ + ^^^^^^^^^^^ : sequence id + ^^ ^^ ^^ : unknown field + ^^ : Sequence packet +<<< URB 160 + 00000000: 05 00 06 00 03 eb ...... + ^^^^^ size of next data +<<< URB 161 + 00000000: 05 00 ef 03 00 00 00 2b 00 00 00 01 4a 17 4a b4 .......+....J.J. + ^^^^^ ^^^^^ ^^^^^^^^^^^|^^^^^^^^^^^ ^^^^^^^^^^^ + socket packet nbr data | ID address ? + ID size readable + 00000010: 00 13 6e 65 74 5f 72 69 6d 5f 61 70 70 5f 6d 61 ..net_rim_app_ma + ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + size name of module + 00000020: 6e 61 67 65 72 00 00 00 02 4a 17 49 96 00 0c 6e nager....J.I...n + ^^^^^^^^^^^^^^|^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^ + | ID address ? size + 00000030: 65 74 5f 72 69 6d 5f 63 6c 64 63 00 00 00 03 4a et_rim_cldc....J + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|^^^^^^^^^^^ + name of module | ID + 00000040: 17 49 96 00 0e 6e 65 74 5f 72 69 6d 5f 63 6c 64 .I...net_rim_cld + 00000050: 63 2d 32 00 00 00 04 4a 17 49 96 00 0e 6e 65 74 c-2....J.I...net + 00000060: 5f 72 69 6d 5f 63 6c 64 63 2d 33 00 00 00 05 4a _rim_cldc-3....J + 00000070: 17 49 96 00 0f 6e 65 74 5f 72 69 6d 5f 63 6c 64 .I...net_rim_cld + 00000080: 63 2d 31 33 00 00 00 06 4a 17 49 96 00 0f 6e 65 c-13....J.I...ne + 00000090: 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 32 00 00 00 t_rim_cldc-12... + 000000a0: 07 4a 17 49 96 00 0f 6e 65 74 5f 72 69 6d 5f 63 .J.I...net_rim_c + 000000b0: 6c 64 63 2d 31 31 00 00 00 08 4a 17 49 96 00 0f ldc-11....J.I... + 000000c0: 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 34 00 net_rim_cldc-14. + 000000d0: 00 00 09 4a 17 49 96 00 0e 6e 65 74 5f 72 69 6d ...J.I...net_rim + 000000e0: 5f 63 6c 64 63 2d 36 00 00 00 0a 4a 17 49 96 00 _cldc-6....J.I.. + 000000f0: 0e 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 38 00 .net_rim_cldc-8. + 00000100: 00 00 0b 4a 17 49 96 00 0e 6e 65 74 5f 72 69 6d ...J.I...net_rim + 00000110: 5f 63 6c 64 63 2d 39 00 00 00 0c 4a 17 49 96 00 _cldc-9....J.I.. + 00000120: 0e 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 00 .net_rim_cldc-1. + 00000130: 00 00 0d 4a 17 49 96 00 0e 6e 65 74 5f 72 69 6d ...J.I...net_rim + 00000140: 5f 63 6c 64 63 2d 37 00 00 00 0e 4a 17 49 96 00 _cldc-7....J.I.. + 00000150: 0f 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 38 .net_rim_cldc-18 + 00000160: 00 00 00 0f 4a 17 49 96 00 0f 6e 65 74 5f 72 69 ....J.I...net_ri + 00000170: 6d 5f 63 6c 64 63 2d 31 39 00 00 00 10 4a 17 49 m_cldc-19....J.I + 00000180: 96 00 0f 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d ...net_rim_cldc- + 00000190: 31 30 00 00 00 11 4a 17 49 96 00 0e 6e 65 74 5f 10....J.I...net_ + 000001a0: 72 69 6d 5f 63 6c 64 63 2d 35 00 00 00 12 4a 17 rim_cldc-5....J. + 000001b0: 49 96 00 0f 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 I...net_rim_cldc + 000001c0: 2d 32 33 00 00 00 13 4a 17 49 96 00 0f 6e 65 74 -23....J.I...net + 000001d0: 5f 72 69 6d 5f 63 6c 64 63 2d 31 37 00 00 00 14 _rim_cldc-17.... + 000001e0: 4a 17 49 96 00 0e 6e 65 74 5f 72 69 6d 5f 63 6c J.I...net_rim_cl + 000001f0: 64 63 2d 34 00 00 00 15 4a 17 49 96 00 0f 6e 65 dc-4....J.I...ne + 00000200: 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 36 00 00 00 t_rim_cldc-16... + 00000210: 16 4a 17 49 96 00 0f 6e 65 74 5f 72 69 6d 5f 63 .J.I...net_rim_c + 00000220: 6c 64 63 2d 32 32 00 00 00 17 4a 17 49 96 00 0f ldc-22....J.I... + 00000230: 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 31 35 00 net_rim_cldc-15. + 00000240: 00 00 18 4a 17 49 96 00 0f 6e 65 74 5f 72 69 6d ...J.I...net_rim + 00000250: 5f 63 6c 64 63 2d 32 30 00 00 00 19 4a 17 49 96 _cldc-20....J.I. + 00000260: 00 0f 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 2d 32 ..net_rim_cldc-2 + 00000270: 31 00 00 00 1a 4a 2f bb a4 00 0c 53 74 6f 72 6d 1....J/....Storm + 00000280: 50 69 63 74 75 72 65 00 00 00 1b 4a 2f bb a4 00 Picture....J/... + 00000290: 0e 53 74 6f 72 6d 50 69 63 74 75 72 65 2d 31 00 .StormPicture-1. + 000002a0: 00 00 1c 4a 51 dc ee 00 0b 42 65 72 72 79 52 75 ...JQ....BerryRu + 000002b0: 62 69 6b 73 00 00 00 1d 4a 51 dc ee 00 0d 42 65 biks....JQ....Be + 000002c0: 72 72 79 52 75 62 69 6b 73 2d 31 00 00 00 1e 4a rryRubiks-1....J + 000002d0: 51 dc ee 00 0d 42 65 72 72 79 52 75 62 69 6b 73 Q....BerryRubiks + 000002e0: 2d 32 00 00 00 1f 4a 51 dc ee 00 0d 42 65 72 72 -2....JQ....Berr + 000002f0: 79 52 75 62 69 6b 73 2d 33 00 00 00 20 4a 51 dc yRubiks-3... JQ. + 00000300: ee 00 0d 42 65 72 72 79 52 75 62 69 6b 73 2d 34 ...BerryRubiks-4 + 00000310: 00 00 00 21 4a 51 dc ee 00 0d 42 65 72 72 79 52 ...!JQ....BerryR + 00000320: 75 62 69 6b 73 2d 35 00 00 00 22 49 86 2e 58 00 ubiks-5..."I..X. + 00000330: 07 73 79 73 49 6e 66 6f 00 00 00 23 49 86 2e 58 .sysInfo...#I..X + 00000340: 00 09 73 79 73 49 6e 66 6f 2d 31 00 00 00 24 4a ..sysInfo-1...$J + 00000350: 51 dc ee 00 0d 42 65 72 72 79 52 75 62 69 6b 73 Q....BerryRubiks + 00000360: 2d 36 00 00 00 25 4a 51 dc ee 00 0d 42 65 72 72 -6...%JQ....Berr + 00000370: 79 52 75 62 69 6b 73 2d 37 00 00 00 26 49 df 42 yRubiks-7...&I.B + 00000380: 41 00 05 4d 65 74 72 4f 00 00 00 27 49 df 42 41 A..MetrO...'I.BA + 00000390: 00 07 4d 65 74 72 4f 2d 31 00 00 00 28 4a 37 61 ..MetrO-1...(J7a + 000003a0: f7 00 09 42 65 72 72 79 54 72 61 70 00 00 00 29 ...BerryTrap...) + 000003b0: 4a 37 61 f7 00 0b 42 65 72 72 79 54 72 61 70 2d J7a...BerryTrap- + 000003c0: 31 00 00 00 2a 4a 37 61 f7 00 0b 42 65 72 72 79 1...*J7a...Berry + 000003d0: 54 72 61 70 2d 32 00 00 00 2b 4a 37 61 f7 00 0b Trap-2...+J7a... + | + 000003e0: 42 65 72 72 79 54 72 61 70 2d 33 00 00 00 2c BerryTrap-3..., + |^^^^^^^^^^^ + ID of next data (if 0x00000000 no data) + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 157 + 00000000: 05 00 0b 00 00 05 8d 00 00 00 2c .........., +<<< URB 162 + 00000000: 00 00 0c 00 13 05 01 00 07 00 00 00 ............ +<<< URB 164 + 00000000: 05 00 06 00 03 cf ...... +<<< URB 165 + 00000000: 05 00 d3 03 00 00 00 17 00 00 00 2c 4a 37 61 f7 ...........,J7a. + |^^^^^^^^^^^ ^^^^^^^^^^^ +                    | ID address + 00000010: 00 0b 42 65 72 72 79 54 72 61 70 2d 34 00 00 00 ..BerryTrap-4... + ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^| + size name of module | + 00000020: 2d 4a 37 61 f7 00 0b 42 65 72 72 79 54 72 61 70 -J7a...BerryTrap + 00000030: 2d 35 00 00 00 2e 4a 37 61 f7 00 0b 42 65 72 72 -5....J7a...Berr + | + 00000040: 79 54 72 61 70 2d 36 00 00 00 2f 4a 37 61 f7 00 yTrap-6.../J7a.. + | + 00000050: 0b 42 65 72 72 79 54 72 61 70 2d 37 00 00 00 30 .BerryTrap-7...0 + | + 00000060: 4a 37 61 f7 00 0b 42 65 72 72 79 54 72 61 70 2d J7a...BerryTrap- + 00000070: 38 00 00 00 31 4a 43 83 be 00 09 42 61 72 72 79 8...1JC....Barry + |^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^ + | ID address size name of + 00000080: 44 65 6d 6f 00 00 00 32 4a 31 31 a3 00 11 6e 65 Demo...2J11...ne + ^^^^^^^^^^^|^^^^^^^^^^^ + module | ID + 00000090: 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f 6d 73 6e 00 t_rim_bb_qm_msn. + 000000a0: 00 00 33 4a 31 31 a3 00 13 6e 65 74 5f 72 69 6d ..3J11...net_rim + 000000b0: 5f 62 62 5f 71 6d 5f 6d 73 6e 2d 36 00 00 00 34 _bb_qm_msn-6...4 + 000000c0: 4a 31 31 a3 00 13 6e 65 74 5f 72 69 6d 5f 62 62 J11...net_rim_bb + 000000d0: 5f 71 6d 5f 6d 73 6e 2d 37 00 00 00 35 4a 31 31 _qm_msn-7...5J11 + 000000e0: a3 00 13 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d ...net_rim_bb_qm + 000000f0: 5f 6d 73 6e 2d 35 00 00 00 36 4a 31 31 a3 00 13 _msn-5...6J11... + 00000100: 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f 6d 73 net_rim_bb_qm_ms + 00000110: 6e 2d 34 00 00 00 37 4a 31 31 a3 00 13 6e 65 74 n-4...7J11...net + 00000120: 5f 72 69 6d 5f 62 62 5f 71 6d 5f 6d 73 6e 2d 31 _rim_bb_qm_msn-1 + 00000130: 00 00 00 38 4a 31 31 a3 00 13 6e 65 74 5f 72 69 ...8J11...net_ri + 00000140: 6d 5f 62 62 5f 71 6d 5f 6d 73 6e 2d 38 00 00 00 m_bb_qm_msn-8... + 00000150: 39 4a 31 31 a3 00 13 6e 65 74 5f 72 69 6d 5f 62 9J11...net_rim_b + 00000160: 62 5f 71 6d 5f 6d 73 6e 2d 32 00 00 00 3a 4a 31 b_qm_msn-2...:J1 + 00000170: 31 a3 00 13 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 1...net_rim_bb_q + 00000180: 6d 5f 6d 73 6e 2d 33 00 00 00 3b 4a 31 31 be 00 m_msn-3...;J11.. + 00000190: 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f 6d .net_rim_bb_qm_m + 000001a0: 73 6e 5f 72 65 73 6f 75 72 63 65 5f 65 6e 00 00 sn_resource_en.. + 000001b0: 00 3c 4a 31 31 c8 00 1d 6e 65 74 5f 72 69 6d 5f .J@....S + 000001f0: 68 61 7a 61 6d 2d 33 00 00 00 3f 4a 40 a2 7f 00 hazam-3...?J@... + 00000200: 08 53 68 61 7a 61 6d 2d 35 00 00 00 40 4a 40 a2 .Shazam-5...@J@. + 00000210: 7f 00 08 53 68 61 7a 61 6d 2d 34 00 00 00 41 4a ...Shazam-4...AJ + 00000220: 40 a2 7f 00 08 53 68 61 7a 61 6d 2d 31 00 00 00 @....Shazam-1... + 00000230: 42 4a 40 a2 7f 00 08 53 68 61 7a 61 6d 2d 32 00 BJ@....Shazam-2. + 00000240: 00 00 b7 4a 17 54 84 00 25 6e 65 74 5f 72 69 6d ...J.T..%net_rim + 00000250: 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e _theme_precision + 00000260: 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 00 00 _zen_360x480_t.. + 00000270: 00 b8 4a 17 54 84 00 27 6e 65 74 5f 72 69 6d 5f ..J.T..'net_rim_ + 00000280: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 00000290: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 31 00 zen_360x480_t-1. + 000002a0: 00 00 b9 4a 17 54 84 00 27 6e 65 74 5f 72 69 6d ...J.T..'net_rim + 000002b0: 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e _theme_precision + 000002c0: 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 32 _zen_360x480_t-2 + 000002d0: 00 00 00 ba 4a 17 54 84 00 27 6e 65 74 5f 72 69 ....J.T..'net_ri + 000002e0: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 000002f0: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 00000300: 33 00 00 00 bb 4a 17 54 84 00 27 6e 65 74 5f 72 3....J.T..'net_r + 00000310: 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 im_theme_precisi + 00000320: 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 on_zen_360x480_t + 00000330: 2d 34 00 00 00 bc 4a 17 54 84 00 27 6e 65 74 5f -4....J.T..'net_ + 00000340: 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 rim_theme_precis + 00000350: 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f ion_zen_360x480_ + 00000360: 74 2d 35 00 00 00 bd 4a 17 54 84 00 27 6e 65 74 t-5....J.T..'net + 00000370: 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 _rim_theme_preci + 00000380: 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 sion_zen_360x480 + 00000390: 5f 74 2d 36 00 00 00 be 4a 17 54 84 00 27 6e 65 _t-6....J.T..'ne + 000003a0: 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 t_rim_theme_prec + 000003b0: 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 ision_zen_360x48 + 000003c0: 30 5f 74 2d 37 00 00 00 bf 0_t-7.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 84 + 00000000: 05 00 0b 00 00 05 8d 00 00 00 bf ........... +<<< URB 64 + 00000000: 00 00 0c 00 13 05 01 00 08 00 00 00 ............ +<<< URB 66 + 00000000: 05 00 06 00 03 ee ...... +<<< URB 67 + 00000000: 05 00 f2 03 00 00 00 14 00 00 00 bf 4a 17 54 84 ............J.T. + 00000010: 00 27 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .'net_rim_theme_ + 00000020: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 00000030: 30 78 34 38 30 5f 74 2d 38 00 00 00 c0 4a 17 54 0x480_t-8....J.T + 00000040: 84 00 27 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 ..'net_rim_theme + 00000050: 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 _precision_zen_3 + 00000060: 36 30 78 34 38 30 5f 74 2d 39 00 00 00 c1 4a 17 60x480_t-9....J. + 00000070: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 00000080: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 00000090: 33 36 30 78 34 38 30 5f 74 2d 31 30 00 00 00 c2 360x480_t-10.... + 000000a0: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 000000b0: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 000000c0: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 31 31 00 00 n_360x480_t-11.. + 000000d0: 00 c3 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 000000e0: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 000000f0: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 31 32 zen_360x480_t-12 + 00000100: 00 00 00 c4 4a 17 54 84 00 28 6e 65 74 5f 72 69 ....J.T..(net_ri + 00000110: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 00000120: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 00000130: 31 33 00 00 00 c5 4a 17 54 84 00 28 6e 65 74 5f 13....J.T..(net_ + 00000140: 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 rim_theme_precis + 00000150: 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f ion_zen_360x480_ + 00000160: 74 2d 31 34 00 00 00 c6 4a 17 54 84 00 28 6e 65 t-14....J.T..(ne + 00000170: 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 t_rim_theme_prec + 00000180: 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 ision_zen_360x48 + 00000190: 30 5f 74 2d 31 35 00 00 00 c7 4a 17 54 84 00 28 0_t-15....J.T..( + 000001a0: 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 net_rim_theme_pr + 000001b0: 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 ecision_zen_360x + 000001c0: 34 38 30 5f 74 2d 31 36 00 00 00 c8 4a 17 54 84 480_t-16....J.T. + 000001d0: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 000001e0: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 000001f0: 30 78 34 38 30 5f 74 2d 31 37 00 00 00 c9 4a 17 0x480_t-17....J. + 00000200: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 00000210: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 00000220: 33 36 30 78 34 38 30 5f 74 2d 31 38 00 00 00 ca 360x480_t-18.... + 00000230: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 00000240: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 00000250: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 31 39 00 00 n_360x480_t-19.. + 00000260: 00 cb 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 00000270: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 00000280: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 32 30 zen_360x480_t-20 + 00000290: 00 00 00 cc 4a 17 54 84 00 28 6e 65 74 5f 72 69 ....J.T..(net_ri + 000002a0: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 000002b0: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 000002c0: 32 31 00 00 00 cd 4a 17 54 84 00 28 6e 65 74 5f 21....J.T..(net_ + 000002d0: 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 rim_theme_precis + 000002e0: 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f ion_zen_360x480_ + 000002f0: 74 2d 32 32 00 00 00 ce 4a 17 54 84 00 28 6e 65 t-22....J.T..(ne + 00000300: 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 t_rim_theme_prec + 00000310: 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 ision_zen_360x48 + 00000320: 30 5f 74 2d 32 33 00 00 00 cf 4a 17 54 84 00 28 0_t-23....J.T..( + 00000330: 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 net_rim_theme_pr + 00000340: 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 ecision_zen_360x + 00000350: 34 38 30 5f 74 2d 32 34 00 00 00 d0 4a 17 54 84 480_t-24....J.T. + 00000360: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 00000370: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 00000380: 30 78 34 38 30 5f 74 2d 32 35 00 00 00 d1 4a 17 0x480_t-25....J. + 00000390: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 000003a0: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 000003b0: 33 36 30 78 34 38 30 5f 74 2d 32 36 00 00 00 d2 360x480_t-26.... + 000003c0: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 000003d0: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 000003e0: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 32 37 00 00 n_360x480_t-27.. + 000003f0: 00 d3 .. + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 88 + 00000000: 05 00 0b 00 00 05 8d 00 00 00 d3 ........... +<<< URB 68 + 00000000: 00 00 0c 00 13 05 01 00 09 00 00 00 ............ +<<< URB 70 + 00000000: 05 00 06 00 03 f0 ...... +<<< URB 71 + 00000000: 05 00 f4 03 00 00 00 14 00 00 00 d3 4a 17 54 84 ............J.T. + 00000010: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 00000020: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 00000030: 30 78 34 38 30 5f 74 2d 32 38 00 00 00 d4 4a 17 0x480_t-28....J. + 00000040: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 00000050: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 00000060: 33 36 30 78 34 38 30 5f 74 2d 32 39 00 00 00 d5 360x480_t-29.... + 00000070: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 00000080: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 00000090: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 33 30 00 00 n_360x480_t-30.. + 000000a0: 00 d6 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 000000b0: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 000000c0: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 33 31 zen_360x480_t-31 + 000000d0: 00 00 00 d7 4a 17 54 84 00 28 6e 65 74 5f 72 69 ....J.T..(net_ri + 000000e0: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 000000f0: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 00000100: 33 32 00 00 00 d8 4a 17 54 84 00 28 6e 65 74 5f 32....J.T..(net_ + 00000110: 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 rim_theme_precis + 00000120: 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f ion_zen_360x480_ + 00000130: 74 2d 33 33 00 00 00 d9 4a 17 54 84 00 28 6e 65 t-33....J.T..(ne + 00000140: 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 t_rim_theme_prec + 00000150: 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 ision_zen_360x48 + 00000160: 30 5f 74 2d 33 34 00 00 00 da 4a 17 54 84 00 28 0_t-34....J.T..( + 00000170: 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 net_rim_theme_pr + 00000180: 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 ecision_zen_360x + 00000190: 34 38 30 5f 74 2d 33 35 00 00 00 db 4a 17 54 84 480_t-35....J.T. + 000001a0: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 000001b0: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 000001c0: 30 78 34 38 30 5f 74 2d 33 36 00 00 00 dc 4a 17 0x480_t-36....J. + 000001d0: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 000001e0: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 000001f0: 33 36 30 78 34 38 30 5f 74 2d 33 37 00 00 00 dd 360x480_t-37.... + 00000200: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 00000210: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 00000220: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 33 38 00 00 n_360x480_t-38.. + 00000230: 00 de 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 00000240: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 00000250: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 33 39 zen_360x480_t-39 + 00000260: 00 00 00 df 4a 17 54 84 00 28 6e 65 74 5f 72 69 ....J.T..(net_ri + 00000270: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 00000280: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 00000290: 34 30 00 00 00 e0 4a 17 54 84 00 28 6e 65 74 5f 40....J.T..(net_ + 000002a0: 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 rim_theme_precis + 000002b0: 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f ion_zen_360x480_ + 000002c0: 74 2d 34 31 00 00 00 e1 4a 17 54 84 00 28 6e 65 t-41....J.T..(ne + 000002d0: 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 65 63 t_rim_theme_prec + 000002e0: 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 ision_zen_360x48 + 000002f0: 30 5f 74 2d 34 32 00 00 00 e2 4a 17 54 84 00 28 0_t-42....J.T..( + 00000300: 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f 70 72 net_rim_theme_pr + 00000310: 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 30 78 ecision_zen_360x + 00000320: 34 38 30 5f 74 2d 34 33 00 00 00 e3 4a 17 54 84 480_t-43....J.T. + 00000330: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 00000340: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 00000350: 30 78 34 38 30 5f 74 2d 34 34 00 00 00 e4 4a 17 0x480_t-44....J. + 00000360: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 00000370: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 00000380: 33 36 30 78 34 38 30 5f 74 2d 34 35 00 00 00 e5 360x480_t-45.... + 00000390: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 000003a0: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 000003b0: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 34 36 00 00 n_360x480_t-46.. + 000003c0: 00 e6 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 000003d0: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 000003e0: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 34 37 zen_360x480_t-47 + 000003f0: 00 00 00 e7 .... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 92 + 00000000: 05 00 0b 00 00 05 8d 00 00 00 e7 ........... +<<< URB 72 + 00000000: 00 00 0c 00 13 05 01 00 0a 00 00 00 ............ +<<< URB 74 + 00000000: 05 00 06 00 03 f0 ...... +<<< URB 75 + 00000000: 05 00 f4 03 00 00 00 1a 00 00 00 e7 4a 17 54 84 ............J.T. + 00000010: 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d 65 5f .(net_rim_theme_ + 00000020: 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f 33 36 precision_zen_36 + 00000030: 30 78 34 38 30 5f 74 2d 34 38 00 00 00 e8 4a 17 0x480_t-48....J. + 00000040: 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 65 6d T..(net_rim_them + 00000050: 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 6e 5f e_precision_zen_ + 00000060: 33 36 30 78 34 38 30 5f 74 2d 34 39 00 00 00 e9 360x480_t-49.... + 00000070: 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f 74 68 J.T..(net_rim_th + 00000080: 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f 7a 65 eme_precision_ze + 00000090: 6e 5f 33 36 30 78 34 38 30 5f 74 2d 35 30 00 00 n_360x480_t-50.. + 000000a0: 00 ea 4a 17 54 84 00 28 6e 65 74 5f 72 69 6d 5f ..J.T..(net_rim_ + 000000b0: 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f 6e 5f theme_precision_ + 000000c0: 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d 35 31 zen_360x480_t-51 + 000000d0: 00 00 00 eb 4a 17 54 84 00 28 6e 65 74 5f 72 69 ....J.T..(net_ri + 000000e0: 6d 5f 74 68 65 6d 65 5f 70 72 65 63 69 73 69 6f m_theme_precisio + 000000f0: 6e 5f 7a 65 6e 5f 33 36 30 78 34 38 30 5f 74 2d n_zen_360x480_t- + 00000100: 35 32 00 00 01 11 4a 17 55 86 00 1a 6e 65 74 5f 52....J.U...net_ + 00000110: 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 rim_bb_setupwiza + 00000120: 72 64 5f 61 70 70 00 00 01 12 4a 17 55 86 00 1d rd_app....J.U... + 00000130: 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 net_rim_bb_setup + 00000140: 77 69 7a 61 72 64 5f 61 70 70 2d 32 33 00 00 01 wizard_app-23... + 00000150: 13 4a 17 4b 2e 00 16 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 00000160: 62 5f 73 65 74 75 70 77 69 7a 61 72 64 00 00 01 b_setupwizard... + 00000170: 14 4a 17 4b 2e 00 18 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 00000180: 62 5f 73 65 74 75 70 77 69 7a 61 72 64 2d 31 00 b_setupwizard-1. + 00000190: 00 01 15 4a 17 49 f8 00 1b 6e 65 74 5f 72 69 6d ...J.I...net_rim + 000001a0: 5f 70 6c 61 7a 6d 69 63 5f 6d 65 64 69 61 65 6e _plazmic_mediaen + 000001b0: 67 69 6e 65 00 00 01 16 4a 17 4a 93 00 18 6e 65 gine....J.J...ne + 000001c0: 74 5f 72 69 6d 5f 62 62 5f 66 72 61 6d 65 77 6f t_rim_bb_framewo + 000001d0: 72 6b 5f 61 70 69 00 00 01 17 4a 17 4a 93 00 1a rk_api....J.J... + 000001e0: 6e 65 74 5f 72 69 6d 5f 62 62 5f 66 72 61 6d 65 net_rim_bb_frame + 000001f0: 77 6f 72 6b 5f 61 70 69 2d 32 00 00 01 18 4a 17 work_api-2....J. + 00000200: 4a 93 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 66 J...net_rim_bb_f + 00000210: 72 61 6d 65 77 6f 72 6b 5f 61 70 69 2d 31 00 00 ramework_api-1.. + 00000220: 01 19 4a 17 4a 93 00 1a 6e 65 74 5f 72 69 6d 5f ..J.J...net_rim_ + 00000230: 62 62 5f 66 72 61 6d 65 77 6f 72 6b 5f 61 70 69 bb_framework_api + 00000240: 2d 33 00 00 01 1a 4a 17 4b 00 00 18 6e 65 74 5f -3....J.K...net_ + 00000250: 72 69 6d 5f 62 62 5f 6c 6f 63 61 6c 65 72 65 6d rim_bb_localerem + 00000260: 6f 76 61 6c 00 00 01 1b 4a 17 4b 03 00 10 6e 65 oval....J.K...ne + 00000270: 74 5f 72 69 6d 5f 62 62 5f 76 6f 69 63 65 00 00 t_rim_bb_voice.. + 00000280: 01 1c 4a 17 4a eb 00 12 6e 65 74 5f 72 69 6d 5f ..J.J...net_rim_ + 00000290: 62 62 5f 6f 70 74 69 6f 6e 73 00 00 01 1d 4a 17 bb_options....J. + 000002a0: 55 86 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 U...net_rim_bb_s + 000002b0: 65 74 75 70 77 69 7a 61 72 64 5f 61 70 70 2d 31 etupwizard_app-1 + 000002c0: 00 00 01 1e 4a 17 55 86 00 1c 6e 65 74 5f 72 69 ....J.U...net_ri + 000002d0: 6d 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 72 64 m_bb_setupwizard + 000002e0: 5f 61 70 70 2d 32 00 00 01 1f 4a 17 55 86 00 1c _app-2....J.U... + 000002f0: 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 net_rim_bb_setup + 00000300: 77 69 7a 61 72 64 5f 61 70 70 2d 33 00 00 01 20 wizard_app-3... + 00000310: 4a 17 55 86 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 J.U...net_rim_bb + 00000320: 5f 73 65 74 75 70 77 69 7a 61 72 64 5f 61 70 70 _setupwizard_app + 00000330: 2d 34 00 00 01 21 4a 17 55 86 00 1c 6e 65 74 5f -4...!J.U...net_ + 00000340: 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 rim_bb_setupwiza + 00000350: 72 64 5f 61 70 70 2d 35 00 00 01 22 4a 17 55 86 rd_app-5..."J.U. + 00000360: 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 ..net_rim_bb_set + 00000370: 75 70 77 69 7a 61 72 64 5f 61 70 70 2d 36 00 00 upwizard_app-6.. + 00000380: 01 23 4a 17 55 86 00 1c 6e 65 74 5f 72 69 6d 5f .#J.U...net_rim_ + 00000390: 62 62 5f 73 65 74 75 70 77 69 7a 61 72 64 5f 61 bb_setupwizard_a + 000003a0: 70 70 2d 37 00 00 01 24 4a 17 55 86 00 1c 6e 65 pp-7...$J.U...ne + 000003b0: 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 69 t_rim_bb_setupwi + 000003c0: 7a 61 72 64 5f 61 70 70 2d 38 00 00 01 25 4a 17 zard_app-8...%J. + 000003d0: 55 86 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 U...net_rim_bb_s + 000003e0: 65 74 75 70 77 69 7a 61 72 64 5f 61 70 70 2d 39 etupwizard_app-9 + 000003f0: 00 00 01 26 ...& + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 96 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 26 ..........& +<<< URB 76 + 00000000: 00 00 0c 00 13 05 01 00 0b 00 00 00 ............ +<<< URB 78 + 00000000: 05 00 06 00 03 d7 ...... +<<< URB 79 + 00000000: 05 00 db 03 00 00 00 19 00 00 01 26 4a 17 55 86 ...........&J.U. + 00000010: 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 ..net_rim_bb_set + 00000020: 75 70 77 69 7a 61 72 64 5f 61 70 70 2d 31 30 00 upwizard_app-10. + 00000030: 00 01 27 4a 17 55 86 00 1d 6e 65 74 5f 72 69 6d ..'J.U...net_rim + 00000040: 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 72 64 5f _bb_setupwizard_ + 00000050: 61 70 70 2d 31 31 00 00 01 28 4a 17 55 86 00 1d app-11...(J.U... + 00000060: 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 net_rim_bb_setup + 00000070: 77 69 7a 61 72 64 5f 61 70 70 2d 31 32 00 00 01 wizard_app-12... + 00000080: 29 4a 17 55 86 00 1d 6e 65 74 5f 72 69 6d 5f 62 )J.U...net_rim_b + 00000090: 62 5f 73 65 74 75 70 77 69 7a 61 72 64 5f 61 70 b_setupwizard_ap + 000000a0: 70 2d 31 33 00 00 01 2a 4a 17 55 86 00 1d 6e 65 p-13...*J.U...ne + 000000b0: 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 69 t_rim_bb_setupwi + 000000c0: 7a 61 72 64 5f 61 70 70 2d 31 34 00 00 01 2b 4a zard_app-14...+J + 000000d0: 17 55 86 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f .U...net_rim_bb_ + 000000e0: 73 65 74 75 70 77 69 7a 61 72 64 5f 61 70 70 2d setupwizard_app- + 000000f0: 31 35 00 00 01 2c 4a 17 55 86 00 1d 6e 65 74 5f 15...,J.U...net_ + 00000100: 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 rim_bb_setupwiza + 00000110: 72 64 5f 61 70 70 2d 31 36 00 00 01 2d 4a 17 55 rd_app-16...-J.U + 00000120: 86 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 ...net_rim_bb_se + 00000130: 74 75 70 77 69 7a 61 72 64 5f 61 70 70 2d 31 37 tupwizard_app-17 + 00000140: 00 00 01 2e 4a 17 55 86 00 1d 6e 65 74 5f 72 69 ....J.U...net_ri + 00000150: 6d 5f 62 62 5f 73 65 74 75 70 77 69 7a 61 72 64 m_bb_setupwizard + 00000160: 5f 61 70 70 2d 31 38 00 00 01 2f 4a 17 55 86 00 _app-18.../J.U.. + 00000170: 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 .net_rim_bb_setu + 00000180: 70 77 69 7a 61 72 64 5f 61 70 70 2d 31 39 00 00 pwizard_app-19.. + 00000190: 01 30 4a 17 55 86 00 1d 6e 65 74 5f 72 69 6d 5f .0J.U...net_rim_ + 000001a0: 62 62 5f 73 65 74 75 70 77 69 7a 61 72 64 5f 61 bb_setupwizard_a + 000001b0: 70 70 2d 32 30 00 00 01 31 4a 17 55 86 00 1d 6e pp-20...1J.U...n + 000001c0: 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 75 70 77 et_rim_bb_setupw + 000001d0: 69 7a 61 72 64 5f 61 70 70 2d 32 31 00 00 01 32 izard_app-21...2 + 000001e0: 4a 17 55 86 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 J.U...net_rim_bb + 000001f0: 5f 73 65 74 75 70 77 69 7a 61 72 64 5f 61 70 70 _setupwizard_app + 00000200: 2d 32 32 00 00 01 33 4a 17 4a 93 00 1b 6e 65 74 -22...3J.J...net + 00000210: 5f 72 69 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f _rim_font_latin_ + 00000220: 74 72 75 65 74 79 70 65 00 00 01 34 4a 17 4a 93 truetype...4J.J. + 00000230: 00 1d 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 00000240: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 31 00 atin_truetype-1. + 00000250: 00 01 35 4a 17 4a 93 00 1d 6e 65 74 5f 72 69 6d ..5J.J...net_rim + 00000260: 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 65 _font_latin_true + 00000270: 74 79 70 65 2d 32 00 00 01 36 4a 17 4a 93 00 1d type-2...6J.J... + 00000280: 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c 61 74 net_rim_font_lat + 00000290: 69 6e 5f 74 72 75 65 74 79 70 65 2d 33 00 00 01 in_truetype-3... + 000002a0: 37 4a 17 4a 93 00 1d 6e 65 74 5f 72 69 6d 5f 66 7J.J...net_rim_f + 000002b0: 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 65 74 79 ont_latin_truety + 000002c0: 70 65 2d 34 00 00 01 38 4a 17 4a 93 00 1d 6e 65 pe-4...8J.J...ne + 000002d0: 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e t_rim_font_latin + 000002e0: 5f 74 72 75 65 74 79 70 65 2d 35 00 00 01 39 4a _truetype-5...9J + 000002f0: 17 4a 93 00 1d 6e 65 74 5f 72 69 6d 5f 66 6f 6e .J...net_rim_fon + 00000300: 74 5f 6c 61 74 69 6e 5f 74 72 75 65 74 79 70 65 t_latin_truetype + 00000310: 2d 36 00 00 01 3a 4a 17 4a 93 00 1d 6e 65 74 5f -6...:J.J...net_ + 00000320: 72 69 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 rim_font_latin_t + 00000330: 72 75 65 74 79 70 65 2d 37 00 00 01 3b 4a 17 4a ruetype-7...;J.J + 00000340: 93 00 1d 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f ...net_rim_font_ + 00000350: 6c 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 38 latin_truetype-8 + 00000360: 00 00 01 3c 4a 17 4a 93 00 1d 6e 65 74 5f 72 69 ...J.J...net_rim + 000003c0: 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 65 _font_latin_true + 000003d0: 74 79 70 65 2d 31 31 00 00 01 3f type-11...? + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 100 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 3f ..........? +<<< URB 80 + 00000000: 00 00 0c 00 13 05 01 00 0c 00 00 00 ............ +<<< URB 82 + 00000000: 05 00 06 00 03 e4 ...... +<<< URB 83 + 00000000: 05 00 e8 03 00 00 00 1f 00 00 01 3f 4a 17 4a 93 ...........?J.J. + 00000010: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 00000020: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 31 32 atin_truetype-12 + 00000030: 00 00 01 40 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...@J.J...net_ri + 00000040: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 00000050: 65 74 79 70 65 2d 31 33 00 00 01 41 4a 17 4a 93 etype-13...AJ.J. + 00000060: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 00000070: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 31 34 atin_truetype-14 + 00000080: 00 00 01 42 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...BJ.J...net_ri + 00000090: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 000000a0: 65 74 79 70 65 2d 31 35 00 00 01 43 4a 17 4a 93 etype-15...CJ.J. + 000000b0: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 000000c0: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 31 36 atin_truetype-16 + 000000d0: 00 00 01 44 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...DJ.J...net_ri + 000000e0: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 000000f0: 65 74 79 70 65 2d 31 37 00 00 01 45 4a 17 4a 93 etype-17...EJ.J. + 00000100: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 00000110: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 31 38 atin_truetype-18 + 00000120: 00 00 01 46 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...FJ.J...net_ri + 00000130: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 00000140: 65 74 79 70 65 2d 31 39 00 00 01 47 4a 17 4a 93 etype-19...GJ.J. + 00000150: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 00000160: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 32 30 atin_truetype-20 + 00000170: 00 00 01 48 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...HJ.J...net_ri + 00000180: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 00000190: 65 74 79 70 65 2d 32 31 00 00 01 49 4a 17 4a 93 etype-21...IJ.J. + 000001a0: 00 1e 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 6c ..net_rim_font_l + 000001b0: 61 74 69 6e 5f 74 72 75 65 74 79 70 65 2d 32 32 atin_truetype-22 + 000001c0: 00 00 01 4a 4a 17 4a 93 00 1e 6e 65 74 5f 72 69 ...JJ.J...net_ri + 000001d0: 6d 5f 66 6f 6e 74 5f 6c 61 74 69 6e 5f 74 72 75 m_font_latin_tru + 000001e0: 65 74 79 70 65 2d 32 33 00 00 01 4b 4a 17 50 bd etype-23...KJ.P. + 000001f0: 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ..net_rim_bb_bro + 00000200: 77 73 65 72 5f 6d 61 6e 67 6f 00 00 01 4c 4a 17 wser_mango...LJ. + 00000210: 49 f2 00 0f 6e 65 74 5f 72 69 6d 5f 78 6d 6c 5f I...net_rim_xml_ + 00000220: 6f 72 67 00 00 01 4d 4a 17 51 dd 00 0a 6e 65 74 org...MJ.Q...net + 00000230: 5f 72 69 6d 5f 6f 73 00 00 01 4e 4a 17 51 dd 00 _rim_os...NJ.Q.. + 00000240: 0c 6e 65 74 5f 72 69 6d 5f 6f 73 2d 38 00 00 01 .net_rim_os-8... + 00000250: 4f 4a 17 51 dd 00 0c 6e 65 74 5f 72 69 6d 5f 6f OJ.Q...net_rim_o + 00000260: 73 2d 35 00 00 01 50 4a 17 51 dd 00 0c 6e 65 74 s-5...PJ.Q...net + 00000270: 5f 72 69 6d 5f 6f 73 2d 39 00 00 01 51 4a 17 51 _rim_os-9...QJ.Q + 00000280: dd 00 0c 6e 65 74 5f 72 69 6d 5f 6f 73 2d 31 00 ...net_rim_os-1. + 00000290: 00 01 52 4a 17 51 dd 00 0c 6e 65 74 5f 72 69 6d ..RJ.Q...net_rim + 000002a0: 5f 6f 73 2d 36 00 00 01 53 4a 17 51 dd 00 0c 6e _os-6...SJ.Q...n + 000002b0: 65 74 5f 72 69 6d 5f 6f 73 2d 37 00 00 01 54 4a et_rim_os-7...TJ + 000002c0: 17 51 dd 00 0c 6e 65 74 5f 72 69 6d 5f 6f 73 2d .Q...net_rim_os- + 000002d0: 32 00 00 01 55 4a 17 51 dd 00 0c 6e 65 74 5f 72 2...UJ.Q...net_r + 000002e0: 69 6d 5f 6f 73 2d 33 00 00 01 56 4a 17 51 dd 00 im_os-3...VJ.Q.. + 000002f0: 0c 6e 65 74 5f 72 69 6d 5f 6f 73 2d 34 00 00 01 .net_rim_os-4... + 00000300: 57 4a 17 50 bd 00 1a 6e 65 74 5f 72 69 6d 5f 62 WJ.P...net_rim_b + 00000310: 62 5f 62 72 6f 77 73 65 72 5f 6d 61 6e 67 6f 2d b_browser_mango- + 00000320: 31 00 00 01 58 4a 17 50 bd 00 1a 6e 65 74 5f 72 1...XJ.P...net_r + 00000330: 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 6d 61 im_bb_browser_ma + 00000340: 6e 67 6f 2d 37 00 00 01 59 4a 17 50 bd 00 1a 6e ngo-7...YJ.P...n + 00000350: 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 et_rim_bb_browse + 00000360: 72 5f 6d 61 6e 67 6f 2d 38 00 00 01 5a 4a 17 4b r_mango-8...ZJ.K + 00000370: 4e 00 12 6e 65 74 5f 72 69 6d 5f 65 63 6d 61 73 N..net_rim_ecmas + 00000380: 63 72 69 70 74 00 00 01 5b 4a 17 4b 4e 00 14 6e cript...[J.KN..n + 00000390: 65 74 5f 72 69 6d 5f 65 63 6d 61 73 63 72 69 70 et_rim_ecmascrip + 000003a0: 74 2d 31 00 00 01 5c 4a 17 4b 4b 00 19 6e 65 74 t-1...\J.KK..net + 000003b0: 5f 72 69 6d 5f 65 63 6d 61 73 63 72 69 70 74 5f _rim_ecmascript_ + 000003c0: 72 65 67 65 78 70 00 00 01 5d 4a 17 4b 4e 00 14 regexp...]J.KN.. + 000003d0: 6e 65 74 5f 72 69 6d 5f 65 63 6d 61 73 63 72 69 net_rim_ecmascri + 000003e0: 70 74 2d 32 00 00 01 5e pt-2...^ + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 104 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 5e ..........^ +<<< URB 84 + 00000000: 00 00 0c 00 13 05 01 00 0d 00 00 00 ............ +<<< URB 86 + 00000000: 05 00 06 00 03 e6 ...... +<<< URB 87 + 00000000: 05 00 ea 03 00 00 00 1f 00 00 01 5e 4a 17 50 bd ...........^J.P. + 00000010: 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ..net_rim_bb_bro + 00000020: 77 73 65 72 5f 6d 61 6e 67 6f 2d 32 00 00 01 5f wser_mango-2..._ + 00000030: 4a 17 50 bd 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 J.P...net_rim_bb + 00000040: 5f 62 72 6f 77 73 65 72 5f 6d 61 6e 67 6f 2d 39 _browser_mango-9 + 00000050: 00 00 01 60 4a 17 50 bd 00 1a 6e 65 74 5f 72 69 ...`J.P...net_ri + 00000060: 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 6d 61 6e m_bb_browser_man + 00000070: 67 6f 2d 34 00 00 01 61 4a 17 49 ff 00 0d 6e 65 go-4...aJ.I...ne + 00000080: 74 5f 72 69 6d 5f 73 61 74 73 61 00 00 01 62 4a t_rim_satsa...bJ + 00000090: 17 50 bd 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f .P...net_rim_bb_ + 000000a0: 62 72 6f 77 73 65 72 5f 6d 61 6e 67 6f 2d 33 00 browser_mango-3. + 000000b0: 00 01 63 4a 17 50 bd 00 1a 6e 65 74 5f 72 69 6d ..cJ.P...net_rim + 000000c0: 5f 62 62 5f 62 72 6f 77 73 65 72 5f 6d 61 6e 67 _bb_browser_mang + 000000d0: 6f 2d 35 00 00 01 64 4a 17 50 bd 00 1a 6e 65 74 o-5...dJ.P...net + 000000e0: 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f _rim_bb_browser_ + 000000f0: 6d 61 6e 67 6f 2d 36 00 00 01 65 4a 17 4a 01 00 mango-6...eJ.J.. + 00000100: 0b 6e 65 74 5f 72 69 6d 5f 74 69 64 00 00 01 66 .net_rim_tid...f + 00000110: 4a 17 4a 01 00 0d 6e 65 74 5f 72 69 6d 5f 74 69 J.J...net_rim_ti + 00000120: 64 2d 31 00 00 01 67 4a 17 4a 01 00 0d 6e 65 74 d-1...gJ.J...net + 00000130: 5f 72 69 6d 5f 74 69 64 2d 33 00 00 01 68 4a 17 _rim_tid-3...hJ. + 00000140: 4a 01 00 0d 6e 65 74 5f 72 69 6d 5f 74 69 64 2d J...net_rim_tid- + 00000150: 32 00 00 01 69 4a 17 54 93 00 19 6e 65 74 5f 72 2...iJ.T...net_r + 00000160: 69 6d 5f 62 62 5f 61 70 70 73 5f 66 72 61 6d 65 im_bb_apps_frame + 00000170: 77 6f 72 6b 00 00 01 6a 4a 17 54 93 00 1b 6e 65 work...jJ.T...ne + 00000180: 74 5f 72 69 6d 5f 62 62 5f 61 70 70 73 5f 66 72 t_rim_bb_apps_fr + 00000190: 61 6d 65 77 6f 72 6b 2d 33 00 00 01 6b 4a 17 54 amework-3...kJ.T + 000001a0: 93 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 70 ...net_rim_bb_ap + 000001b0: 70 73 5f 66 72 61 6d 65 77 6f 72 6b 2d 34 00 00 ps_framework-4.. + 000001c0: 01 6c 4a 17 54 93 00 1b 6e 65 74 5f 72 69 6d 5f .lJ.T...net_rim_ + 000001d0: 62 62 5f 61 70 70 73 5f 66 72 61 6d 65 77 6f 72 bb_apps_framewor + 000001e0: 6b 2d 35 00 00 01 6d 4a 17 54 93 00 1b 6e 65 74 k-5...mJ.T...net + 000001f0: 5f 72 69 6d 5f 62 62 5f 61 70 70 73 5f 66 72 61 _rim_bb_apps_fra + 00000200: 6d 65 77 6f 72 6b 2d 31 00 00 01 6e 4a 17 54 93 mework-1...nJ.T. + 00000210: 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 70 70 ..net_rim_bb_app + 00000220: 73 5f 66 72 61 6d 65 77 6f 72 6b 2d 32 00 00 01 s_framework-2... + 00000230: 6f 4a 17 4b 03 00 14 6e 65 74 5f 72 69 6d 5f 62 oJ.K...net_rim_b + 00000240: 62 5f 6d 65 73 73 61 67 69 6e 67 00 00 01 70 4a b_messaging...pJ + 00000250: 17 4b 03 00 16 6e 65 74 5f 72 69 6d 5f 62 62 5f .K...net_rim_bb_ + 00000260: 6d 65 73 73 61 67 69 6e 67 2d 31 00 00 01 71 4a messaging-1...qJ + 00000270: 17 4a e8 00 11 6e 65 74 5f 72 69 6d 5f 62 62 5f .J...net_rim_bb_ + 00000280: 73 65 61 72 63 68 00 00 01 72 4a 17 4a f7 00 16 search...rJ.J... + 00000290: 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 64 64 72 65 net_rim_bb_addre + 000002a0: 73 73 62 6f 6f 6b 00 00 01 73 4a 17 4b 09 00 11 ssbook...sJ.K... + 000002b0: 6e 65 74 5f 72 69 6d 5f 62 62 5f 6d 6f 64 65 6c net_rim_bb_model + 000002c0: 73 00 00 01 74 4a 17 53 9f 00 15 6e 65 74 5f 72 s...tJ.S...net_r + 000002d0: 69 6d 5f 73 65 72 69 61 6c 66 6f 72 6d 61 74 73 im_serialformats + 000002e0: 00 00 01 75 4a 17 52 a2 00 10 6e 65 74 5f 72 69 ...uJ.R...net_ri + 000002f0: 6d 5f 63 72 79 70 74 6f 5f 31 00 00 01 76 4a 17 m_crypto_1...vJ. + 00000300: 52 a2 00 12 6e 65 74 5f 72 69 6d 5f 63 72 79 70 R...net_rim_cryp + 00000310: 74 6f 5f 31 2d 31 00 00 01 77 4a 17 52 a2 00 12 to_1-1...wJ.R... + 00000320: 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f 31 net_rim_crypto_1 + 00000330: 2d 32 00 00 01 78 4a 17 52 a2 00 12 6e 65 74 5f -2...xJ.R...net_ + 00000340: 72 69 6d 5f 63 72 79 70 74 6f 5f 31 2d 33 00 00 rim_crypto_1-3.. + 00000350: 01 79 4a 17 53 ae 00 21 6e 65 74 5f 72 69 6d 5f .yJ.S..!net_rim_ + 00000360: 62 62 5f 62 72 6f 77 73 65 72 5f 6e 69 6e 6a 61 bb_browser_ninja + 00000370: 69 6e 74 65 72 66 61 63 65 00 00 01 7a 4a 17 53 interface...zJ.S + 00000380: 9f 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 ...net_rim_bb_br + 00000390: 6f 77 73 65 72 5f 66 69 65 6c 64 5f 61 70 69 00 owser_field_api. + 000003a0: 00 01 7b 4a 17 49 f4 00 13 6e 65 74 5f 72 69 6d ..{J.I...net_rim + 000003b0: 5f 6c 6f 63 61 74 69 6f 6e 61 70 69 00 00 01 7c _locationapi...| + 000003c0: 4a 17 54 ff 00 20 6e 65 74 5f 72 69 6d 5f 62 62 J.T.. net_rim_bb + 000003d0: 5f 62 72 6f 77 73 65 72 5f 72 65 6e 64 65 72 69 _browser_renderi + 000003e0: 6e 67 5f 6c 69 62 00 00 01 7d ng_lib...} + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 108 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 7d ..........} +<<< URB 88 + 00000000: 00 00 0c 00 13 05 01 00 0e 00 00 00 ............ +<<< URB 90 + 00000000: 05 00 06 00 03 de ...... +<<< URB 91 + 00000000: 05 00 e2 03 00 00 00 1d 00 00 01 7d 4a 17 54 ff ...........}J.T. + 00000010: 00 22 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ."net_rim_bb_bro + 00000020: 77 73 65 72 5f 72 65 6e 64 65 72 69 6e 67 5f 6c wser_rendering_l + 00000030: 69 62 2d 34 00 00 01 7e 4a 17 54 ff 00 22 6e 65 ib-4...~J.T.."ne + 00000040: 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 t_rim_bb_browser + 00000050: 5f 72 65 6e 64 65 72 69 6e 67 5f 6c 69 62 2d 36 _rendering_lib-6 + 00000060: 00 00 01 7f 4a 17 54 ff 00 22 6e 65 74 5f 72 69 ....J.T.."net_ri + 00000070: 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 72 65 6e m_bb_browser_ren + 00000080: 64 65 72 69 6e 67 5f 6c 69 62 2d 31 00 00 01 80 dering_lib-1.... + 00000090: 4a 17 54 ff 00 22 6e 65 74 5f 72 69 6d 5f 62 62 J.T.."net_rim_bb + 000000a0: 5f 62 72 6f 77 73 65 72 5f 72 65 6e 64 65 72 69 _browser_renderi + 000000b0: 6e 67 5f 6c 69 62 2d 33 00 00 01 81 4a 17 54 ff ng_lib-3....J.T. + 000000c0: 00 22 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ."net_rim_bb_bro + 000000d0: 77 73 65 72 5f 72 65 6e 64 65 72 69 6e 67 5f 6c wser_rendering_l + 000000e0: 69 62 2d 32 00 00 01 82 4a 17 54 ff 00 22 6e 65 ib-2....J.T.."ne + 000000f0: 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 t_rim_bb_browser + 00000100: 5f 72 65 6e 64 65 72 69 6e 67 5f 6c 69 62 2d 35 _rendering_lib-5 + 00000110: 00 00 01 83 4a 17 54 ff 00 22 6e 65 74 5f 72 69 ....J.T.."net_ri + 00000120: 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 72 65 6e m_bb_browser_ren + 00000130: 64 65 72 69 6e 67 5f 6c 69 62 2d 37 00 00 01 84 dering_lib-7.... + 00000140: 4a 17 4a 72 00 0b 6e 65 74 5f 72 69 6d 5f 78 6d J.Jr..net_rim_xm + 00000150: 6c 00 00 01 85 4a 17 4a fd 00 12 6e 65 74 5f 72 l....J.J...net_r + 00000160: 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 00 00 01 im_bb_browser... + 00000170: 86 4a 17 4b 0f 00 17 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 00000180: 62 5f 70 72 6f 66 69 6c 65 73 5f 6c 69 62 00 00 b_profiles_lib.. + 00000190: 01 87 4a 17 4b 0f 00 19 6e 65 74 5f 72 69 6d 5f ..J.K...net_rim_ + 000001a0: 62 62 5f 70 72 6f 66 69 6c 65 73 5f 6c 69 62 2d bb_profiles_lib- + 000001b0: 31 00 00 01 88 4a 17 4b 09 00 16 6e 65 74 5f 72 1....J.K...net_r + 000001c0: 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f 6d 6f 64 65 im_bb_phone_mode + 000001d0: 6c 00 00 01 89 4a 17 4a ec 00 19 6e 65 74 5f 72 l....J.J...net_r + 000001e0: 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f 72 65 73 6f im_bb_phone_reso + 000001f0: 75 72 63 65 00 00 01 8a 4a 17 4a ec 00 1b 6e 65 urce....J.J...ne + 00000200: 74 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f 72 t_rim_bb_phone_r + 00000210: 65 73 6f 75 72 63 65 2d 31 00 00 01 8b 4a 17 4a esource-1....J.J + 00000220: ec 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 68 ...net_rim_bb_ph + 00000230: 6f 6e 65 5f 72 65 73 6f 75 72 63 65 2d 32 00 00 one_resource-2.. + 00000240: 01 8c 4a 17 4b 00 00 17 6e 65 74 5f 72 69 6d 5f ..J.K...net_rim_ + 00000250: 62 62 5f 71 75 69 63 6b 63 6f 6e 74 61 63 74 00 bb_quickcontact. + 00000260: 00 01 8d 4a 17 4b 15 00 14 6e 65 74 5f 72 69 6d ...J.K...net_rim + 00000270: 5f 62 62 5f 70 68 6f 6e 65 5f 61 70 69 00 00 01 _bb_phone_api... + 00000280: 8e 4a 17 4b 15 00 16 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 00000290: 62 5f 70 68 6f 6e 65 5f 61 70 69 2d 31 00 00 01 b_phone_api-1... + 000002a0: 8f 4a 17 4b 15 00 16 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 000002b0: 62 5f 70 68 6f 6e 65 5f 61 70 69 2d 34 00 00 01 b_phone_api-4... + 000002c0: 90 4a 17 4b 15 00 16 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 000002d0: 62 5f 70 68 6f 6e 65 5f 61 70 69 2d 33 00 00 01 b_phone_api-3... + 000002e0: 91 4a 17 4b 15 00 16 6e 65 74 5f 72 69 6d 5f 62 .J.K...net_rim_b + 000002f0: 62 5f 70 68 6f 6e 65 5f 61 70 69 2d 32 00 00 01 b_phone_api-2... + 00000300: 92 4a 17 55 88 00 0e 6e 65 74 5f 72 69 6d 5f 62 .J.U...net_rim_b + 00000310: 62 5f 6c 62 73 00 00 01 93 4a 17 53 a6 00 12 6e b_lbs....J.S...n + 00000320: 65 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 5f 61 70 et_rim_bb_lbs_ap + 00000330: 69 00 00 01 94 4a 17 4b 2c 00 11 6e 65 74 5f 72 i....J.K,..net_r + 00000340: 69 6d 5f 62 6c 75 65 74 6f 6f 74 68 00 00 01 95 im_bluetooth.... + 00000350: 4a 17 4b 2c 00 13 6e 65 74 5f 72 69 6d 5f 62 6c J.K,..net_rim_bl + 00000360: 75 65 74 6f 6f 74 68 2d 31 00 00 01 96 4a 17 55 uetooth-1....J.U + 00000370: 88 00 10 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c 62 ...net_rim_bb_lb + 00000380: 73 2d 39 00 00 01 97 4a 17 55 88 00 10 6e 65 74 s-9....J.U...net + 00000390: 5f 72 69 6d 5f 62 62 5f 6c 62 73 2d 36 00 00 01 _rim_bb_lbs-6... + 000003a0: 98 4a 17 54 e4 00 1d 6e 65 74 5f 72 69 6d 5f 62 .J.T...net_rim_b + 000003b0: 62 5f 61 64 64 72 65 73 73 62 6f 6f 6b 5f 6d 6f b_addressbook_mo + 000003c0: 64 65 6c 73 00 00 01 99 4a 17 55 88 00 10 6e 65 dels....J.U...ne + 000003d0: 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 2d 38 00 00 t_rim_bb_lbs-8.. + 000003e0: 01 9a .. + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 112 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 9a ........... +<<< URB 92 + 00000000: 00 00 0c 00 13 05 01 00 0f 00 00 00 ............ +<<< URB 94 + 00000000: 05 00 06 00 03 b6 ...... +<<< URB 95 + 00000000: 05 00 ba 03 00 00 00 13 00 00 01 9a 4a 17 55 88 ............J.U. + 00000010: 00 10 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 ..net_rim_bb_lbs + 00000020: 2d 31 00 00 01 9b 4a 17 55 88 00 10 6e 65 74 5f -1....J.U...net_ + 00000030: 72 69 6d 5f 62 62 5f 6c 62 73 2d 37 00 00 01 9c rim_bb_lbs-7.... + 00000040: 4a 17 55 88 00 10 6e 65 74 5f 72 69 6d 5f 62 62 J.U...net_rim_bb + 00000050: 5f 6c 62 73 2d 35 00 00 01 9d 4a 17 55 88 00 10 _lbs-5....J.U... + 00000060: 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 2d 32 net_rim_bb_lbs-2 + 00000070: 00 00 01 9e 4a 17 55 88 00 10 6e 65 74 5f 72 69 ....J.U...net_ri + 00000080: 6d 5f 62 62 5f 6c 62 73 2d 33 00 00 01 9f 4a 17 m_bb_lbs-3....J. + 00000090: 55 88 00 10 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c U...net_rim_bb_l + 000000a0: 62 73 2d 34 00 00 01 a0 4a 17 53 a6 00 14 6e 65 bs-4....J.S...ne + 000000b0: 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 5f 61 70 69 t_rim_bb_lbs_api + 000000c0: 5f 32 00 00 01 a1 4a 17 4f de 00 33 6e 65 74 5f _2....J.O..3net_ + 000000d0: 72 69 6d 5f 64 65 76 69 63 65 5f 61 70 70 73 5f rim_device_apps_ + 000000e0: 67 61 6d 65 73 5f 77 6f 72 64 6d 6f 6c 65 5f 67 games_wordmole_g + 000000f0: 72 61 70 68 69 63 73 5f 74 68 75 6e 64 65 72 00 raphics_thunder. + 00000100: 00 01 a2 4a 17 4f de 00 36 6e 65 74 5f 72 69 6d ...J.O..6net_rim + 00000110: 5f 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d _device_apps_gam + 00000120: 65 73 5f 77 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 es_wordmole_grap + 00000130: 68 69 63 73 5f 74 68 75 6e 64 65 72 2d 31 32 00 hics_thunder-12. + 00000140: 00 01 a3 4a 17 4f de 00 35 6e 65 74 5f 72 69 6d ...J.O..5net_rim + 00000150: 5f 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d _device_apps_gam + 00000160: 65 73 5f 77 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 es_wordmole_grap + 00000170: 68 69 63 73 5f 74 68 75 6e 64 65 72 2d 31 00 00 hics_thunder-1.. + 00000180: 01 a4 4a 17 4f de 00 35 6e 65 74 5f 72 69 6d 5f ..J.O..5net_rim_ + 00000190: 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 device_apps_game + 000001a0: 73 5f 77 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 68 s_wordmole_graph + 000001b0: 69 63 73 5f 74 68 75 6e 64 65 72 2d 32 00 00 01 ics_thunder-2... + 000001c0: a5 4a 17 4f de 00 35 6e 65 74 5f 72 69 6d 5f 64 .J.O..5net_rim_d + 000001d0: 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 evice_apps_games + 000001e0: 5f 77 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 68 69 _wordmole_graphi + 000001f0: 63 73 5f 74 68 75 6e 64 65 72 2d 33 00 00 01 a6 cs_thunder-3.... + 00000200: 4a 17 4f de 00 35 6e 65 74 5f 72 69 6d 5f 64 65 J.O..5net_rim_de + 00000210: 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f vice_apps_games_ + 00000220: 77 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 68 69 63 wordmole_graphic + 00000230: 73 5f 74 68 75 6e 64 65 72 2d 34 00 00 01 a7 4a s_thunder-4....J + 00000240: 17 4f de 00 35 6e 65 74 5f 72 69 6d 5f 64 65 76 .O..5net_rim_dev + 00000250: 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 ice_apps_games_w + 00000260: 6f 72 64 6d 6f 6c 65 5f 67 72 61 70 68 69 63 73 ordmole_graphics + 00000270: 5f 74 68 75 6e 64 65 72 2d 35 00 00 01 a8 4a 17 _thunder-5....J. + 00000280: 4f de 00 35 6e 65 74 5f 72 69 6d 5f 64 65 76 69 O..5net_rim_devi + 00000290: 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f ce_apps_games_wo + 000002a0: 72 64 6d 6f 6c 65 5f 67 72 61 70 68 69 63 73 5f rdmole_graphics_ + 000002b0: 74 68 75 6e 64 65 72 2d 36 00 00 01 a9 4a 17 4f thunder-6....J.O + 000002c0: de 00 35 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 ..5net_rim_devic + 000002d0: 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 e_apps_games_wor + 000002e0: 64 6d 6f 6c 65 5f 67 72 61 70 68 69 63 73 5f 74 dmole_graphics_t + 000002f0: 68 75 6e 64 65 72 2d 37 00 00 01 aa 4a 17 4f de hunder-7....J.O. + 00000300: 00 35 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 .5net_rim_device + 00000310: 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 _apps_games_word + 00000320: 6d 6f 6c 65 5f 67 72 61 70 68 69 63 73 5f 74 68 mole_graphics_th + 00000330: 75 6e 64 65 72 2d 38 00 00 01 ab 4a 17 4f de 00 under-8....J.O.. + 00000340: 35 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 5f 5net_rim_device_ + 00000350: 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 6d apps_games_wordm + 00000360: 6f 6c 65 5f 67 72 61 70 68 69 63 73 5f 74 68 75 ole_graphics_thu + 00000370: 6e 64 65 72 2d 39 00 00 01 ac 4a 17 4f de 00 36 nder-9....J.O..6 + 00000380: 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 5f 61 net_rim_device_a + 00000390: 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 6d 6f pps_games_wordmo + 000003a0: 6c 65 5f 67 72 61 70 68 69 63 73 5f 74 68 75 6e le_graphics_thun + 000003b0: 64 65 72 2d 31 30 00 00 01 ad der-10.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 116 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 ad ........... +<<< URB 96 + 00000000: 00 00 0c 00 13 05 01 00 10 00 00 00 ............ +<<< URB 98 + 00000000: 05 00 06 00 03 da ...... +<<< URB 99 + 00000000: 05 00 de 03 00 00 00 1a 00 00 01 ad 4a 17 4f de ............J.O. + 00000010: 00 36 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 .6net_rim_device + 00000020: 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 _apps_games_word + 00000030: 6d 6f 6c 65 5f 67 72 61 70 68 69 63 73 5f 74 68 mole_graphics_th + 00000040: 75 6e 64 65 72 2d 31 31 00 00 01 ae 4a 17 4a f7 under-11....J.J. + 00000050: 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 76 69 72 ..net_rim_bb_vir + 00000060: 74 75 61 6c 5f 6b 65 79 62 6f 61 72 64 00 00 01 tual_keyboard... + 00000070: af 4a 17 4a f7 00 1d 6e 65 74 5f 72 69 6d 5f 62 .J.J...net_rim_b + 00000080: 62 5f 76 69 72 74 75 61 6c 5f 6b 65 79 62 6f 61 b_virtual_keyboa + 00000090: 72 64 2d 31 00 00 01 b0 4a 17 4a b4 00 23 6e 65 rd-1....J.J..#ne + 000000a0: 74 5f 72 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c t_rim_bb_virtual + 000000b0: 5f 6b 65 79 62 6f 61 72 64 5f 6c 69 62 72 61 72 _keyboard_librar + 000000c0: 79 00 00 01 b1 4a 17 4a b4 00 25 6e 65 74 5f 72 y....J.J..%net_r + 000000d0: 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c 5f 6b 65 im_bb_virtual_ke + 000000e0: 79 62 6f 61 72 64 5f 6c 69 62 72 61 72 79 2d 31 yboard_library-1 + 000000f0: 00 00 01 b2 4a 17 4a b4 00 25 6e 65 74 5f 72 69 ....J.J..%net_ri + 00000100: 6d 5f 62 62 5f 76 69 72 74 75 61 6c 5f 6b 65 79 m_bb_virtual_key + 00000110: 62 6f 61 72 64 5f 6c 69 62 72 61 72 79 2d 32 00 board_library-2. + 00000120: 00 01 b3 4a 17 4a 7a 00 0b 6e 65 74 5f 72 69 6d ...J.Jz..net_rim + 00000130: 5f 6d 32 67 00 00 01 b4 4a 17 4a f7 00 1d 6e 65 _m2g....J.J...ne + 00000140: 74 5f 72 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c t_rim_bb_virtual + 00000150: 5f 6b 65 79 62 6f 61 72 64 2d 33 00 00 01 b5 4a _keyboard-3....J + 00000160: 17 4a f7 00 1e 6e 65 74 5f 72 69 6d 5f 62 62 5f .J...net_rim_bb_ + 00000170: 76 69 72 74 75 61 6c 5f 6b 65 79 62 6f 61 72 64 virtual_keyboard + 00000180: 2d 31 31 00 00 01 b6 4a 17 4a f7 00 1d 6e 65 74 -11....J.J...net + 00000190: 5f 72 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c 5f _rim_bb_virtual_ + 000001a0: 6b 65 79 62 6f 61 72 64 2d 32 00 00 01 b7 4a 17 keyboard-2....J. + 000001b0: 4a f7 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 76 J...net_rim_bb_v + 000001c0: 69 72 74 75 61 6c 5f 6b 65 79 62 6f 61 72 64 2d irtual_keyboard- + 000001d0: 34 00 00 01 b8 4a 17 4a f7 00 1d 6e 65 74 5f 72 4....J.J...net_r + 000001e0: 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c 5f 6b 65 im_bb_virtual_ke + 000001f0: 79 62 6f 61 72 64 2d 35 00 00 01 b9 4a 17 4a f7 yboard-5....J.J. + 00000200: 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 76 69 72 ..net_rim_bb_vir + 00000210: 74 75 61 6c 5f 6b 65 79 62 6f 61 72 64 2d 36 00 tual_keyboard-6. + 00000220: 00 01 ba 4a 17 4a f7 00 1d 6e 65 74 5f 72 69 6d ...J.J...net_rim + 00000230: 5f 62 62 5f 76 69 72 74 75 61 6c 5f 6b 65 79 62 _bb_virtual_keyb + 00000240: 6f 61 72 64 2d 37 00 00 01 bb 4a 17 4a f7 00 1d oard-7....J.J... + 00000250: 6e 65 74 5f 72 69 6d 5f 62 62 5f 76 69 72 74 75 net_rim_bb_virtu + 00000260: 61 6c 5f 6b 65 79 62 6f 61 72 64 2d 38 00 00 01 al_keyboard-8... + 00000270: bc 4a 17 4a f7 00 1d 6e 65 74 5f 72 69 6d 5f 62 .J.J...net_rim_b + 00000280: 62 5f 76 69 72 74 75 61 6c 5f 6b 65 79 62 6f 61 b_virtual_keyboa + 00000290: 72 64 2d 39 00 00 01 bd 4a 17 4a f7 00 1e 6e 65 rd-9....J.J...ne + 000002a0: 74 5f 72 69 6d 5f 62 62 5f 76 69 72 74 75 61 6c t_rim_bb_virtual + 000002b0: 5f 6b 65 79 62 6f 61 72 64 2d 31 30 00 00 01 be _keyboard-10.... + 000002c0: 4a 17 4a 77 00 0e 6e 65 74 5f 72 69 6d 5f 6a 61 J.Jw..net_rim_ja + 000002d0: 78 72 70 63 00 00 01 bf 4a 17 55 26 00 16 6e 65 xrpc....J.U&..ne + 000002e0: 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 t_rim_bb_browser + 000002f0: 5f 6c 69 62 00 00 01 c0 4a 17 55 26 00 18 6e 65 _lib....J.U&..ne + 00000300: 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 t_rim_bb_browser + 00000310: 5f 6c 69 62 2d 32 00 00 01 c1 4a 17 55 26 00 18 _lib-2....J.U&.. + 00000320: 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 net_rim_bb_brows + 00000330: 65 72 5f 6c 69 62 2d 34 00 00 01 c2 4a 17 55 26 er_lib-4....J.U& + 00000340: 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ..net_rim_bb_bro + 00000350: 77 73 65 72 5f 6c 69 62 2d 33 00 00 01 c3 4a 17 wser_lib-3....J. + 00000360: 55 26 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 U&..net_rim_bb_b + 00000370: 72 6f 77 73 65 72 5f 6c 69 62 2d 35 00 00 01 c4 rowser_lib-5.... + 00000380: 4a 17 55 26 00 18 6e 65 74 5f 72 69 6d 5f 62 62 J.U&..net_rim_bb + 00000390: 5f 62 72 6f 77 73 65 72 5f 6c 69 62 2d 36 00 00 _browser_lib-6.. + 000003a0: 01 c5 4a 17 55 26 00 18 6e 65 74 5f 72 69 6d 5f ..J.U&..net_rim_ + 000003b0: 62 62 5f 62 72 6f 77 73 65 72 5f 6c 69 62 2d 31 bb_browser_lib-1 + 000003c0: 00 00 01 c6 4a 17 54 f1 00 10 6e 65 74 5f 72 69 ....J.T...net_ri + 000003d0: 6d 5f 62 62 5f 65 6d 61 69 6c 00 00 01 c7 m_bb_email.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 120 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 c7 ........... +<<< URB 100 + 00000000: 00 00 0c 00 13 05 01 00 11 00 00 00 ............ +<<< URB 102 + 00000000: 05 00 06 00 03 cd ...... +<<< URB 103 + 00000000: 05 00 d1 03 00 00 00 1d 00 00 01 c7 4a 17 54 f1 ............J.T. + 00000010: 00 12 6e 65 74 5f 72 69 6d 5f 62 62 5f 65 6d 61 ..net_rim_bb_ema + 00000020: 69 6c 2d 31 00 00 01 c8 4a 17 54 f1 00 12 6e 65 il-1....J.T...ne + 00000030: 74 5f 72 69 6d 5f 62 62 5f 65 6d 61 69 6c 2d 33 t_rim_bb_email-3 + 00000040: 00 00 01 c9 4a 17 54 f1 00 12 6e 65 74 5f 72 69 ....J.T...net_ri + 00000050: 6d 5f 62 62 5f 65 6d 61 69 6c 2d 35 00 00 01 ca m_bb_email-5.... + 00000060: 4a 17 54 f1 00 12 6e 65 74 5f 72 69 6d 5f 62 62 J.T...net_rim_bb + 00000070: 5f 65 6d 61 69 6c 2d 34 00 00 01 cb 4a 17 54 f1 _email-4....J.T. + 00000080: 00 12 6e 65 74 5f 72 69 6d 5f 62 62 5f 65 6d 61 ..net_rim_bb_ema + 00000090: 69 6c 2d 32 00 00 01 cc 4a 17 4a fc 00 15 6e 65 il-2....J.J...ne + 000000a0: 74 5f 72 69 6d 5f 62 62 5f 73 70 65 6c 6c 63 68 t_rim_bb_spellch + 000000b0: 65 63 6b 00 00 01 cd 4a 17 54 ed 00 1a 6e 65 74 eck....J.T...net + 000000c0: 5f 72 69 6d 5f 62 62 5f 61 64 64 72 65 73 73 62 _rim_bb_addressb + 000000d0: 6f 6f 6b 5f 67 61 6c 00 00 01 ce 4a 17 4b 22 00 ook_gal....J.K". + 000000e0: 0e 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 6d 73 00 .net_rim_bb_sms. + 000000f0: 00 01 cf 4a 17 53 a3 00 1c 6e 65 74 5f 72 69 6d ...J.S...net_rim + 00000100: 5f 62 62 5f 65 6d 61 69 6c 5f 63 6f 6d 70 72 65 _bb_email_compre + 00000110: 73 73 69 6f 6e 00 00 01 d0 4a 17 52 78 00 1a 6e ssion....J.Rx..n + 00000120: 65 74 5f 72 69 6d 5f 63 6c 64 63 5f 69 6f 5f 72 et_rim_cldc_io_r + 00000130: 65 6d 6f 74 65 66 69 6c 65 00 00 01 d1 4a 17 55 emotefile....J.U + 00000140: 21 00 14 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 !..net_rim_bbapi + 00000150: 5f 6d 61 69 6c 76 32 00 00 01 d2 4a 17 54 fe 00 _mailv2....J.T.. + 00000160: 15 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 74 74 61 .net_rim_bb_atta + 00000170: 63 68 6d 65 6e 74 00 00 01 d3 4a 17 53 ae 00 17 chment....J.S... + 00000180: 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 net_rim_bb_brows + 00000190: 65 72 5f 70 75 73 68 00 00 01 d4 4a 17 53 03 00 er_push....J.S.. + 000001a0: 10 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f .net_rim_crypto_ + 000001b0: 32 00 00 01 d5 4a 17 52 a2 00 11 6e 65 74 5f 72 2....J.R...net_r + 000001c0: 69 6d 5f 73 6d 61 72 74 63 61 72 64 00 00 01 d6 im_smartcard.... + 000001d0: 4a 17 53 03 00 12 6e 65 74 5f 72 69 6d 5f 63 72 J.S...net_rim_cr + 000001e0: 79 70 74 6f 5f 32 2d 32 00 00 01 d7 4a 17 53 03 ypto_2-2....J.S. + 000001f0: 00 12 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f ..net_rim_crypto + 00000200: 5f 32 2d 31 00 00 01 d8 4a 17 49 ef 00 0f 6e 65 _2-1....J.I...ne + 00000210: 74 5f 72 69 6d 5f 65 73 63 72 65 65 6e 00 00 01 t_rim_escreen... + 00000220: d9 4a 17 55 6d 00 19 6e 65 74 5f 72 69 6d 5f 62 .J.Um..net_rim_b + 00000230: 62 5f 73 62 69 6e 6a 65 63 74 6f 72 5f 6c 69 62 b_sbinjector_lib + 00000240: 00 00 01 da 4a 17 55 6d 00 1b 6e 65 74 5f 72 69 ....J.Um..net_ri + 00000250: 6d 5f 62 62 5f 73 62 69 6e 6a 65 63 74 6f 72 5f m_bb_sbinjector_ + 00000260: 6c 69 62 2d 31 00 00 01 db 4a 17 55 6d 00 1b 6e lib-1....J.Um..n + 00000270: 65 74 5f 72 69 6d 5f 62 62 5f 73 62 69 6e 6a 65 et_rim_bb_sbinje + 00000280: 63 74 6f 72 5f 6c 69 62 2d 32 00 00 01 dc 4a 17 ctor_lib-2....J. + 00000290: 55 6d 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 Um..net_rim_bb_s + 000002a0: 62 69 6e 6a 65 63 74 6f 72 5f 6c 69 62 2d 33 00 binjector_lib-3. + 000002b0: 00 01 dd 4a 17 55 6d 00 1b 6e 65 74 5f 72 69 6d ...J.Um..net_rim + 000002c0: 5f 62 62 5f 73 62 69 6e 6a 65 63 74 6f 72 5f 6c _bb_sbinjector_l + 000002d0: 69 62 2d 34 00 00 01 de 4a 17 55 6d 00 1b 6e 65 ib-4....J.Um..ne + 000002e0: 74 5f 72 69 6d 5f 62 62 5f 73 62 69 6e 6a 65 63 t_rim_bb_sbinjec + 000002f0: 74 6f 72 5f 6c 69 62 2d 35 00 00 01 df 4a 17 55 tor_lib-5....J.U + 00000300: 6d 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 62 m..net_rim_bb_sb + 00000310: 69 6e 6a 65 63 74 6f 72 5f 6c 69 62 2d 36 00 00 injector_lib-6.. + 00000320: 01 e0 4a 17 55 6d 00 1b 6e 65 74 5f 72 69 6d 5f ..J.Um..net_rim_ + 00000330: 62 62 5f 73 62 69 6e 6a 65 63 74 6f 72 5f 6c 69 bb_sbinjector_li + 00000340: 62 2d 37 00 00 01 e1 4a 17 55 6d 00 1b 6e 65 74 b-7....J.Um..net + 00000350: 5f 72 69 6d 5f 62 62 5f 73 62 69 6e 6a 65 63 74 _rim_bb_sbinject + 00000360: 6f 72 5f 6c 69 62 2d 38 00 00 01 e2 4a 17 55 6d or_lib-8....J.Um + 00000370: 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 62 69 ..net_rim_bb_sbi + 00000380: 6e 6a 65 63 74 6f 72 5f 6c 69 62 2d 39 00 00 01 njector_lib-9... + 00000390: e3 4a 17 4f cd 00 36 6e 65 74 5f 72 69 6d 5f 64 .J.O..6net_rim_d + 000003a0: 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 evice_apps_games + 000003b0: 5f 62 72 69 63 6b 62 72 65 61 6b 65 72 33 36 30 _brickbreaker360 + 000003c0: 78 34 38 30 52 65 73 6f 75 72 63 65 73 00 00 01 x480Resources... + 000003d0: e4 . + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 124 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 e4 ........... +<<< URB 104 + 00000000: 00 00 0c 00 13 05 01 00 12 00 00 00 ............ +<<< URB 106 + 00000000: 05 00 06 00 03 e2 ...... +<<< URB 107 + 00000000: 05 00 e6 03 00 00 00 12 00 00 01 e4 4a 17 4f cd ............J.O. + 00000010: 00 38 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 .8net_rim_device + 00000020: 5f 61 70 70 73 5f 67 61 6d 65 73 5f 62 72 69 63 _apps_games_bric + 00000030: 6b 62 72 65 61 6b 65 72 33 36 30 78 34 38 30 52 kbreaker360x480R + 00000040: 65 73 6f 75 72 63 65 73 2d 38 00 00 01 e5 4a 17 esources-8....J. + 00000050: 4f cd 00 38 6e 65 74 5f 72 69 6d 5f 64 65 76 69 O..8net_rim_devi + 00000060: 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 62 72 ce_apps_games_br + 00000070: 69 63 6b 62 72 65 61 6b 65 72 33 36 30 78 34 38 ickbreaker360x48 + 00000080: 30 52 65 73 6f 75 72 63 65 73 2d 31 00 00 01 e6 0Resources-1.... + 00000090: 4a 17 4f cd 00 38 6e 65 74 5f 72 69 6d 5f 64 65 J.O..8net_rim_de + 000000a0: 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f vice_apps_games_ + 000000b0: 62 72 69 63 6b 62 72 65 61 6b 65 72 33 36 30 78 brickbreaker360x + 000000c0: 34 38 30 52 65 73 6f 75 72 63 65 73 2d 32 00 00 480Resources-2.. + 000000d0: 01 e7 4a 17 4f cd 00 38 6e 65 74 5f 72 69 6d 5f ..J.O..8net_rim_ + 000000e0: 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 device_apps_game + 000000f0: 73 5f 62 72 69 63 6b 62 72 65 61 6b 65 72 33 36 s_brickbreaker36 + 00000100: 30 78 34 38 30 52 65 73 6f 75 72 63 65 73 2d 33 0x480Resources-3 + 00000110: 00 00 01 e8 4a 17 4f cd 00 38 6e 65 74 5f 72 69 ....J.O..8net_ri + 00000120: 6d 5f 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 m_device_apps_ga + 00000130: 6d 65 73 5f 62 72 69 63 6b 62 72 65 61 6b 65 72 mes_brickbreaker + 00000140: 33 36 30 78 34 38 30 52 65 73 6f 75 72 63 65 73 360x480Resources + 00000150: 2d 34 00 00 01 e9 4a 17 4f cd 00 38 6e 65 74 5f -4....J.O..8net_ + 00000160: 72 69 6d 5f 64 65 76 69 63 65 5f 61 70 70 73 5f rim_device_apps_ + 00000170: 67 61 6d 65 73 5f 62 72 69 63 6b 62 72 65 61 6b games_brickbreak + 00000180: 65 72 33 36 30 78 34 38 30 52 65 73 6f 75 72 63 er360x480Resourc + 00000190: 65 73 2d 35 00 00 01 ea 4a 17 4f cd 00 38 6e 65 es-5....J.O..8ne + 000001a0: 74 5f 72 69 6d 5f 64 65 76 69 63 65 5f 61 70 70 t_rim_device_app + 000001b0: 73 5f 67 61 6d 65 73 5f 62 72 69 63 6b 62 72 65 s_games_brickbre + 000001c0: 61 6b 65 72 33 36 30 78 34 38 30 52 65 73 6f 75 aker360x480Resou + 000001d0: 72 63 65 73 2d 36 00 00 01 eb 4a 17 4f cd 00 38 rces-6....J.O..8 + 000001e0: 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 5f 61 net_rim_device_a + 000001f0: 70 70 73 5f 67 61 6d 65 73 5f 62 72 69 63 6b 62 pps_games_brickb + 00000200: 72 65 61 6b 65 72 33 36 30 78 34 38 30 52 65 73 reaker360x480Res + 00000210: 6f 75 72 63 65 73 2d 37 00 00 01 ec 4a 17 54 b3 ources-7....J.T. + 00000220: 00 22 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e ."net_rim_vad_en + 00000230: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 gine_resource__e + 00000240: 6e 5f 55 53 00 00 01 ed 4a 17 54 b3 00 24 6e 65 n_US....J.T..$ne + 00000250: 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 t_rim_vad_engine + 00000260: 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 55 53 _resource__en_US + 00000270: 2d 31 00 00 01 ee 4a 17 54 b3 00 24 6e 65 74 5f -1....J.T..$net_ + 00000280: 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 rim_vad_engine_r + 00000290: 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 55 53 2d 32 esource__en_US-2 + 000002a0: 00 00 01 ef 4a 17 54 b3 00 24 6e 65 74 5f 72 69 ....J.T..$net_ri + 000002b0: 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 m_vad_engine_res + 000002c0: 6f 75 72 63 65 5f 5f 65 6e 5f 55 53 2d 33 00 00 ource__en_US-3.. + 000002d0: 01 f0 4a 17 54 b3 00 24 6e 65 74 5f 72 69 6d 5f ..J.T..$net_rim_ + 000002e0: 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 vad_engine_resou + 000002f0: 72 63 65 5f 5f 65 6e 5f 55 53 2d 34 00 00 01 f1 rce__en_US-4.... + 00000300: 4a 17 54 b3 00 24 6e 65 74 5f 72 69 6d 5f 76 61 J.T..$net_rim_va + 00000310: 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 d_engine_resourc + 00000320: 65 5f 5f 65 6e 5f 55 53 2d 35 00 00 01 f2 4a 17 e__en_US-5....J. + 00000330: 54 b3 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f T..$net_rim_vad_ + 00000340: 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f engine_resource_ + 00000350: 5f 65 6e 5f 55 53 2d 36 00 00 01 f3 4a 17 54 b3 _en_US-6....J.T. + 00000360: 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e .$net_rim_vad_en + 00000370: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 gine_resource__e + 00000380: 6e 5f 55 53 2d 37 00 00 01 f4 4a 17 54 b3 00 24 n_US-7....J.T..$ + 00000390: 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 net_rim_vad_engi + 000003a0: 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f ne_resource__en_ + 000003b0: 55 53 2d 38 00 00 01 f5 4a 17 54 b3 00 24 6e 65 US-8....J.T..$ne + 000003c0: 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 t_rim_vad_engine + 000003d0: 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 55 53 _resource__en_US + 000003e0: 2d 39 00 00 01 f6 -9.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 128 + 00000000: 05 00 0b 00 00 05 8d 00 00 01 f6 ........... +<<< URB 108 + 00000000: 00 00 0c 00 13 05 01 00 13 00 00 00 ............ +<<< URB 110 + 00000000: 05 00 06 00 03 e4 ...... +<<< URB 111 + 00000000: 05 00 e8 03 00 00 00 1b 00 00 01 f6 4a 17 53 6f ............J.So + 00000010: 00 2a 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 64 79 .*net_rim_tid_dy + 00000020: 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 61 5f namic_ling_data_ + 00000030: 66 72 65 6e 63 68 5f 34 35 6b 5f 32 00 00 01 f7 french_45k_2.... + 00000040: 4a 17 53 6f 00 2c 6e 65 74 5f 72 69 6d 5f 74 69 J.So.,net_rim_ti + 00000050: 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 d_dynamic_ling_d + 00000060: 61 74 61 5f 66 72 65 6e 63 68 5f 34 35 6b 5f 32 ata_french_45k_2 + 00000070: 2d 36 00 00 01 f8 4a 17 52 cf 00 18 6e 65 74 5f -6....J.R...net_ + 00000080: 72 69 6d 5f 74 69 64 5f 69 6d 5f 61 6c 70 68 5f rim_tid_im_alph_ + 00000090: 63 6f 72 65 00 00 01 f9 4a 17 52 13 00 10 6e 65 core....J.R...ne + 000000a0: 74 5f 72 69 6d 5f 74 69 64 5f 63 6f 72 65 00 00 t_rim_tid_core.. + 000000b0: 01 fa 4a 17 53 3c 00 2a 6e 65 74 5f 72 69 6d 5f ..J.S<.*net_rim_ + 000000c0: 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 tid_dynamic_ling + 000000d0: 5f 64 61 74 61 5f 64 6f 6d 61 69 6e 5f 6e 61 6d _data_domain_nam + 000000e0: 65 73 00 00 01 fb 4a 17 53 6f 00 2c 6e 65 74 5f es....J.So.,net_ + 000000f0: 72 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 63 5f rim_tid_dynamic_ + 00000100: 6c 69 6e 67 5f 64 61 74 61 5f 66 72 65 6e 63 68 ling_data_french + 00000110: 5f 34 35 6b 5f 32 2d 31 00 00 01 fc 4a 17 53 6f _45k_2-1....J.So + 00000120: 00 2c 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 64 79 .,net_rim_tid_dy + 00000130: 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 61 5f namic_ling_data_ + 00000140: 66 72 65 6e 63 68 5f 34 35 6b 5f 32 2d 32 00 00 french_45k_2-2.. + 00000150: 01 fd 4a 17 53 6f 00 2c 6e 65 74 5f 72 69 6d 5f ..J.So.,net_rim_ + 00000160: 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 tid_dynamic_ling + 00000170: 5f 64 61 74 61 5f 66 72 65 6e 63 68 5f 34 35 6b _data_french_45k + 00000180: 5f 32 2d 33 00 00 01 fe 4a 17 53 6f 00 2c 6e 65 _2-3....J.So.,ne + 00000190: 74 5f 72 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 t_rim_tid_dynami + 000001a0: 63 5f 6c 69 6e 67 5f 64 61 74 61 5f 66 72 65 6e c_ling_data_fren + 000001b0: 63 68 5f 34 35 6b 5f 32 2d 34 00 00 01 ff 4a 17 ch_45k_2-4....J. + 000001c0: 53 6f 00 2c 6e 65 74 5f 72 69 6d 5f 74 69 64 5f So.,net_rim_tid_ + 000001d0: 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 dynamic_ling_dat + 000001e0: 61 5f 66 72 65 6e 63 68 5f 34 35 6b 5f 32 2d 35 a_french_45k_2-5 + 000001f0: 00 00 02 00 49 f2 29 ce 00 12 6e 65 74 5f 72 69 ....I.)...net_ri + 00000200: 6d 5f 62 62 5f 71 6d 5f 70 65 65 72 00 00 02 01 m_bb_qm_peer.... + 00000210: 49 f2 29 ce 00 14 6e 65 74 5f 72 69 6d 5f 62 62 I.)...net_rim_bb + 00000220: 5f 71 6d 5f 70 65 65 72 2d 32 00 00 02 02 49 f2 _qm_peer-2....I. + 00000230: 29 ce 00 14 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 )...net_rim_bb_q + 00000240: 6d 5f 70 65 65 72 2d 31 00 00 02 03 49 f2 29 ce m_peer-1....I.). + 00000250: 00 14 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f ..net_rim_bb_qm_ + 00000260: 70 65 65 72 2d 34 00 00 02 04 49 f2 29 ce 00 14 peer-4....I.)... + 00000270: 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f 70 65 net_rim_bb_qm_pe + 00000280: 65 72 2d 33 00 00 02 05 4a 17 55 9c 00 21 6e 65 er-3....J.U..!ne + 00000290: 74 5f 72 69 6d 5f 62 62 61 70 69 5f 62 6c 61 63 t_rim_bbapi_blac + 000002a0: 6b 62 65 72 72 79 6d 65 73 73 65 6e 67 65 72 00 kberrymessenger. + 000002b0: 00 02 06 4a 17 55 6e 00 0c 6e 65 74 5f 72 69 6d ...J.Un..net_rim + 000002c0: 5f 70 64 61 70 00 00 02 07 4a 17 55 6e 00 0e 6e _pdap....J.Un..n + 000002d0: 65 74 5f 72 69 6d 5f 70 64 61 70 2d 31 00 00 02 et_rim_pdap-1... + 000002e0: 08 4a 17 53 a4 00 16 6e 65 74 5f 72 69 6d 5f 70 .J.S...net_rim_p + 000002f0: 64 61 70 5f 72 65 73 6f 75 72 63 65 73 00 00 02 dap_resources... + 00000300: 09 49 f2 29 ce 00 14 6e 65 74 5f 72 69 6d 5f 62 .I.)...net_rim_b + 00000310: 62 5f 71 6d 5f 70 65 65 72 2d 35 00 00 02 0a 4a b_qm_peer-5....J + 00000320: 17 53 ac 00 12 6e 65 74 5f 72 69 6d 5f 62 62 61 .S...net_rim_bba + 00000330: 70 69 5f 6d 61 70 73 00 00 02 0b 4a 17 55 a5 00 pi_maps....J.U.. + 00000340: 14 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f 69 .net_rim_bbapi_i + 00000350: 6e 76 6f 6b 65 00 00 02 0c 4a 17 55 1b 00 16 6e nvoke....J.U...n + 00000360: 65 74 5f 72 69 6d 5f 62 62 5f 73 6d 73 5f 63 6f et_rim_bb_sms_co + 00000370: 6d 70 6f 73 65 00 00 02 0d 4a 17 55 70 00 0e 6e mpose....J.Up..n + 00000380: 65 74 5f 72 69 6d 5f 62 62 5f 6d 6d 73 00 00 02 et_rim_bb_mms... + 00000390: 0e 4a 17 55 70 00 10 6e 65 74 5f 72 69 6d 5f 62 .J.Up..net_rim_b + 000003a0: 62 5f 6d 6d 73 2d 31 00 00 02 0f 4a 17 55 70 00 b_mms-1....J.Up. + 000003b0: 10 6e 65 74 5f 72 69 6d 5f 62 62 5f 6d 6d 73 2d .net_rim_bb_mms- + 000003c0: 32 00 00 02 10 4a 17 51 8a 00 19 6e 65 74 5f 72 2....J.Q...net_r + 000003d0: 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 64 61 im_bb_browser_da + 000003e0: 65 6d 6f 6e 00 00 02 11 emon.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 132 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 11 ........... +<<< URB 112 + 00000000: 00 00 0c 00 13 05 01 00 14 00 00 00 ............ +<<< URB 114 + 00000000: 05 00 06 00 03 ef ...... +<<< URB 115 + 00000000: 05 00 f3 03 00 00 00 1b 00 00 02 11 4a 17 51 8a ............J.Q. + 00000010: 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 62 72 6f ..net_rim_bb_bro + 00000020: 77 73 65 72 5f 64 61 65 6d 6f 6e 2d 33 00 00 02 wser_daemon-3... + 00000030: 12 4a 17 51 8a 00 1b 6e 65 74 5f 72 69 6d 5f 62 .J.Q...net_rim_b + 00000040: 62 5f 62 72 6f 77 73 65 72 5f 64 61 65 6d 6f 6e b_browser_daemon + 00000050: 2d 34 00 00 02 13 4a 17 51 8a 00 1b 6e 65 74 5f -4....J.Q...net_ + 00000060: 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 5f 64 rim_bb_browser_d + 00000070: 61 65 6d 6f 6e 2d 35 00 00 02 14 4a 17 4b 5f 00 aemon-5....J.K_. + 00000080: 0e 6e 65 74 5f 72 69 6d 5f 6c 6f 61 64 65 72 00 .net_rim_loader. + 00000090: 00 02 15 4a 17 4b 5f 00 10 6e 65 74 5f 72 69 6d ...J.K_..net_rim + 000000a0: 5f 6c 6f 61 64 65 72 2d 31 00 00 02 16 4a 17 55 _loader-1....J.U + 000000b0: 7b 00 14 6e 65 74 5f 72 69 6d 5f 62 62 5f 64 72 {..net_rim_bb_dr + 000000c0: 6d 5f 61 67 65 6e 74 00 00 02 17 4a 17 49 ee 00 m_agent....J.I.. + 000000d0: 0b 6e 65 74 5f 72 69 6d 5f 64 72 6d 00 00 02 18 .net_rim_drm.... + 000000e0: 4a 17 55 15 00 17 6e 65 74 5f 72 69 6d 5f 62 62 J.U...net_rim_bb + 000000f0: 5f 6d 65 64 69 61 6c 69 62 72 61 72 79 00 00 02 _medialibrary... + 00000100: 19 4a 17 55 15 00 19 6e 65 74 5f 72 69 6d 5f 62 .J.U...net_rim_b + 00000110: 62 5f 6d 65 64 69 61 6c 69 62 72 61 72 79 2d 31 b_medialibrary-1 + 00000120: 00 00 02 1a 4a 17 4a 7b 00 21 6e 65 74 5f 72 69 ....J.J{.!net_ri + 00000130: 6d 5f 70 6c 61 7a 6d 69 63 5f 6d 65 64 69 61 65 m_plazmic_mediae + 00000140: 6e 67 69 6e 65 5f 70 6d 65 31 32 00 00 02 1b 4a ngine_pme12....J + 00000150: 17 4a 7b 00 23 6e 65 74 5f 72 69 6d 5f 70 6c 61 .J{.#net_rim_pla + 00000160: 7a 6d 69 63 5f 6d 65 64 69 61 65 6e 67 69 6e 65 zmic_mediaengine + 00000170: 5f 70 6d 65 31 32 2d 31 00 00 02 1c 4a 17 4a 7b _pme12-1....J.J{ + 00000180: 00 23 6e 65 74 5f 72 69 6d 5f 70 6c 61 7a 6d 69 .#net_rim_plazmi + 00000190: 63 5f 6d 65 64 69 61 65 6e 67 69 6e 65 5f 70 6d c_mediaengine_pm + 000001a0: 65 31 32 2d 32 00 00 02 1d 4a 17 4a 72 00 22 6e e12-2....J.Jr."n + 000001b0: 65 74 5f 72 69 6d 5f 70 6c 61 7a 6d 69 63 5f 6d et_rim_plazmic_m + 000001c0: 65 64 69 61 65 6e 67 69 6e 65 5f 62 75 6e 64 6c ediaengine_bundl + 000001d0: 65 00 00 02 1e 4a 17 49 f7 00 14 6e 65 74 5f 72 e....J.I...net_r + 000001e0: 69 6d 5f 70 6c 61 7a 6d 69 63 5f 6d 61 74 68 00 im_plazmic_math. + 000001f0: 00 02 1f 4a 17 51 8a 00 1b 6e 65 74 5f 72 69 6d ...J.Q...net_rim + 00000200: 5f 62 62 5f 62 72 6f 77 73 65 72 5f 64 61 65 6d _bb_browser_daem + 00000210: 6f 6e 2d 31 00 00 02 20 4a 17 51 8a 00 1b 6e 65 on-1... J.Q...ne + 00000220: 74 5f 72 69 6d 5f 62 62 5f 62 72 6f 77 73 65 72 t_rim_bb_browser + 00000230: 5f 64 61 65 6d 6f 6e 2d 32 00 00 02 21 4a 17 55 _daemon-2...!J.U + 00000240: 15 00 12 6e 65 74 5f 72 69 6d 5f 62 62 5f 64 6f ...net_rim_bb_do + 00000250: 63 76 69 65 77 00 00 02 22 4a 17 55 15 00 14 6e cview..."J.U...n + 00000260: 65 74 5f 72 69 6d 5f 62 62 5f 64 6f 63 76 69 65 et_rim_bb_docvie + 00000270: 77 2d 31 00 00 02 23 4a 17 55 15 00 14 6e 65 74 w-1...#J.U...net + 00000280: 5f 72 69 6d 5f 62 62 5f 64 6f 63 76 69 65 77 2d _rim_bb_docview- + 00000290: 32 00 00 02 24 4a 17 55 15 00 14 6e 65 74 5f 72 2...$J.U...net_r + 000002a0: 69 6d 5f 62 62 5f 64 6f 63 76 69 65 77 2d 33 00 im_bb_docview-3. + 000002b0: 00 02 25 4a 17 54 bb 00 22 6e 65 74 5f 72 69 6d ..%J.T.."net_rim + 000002c0: 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f _vad_engine_reso + 000002d0: 75 72 63 65 5f 5f 66 72 5f 43 41 00 00 02 26 4a urce__fr_CA...&J + 000002e0: 17 54 bb 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 .T..$net_rim_vad + 000002f0: 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 _engine_resource + 00000300: 5f 5f 66 72 5f 43 41 2d 31 00 00 02 27 4a 17 54 __fr_CA-1...'J.T + 00000310: bb 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 ..$net_rim_vad_e + 00000320: 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f ngine_resource__ + 00000330: 66 72 5f 43 41 2d 32 00 00 02 28 4a 17 54 bb 00 fr_CA-2...(J.T.. + 00000340: 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 $net_rim_vad_eng + 00000350: 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 ine_resource__fr + 00000360: 5f 43 41 2d 33 00 00 02 29 4a 17 54 bb 00 24 6e _CA-3...)J.T..$n + 00000370: 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e et_rim_vad_engin + 00000380: 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 5f 43 e_resource__fr_C + 00000390: 41 2d 34 00 00 02 2a 4a 17 54 bb 00 24 6e 65 74 A-4...*J.T..$net + 000003a0: 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f _rim_vad_engine_ + 000003b0: 72 65 73 6f 75 72 63 65 5f 5f 66 72 5f 43 41 2d resource__fr_CA- + 000003c0: 35 00 00 02 2b 4a 17 54 bb 00 24 6e 65 74 5f 72 5...+J.T..$net_r + 000003d0: 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 im_vad_engine_re + 000003e0: 73 6f 75 72 63 65 5f 5f 66 72 5f 43 41 2d 36 00 source__fr_CA-6. + 000003f0: 00 02 2c .., + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 136 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 2c .........., +<<< URB 116 + 00000000: 00 00 0c 00 13 05 01 00 15 00 00 00 ............ +<<< URB 118 + 00000000: 05 00 06 00 03 f0 ...... +<<< URB 119 + 00000000: 05 00 f4 03 00 00 00 1b 00 00 02 2c 4a 17 54 bb ...........,J.T. + 00000010: 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e .$net_rim_vad_en + 00000020: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 gine_resource__f + 00000030: 72 5f 43 41 2d 37 00 00 02 2d 4a 17 54 b9 00 1f r_CA-7...-J.T... + 00000040: 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 net_rim_vad_engi + 00000050: 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 ne_resource__fr. + 00000060: 00 02 2e 4a 17 54 b9 00 21 6e 65 74 5f 72 69 6d ...J.T..!net_rim + 00000070: 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f _vad_engine_reso + 00000080: 75 72 63 65 5f 5f 66 72 2d 31 00 00 02 2f 4a 17 urce__fr-1.../J. + 00000090: 54 b9 00 21 6e 65 74 5f 72 69 6d 5f 76 61 64 5f T..!net_rim_vad_ + 000000a0: 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f engine_resource_ + 000000b0: 5f 66 72 2d 32 00 00 02 30 4a 17 54 b9 00 21 6e _fr-2...0J.T..!n + 000000c0: 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e et_rim_vad_engin + 000000d0: 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 2d 33 e_resource__fr-3 + 000000e0: 00 00 02 31 4a 17 54 b9 00 21 6e 65 74 5f 72 69 ...1J.T..!net_ri + 000000f0: 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 m_vad_engine_res + 00000100: 6f 75 72 63 65 5f 5f 66 72 2d 34 00 00 02 32 4a ource__fr-4...2J + 00000110: 17 54 b9 00 21 6e 65 74 5f 72 69 6d 5f 76 61 64 .T..!net_rim_vad + 00000120: 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 _engine_resource + 00000130: 5f 5f 66 72 2d 35 00 00 02 33 4a 17 54 b9 00 21 __fr-5...3J.T..! + 00000140: 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 net_rim_vad_engi + 00000150: 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 2d ne_resource__fr- + 00000160: 36 00 00 02 34 4a 17 54 b9 00 21 6e 65 74 5f 72 6...4J.T..!net_r + 00000170: 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 im_vad_engine_re + 00000180: 73 6f 75 72 63 65 5f 5f 66 72 2d 37 00 00 02 35 source__fr-7...5 + 00000190: 4a 17 51 98 00 15 6e 65 74 5f 72 69 6d 5f 62 62 J.Q...net_rim_bb + 000001a0: 5f 72 69 62 62 6f 6e 5f 61 70 70 00 00 02 36 4a _ribbon_app...6J + 000001b0: 17 51 98 00 17 6e 65 74 5f 72 69 6d 5f 62 62 5f .Q...net_rim_bb_ + 000001c0: 72 69 62 62 6f 6e 5f 61 70 70 2d 31 00 00 02 37 ribbon_app-1...7 + 000001d0: 4a 17 51 98 00 17 6e 65 74 5f 72 69 6d 5f 62 62 J.Q...net_rim_bb + 000001e0: 5f 72 69 62 62 6f 6e 5f 61 70 70 2d 32 00 00 02 _ribbon_app-2... + 000001f0: 38 4a 17 51 98 00 17 6e 65 74 5f 72 69 6d 5f 62 8J.Q...net_rim_b + 00000200: 62 5f 72 69 62 62 6f 6e 5f 61 70 70 2d 33 00 00 b_ribbon_app-3.. + 00000210: 02 39 4a 17 55 c7 00 1a 6e 65 74 5f 72 69 6d 5f .9J.U...net_rim_ + 00000220: 62 62 5f 72 69 62 62 6f 6e 5f 73 6b 69 6e 5f 73 bb_ribbon_skin_s + 00000230: 76 67 00 00 02 3a 4a 17 55 c7 00 1c 6e 65 74 5f vg...:J.U...net_ + 00000240: 72 69 6d 5f 62 62 5f 72 69 62 62 6f 6e 5f 73 6b rim_bb_ribbon_sk + 00000250: 69 6e 5f 73 76 67 2d 31 00 00 02 3b 4a 17 53 aa in_svg-1...;J.S. + 00000260: 00 13 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f ..net_rim_bbapi_ + 00000270: 70 68 6f 6e 65 00 00 02 3c 4a 17 55 a3 00 18 6e phone...J.U. + 000002c0: 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 66 69 6c ..net_rim_bb_fil + 000002d0: 65 5f 65 78 70 6c 6f 72 65 72 00 00 02 3f 4a 17 e_explorer...?J. + 000002e0: 55 bc 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 66 U...net_rim_bb_f + 000002f0: 69 6c 65 5f 65 78 70 6c 6f 72 65 72 2d 33 00 00 ile_explorer-3.. + 00000300: 02 40 4a 17 55 bc 00 1a 6e 65 74 5f 72 69 6d 5f .@J.U...net_rim_ + 00000310: 62 62 5f 66 69 6c 65 5f 65 78 70 6c 6f 72 65 72 bb_file_explorer + 00000320: 2d 32 00 00 02 41 4a 17 55 bc 00 1a 6e 65 74 5f -2...AJ.U...net_ + 00000330: 72 69 6d 5f 62 62 5f 66 69 6c 65 5f 65 78 70 6c rim_bb_file_expl + 00000340: 6f 72 65 72 2d 31 00 00 02 42 4a 17 55 bc 00 1a orer-1...BJ.U... + 00000350: 6e 65 74 5f 72 69 6d 5f 62 62 5f 66 69 6c 65 5f net_rim_bb_file_ + 00000360: 65 78 70 6c 6f 72 65 72 2d 34 00 00 02 43 4a 17 explorer-4...CJ. + 00000370: 4b 41 00 16 6e 65 74 5f 72 69 6d 5f 62 62 5f 6f KA..net_rim_bb_o + 00000380: 70 74 69 6f 6e 73 5f 61 70 70 00 00 02 44 4a 17 ptions_app...DJ. + 00000390: 4b 41 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 6f KA..net_rim_bb_o + 000003a0: 70 74 69 6f 6e 73 5f 61 70 70 2d 34 00 00 02 45 ptions_app-4...E + 000003b0: 4a 17 4b 41 00 18 6e 65 74 5f 72 69 6d 5f 62 62 J.KA..net_rim_bb + 000003c0: 5f 6f 70 74 69 6f 6e 73 5f 61 70 70 2d 33 00 00 _options_app-3.. + 000003d0: 02 46 4a 17 4b 41 00 18 6e 65 74 5f 72 69 6d 5f .FJ.KA..net_rim_ + 000003e0: 62 62 5f 6f 70 74 69 6f 6e 73 5f 61 70 70 2d 31 bb_options_app-1 + 000003f0: 00 00 02 47 ...G + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 140 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 47 ..........G +<<< URB 120 + 00000000: 00 00 0c 00 13 05 01 00 16 00 00 00 ............ +<<< URB 122 + 00000000: 05 00 06 00 03 db ...... +<<< URB 123 + 00000000: 05 00 df 03 00 00 00 15 00 00 02 47 4a 17 4b 41 ...........GJ.KA + 00000010: 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 6f 70 74 ..net_rim_bb_opt + 00000020: 69 6f 6e 73 5f 61 70 70 2d 32 00 00 02 48 4a 17 ions_app-2...HJ. + 00000030: 4b 15 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 K...net_rim_bb_p + 00000040: 72 6f 66 69 6c 65 73 5f 61 70 70 5f 6e 65 77 00 rofiles_app_new. + 00000050: 00 02 49 4a 17 4b 15 00 1d 6e 65 74 5f 72 69 6d ..IJ.K...net_rim + 00000060: 5f 62 62 5f 70 72 6f 66 69 6c 65 73 5f 61 70 70 _bb_profiles_app + 00000070: 5f 6e 65 77 2d 31 00 00 02 4a 4a 17 4f e5 00 29 _new-1...JJ.O..) + 00000080: 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 5f 61 net_rim_device_a + 00000090: 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 6d 6f pps_games_wordmo + 000000a0: 6c 65 5f 73 6f 75 6e 64 73 00 00 02 4b 4a 17 4f le_sounds...KJ.O + 000000b0: e5 00 2b 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 ..+net_rim_devic + 000000c0: 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 e_apps_games_wor + 000000d0: 64 6d 6f 6c 65 5f 73 6f 75 6e 64 73 2d 31 00 00 dmole_sounds-1.. + 000000e0: 02 4c 4a 17 4f e5 00 2b 6e 65 74 5f 72 69 6d 5f .LJ.O..+net_rim_ + 000000f0: 64 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 device_apps_game + 00000100: 73 5f 77 6f 72 64 6d 6f 6c 65 5f 73 6f 75 6e 64 s_wordmole_sound + 00000110: 73 2d 32 00 00 02 4d 4a 17 4f e5 00 2b 6e 65 74 s-2...MJ.O..+net + 00000120: 5f 72 69 6d 5f 64 65 76 69 63 65 5f 61 70 70 73 _rim_device_apps + 00000130: 5f 67 61 6d 65 73 5f 77 6f 72 64 6d 6f 6c 65 5f _games_wordmole_ + 00000140: 73 6f 75 6e 64 73 2d 33 00 00 02 4e 4a 17 4f e5 sounds-3...NJ.O. + 00000150: 00 2b 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 .+net_rim_device + 00000160: 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 _apps_games_word + 00000170: 6d 6f 6c 65 5f 73 6f 75 6e 64 73 2d 34 00 00 02 mole_sounds-4... + 00000180: 4f 4a 17 4f e5 00 2b 6e 65 74 5f 72 69 6d 5f 64 OJ.O..+net_rim_d + 00000190: 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 evice_apps_games + 000001a0: 5f 77 6f 72 64 6d 6f 6c 65 5f 73 6f 75 6e 64 73 _wordmole_sounds + 000001b0: 2d 35 00 00 02 50 4a 17 4f e5 00 2b 6e 65 74 5f -5...PJ.O..+net_ + 000001c0: 72 69 6d 5f 64 65 76 69 63 65 5f 61 70 70 73 5f rim_device_apps_ + 000001d0: 67 61 6d 65 73 5f 77 6f 72 64 6d 6f 6c 65 5f 73 games_wordmole_s + 000001e0: 6f 75 6e 64 73 2d 36 00 00 02 51 4a 17 53 6a 00 ounds-6...QJ.Sj. + 000001f0: 2e 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 64 79 6e .net_rim_tid_dyn + 00000200: 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 61 5f 65 amic_ling_data_e + 00000210: 6e 67 6c 69 73 68 5f 75 73 5f 34 35 6b 5f 32 00 nglish_us_45k_2. + 00000220: 00 02 52 4a 17 53 6a 00 30 6e 65 74 5f 72 69 6d ..RJ.Sj.0net_rim + 00000230: 5f 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e _tid_dynamic_lin + 00000240: 67 5f 64 61 74 61 5f 65 6e 67 6c 69 73 68 5f 75 g_data_english_u + 00000250: 73 5f 34 35 6b 5f 32 2d 34 00 00 02 53 4a 17 53 s_45k_2-4...SJ.S + 00000260: 6a 00 30 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 64 j.0net_rim_tid_d + 00000270: 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 61 ynamic_ling_data + 00000280: 5f 65 6e 67 6c 69 73 68 5f 75 73 5f 34 35 6b 5f _english_us_45k_ + 00000290: 32 2d 31 00 00 02 54 4a 17 53 6a 00 30 6e 65 74 2-1...TJ.Sj.0net + 000002a0: 5f 72 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 63 _rim_tid_dynamic + 000002b0: 5f 6c 69 6e 67 5f 64 61 74 61 5f 65 6e 67 6c 69 _ling_data_engli + 000002c0: 73 68 5f 75 73 5f 34 35 6b 5f 32 2d 32 00 00 02 sh_us_45k_2-2... + 000002d0: 55 4a 17 53 6a 00 30 6e 65 74 5f 72 69 6d 5f 74 UJ.Sj.0net_rim_t + 000002e0: 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f id_dynamic_ling_ + 000002f0: 64 61 74 61 5f 65 6e 67 6c 69 73 68 5f 75 73 5f data_english_us_ + 00000300: 34 35 6b 5f 32 2d 33 00 00 02 56 4a 17 55 f8 00 45k_2-3...VJ.U.. + 00000310: 18 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 65 6c 70 .net_rim_bb_help + 00000320: 5f 39 35 30 30 5f 5f 65 6e 00 00 02 57 4a 17 55 _9500__en...WJ.U + 00000330: f8 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 65 ...net_rim_bb_he + 00000340: 6c 70 5f 39 35 30 30 5f 5f 65 6e 2d 31 00 00 02 lp_9500__en-1... + 00000350: 58 4a 17 55 f8 00 1a 6e 65 74 5f 72 69 6d 5f 62 XJ.U...net_rim_b + 00000360: 62 5f 68 65 6c 70 5f 39 35 30 30 5f 5f 65 6e 2d b_help_9500__en- + 00000370: 32 00 00 02 59 4a 17 55 f8 00 1a 6e 65 74 5f 72 2...YJ.U...net_r + 00000380: 69 6d 5f 62 62 5f 68 65 6c 70 5f 39 35 30 30 5f im_bb_help_9500_ + 00000390: 5f 65 6e 2d 33 00 00 02 5a 4a 17 56 01 00 18 6e _en-3...ZJ.V...n + 000003a0: 65 74 5f 72 69 6d 5f 62 62 5f 68 65 6c 70 5f 39 et_rim_bb_help_9 + 000003b0: 35 30 30 5f 5f 66 72 00 00 02 5b 4a 17 56 01 00 500__fr...[J.V.. + 000003c0: 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 65 6c 70 .net_rim_bb_help + 000003d0: 5f 39 35 30 30 5f 5f 66 72 2d 31 00 00 02 5c _9500__fr-1...\ + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 144 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 5c ..........\ +<<< URB 124 + 00000000: 00 00 0c 00 13 05 01 00 17 00 00 00 ............ +<<< URB 126 + 00000000: 05 00 06 00 03 d6 ...... +<<< URB 127 + 00000000: 05 00 da 03 00 00 00 16 00 00 02 5c 4a 17 56 01 ...........\J.V. + 00000010: 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 65 6c ..net_rim_bb_hel + 00000020: 70 5f 39 35 30 30 5f 5f 66 72 2d 32 00 00 02 5d p_9500__fr-2...] + 00000030: 4a 17 56 01 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 J.V...net_rim_bb + 00000040: 5f 68 65 6c 70 5f 39 35 30 30 5f 5f 66 72 2d 33 _help_9500__fr-3 + 00000050: 00 00 02 5e 4a 17 4a 82 00 14 6e 65 74 5f 72 69 ...^J.J...net_ri + 00000060: 6d 5f 6d 32 67 5f 69 6e 74 65 72 6e 61 6c 00 00 m_m2g_internal.. + 00000070: 02 5f 4a 17 4a 82 00 16 6e 65 74 5f 72 69 6d 5f ._J.J...net_rim_ + 00000080: 6d 32 67 5f 69 6e 74 65 72 6e 61 6c 2d 31 00 00 m2g_internal-1.. + 00000090: 02 60 4a 17 4a 82 00 16 6e 65 74 5f 72 69 6d 5f .`J.J...net_rim_ + 000000a0: 6d 32 67 5f 69 6e 74 65 72 6e 61 6c 2d 32 00 00 m2g_internal-2.. + 000000b0: 02 61 4a 17 55 fc 00 1b 6e 65 74 5f 72 69 6d 5f .aJ.U...net_rim_ + 000000c0: 62 62 5f 68 65 6c 70 5f 39 35 30 30 5f 5f 65 6e bb_help_9500__en + 000000d0: 5f 47 42 00 00 02 62 4a 17 55 fc 00 1d 6e 65 74 _GB...bJ.U...net + 000000e0: 5f 72 69 6d 5f 62 62 5f 68 65 6c 70 5f 39 35 30 _rim_bb_help_950 + 000000f0: 30 5f 5f 65 6e 5f 47 42 2d 31 00 00 02 63 4a 17 0__en_GB-1...cJ. + 00000100: 55 fc 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 U...net_rim_bb_h + 00000110: 65 6c 70 5f 39 35 30 30 5f 5f 65 6e 5f 47 42 2d elp_9500__en_GB- + 00000120: 32 00 00 02 64 4a 17 55 fc 00 1d 6e 65 74 5f 72 2...dJ.U...net_r + 00000130: 69 6d 5f 62 62 5f 68 65 6c 70 5f 39 35 30 30 5f im_bb_help_9500_ + 00000140: 5f 65 6e 5f 47 42 2d 33 00 00 02 65 4a 17 53 66 _en_GB-3...eJ.Sf + 00000150: 00 2e 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 64 79 ..net_rim_tid_dy + 00000160: 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 61 5f namic_ling_data_ + 00000170: 65 6e 67 6c 69 73 68 5f 67 62 5f 34 35 6b 5f 32 english_gb_45k_2 + 00000180: 00 00 02 66 4a 17 53 66 00 30 6e 65 74 5f 72 69 ...fJ.Sf.0net_ri + 00000190: 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 m_tid_dynamic_li + 000001a0: 6e 67 5f 64 61 74 61 5f 65 6e 67 6c 69 73 68 5f ng_data_english_ + 000001b0: 67 62 5f 34 35 6b 5f 32 2d 34 00 00 02 67 4a 17 gb_45k_2-4...gJ. + 000001c0: 53 66 00 30 6e 65 74 5f 72 69 6d 5f 74 69 64 5f Sf.0net_rim_tid_ + 000001d0: 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 dynamic_ling_dat + 000001e0: 61 5f 65 6e 67 6c 69 73 68 5f 67 62 5f 34 35 6b a_english_gb_45k + 000001f0: 5f 32 2d 31 00 00 02 68 4a 17 53 66 00 30 6e 65 _2-1...hJ.Sf.0ne + 00000200: 74 5f 72 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 t_rim_tid_dynami + 00000210: 63 5f 6c 69 6e 67 5f 64 61 74 61 5f 65 6e 67 6c c_ling_data_engl + 00000220: 69 73 68 5f 67 62 5f 34 35 6b 5f 32 2d 32 00 00 ish_gb_45k_2-2.. + 00000230: 02 69 4a 17 53 66 00 30 6e 65 74 5f 72 69 6d 5f .iJ.Sf.0net_rim_ + 00000240: 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 tid_dynamic_ling + 00000250: 5f 64 61 74 61 5f 65 6e 67 6c 69 73 68 5f 67 62 _data_english_gb + 00000260: 5f 34 35 6b 5f 32 2d 33 00 00 02 6a 4a 17 54 b2 _45k_2-3...jJ.T. + 00000270: 00 22 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e ."net_rim_vad_en + 00000280: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 gine_resource__e + 00000290: 6e 5f 47 42 00 00 02 6b 4a 17 54 b2 00 24 6e 65 n_GB...kJ.T..$ne + 000002a0: 74 5f 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 t_rim_vad_engine + 000002b0: 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 47 42 _resource__en_GB + 000002c0: 2d 31 00 00 02 6c 4a 17 54 b2 00 24 6e 65 74 5f -1...lJ.T..$net_ + 000002d0: 72 69 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 rim_vad_engine_r + 000002e0: 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 47 42 2d 32 esource__en_GB-2 + 000002f0: 00 00 02 6d 4a 17 54 b2 00 24 6e 65 74 5f 72 69 ...mJ.T..$net_ri + 00000300: 6d 5f 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 m_vad_engine_res + 00000310: 6f 75 72 63 65 5f 5f 65 6e 5f 47 42 2d 33 00 00 ource__en_GB-3.. + 00000320: 02 6e 4a 17 54 b2 00 24 6e 65 74 5f 72 69 6d 5f .nJ.T..$net_rim_ + 00000330: 76 61 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 vad_engine_resou + 00000340: 72 63 65 5f 5f 65 6e 5f 47 42 2d 34 00 00 02 6f rce__en_GB-4...o + 00000350: 4a 17 54 b2 00 24 6e 65 74 5f 72 69 6d 5f 76 61 J.T..$net_rim_va + 00000360: 64 5f 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 d_engine_resourc + 00000370: 65 5f 5f 65 6e 5f 47 42 2d 35 00 00 02 70 4a 17 e__en_GB-5...pJ. + 00000380: 54 b2 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f T..$net_rim_vad_ + 00000390: 65 6e 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f engine_resource_ + 000003a0: 5f 65 6e 5f 47 42 2d 36 00 00 02 71 4a 17 54 b2 _en_GB-6...qJ.T. + 000003b0: 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e .$net_rim_vad_en + 000003c0: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 gine_resource__e + 000003d0: 6e 5f 47 42 2d 37 00 00 02 72 n_GB-7...r + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 148 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 72 ..........r +<<< URB 128 + 00000000: 00 00 0c 00 13 05 01 00 18 00 00 00 ............ +<<< URB 130 + 00000000: 05 00 06 00 03 e6 ...... +<<< URB 131 + 00000000: 05 00 ea 03 00 00 00 1f 00 00 02 72 4a 17 54 b2 ...........rJ.T. + 00000010: 00 24 6e 65 74 5f 72 69 6d 5f 76 61 64 5f 65 6e .$net_rim_vad_en + 00000020: 67 69 6e 65 5f 72 65 73 6f 75 72 63 65 5f 5f 65 gine_resource__e + 00000030: 6e 5f 47 42 2d 38 00 00 02 73 4a 17 55 b1 00 12 n_GB-8...sJ.U... + 00000040: 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 6c 69 65 net_rim_bis_clie + 00000050: 6e 74 00 00 02 74 4a 17 55 b1 00 14 6e 65 74 5f nt...tJ.U...net_ + 00000060: 72 69 6d 5f 62 69 73 5f 63 6c 69 65 6e 74 2d 31 rim_bis_client-1 + 00000070: 00 00 02 75 4a 17 55 b1 00 14 6e 65 74 5f 72 69 ...uJ.U...net_ri + 00000080: 6d 5f 62 69 73 5f 63 6c 69 65 6e 74 2d 33 00 00 m_bis_client-3.. + 00000090: 02 76 4a 17 55 76 00 15 6e 65 74 5f 72 69 6d 5f .vJ.Uv..net_rim_ + 000000a0: 62 62 61 70 69 5f 62 72 6f 77 73 65 72 00 00 02 bbapi_browser... + 000000b0: 77 4a 17 53 d2 00 0f 6e 65 74 5f 72 69 6d 5f 62 wJ.S...net_rim_b + 000000c0: 69 73 5f 6c 69 62 00 00 02 78 4a 17 55 b1 00 14 is_lib...xJ.U... + 000000d0: 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 6c 69 65 net_rim_bis_clie + 000000e0: 6e 74 2d 32 00 00 02 79 4a 17 51 65 00 15 6e 65 nt-2...yJ.Qe..ne + 000000f0: 74 5f 72 69 6d 5f 62 62 5f 6f 74 61 75 70 67 72 t_rim_bb_otaupgr + 00000100: 61 64 65 00 00 02 7a 4a 17 51 65 00 17 6e 65 74 ade...zJ.Qe..net + 00000110: 5f 72 69 6d 5f 62 62 5f 6f 74 61 75 70 67 72 61 _rim_bb_otaupgra + 00000120: 64 65 2d 31 00 00 02 7b 4a 17 51 65 00 17 6e 65 de-1...{J.Qe..ne + 00000130: 74 5f 72 69 6d 5f 62 62 5f 6f 74 61 75 70 67 72 t_rim_bb_otaupgr + 00000140: 61 64 65 2d 32 00 00 02 7c 4a 17 50 6e 00 18 6e ade-2...|J.Pn..n + 00000150: 65 74 5f 72 69 6d 5f 62 62 5f 6f 74 61 73 6c 5f et_rim_bb_otasl_ + 00000160: 63 68 61 6e 6e 65 6c 00 00 02 7d 4a 17 53 28 00 channel...}J.S(. + 00000170: 10 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f .net_rim_crypto_ + 00000180: 33 00 00 02 7e 4a 17 53 28 00 12 6e 65 74 5f 72 3...~J.S(..net_r + 00000190: 69 6d 5f 63 72 79 70 74 6f 5f 33 2d 31 00 00 02 im_crypto_3-1... + 000001a0: 7f 4a 17 53 28 00 12 6e 65 74 5f 72 69 6d 5f 63 .J.S(..net_rim_c + 000001b0: 72 79 70 74 6f 5f 33 2d 32 00 00 02 80 4a 17 50 rypto_3-2....J.P + 000001c0: ab 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 64 ...net_rim_bb_ad + 000001d0: 64 72 65 73 73 62 6f 6f 6b 5f 61 70 70 00 00 02 dressbook_app... + 000001e0: 81 4a 17 50 ab 00 1c 6e 65 74 5f 72 69 6d 5f 62 .J.P...net_rim_b + 000001f0: 62 5f 61 64 64 72 65 73 73 62 6f 6f 6b 5f 61 70 b_addressbook_ap + 00000200: 70 2d 32 00 00 02 82 4a 17 50 ab 00 1c 6e 65 74 p-2....J.P...net + 00000210: 5f 72 69 6d 5f 62 62 5f 61 64 64 72 65 73 73 62 _rim_bb_addressb + 00000220: 6f 6f 6b 5f 61 70 70 2d 31 00 00 02 83 4a 17 55 ook_app-1....J.U + 00000230: 04 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 5f 6d 65 ...net_rim_bb_me + 00000240: 73 73 61 67 65 73 65 61 72 63 68 5f 6c 69 62 00 ssagesearch_lib. + 00000250: 00 02 84 4a 17 55 04 00 1e 6e 65 74 5f 72 69 6d ...J.U...net_rim + 00000260: 5f 62 62 5f 6d 65 73 73 61 67 65 73 65 61 72 63 _bb_messagesearc + 00000270: 68 5f 6c 69 62 2d 31 00 00 02 85 4a 17 50 c7 00 h_lib-1....J.P.. + 00000280: 14 6e 65 74 5f 72 69 6d 5f 62 62 5f 63 6c 6f 63 .net_rim_bb_cloc + 00000290: 6b 5f 6c 69 62 00 00 02 86 4a 17 50 c7 00 16 6e k_lib....J.P...n + 000002a0: 65 74 5f 72 69 6d 5f 62 62 5f 63 6c 6f 63 6b 5f et_rim_bb_clock_ + 000002b0: 6c 69 62 2d 31 00 00 02 87 4a 17 50 c7 00 16 6e lib-1....J.P...n + 000002c0: 65 74 5f 72 69 6d 5f 62 62 5f 63 6c 6f 63 6b 5f et_rim_bb_clock_ + 000002d0: 6c 69 62 2d 32 00 00 02 88 4a 17 4b 34 00 14 6e lib-2....J.K4..n + 000002e0: 65 74 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f et_rim_bb_phone_ + 000002f0: 61 70 70 00 00 02 89 4a 17 4b 34 00 16 6e 65 74 app....J.K4..net + 00000300: 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f 61 70 _rim_bb_phone_ap + 00000310: 70 2d 32 00 00 02 8a 4a 17 4b 34 00 16 6e 65 74 p-2....J.K4..net + 00000320: 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e 65 5f 61 70 _rim_bb_phone_ap + 00000330: 70 2d 31 00 00 02 8b 4a 17 55 b6 00 11 6e 65 74 p-1....J.U...net + 00000340: 5f 72 69 6d 5f 62 62 5f 63 61 6d 65 72 61 00 00 _rim_bb_camera.. + 00000350: 02 8c 4a 17 55 b6 00 13 6e 65 74 5f 72 69 6d 5f ..J.U...net_rim_ + 00000360: 62 62 5f 63 61 6d 65 72 61 2d 31 00 00 02 8d 4a bb_camera-1....J + 00000370: 17 55 b6 00 13 6e 65 74 5f 72 69 6d 5f 62 62 5f .U...net_rim_bb_ + 00000380: 63 61 6d 65 72 61 2d 32 00 00 02 8e 4a 17 50 d5 camera-2....J.P. + 00000390: 00 0e 6e 65 74 5f 72 69 6d 5f 62 62 5f 6d 74 70 ..net_rim_bb_mtp + 000003a0: 00 00 02 8f 4a 17 50 d5 00 10 6e 65 74 5f 72 69 ....J.P...net_ri + 000003b0: 6d 5f 62 62 5f 6d 74 70 2d 31 00 00 02 90 4a 17 m_bb_mtp-1....J. + 000003c0: 51 88 00 22 6e 65 74 5f 72 69 6d 5f 64 65 76 69 Q.."net_rim_devi + 000003d0: 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f ce_apps_games_wo + 000003e0: 72 64 6d 6f 6c 65 00 00 02 91 rdmole.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 152 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 91 ........... +<<< URB 132 + 00000000: 00 00 0c 00 13 05 01 00 19 00 00 00 ............ +<<< URB 134 + 00000000: 05 00 06 00 03 e6 ...... +<<< URB 135 + 00000000: 05 00 ea 03 00 00 00 1d 00 00 02 91 4a 17 51 88 ............J.Q. + 00000010: 00 24 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 65 .$net_rim_device + 00000020: 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 64 _apps_games_word + 00000030: 6d 6f 6c 65 2d 31 00 00 02 92 4a 17 49 fa 00 0d mole-1....J.I... + 00000040: 6e 65 74 5f 72 69 6d 5f 6d 65 64 69 61 00 00 02 net_rim_media... + 00000050: 93 4a 17 49 fa 00 0f 6e 65 74 5f 72 69 6d 5f 6d .J.I...net_rim_m + 00000060: 65 64 69 61 2d 31 00 00 02 94 4a 17 53 37 00 12 edia-1....J.S7.. + 00000070: 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f 70 net_rim_crypto_p + 00000080: 67 70 00 00 02 95 4a 17 53 37 00 14 6e 65 74 5f gp....J.S7..net_ + 00000090: 72 69 6d 5f 63 72 79 70 74 6f 5f 70 67 70 2d 31 rim_crypto_pgp-1 + 000000a0: 00 00 02 96 4a 17 55 40 00 17 6e 65 74 5f 72 69 ....J.U@..net_ri + 000000b0: 6d 5f 62 62 5f 63 61 6c 65 6e 64 61 72 5f 6c 69 m_bb_calendar_li + 000000c0: 62 00 00 02 97 4a 17 55 40 00 19 6e 65 74 5f 72 b....J.U@..net_r + 000000d0: 69 6d 5f 62 62 5f 63 61 6c 65 6e 64 61 72 5f 6c im_bb_calendar_l + 000000e0: 69 62 2d 31 00 00 02 98 4a 17 55 26 00 18 6e 65 ib-1....J.U&..ne + 000000f0: 74 5f 72 69 6d 5f 62 62 5f 66 72 65 65 5f 62 75 t_rim_bb_free_bu + 00000100: 73 79 5f 6c 69 62 00 00 02 99 4a 17 52 f2 00 17 sy_lib....J.R... + 00000110: 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 73 70 65 6c net_rim_tid_spel + 00000120: 6c 5f 63 68 65 63 6b 00 00 02 9a 4a 17 52 f2 00 l_check....J.R.. + 00000130: 19 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 73 70 65 .net_rim_tid_spe + 00000140: 6c 6c 5f 63 68 65 63 6b 2d 31 00 00 02 9b 4a 17 ll_check-1....J. + 00000150: 57 48 00 13 6e 65 74 5f 72 69 6d 5f 73 65 63 75 WH..net_rim_secu + 00000160: 72 65 65 6d 61 69 6c 00 00 02 9c 4a 17 57 48 00 reemail....J.WH. + 00000170: 15 6e 65 74 5f 72 69 6d 5f 73 65 63 75 72 65 65 .net_rim_securee + 00000180: 6d 61 69 6c 2d 31 00 00 02 9d 4a 17 57 3e 00 17 mail-1....J.W>.. + 00000190: 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c 64 61 70 5f net_rim_bb_ldap_ + 000001a0: 62 72 6f 77 73 65 72 00 00 02 9e 4a 17 57 2c 00 browser....J.W,. + 000001b0: 1f 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f .net_rim_crypto_ + 000001c0: 6b 65 79 73 74 6f 72 65 5f 62 72 6f 77 73 65 72 keystore_browser + 000001d0: 00 00 02 9f 4a 17 56 36 00 15 6e 65 74 5f 72 69 ....J.V6..net_ri + 000001e0: 6d 5f 62 62 5f 63 72 79 70 74 6f 5f 61 70 69 00 m_bb_crypto_api. + 000001f0: 00 02 a0 4a 17 55 a9 00 15 6e 65 74 5f 72 69 6d ...J.U...net_rim + 00000200: 5f 62 62 5f 61 70 70 5f 63 65 6e 74 65 72 00 00 _bb_app_center.. + 00000210: 02 a1 4a 17 55 a9 00 17 6e 65 74 5f 72 69 6d 5f ..J.U...net_rim_ + 00000220: 62 62 5f 61 70 70 5f 63 65 6e 74 65 72 2d 31 00 bb_app_center-1. + 00000230: 00 02 a2 4a 17 51 32 00 17 6e 65 74 5f 72 69 6d ...J.Q2..net_rim + 00000240: 5f 62 62 5f 63 61 6c 65 6e 64 61 72 5f 61 70 70 _bb_calendar_app + 00000250: 00 00 02 a3 4a 17 51 32 00 19 6e 65 74 5f 72 69 ....J.Q2..net_ri + 00000260: 6d 5f 62 62 5f 63 61 6c 65 6e 64 61 72 5f 61 70 m_bb_calendar_ap + 00000270: 70 2d 31 00 00 02 a4 4a 17 50 e2 00 10 6e 65 74 p-1....J.P...net + 00000280: 5f 72 69 6d 5f 62 62 5f 63 6c 6f 63 6b 00 00 02 _rim_bb_clock... + 00000290: a5 4a 17 50 e2 00 12 6e 65 74 5f 72 69 6d 5f 62 .J.P...net_rim_b + 000002a0: 62 5f 63 6c 6f 63 6b 2d 31 00 00 02 a6 4a 17 55 b_clock-1....J.U + 000002b0: bf 00 0e 6e 65 74 5f 72 69 6d 5f 62 62 5f 67 61 ...net_rim_bb_ga + 000002c0: 73 00 00 02 a7 4a 17 55 bf 00 10 6e 65 74 5f 72 s....J.U...net_r + 000002d0: 69 6d 5f 62 62 5f 67 61 73 2d 31 00 00 02 a8 4a im_bb_gas-1....J + 000002e0: 17 53 11 00 28 6e 65 74 5f 72 69 6d 5f 74 69 64 .S..(net_rim_tid + 000002f0: 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 _dynamic_ling_da + 00000300: 74 61 5f 66 72 65 6e 63 68 5f 6c 74 72 00 00 02 ta_french_ltr... + 00000310: a9 4a 17 53 11 00 2a 6e 65 74 5f 72 69 6d 5f 74 .J.S..*net_rim_t + 00000320: 69 64 5f 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f id_dynamic_ling_ + 00000330: 64 61 74 61 5f 66 72 65 6e 63 68 5f 6c 74 72 2d data_french_ltr- + 00000340: 32 00 00 02 aa 4a 17 53 11 00 2a 6e 65 74 5f 72 2....J.S..*net_r + 00000350: 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 63 5f 6c im_tid_dynamic_l + 00000360: 69 6e 67 5f 64 61 74 61 5f 66 72 65 6e 63 68 5f ing_data_french_ + 00000370: 6c 74 72 2d 31 00 00 02 ab 4a 17 50 89 00 1d 6e ltr-1....J.P...n + 00000380: 65 74 5f 72 69 6d 5f 62 62 5f 61 64 64 72 65 73 et_rim_bb_addres + 00000390: 73 62 6f 6f 6b 5f 73 69 6d 61 70 70 00 00 02 ac sbook_simapp.... + 000003a0: 4a 17 50 89 00 1f 6e 65 74 5f 72 69 6d 5f 62 62 J.P...net_rim_bb + 000003b0: 5f 61 64 64 72 65 73 73 62 6f 6f 6b 5f 73 69 6d _addressbook_sim + 000003c0: 61 70 70 2d 31 00 00 02 ad 4a 17 4f e8 00 17 6e app-1....J.O...n + 000003d0: 65 74 5f 72 69 6d 5f 62 62 5f 73 69 6d 70 68 6f et_rim_bb_simpho + 000003e0: 6e 65 62 6f 6f 6b 00 00 02 ae nebook.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 156 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 ae ........... +<<< URB 136 + 00000000: 00 00 0c 00 13 05 01 00 1a 00 00 00 ............ +<<< URB 138 + 00000000: 05 00 06 00 03 e1 ...... +<<< URB 139 + 00000000: 05 00 e5 03 00 00 00 1b 00 00 02 ae 4a 17 53 d9 ............J.S. + 00000010: 00 16 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 6c ..net_rim_bis_cl + 00000020: 69 65 6e 74 5f 5f 65 6e 00 00 02 af 4a 17 53 d9 ient__en....J.S. + 00000030: 00 18 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 6c ..net_rim_bis_cl + 00000040: 69 65 6e 74 5f 5f 65 6e 2d 31 00 00 02 b0 4a 17 ient__en-1....J. + 00000050: 51 90 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 64 Q...net_rim_bb_d + 00000060: 65 76 69 63 65 5f 73 65 6c 66 74 65 73 74 00 00 evice_selftest.. + 00000070: 02 b1 4a 17 51 90 00 1c 6e 65 74 5f 72 69 6d 5f ..J.Q...net_rim_ + 00000080: 62 62 5f 64 65 76 69 63 65 5f 73 65 6c 66 74 65 bb_device_selfte + 00000090: 73 74 2d 31 00 00 02 b2 4a 17 57 50 00 12 6e 65 st-1....J.WP..ne + 000000a0: 74 5f 72 69 6d 5f 62 62 5f 70 67 70 5f 6c 69 62 t_rim_bb_pgp_lib + 000000b0: 00 00 02 b3 4a 17 57 44 00 23 6e 65 74 5f 72 69 ....J.WD.#net_ri + 000000c0: 6d 5f 63 72 79 70 74 6f 5f 6b 65 79 73 74 6f 72 m_crypto_keystor + 000000d0: 65 5f 62 72 6f 77 73 65 72 5f 70 67 70 00 00 02 e_browser_pgp... + 000000e0: b4 4a 17 57 50 00 14 6e 65 74 5f 72 69 6d 5f 62 .J.WP..net_rim_b + 000000f0: 62 5f 70 67 70 5f 6c 69 62 2d 31 00 00 02 b5 4a b_pgp_lib-1....J + 00000100: 17 49 e8 00 1c 6e 65 74 5f 72 69 6d 5f 70 6c 61 .I...net_rim_pla + 00000110: 74 66 6f 72 6d 5f 69 6d 5f 72 65 73 6f 75 72 63 tform_im_resourc + 00000120: 65 00 00 02 b6 4a 17 49 e8 00 1e 6e 65 74 5f 72 e....J.I...net_r + 00000130: 69 6d 5f 70 6c 61 74 66 6f 72 6d 5f 69 6d 5f 72 im_platform_im_r + 00000140: 65 73 6f 75 72 63 65 2d 31 00 00 02 b7 4a 17 53 esource-1....J.S + 00000150: dc 00 16 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 ...net_rim_bis_c + 00000160: 6c 69 65 6e 74 5f 5f 66 72 00 00 02 b8 4a 17 53 lient__fr....J.S + 00000170: dc 00 18 6e 65 74 5f 72 69 6d 5f 62 69 73 5f 63 ...net_rim_bis_c + 00000180: 6c 69 65 6e 74 5f 5f 66 72 2d 31 00 00 02 b9 4a lient__fr-1....J + 00000190: 17 50 59 00 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f .PY..net_rim_bb_ + 000001a0: 63 6c 6f 63 6b 5f 66 61 63 65 73 5f 34 38 30 00 clock_faces_480. + 000001b0: 00 02 ba 4a 17 50 59 00 1c 6e 65 74 5f 72 69 6d ...J.PY..net_rim + 000001c0: 5f 62 62 5f 63 6c 6f 63 6b 5f 66 61 63 65 73 5f _bb_clock_faces_ + 000001d0: 34 38 30 2d 31 00 00 02 bb 4a 17 52 92 00 19 6e 480-1....J.R...n + 000001e0: 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 65 75 72 6f et_rim_font_euro + 000001f0: 70 65 61 6e 5f 73 66 66 00 00 02 bc 4a 17 52 92 pean_sff....J.R. + 00000200: 00 1b 6e 65 74 5f 72 69 6d 5f 66 6f 6e 74 5f 65 ..net_rim_font_e + 00000210: 75 72 6f 70 65 61 6e 5f 73 66 66 2d 31 00 00 02 uropean_sff-1... + 00000220: bd 4a 17 55 d6 00 26 6e 65 74 5f 72 69 6d 5f 64 .J.U..&net_rim_d + 00000230: 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 evice_apps_games + 00000240: 5f 62 72 69 63 6b 62 72 65 61 6b 65 72 00 00 02 _brickbreaker... + 00000250: be 4a 17 55 d6 00 28 6e 65 74 5f 72 69 6d 5f 64 .J.U..(net_rim_d + 00000260: 65 76 69 63 65 5f 61 70 70 73 5f 67 61 6d 65 73 evice_apps_games + 00000270: 5f 62 72 69 63 6b 62 72 65 61 6b 65 72 2d 31 00 _brickbreaker-1. + 00000280: 00 02 bf 4a 17 54 9d 00 18 6e 65 74 5f 72 69 6d ...J.T...net_rim + 00000290: 5f 62 62 5f 6d 65 64 69 61 72 65 63 6f 72 64 65 _bb_mediarecorde + 000002a0: 72 00 00 02 c0 4a 17 54 9d 00 1a 6e 65 74 5f 72 r....J.T...net_r + 000002b0: 69 6d 5f 62 62 5f 6d 65 64 69 61 72 65 63 6f 72 im_bb_mediarecor + 000002c0: 64 65 72 2d 31 00 00 02 c1 4a 17 54 4f 00 17 6e der-1....J.TO..n + 000002d0: 65 74 5f 72 69 6d 5f 62 62 5f 72 65 73 6f 75 72 et_rim_bb_resour + 000002e0: 63 65 5f 5f 65 6e 00 00 02 c2 4a 17 54 4f 00 19 ce__en....J.TO.. + 000002f0: 6e 65 74 5f 72 69 6d 5f 62 62 5f 72 65 73 6f 75 net_rim_bb_resou + 00000300: 72 63 65 5f 5f 65 6e 2d 31 00 00 02 c3 4a 17 54 rce__en-1....J.T + 00000310: 54 00 17 6e 65 74 5f 72 69 6d 5f 62 62 5f 72 65 T..net_rim_bb_re + 00000320: 73 6f 75 72 63 65 5f 5f 66 72 00 00 02 c4 4a 17 source__fr....J. + 00000330: 54 54 00 19 6e 65 74 5f 72 69 6d 5f 62 62 5f 72 TT..net_rim_bb_r + 00000340: 65 73 6f 75 72 63 65 5f 5f 66 72 2d 31 00 00 02 esource__fr-1... + 00000350: c5 4a 17 51 76 00 1d 6e 65 74 5f 72 69 6d 5f 62 .J.Qv..net_rim_b + 00000360: 62 5f 76 6f 69 63 65 6e 6f 74 65 73 72 65 63 6f b_voicenotesreco + 00000370: 72 64 65 72 00 00 02 c6 4a 17 51 76 00 1f 6e 65 rder....J.Qv..ne + 00000380: 74 5f 72 69 6d 5f 62 62 5f 76 6f 69 63 65 6e 6f t_rim_bb_voiceno + 00000390: 74 65 73 72 65 63 6f 72 64 65 72 2d 31 00 00 02 tesrecorder-1... + 000003a0: c7 4a 17 52 7a 00 18 6e 65 74 5f 72 69 6d 5f 63 .J.Rz..net_rim_c + 000003b0: 6c 64 63 5f 69 6f 5f 72 69 6d 5f 69 6d 70 6c 00 ldc_io_rim_impl. + 000003c0: 00 02 c8 4a 17 53 3e 00 18 6e 65 74 5f 72 69 6d ...J.S>..net_rim + 000003d0: 5f 74 69 64 5f 66 61 73 74 45 75 72 6f 70 65 61 _tid_fastEuropea + 000003e0: 6e 00 00 02 c9 n.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 160 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 c9 ........... +<<< URB 140 + 00000000: 00 00 0c 00 13 05 01 00 1b 00 00 00 ............ +<<< URB 142 + 00000000: 05 00 06 00 03 ea ...... +<<< URB 143 + 00000000: 05 00 ee 03 00 00 00 1d 00 00 02 c9 4a 17 53 32 ............J.S2 + 00000010: 00 1d 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 62 61 ..net_rim_tid_ba + 00000020: 73 69 63 46 61 73 74 45 75 72 6f 70 65 61 6e 00 sicFastEuropean. + 00000030: 00 02 ca 4a 17 53 07 00 23 6e 65 74 5f 72 69 6d ...J.S..#net_rim + 00000040: 5f 74 69 64 5f 72 65 70 6f 73 69 74 6f 72 79 42 _tid_repositoryB + 00000050: 61 73 65 64 45 75 72 6f 70 65 61 6e 00 00 02 cb asedEuropean.... + 00000060: 4a 17 52 85 00 0b 6e 65 74 5f 72 69 6d 5f 77 61 J.R...net_rim_wa + 00000070: 70 00 00 02 cc 4a 17 55 3a 00 11 6e 65 74 5f 72 p....J.U:..net_r + 00000080: 69 6d 5f 62 62 61 70 69 5f 70 69 6d 00 00 02 cd im_bbapi_pim.... + 00000090: 4a 17 51 2b 00 15 6e 65 74 5f 72 69 6d 5f 62 62 J.Q+..net_rim_bb + 000000a0: 5f 61 63 74 69 76 61 74 69 6f 6e 00 00 02 ce 4a _activation....J + 000000b0: 17 4a e5 00 1b 6e 65 74 5f 72 69 6d 5f 70 6c 61 .J...net_rim_pla + 000000c0: 7a 6d 69 63 5f 74 68 65 6d 65 72 65 61 64 65 72 zmic_themereader + 000000d0: 00 00 02 cf 4a 17 51 83 00 14 6e 65 74 5f 72 69 ....J.Q...net_ri + 000000e0: 6d 5f 62 62 5f 67 61 6d 65 73 5f 61 70 70 00 00 m_bb_games_app.. + 000000f0: 02 d0 4a 17 53 37 00 12 6e 65 74 5f 72 69 6d 5f ..J.S7..net_rim_ + 00000100: 63 72 79 70 74 6f 5f 63 6d 73 00 00 02 d1 4a 17 crypto_cms....J. + 00000110: 4a cc 00 21 6e 65 74 5f 72 69 6d 5f 70 6c 61 74 J..!net_rim_plat + 00000120: 66 6f 72 6d 61 70 70 73 5f 72 65 73 6f 75 72 63 formapps_resourc + 00000130: 65 5f 5f 66 72 00 00 02 d2 4a 17 4a ef 00 21 6e e__fr....J.J..!n + 00000140: 65 74 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d 61 et_rim_platforma + 00000150: 70 70 73 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e pps_resource__en + 00000160: 00 00 02 d3 4a 17 51 1e 00 13 6e 65 74 5f 72 69 ....J.Q...net_ri + 00000170: 6d 5f 62 62 5f 74 61 73 6b 5f 61 70 70 00 00 02 m_bb_task_app... + 00000180: d4 4a 17 57 54 00 14 6e 65 74 5f 72 69 6d 5f 62 .J.WT..net_rim_b + 00000190: 62 5f 73 6d 69 6d 65 5f 6c 69 62 00 00 02 d5 4a b_smime_lib....J + 000001a0: 17 57 40 00 2b 6e 65 74 5f 72 69 6d 5f 63 72 79 .W@.+net_rim_cry + 000001b0: 70 74 6f 5f 6b 65 79 73 74 6f 72 65 5f 62 72 6f pto_keystore_bro + 000001c0: 77 73 65 72 5f 63 65 72 74 69 66 69 63 61 74 65 wser_certificate + 000001d0: 00 00 02 d6 4a 17 55 8e 00 13 6e 65 74 5f 72 69 ....J.U...net_ri + 000001e0: 6d 5f 62 62 5f 73 75 70 6c 5f 61 70 70 00 00 02 m_bb_supl_app... + 000001f0: d7 4a 17 4f 53 00 14 6e 65 74 5f 72 69 6d 5f 73 .J.OS..net_rim_s + 00000200: 65 31 33 6e 65 74 74 61 62 6c 65 00 00 02 d8 4a e13nettable....J + 00000210: 17 55 2c 00 15 6e 65 74 5f 72 69 6d 5f 62 62 5f .U,..net_rim_bb_ + 00000220: 64 69 61 67 6e 6f 73 74 69 63 00 00 02 d9 4a 17 diagnostic....J. + 00000230: 54 ac 00 0b 6e 65 74 5f 72 69 6d 5f 76 61 64 00 T...net_rim_vad. + 00000240: 00 02 da 4a 17 50 bc 00 15 6e 65 74 5f 72 69 6d ...J.P...net_rim + 00000250: 5f 62 62 5f 72 69 63 68 5f 65 6d 61 69 6c 00 00 _bb_rich_email.. + 00000260: 02 db 4a 17 53 29 00 15 6e 65 74 5f 72 69 6d 5f ..J.S)..net_rim_ + 00000270: 4d 49 44 50 52 6f 6f 74 43 65 72 74 73 00 00 02 MIDPRootCerts... + 00000280: dc 4a 17 55 95 00 18 6e 65 74 5f 72 69 6d 5f 62 .J.U...net_rim_b + 00000290: 62 5f 76 69 64 65 6f 72 65 63 6f 72 64 65 72 00 b_videorecorder. + 000002a0: 00 02 dd 4a 17 51 19 00 17 6e 65 74 5f 72 69 6d ...J.Q...net_rim + 000002b0: 5f 62 62 5f 63 61 6c 65 6e 64 61 72 5f 6f 74 61 _bb_calendar_ota + 000002c0: 00 00 02 de 4a 17 4a bf 00 15 6e 65 74 5f 72 69 ....J.J...net_ri + 000002d0: 6d 5f 73 65 72 76 69 63 65 73 5f 69 6d 70 6c 00 m_services_impl. + 000002e0: 00 02 df 4a 17 4a 03 00 18 6e 65 74 5f 72 69 6d ...J.J...net_rim + 000002f0: 5f 70 72 6f 63 65 73 73 5f 6c 61 75 6e 63 68 65 _process_launche + 00000300: 72 00 00 02 e0 4a 17 56 7c 00 19 6e 65 74 5f 72 r....J.V|..net_r + 00000310: 69 6d 5f 62 62 5f 70 61 73 73 77 6f 72 64 6b 65 im_bb_passwordke + 00000320: 65 70 65 72 00 00 02 e1 4a 17 4b 22 00 15 6e 65 eper....J.K"..ne + 00000330: 74 5f 72 69 6d 5f 62 62 5f 72 69 62 62 6f 6e 5f t_rim_bb_ribbon_ + 00000340: 6c 69 62 00 00 02 e2 4a 17 51 7b 00 23 6e 65 74 lib....J.Q{.#net + 00000350: 5f 72 69 6d 5f 70 6c 61 7a 6d 69 63 5f 6d 65 64 _rim_plazmic_med + 00000360: 69 61 65 6e 67 69 6e 65 5f 73 6d 69 6c 5f 30 30 iaengine_smil_00 + 00000370: 00 00 02 e3 4a 17 55 80 00 0f 6e 65 74 5f 72 69 ....J.U...net_ri + 00000380: 6d 5f 62 62 5f 69 6f 74 61 00 00 02 e4 4a 17 4f m_bb_iota....J.O + 00000390: e3 00 30 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 ..0net_rim_devic + 000003a0: 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 e_apps_games_wor + 000003b0: 64 6d 6f 6c 65 5f 72 65 73 6f 75 72 63 65 73 5f dmole_resources_ + 000003c0: 5f 66 72 00 00 02 e5 4a 17 4a 40 00 1d 6e 65 74 _fr....J.J@..net + 000003d0: 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d 5f 72 65 _rim_platform_re + 000003e0: 73 6f 75 72 63 65 5f 5f 66 72 00 00 02 e6 source__fr.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 164 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 e6 ........... +<<< URB 144 + 00000000: 00 00 0c 00 13 05 01 00 1c 00 00 00 ............ +<<< URB 146 + 00000000: 05 00 06 00 03 dc ...... +<<< URB 147 + 00000000: 05 00 e0 03 00 00 00 19 00 00 02 e6 4a 17 56 2a ............J.V* + 00000010: 00 22 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 65 74 ."net_rim_bb_set + 00000020: 75 70 77 69 7a 61 72 64 5f 69 6d 61 67 65 73 5f upwizard_images_ + 00000030: 39 35 30 30 00 00 02 e7 4a 17 55 11 00 15 6e 65 9500....J.U...ne + 00000040: 74 5f 72 69 6d 5f 62 62 5f 69 6d 70 6c 75 73 5f t_rim_bb_implus_ + 00000050: 61 70 70 00 00 02 e8 4a 17 51 a3 00 19 6e 65 74 app....J.Q...net + 00000060: 5f 72 69 6d 5f 62 62 61 70 69 5f 6d 65 73 73 61 _rim_bbapi_messa + 00000070: 67 65 6c 69 73 74 00 00 02 e9 4a 17 55 9f 00 16 gelist....J.U... + 00000080: 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f 6d 65 net_rim_bbapi_me + 00000090: 6e 75 69 74 65 6d 00 00 02 ea 4a 17 4f c1 00 23 nuitem....J.O..# + 000000a0: 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f 6d 65 net_rim_bbapi_me + 000000b0: 73 73 61 67 65 6c 69 73 74 5f 72 65 73 6f 75 72 ssagelist_resour + 000000c0: 63 65 73 00 00 02 eb 4a 17 52 e9 00 2c 6e 65 74 ces....J.R..,net + 000000d0: 5f 72 69 6d 5f 74 69 64 5f 64 79 6e 61 6d 69 63 _rim_tid_dynamic + 000000e0: 5f 6c 69 6e 67 5f 64 61 74 61 5f 65 6e 67 6c 69 _ling_data_engli + 000000f0: 73 68 5f 67 62 5f 6c 74 72 00 00 02 ec 4a 17 4f sh_gb_ltr....J.O + 00000100: e1 00 30 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 ..0net_rim_devic + 00000110: 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 e_apps_games_wor + 00000120: 64 6d 6f 6c 65 5f 72 65 73 6f 75 72 63 65 73 5f dmole_resources_ + 00000130: 5f 65 6e 00 00 02 ed 4a 17 4a 6f 00 1d 6e 65 74 _en....J.Jo..net + 00000140: 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d 5f 72 65 _rim_platform_re + 00000150: 73 6f 75 72 63 65 5f 5f 65 6e 00 00 02 ee 4a 17 source__en....J. + 00000160: 55 7f 00 0f 6e 65 74 5f 72 69 6d 5f 62 62 5f 68 U...net_rim_bb_h + 00000170: 65 6c 70 00 00 02 ef 4a 17 4a f2 00 24 6e 65 74 elp....J.J..$net + 00000180: 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d 61 70 70 _rim_platformapp + 00000190: 73 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f 47 s_resource__en_G + 000001a0: 42 00 00 02 f0 4a 17 4a 75 00 21 6e 65 74 5f 72 B....J.Ju.!net_r + 000001b0: 69 6d 5f 70 6c 61 7a 6d 69 63 5f 6d 65 64 69 61 im_plazmic_media + 000001c0: 65 6e 67 69 6e 65 5f 70 6d 65 30 32 00 00 02 f1 engine_pme02.... + 000001d0: 4a 17 50 7f 00 14 6e 65 74 5f 72 69 6d 5f 62 62 J.P...net_rim_bb + 000001e0: 5f 6f 74 61 73 6c 5f 61 70 70 00 00 02 f2 4a 17 _otasl_app....J. + 000001f0: 53 0f 00 2c 6e 65 74 5f 72 69 6d 5f 74 69 64 5f S..,net_rim_tid_ + 00000200: 64 79 6e 61 6d 69 63 5f 6c 69 6e 67 5f 64 61 74 dynamic_ling_dat + 00000210: 61 5f 65 6e 67 6c 69 73 68 5f 75 73 5f 6c 74 72 a_english_us_ltr + 00000220: 00 00 02 f3 4a 17 54 38 00 1d 6e 65 74 5f 72 69 ....J.T8..net_ri + 00000230: 6d 5f 62 62 5f 6d 61 6e 61 67 65 5f 63 6f 6e 6e m_bb_manage_conn + 00000240: 65 63 74 69 6f 6e 73 00 00 02 f4 4a 17 4b 29 00 ections....J.K). + 00000250: 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e .net_rim_bb_phon + 00000260: 65 5f 63 64 6d 61 5f 73 65 72 76 69 63 65 00 00 e_cdma_service.. + 00000270: 02 f5 4a 17 50 5e 00 13 6e 65 74 5f 72 69 6d 5f ..J.P^..net_rim_ + 00000280: 62 62 5f 6d 65 6d 6f 5f 61 70 70 00 00 02 f6 4a bb_memo_app....J + 00000290: 17 4b 0f 00 18 6e 65 74 5f 72 69 6d 5f 62 62 5f .K...net_rim_bb_ + 000002a0: 6d 65 73 73 61 67 69 6e 67 5f 61 70 70 00 00 02 messaging_app... + 000002b0: f7 4a 17 54 1c 00 11 6e 65 74 5f 72 69 6d 5f 62 .J.T...net_rim_b + 000002c0: 62 5f 67 70 73 5f 65 65 00 00 02 f8 4a 17 57 26 b_gps_ee....J.W& + 000002d0: 00 15 6e 65 74 5f 72 69 6d 5f 73 6d 61 72 74 63 ..net_rim_smartc + 000002e0: 61 72 64 5f 70 69 76 00 00 02 f9 4a 17 50 84 00 ard_piv....J.P.. + 000002f0: 23 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 64 64 72 #net_rim_bb_addr + 00000300: 65 73 73 62 6f 6f 6b 5f 67 72 6f 75 70 61 64 64 essbook_groupadd + 00000310: 72 65 73 73 00 00 02 fa 4a 17 54 a8 00 1a 6e 65 ress....J.T...ne + 00000320: 74 5f 72 69 6d 5f 62 62 5f 72 65 6d 69 6e 64 65 t_rim_bb_reminde + 00000330: 72 6d 61 6e 61 67 65 72 00 00 02 fb 4a 17 54 a1 rmanager....J.T. + 00000340: 00 1f 6e 65 74 5f 72 69 6d 5f 62 62 5f 6f 70 74 ..net_rim_bb_opt + 00000350: 69 6f 6e 73 5f 66 61 73 74 45 75 72 6f 70 65 61 ions_fastEuropea + 00000360: 6e 00 00 02 fc 4a 17 54 3d 00 27 6e 65 74 5f 72 n....J.T=.'net_r + 00000370: 69 6d 5f 62 62 5f 6f 70 74 69 6f 6e 73 5f 63 75 im_bb_options_cu + 00000380: 73 74 6f 6d 77 6f 72 64 6c 69 73 74 73 63 72 65 stomwordlistscre + 00000390: 65 6e 00 00 02 fd 4a 17 50 cd 00 1b 6e 65 74 5f en....J.P...net_ + 000003a0: 72 69 6d 5f 62 62 5f 66 69 6c 65 69 6e 64 65 78 rim_bb_fileindex + 000003b0: 73 65 72 76 69 63 65 00 00 02 fe 4a 17 52 b7 00 service....J.R.. + 000003c0: 1b 6e 65 74 5f 72 69 6d 5f 63 72 79 70 74 6f 5f .net_rim_crypto_ + 000003d0: 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 02 ff resource__fr.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 168 + 00000000: 05 00 0b 00 00 05 8d 00 00 02 ff ........... +<<< URB 148 + 00000000: 00 00 0c 00 13 05 01 00 1d 00 00 00 ............ +<<< URB 150 + 00000000: 05 00 06 00 03 e1 ...... +<<< URB 151 + 00000000: 05 00 e5 03 00 00 00 1c 00 00 02 ff 4a 17 4a 97 ............J.J. + 00000010: 00 19 6e 65 74 5f 72 69 6d 5f 62 62 5f 73 79 73 ..net_rim_bb_sys + 00000020: 74 65 6d 5f 73 6d 69 6c 65 79 73 00 00 03 00 4a tem_smileys....J + 00000030: 17 50 ad 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f .P...net_rim_bb_ + 00000040: 67 6c 6f 62 61 6c 73 65 61 72 63 68 5f 61 70 70 globalsearch_app + 00000050: 00 00 03 01 49 f2 29 9a 00 1e 6e 65 74 5f 72 69 ....I.)...net_ri + 00000060: 6d 5f 62 62 5f 71 6d 5f 70 65 65 72 5f 72 65 73 m_bb_qm_peer_res + 00000070: 6f 75 72 63 65 5f 66 72 00 00 03 02 4a 17 50 da ource_fr....J.P. + 00000080: 00 19 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 72 6f ..net_rim_bb_pro + 00000090: 66 69 6c 65 73 5f 74 75 6e 65 73 00 00 03 03 4a files_tunes....J + 000000a0: 17 52 b0 00 1b 6e 65 74 5f 72 69 6d 5f 63 72 79 .R...net_rim_cry + 000000b0: 70 74 6f 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e pto_resource__en + 000000c0: 00 00 03 04 4a 17 50 0b 00 21 6e 65 74 5f 72 69 ....J.P..!net_ri + 000000d0: 6d 5f 62 62 5f 73 74 61 6e 64 61 72 64 63 61 6c m_bb_standardcal + 000000e0: 63 75 6c 61 74 6f 72 5f 61 70 70 00 00 03 05 4a culator_app....J + 000000f0: 17 57 22 00 19 6e 65 74 5f 72 69 6d 5f 73 6d 61 .W"..net_rim_sma + 00000100: 72 74 63 61 72 64 5f 64 61 74 61 6b 65 79 00 00 rtcard_datakey.. + 00000110: 03 06 4a 17 53 f9 00 0e 6e 65 74 5f 72 69 6d 5f ..J.S...net_rim_ + 00000120: 62 62 5f 65 6c 74 00 00 03 07 49 f2 29 91 00 1e bb_elt....I.)... + 00000130: 6e 65 74 5f 72 69 6d 5f 62 62 5f 71 6d 5f 70 65 net_rim_bb_qm_pe + 00000140: 65 72 5f 72 65 73 6f 75 72 63 65 5f 65 6e 00 00 er_resource_en.. + 00000150: 03 08 4a 17 56 f5 00 20 6e 65 74 5f 72 69 6d 5f ..J.V.. net_rim_ + 00000160: 73 65 63 75 72 65 65 6d 61 69 6c 5f 72 65 73 6f secureemail_reso + 00000170: 75 72 63 65 5f 5f 65 6e 00 00 03 09 4a 17 51 56 urce__en....J.QV + 00000180: 00 17 6e 65 74 5f 72 69 6d 5f 62 62 5f 64 6f 63 ..net_rim_bb_doc + 00000190: 76 69 65 77 69 6d 61 67 65 00 00 03 0a 4a 17 51 viewimage....J.Q + 000001a0: f9 00 1c 6e 65 74 5f 72 69 6d 5f 72 75 6e 74 69 ...net_rim_runti + 000001b0: 6d 65 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 me_resource__fr. + 000001c0: 00 03 0b 4a 17 54 e9 00 13 6e 65 74 5f 72 69 6d ...J.T...net_rim + 000001d0: 5f 62 62 5f 70 69 6e 67 5f 61 70 70 00 00 03 0c _bb_ping_app.... + 000001e0: 4a 17 50 45 00 14 6e 65 74 5f 72 69 6d 5f 62 62 J.PE..net_rim_bb + 000001f0: 5f 61 6c 61 72 6d 5f 61 70 70 00 00 03 0d 4a 17 _alarm_app....J. + 00000200: 4f eb 00 14 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 O...net_rim_bb_a + 00000210: 6c 61 72 6d 5f 6c 69 62 00 00 03 0e 4a 17 52 80 larm_lib....J.R. + 00000220: 00 1c 6e 65 74 5f 72 69 6d 5f 65 76 65 6e 74 5f ..net_rim_event_ + 00000230: 6c 6f 67 5f 76 69 65 77 65 72 5f 61 70 70 00 00 log_viewer_app.. + 00000240: 03 0f 4a 17 52 70 00 1b 6e 65 74 5f 72 69 6d 5f ..J.Rp..net_rim_ + 00000250: 63 6c 64 63 5f 69 6d 70 6c 5f 73 6f 66 74 74 6f cldc_impl_softto + 00000260: 6b 65 6e 00 00 03 10 45 77 3a ac 00 15 6e 65 74 ken....Ew:...net + 00000270: 5f 72 69 6d 5f 72 69 6d 73 65 63 75 72 69 64 6c _rim_rimsecuridl + 00000280: 69 62 00 00 03 11 45 6c 51 07 00 0a 53 65 63 75 ib....ElQ...Secu + 00000290: 72 49 44 4c 69 62 00 00 03 12 4a 17 4f 4d 00 1c rIDLib....J.OM.. + 000002a0: 6e 65 74 5f 72 69 6d 5f 72 75 6e 74 69 6d 65 5f net_rim_runtime_ + 000002b0: 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 13 resource__en.... + 000002c0: 4a 17 53 ce 00 1c 6e 65 74 5f 72 69 6d 5f 62 62 J.S...net_rim_bb + 000002d0: 5f 61 64 64 72 65 73 73 62 6f 6f 6b 5f 76 63 61 _addressbook_vca + 000002e0: 72 64 00 00 03 14 4a 17 54 ec 00 1e 6e 65 74 5f rd....J.T...net_ + 000002f0: 72 69 6d 5f 62 62 5f 61 70 70 6c 69 63 61 74 69 rim_bb_applicati + 00000300: 6f 6e 64 65 6c 69 76 65 72 79 00 00 03 15 4a 17 ondelivery....J. + 00000310: 54 25 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c T%..net_rim_bb_l + 00000320: 62 73 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 bs_resource__fr. + 00000330: 00 03 16 4a 17 4a 6c 00 19 6e 65 74 5f 72 69 6d ...J.Jl..net_rim + 00000340: 5f 70 6c 61 74 66 6f 72 6d 5f 72 65 73 6f 75 72 _platform_resour + 00000350: 63 65 00 00 03 17 4a 17 57 48 00 1c 6e 65 74 5f ce....J.WH..net_ + 00000360: 72 69 6d 5f 62 62 5f 6c 64 61 70 5f 62 72 6f 77 rim_bb_ldap_brow + 00000370: 73 65 72 5f 78 35 30 39 00 00 03 18 4a 17 56 f9 ser_x509....J.V. + 00000380: 00 20 6e 65 74 5f 72 69 6d 5f 73 65 63 75 72 65 . net_rim_secure + 00000390: 65 6d 61 69 6c 5f 72 65 73 6f 75 72 63 65 5f 5f email_resource__ + 000003a0: 66 72 00 00 03 19 4a 17 54 45 00 16 6e 65 74 5f fr....J.TE..net_ + 000003b0: 72 69 6d 5f 62 62 5f 70 72 6c 5f 75 70 67 72 61 rim_bb_prl_upgra + 000003c0: 64 65 00 00 03 1a 4a 17 4b 3e 00 15 6e 65 74 5f de....J.K>..net_ + 000003d0: 72 69 6d 5f 63 65 6c 6c 62 72 6f 61 64 63 61 73 rim_cellbroadcas + 000003e0: 74 00 00 03 1b t.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 172 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 1b ........... +<<< URB 152 + 00000000: 00 00 0c 00 13 05 01 00 1e 00 00 00 ............ +<<< URB 154 + 00000000: 05 00 06 00 03 d4 ...... +<<< URB 155 + 00000000: 05 00 d8 03 00 00 00 1a 00 00 03 1b 4a 17 54 23 ............J.T# + 00000010: 00 1b 6e 65 74 5f 72 69 6d 5f 62 62 5f 6c 62 73 ..net_rim_bb_lbs + 00000020: 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 _resource__en... + 00000030: 1c 4a 17 56 79 00 11 6e 65 74 5f 72 69 6d 5f 62 .J.Vy..net_rim_b + 00000040: 62 5f 6d 63 5f 61 70 70 00 00 03 1d 4a 17 57 25 b_mc_app....J.W% + 00000050: 00 18 6e 65 74 5f 72 69 6d 5f 73 6d 61 72 74 63 ..net_rim_smartc + 00000060: 61 72 64 5f 67 73 61 63 61 63 00 00 03 1e 4a 17 ard_gsacac....J. + 00000070: 51 99 00 24 6e 65 74 5f 72 69 6d 5f 70 6c 61 7a Q..$net_rim_plaz + 00000080: 6d 69 63 5f 6d 65 64 69 61 65 6e 67 69 6e 65 5f mic_mediaengine_ + 00000090: 73 6d 69 6c 5f 6d 6d 73 00 00 03 1f 4a 17 50 d5 smil_mms....J.P. + 000000a0: 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 5f 6d 65 64 ..net_rim_bb_med + 000000b0: 69 61 6c 69 62 72 61 72 79 70 6c 61 79 65 72 00 ialibraryplayer. + 000000c0: 00 03 20 4a 17 54 e7 00 18 6e 65 74 5f 72 69 6d .. J.T...net_rim + 000000d0: 5f 62 62 5f 64 6e 73 6c 6f 6f 6b 75 70 5f 61 70 _bb_dnslookup_ap + 000000e0: 70 00 00 03 21 4a 17 4a bb 00 13 6e 65 74 5f 72 p...!J.J...net_r + 000000f0: 69 6d 5f 65 73 63 72 65 65 6e 5f 61 70 70 00 00 im_escreen_app.. + 00000100: 03 22 4a 17 57 45 00 1b 6e 65 74 5f 72 69 6d 5f ."J.WE..net_rim_ + 00000110: 62 62 5f 6c 64 61 70 5f 62 72 6f 77 73 65 72 5f bb_ldap_browser_ + 00000120: 70 67 70 00 00 03 23 4a 17 54 a8 00 1a 6e 65 74 pgp...#J.T...net + 00000130: 5f 72 69 6d 5f 73 6f 66 74 74 6f 6b 65 6e 73 5f _rim_softtokens_ + 00000140: 6f 70 74 69 6f 6e 73 00 00 03 24 4a 17 55 6b 00 options...$J.Uk. + 00000150: 16 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f 70 .net_rim_bbapi_p + 00000160: 69 6d 5f 74 6f 64 6f 00 00 03 25 4a 17 55 99 00 im_todo...%J.U.. + 00000170: 1d 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 6e 65 77 .net_rim_tid_new + 00000180: 57 6f 72 64 73 45 78 74 72 61 63 74 6f 72 00 00 WordsExtractor.. + 00000190: 03 26 4a 17 54 48 00 13 6e 65 74 5f 72 69 6d 5f .&J.TH..net_rim_ + 000001a0: 62 62 5f 72 65 73 6f 75 72 63 65 00 00 03 27 4a bb_resource...'J + 000001b0: 17 50 d2 00 1e 6e 65 74 5f 72 69 6d 5f 62 62 5f .P...net_rim_bb_ + 000001c0: 6d 65 64 69 61 63 6f 6e 74 65 6e 74 68 61 6e 64 mediacontenthand + 000001d0: 6c 65 72 00 00 03 28 4a 17 56 d3 00 1e 6e 65 74 ler...(J.V...net + 000001e0: 5f 72 69 6d 5f 62 62 5f 63 72 79 70 74 6f 5f 72 _rim_bb_crypto_r + 000001f0: 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 03 29 4a esource__fr...)J + 00000200: 17 51 ad 00 22 6e 65 74 5f 72 69 6d 5f 61 70 70 .Q.."net_rim_app + 00000210: 73 5f 69 6e 74 65 72 6e 61 6c 5f 62 72 6f 77 73 s_internal_brows + 00000220: 65 72 5f 73 6d 69 6c 00 00 03 2a 4a 17 56 cd 00 er_smil...*J.V.. + 00000230: 1e 6e 65 74 5f 72 69 6d 5f 62 62 5f 63 72 79 70 .net_rim_bb_cryp + 00000240: 74 6f 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 to_resource__en. + 00000250: 00 03 2b 4a 17 54 ac 00 1a 6e 65 74 5f 72 69 6d ..+J.T...net_rim + 00000260: 5f 62 62 5f 73 65 63 75 72 69 74 79 6d 6f 6e 69 _bb_securitymoni + 00000270: 74 6f 72 00 00 03 2c 4a 17 4a 1a 00 20 6e 65 74 tor...,J.J.. net + 00000280: 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d 5f 69 6d _rim_platform_im + 00000290: 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 03 _resource__fr... + 000002a0: 2d 4a 17 51 a9 00 1b 6e 65 74 5f 72 69 6d 5f 62 -J.Q...net_rim_b + 000002b0: 62 61 70 69 5f 73 74 72 69 6e 67 70 61 74 74 65 bapi_stringpatte + 000002c0: 72 6e 00 00 03 2e 4a 17 53 ba 00 22 6e 65 74 5f rn....J.S.."net_ + 000002d0: 72 69 6d 5f 62 62 5f 64 69 61 67 6e 6f 73 74 69 rim_bb_diagnosti + 000002e0: 63 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 c_resource__fr.. + 000002f0: 03 2f 4a 17 4b 1f 00 17 6e 65 74 5f 72 69 6d 5f ./J.K...net_rim_ + 00000300: 62 62 5f 70 72 6f 66 69 6c 65 73 5f 61 70 70 00 bb_profiles_app. + 00000310: 00 03 30 4a 17 55 21 00 21 6e 65 74 5f 72 69 6d ..0J.U!.!net_rim + 00000320: 5f 62 62 5f 62 72 6f 77 73 65 72 5f 70 6c 75 67 _bb_browser_plug + 00000330: 69 6e 5f 64 6f 63 76 69 65 77 00 00 03 31 4a 17 in_docview...1J. + 00000340: 53 b6 00 22 6e 65 74 5f 72 69 6d 5f 62 62 5f 64 S.."net_rim_bb_d + 00000350: 69 61 67 6e 6f 73 74 69 63 5f 72 65 73 6f 75 72 iagnostic_resour + 00000360: 63 65 5f 5f 65 6e 00 00 03 32 4a 17 50 0e 00 13 ce__en...2J.P... + 00000370: 6e 65 74 5f 72 69 6d 5f 74 63 70 5f 6f 70 74 69 net_rim_tcp_opti + 00000380: 6f 6e 73 00 00 03 33 4a 17 54 3b 00 22 6e 65 74 ons...3J.T;."net + 00000390: 5f 72 69 6d 5f 62 62 5f 70 72 65 6c 6f 61 64 65 _rim_bb_preloade + 000003a0: 64 5f 6d 65 64 69 61 5f 63 72 61 77 6c 65 72 00 d_media_crawler. + 000003b0: 00 03 34 4a 17 54 18 00 1b 6e 65 74 5f 72 69 6d ..4J.T...net_rim + 000003c0: 5f 62 62 5f 65 6e 74 65 72 70 72 69 73 65 63 6f _bb_enterpriseco + 000003d0: 6e 66 69 67 00 00 03 35 nfig...5 + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 176 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 35 ..........5 +<<< URB 156 + 00000000: 00 00 0c 00 13 05 01 00 1f 00 00 00 ............ +<<< URB 158 + 00000000: 05 00 06 00 03 e1 ...... +<<< URB 159 + 00000000: 05 00 e5 03 00 00 00 1a 00 00 03 35 4a 17 4a b7 ...........5J.J. + 00000010: 00 1b 6e 65 74 5f 72 69 6d 5f 61 70 70 5f 6d 61 ..net_rim_app_ma + 00000020: 6e 61 67 65 72 5f 63 6f 6e 73 6f 6c 65 00 00 03 nager_console... + 00000030: 36 4a 17 56 62 00 1c 6e 65 74 5f 72 69 6d 5f 62 6J.Vb..net_rim_b + 00000040: 62 5f 6c 64 61 70 5f 72 65 73 6f 75 72 63 65 5f b_ldap_resource_ + 00000050: 5f 66 72 00 00 03 37 4a 17 4b 58 00 1f 6e 65 74 _fr...7J.KX..net + 00000060: 5f 72 69 6d 5f 65 63 6d 61 73 63 72 69 70 74 5f _rim_ecmascript_ + 00000070: 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 38 resource__en...8 + 00000080: 4a 17 57 2f 00 22 6e 65 74 5f 72 69 6d 5f 62 62 J.W/."net_rim_bb + 00000090: 5f 62 72 6f 77 73 65 72 5f 70 6c 75 67 69 6e 5f _browser_plugin_ + 000000a0: 73 65 63 75 72 69 74 79 00 00 03 39 4a 17 4a aa security...9J.J. + 000000b0: 00 14 6e 65 74 5f 72 69 6d 5f 63 6c 64 63 5f 69 ..net_rim_cldc_i + 000000c0: 6f 5f 69 6d 70 6c 00 00 03 3a 4a 17 4a b1 00 14 o_impl...:J.J... + 000000d0: 6e 65 74 5f 72 69 6d 5f 62 62 5f 74 69 6d 65 7a net_rim_bb_timez + 000000e0: 6f 6e 65 73 00 00 03 3b 4a 17 56 5d 00 1c 6e 65 ones...;J.V]..ne + 000000f0: 74 5f 72 69 6d 5f 62 62 5f 6c 64 61 70 5f 72 65 t_rim_bb_ldap_re + 00000100: 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 3c 4a 17 source__en... + 00000150: 4a 17 52 6c 00 1a 6e 65 74 5f 72 69 6d 5f 74 69 J.Rl..net_rim_ti + 00000160: 64 5f 77 6f 72 64 73 5f 69 6e 6a 65 63 74 6f 72 d_words_injector + 00000170: 00 00 03 3f 4a 17 56 8a 00 26 6e 65 74 5f 72 69 ...?J.V..&net_ri + 00000180: 6d 5f 62 62 5f 70 61 73 73 77 6f 72 64 6b 65 65 m_bb_passwordkee + 00000190: 70 65 72 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 per_resource__fr + 000001a0: 00 00 03 40 4a 17 49 e8 00 20 6e 65 74 5f 72 69 ...@J.I.. net_ri + 000001b0: 6d 5f 70 6c 61 74 66 6f 72 6d 5f 69 6d 5f 72 65 m_platform_im_re + 000001c0: 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 41 4a 17 source__en...AJ. + 000001d0: 4a a7 00 28 6e 65 74 5f 72 69 6d 5f 62 62 5f 61 J..(net_rim_bb_a + 000001e0: 70 70 6c 69 63 61 74 69 6f 6e 5f 70 65 72 6d 69 pplication_permi + 000001f0: 73 73 69 6f 6e 73 5f 70 72 6f 78 79 00 00 03 42 ssions_proxy...B + 00000200: 4a 17 56 86 00 26 6e 65 74 5f 72 69 6d 5f 62 62 J.V..&net_rim_bb + 00000210: 5f 70 61 73 73 77 6f 72 64 6b 65 65 70 65 72 5f _passwordkeeper_ + 00000220: 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 43 resource__en...C + 00000230: 4a 17 53 d0 00 11 6e 65 74 5f 72 69 6d 5f 62 62 J.S...net_rim_bb + 00000240: 5f 62 61 6e 6e 65 72 00 00 03 44 4a 17 54 51 00 _banner...DJ.TQ. + 00000250: 1a 6e 65 74 5f 72 69 6d 5f 62 62 5f 72 65 73 6f .net_rim_bb_reso + 00000260: 75 72 63 65 5f 5f 65 6e 5f 47 42 00 00 03 45 4a urce__en_GB...EJ + 00000270: 17 54 d5 00 18 6e 65 74 5f 72 69 6d 5f 76 61 64 .T...net_rim_vad + 00000280: 5f 72 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 03 _resource__fr... + 00000290: 46 4a 17 54 d0 00 18 6e 65 74 5f 72 69 6d 5f 76 FJ.T...net_rim_v + 000002a0: 61 64 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 00 ad_resource__en. + 000002b0: 00 03 47 4a 17 4a a7 00 24 6e 65 74 5f 72 69 6d ..GJ.J..$net_rim + 000002c0: 5f 62 62 5f 74 72 75 73 74 5f 61 70 70 6c 69 63 _bb_trust_applic + 000002d0: 61 74 69 6f 6e 5f 6d 61 6e 61 67 65 72 00 00 03 ation_manager... + 000002e0: 48 4a 17 54 41 00 28 6e 65 74 5f 72 69 6d 5f 62 HJ.TA.(net_rim_b + 000002f0: 62 5f 6f 70 74 69 6f 6e 73 5f 53 70 65 6c 6c 63 b_options_Spellc + 00000300: 68 65 63 6b 61 62 6c 65 4f 70 74 69 6f 6e 73 00 heckableOptions. + 00000310: 00 03 49 4a 17 4b 3b 00 16 6e 65 74 5f 72 69 6d ..IJ.K;..net_rim + 00000320: 5f 62 62 5f 70 68 6f 6e 65 5f 65 6e 74 72 79 00 _bb_phone_entry. + 00000330: 00 03 4a 4a 17 4a ef 00 1d 6e 65 74 5f 72 69 6d ..JJ.J...net_rim + 00000340: 5f 70 6c 61 74 66 6f 72 6d 61 70 70 73 5f 72 65 _platformapps_re + 00000350: 73 6f 75 72 63 65 00 00 03 4b 4a 17 4f 54 00 18 source...KJ.OT.. + 00000360: 6e 65 74 5f 72 69 6d 5f 72 75 6e 74 69 6d 65 5f net_rim_runtime_ + 00000370: 72 65 73 6f 75 72 63 65 00 00 03 4c 4a 17 53 b1 resource...LJ.S. + 00000380: 00 15 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f ..net_rim_bbapi_ + 00000390: 6f 70 74 69 6f 6e 73 00 00 03 4d 4a 17 4b 27 00 options...MJ.K'. + 000003a0: 1f 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 68 6f 6e .net_rim_bb_phon + 000003b0: 65 5f 63 61 6c 6c 5f 6c 6f 67 5f 65 6e 74 72 79 e_call_log_entry + 000003c0: 00 00 03 4e 4a 17 52 a7 00 17 6e 65 74 5f 72 69 ...NJ.R...net_ri + 000003d0: 6d 5f 63 72 79 70 74 6f 5f 72 65 73 6f 75 72 63 m_crypto_resourc + 000003e0: 65 00 00 03 4f e...O + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 180 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 4f ..........O +<<< URB 160 + 00000000: 00 00 0c 00 13 05 01 00 20 00 00 00 ........ ... +<<< URB 162 + 00000000: 05 00 06 00 03 e3 ...... +<<< URB 163 + 00000000: 05 00 e7 03 00 00 00 19 00 00 03 4f 4a 17 54 93 ...........OJ.T. + 00000010: 00 19 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f ..net_rim_bbapi_ + 00000020: 70 69 6d 5f 72 65 73 5f 5f 66 72 00 00 03 50 4a pim_res__fr...PJ + 00000030: 17 52 4a 00 2b 6e 65 74 5f 72 69 6d 5f 74 69 64 .RJ.+net_rim_tid + 00000040: 5f 64 79 6e 61 6d 69 63 5f 74 72 61 6e 73 63 6f _dynamic_transco + 00000050: 64 69 6e 67 5f 64 61 74 61 5f 43 50 31 32 35 30 ding_data_CP1250 + 00000060: 00 00 03 51 4a 17 50 37 00 19 6e 65 74 5f 72 69 ...QJ.P7..net_ri + 00000070: 6d 5f 62 62 61 70 69 5f 70 69 6d 5f 72 65 73 5f m_bbapi_pim_res_ + 00000080: 5f 65 6e 00 00 03 52 4a 17 54 70 00 12 6e 65 74 _en...RJ.Tp..net + 00000090: 5f 72 69 6d 5f 62 62 5f 73 74 61 72 74 75 70 00 _rim_bb_startup. + 000000a0: 00 03 53 4a 17 4a 3a 00 20 6e 65 74 5f 72 69 6d ..SJ.J:. net_rim + 000000b0: 5f 70 6c 61 74 66 6f 72 6d 5f 72 65 73 6f 75 72 _platform_resour + 000000c0: 63 65 5f 5f 65 6e 5f 47 42 00 00 03 54 4a 17 4b ce__en_GB...TJ.K + 000000d0: 1b 00 23 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 72 ..#net_rim_bb_pr + 000000e0: 6f 66 69 6c 65 73 5f 61 6c 65 72 74 65 6e 67 69 ofiles_alertengi + 000000f0: 6e 65 5f 61 70 70 00 00 03 55 4a 17 54 03 00 1b ne_app...UJ.T... + 00000100: 6e 65 74 5f 72 69 6d 5f 62 62 5f 65 6c 74 5f 72 net_rim_bb_elt_r + 00000110: 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 03 56 4a esource__fr...VJ + 00000120: 17 56 eb 00 1c 6e 65 74 5f 72 69 6d 5f 73 65 63 .V...net_rim_sec + 00000130: 75 72 65 65 6d 61 69 6c 5f 72 65 73 6f 75 72 63 ureemail_resourc + 00000140: 65 00 00 03 57 4a 17 53 ff 00 1b 6e 65 74 5f 72 e...WJ.S...net_r + 00000150: 69 6d 5f 62 62 5f 65 6c 74 5f 72 65 73 6f 75 72 im_bb_elt_resour + 00000160: 63 65 5f 5f 65 6e 00 00 03 58 4a 17 4a f2 00 24 ce__en...XJ.J..$ + 00000170: 6e 65 74 5f 72 69 6d 5f 70 6c 61 74 66 6f 72 6d net_rim_platform + 00000180: 61 70 70 73 5f 72 65 73 6f 75 72 63 65 5f 5f 65 apps_resource__e + 00000190: 6e 5f 55 53 00 00 03 59 4a 17 56 c8 00 1a 6e 65 n_US...YJ.V...ne + 000001a0: 74 5f 72 69 6d 5f 62 62 5f 63 72 79 70 74 6f 5f t_rim_bb_crypto_ + 000001b0: 72 65 73 6f 75 72 63 65 00 00 03 5a 4a 17 51 95 resource...ZJ.Q. + 000001c0: 00 2d 6e 65 74 5f 72 69 6d 5f 62 62 5f 72 69 62 .-net_rim_bb_rib + 000001d0: 62 6f 6e 5f 73 6b 69 6e 5f 73 76 67 5f 44 65 6c bon_skin_svg_Del + 000001e0: 61 79 65 64 49 6e 69 74 69 61 6c 69 7a 65 72 00 ayedInitializer. + 000001f0: 00 03 5b 4a 17 4a bf 00 0f 6e 65 74 5f 72 69 6d ..[J.J...net_rim + 00000200: 5f 75 69 5f 69 6d 70 6c 00 00 03 5c 4a 17 4a 70 _ui_impl...\J.Jp + 00000210: 00 20 6e 65 74 5f 72 69 6d 5f 70 6c 61 74 66 6f . net_rim_platfo + 00000220: 72 6d 5f 72 65 73 6f 75 72 63 65 5f 5f 65 6e 5f rm_resource__en_ + 00000230: 55 53 00 00 03 5d 4a 17 4b 55 00 1b 6e 65 74 5f US...]J.KU..net_ + 00000240: 72 69 6d 5f 65 63 6d 61 73 63 72 69 70 74 5f 72 rim_ecmascript_r + 00000250: 65 73 6f 75 72 63 65 00 00 03 5e 4a 17 4f c4 00 esource...^J.O.. + 00000260: 21 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f 6d !net_rim_bbapi_m + 00000270: 65 73 73 61 67 65 6c 69 73 74 5f 72 65 73 5f 5f essagelist_res__ + 00000280: 65 6e 00 00 03 5f 4a 17 57 59 00 10 6e 65 74 5f en..._J.WY..net_ + 00000290: 72 69 6d 5f 62 62 5f 73 6d 69 6d 65 00 00 03 60 rim_bb_smime...` + 000002a0: 4a 17 4b 2a 00 19 6e 65 74 5f 72 69 6d 5f 70 68 J.K*..net_rim_ph + 000002b0: 6f 6e 65 5f 74 74 79 5f 65 6e 61 62 6c 65 72 00 one_tty_enabler. + 000002c0: 00 03 61 4a 17 49 eb 00 23 6e 65 74 5f 72 69 6d ..aJ.I..#net_rim + 000002d0: 5f 70 6c 61 74 66 6f 72 6d 5f 69 6d 5f 72 65 73 _platform_im_res + 000002e0: 6f 75 72 63 65 5f 5f 65 6e 5f 55 53 00 00 03 62 ource__en_US...b + 000002f0: 4a 17 4a 14 00 23 6e 65 74 5f 72 69 6d 5f 70 6c J.J..#net_rim_pl + 00000300: 61 74 66 6f 72 6d 5f 69 6d 5f 72 65 73 6f 75 72 atform_im_resour + 00000310: 63 65 5f 5f 65 6e 5f 47 42 00 00 03 63 4a 17 4f ce__en_GB...cJ.O + 00000320: d3 00 2c 6e 65 74 5f 72 69 6d 5f 64 65 76 69 63 ..,net_rim_devic + 00000330: 65 5f 61 70 70 73 5f 67 61 6d 65 73 5f 77 6f 72 e_apps_games_wor + 00000340: 64 6d 6f 6c 65 5f 72 65 73 6f 75 72 63 65 73 00 dmole_resources. + 00000350: 00 03 64 4a 17 54 cc 00 14 6e 65 74 5f 72 69 6d ..dJ.T...net_rim + 00000360: 5f 76 61 64 5f 72 65 73 6f 75 72 63 65 00 00 03 _vad_resource... + 00000370: 65 4a 17 4b 5a 00 1f 6e 65 74 5f 72 69 6d 5f 65 eJ.KZ..net_rim_e + 00000380: 63 6d 61 73 63 72 69 70 74 5f 72 65 73 6f 75 72 cmascript_resour + 00000390: 63 65 5f 5f 66 72 00 00 03 66 4a 17 52 f2 00 17 ce__fr...fJ.R... + 000003a0: 6e 65 74 5f 72 69 6d 5f 74 69 64 5f 41 64 64 72 net_rim_tid_Addr + 000003b0: 42 6f 6f 6b 52 65 70 00 00 03 67 4a 17 56 7e 00 BookRep...gJ.V~. + 000003c0: 22 6e 65 74 5f 72 69 6d 5f 62 62 5f 70 61 73 73 "net_rim_bb_pass + 000003d0: 77 6f 72 64 6b 65 65 70 65 72 5f 72 65 73 6f 75 wordkeeper_resou + 000003e0: 72 63 65 00 00 03 68 rce...h + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 184 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 68 ..........h +<<< URB 164 + 00000000: 00 00 0c 00 13 05 01 00 21 00 00 00 ........!... +<<< URB 166 + 00000000: 05 00 06 00 03 ee ...... +<<< URB 167 + 00000000: 05 00 f2 03 00 00 00 1e 00 00 03 68 4a 17 4f c2 ...........hJ.O. + 00000010: 00 1d 6e 65 74 5f 72 69 6d 5f 62 62 61 70 69 5f ..net_rim_bbapi_ + 00000020: 6d 65 73 73 61 67 65 6c 69 73 74 5f 72 65 73 00 messagelist_res. + 00000030: 00 03 69 4a 17 55 68 00 12 6e 65 74 5f 72 69 6d ..iJ.Uh..net_rim + 00000040: 5f 62 62 61 70 69 5f 6d 61 69 6c 00 00 03 6a 4a _bbapi_mail...jJ + 00000050: 17 4a ae 00 17 6e 65 74 5f 72 69 6d 5f 62 62 5f .J...net_rim_bb_ + 00000060: 63 61 6c 6c 5f 63 6f 6e 74 72 6f 6c 00 00 03 6b call_control...k + 00000070: 4a 17 56 57 00 18 6e 65 74 5f 72 69 6d 5f 62 62 J.VW..net_rim_bb + 00000080: 5f 6c 64 61 70 5f 72 65 73 6f 75 72 63 65 00 00 _ldap_resource.. + 00000090: 03 6c 4a 17 50 34 00 15 6e 65 74 5f 72 69 6d 5f .lJ.P4..net_rim_ + 000000a0: 62 62 61 70 69 5f 70 69 6d 5f 72 65 73 00 00 03 bbapi_pim_res... + 000000b0: 6d 4a 17 50 26 00 27 6e 65 74 5f 72 69 6d 5f 70 mJ.P&.'net_rim_p + 000000c0: 6c 61 7a 6d 69 63 5f 6d 65 64 69 61 65 6e 67 69 lazmic_mediaengi + 000000d0: 6e 65 5f 73 6d 69 6c 5f 66 6f 72 6d 61 74 00 00 ne_smil_format.. + 000000e0: 03 6e 4a 17 53 f1 00 1c 6e 65 74 5f 72 69 6d 5f .nJ.S...net_rim_ + 000000f0: 62 69 73 5f 63 6c 69 65 6e 74 5f 72 65 73 6f 75 bis_client_resou + 00000100: 72 63 65 73 00 00 03 6f 4a 17 53 f1 00 16 6e 65 rces...oJ.S...ne + 00000110: 74 5f 72 69 6d 5f 62 69 73 5f 63 6c 69 65 6e 74 t_rim_bis_client + 00000120: 5f 72 65 73 00 00 03 70 49 1c 40 0b 00 14 73 66 _res...pI.@...sf + 00000130: 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 rfngo_fr_wap2_wa + 00000140: 70 31 00 00 03 71 49 1c 40 0b 00 17 73 66 72 66 p1...qI.@...sfrf + 00000150: 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 70 31 ngo_fr_wap2_wap1 + 00000160: 2d 32 30 00 00 03 72 49 1c 40 0b 00 16 73 66 72 -20...rI.@...sfr + 00000170: 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 70 fngo_fr_wap2_wap + 00000180: 31 2d 31 00 00 03 73 49 1c 40 0b 00 16 73 66 72 1-1...sI.@...sfr + 00000190: 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 70 fngo_fr_wap2_wap + 000001a0: 31 2d 32 00 00 03 74 49 1c 40 0b 00 16 73 66 72 1-2...tI.@...sfr + 000001b0: 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 70 fngo_fr_wap2_wap + 000001c0: 31 2d 34 00 00 03 75 49 1c 40 0b 00 17 73 66 72 1-4...uI.@...sfr + 000001d0: 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 70 fngo_fr_wap2_wap + 000001e0: 31 2d 31 31 00 00 03 76 49 1c 40 0b 00 17 73 66 1-11...vI.@...sf + 000001f0: 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 61 rfngo_fr_wap2_wa + 00000200: 70 31 2d 31 37 00 00 03 77 49 1c 40 0b 00 17 73 p1-17...wI.@...s + 00000210: 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f 77 frfngo_fr_wap2_w + 00000220: 61 70 31 2d 31 32 00 00 03 78 49 1c 40 0b 00 16 ap1-12...xI.@... + 00000230: 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f sfrfngo_fr_wap2_ + 00000240: 77 61 70 31 2d 37 00 00 03 79 49 1c 40 0b 00 17 wap1-7...yI.@... + 00000250: 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 5f sfrfngo_fr_wap2_ + 00000260: 77 61 70 31 2d 31 30 00 00 03 7a 49 1c 40 0b 00 wap1-10...zI.@.. + 00000270: 16 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 00000280: 5f 77 61 70 31 2d 33 00 00 03 7b 49 1c 40 0b 00 _wap1-3...{I.@.. + 00000290: 16 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 000002a0: 5f 77 61 70 31 2d 35 00 00 03 7c 49 1c 40 0b 00 _wap1-5...|I.@.. + 000002b0: 16 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 000002c0: 5f 77 61 70 31 2d 36 00 00 03 7d 49 1c 40 0b 00 _wap1-6...}I.@.. + 000002d0: 16 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 000002e0: 5f 77 61 70 31 2d 38 00 00 03 7e 49 1c 40 0b 00 _wap1-8...~I.@.. + 000002f0: 16 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 00000300: 5f 77 61 70 31 2d 39 00 00 03 7f 49 1c 40 0b 00 _wap1-9....I.@.. + 00000310: 17 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 32 .sfrfngo_fr_wap2 + 00000320: 5f 77 61 70 31 2d 31 33 00 00 03 80 49 1c 40 0b _wap1-13....I.@. + 00000330: 00 17 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 70 ..sfrfngo_fr_wap + 00000340: 32 5f 77 61 70 31 2d 31 34 00 00 03 81 49 1c 40 2_wap1-14....I.@ + 00000350: 0b 00 17 73 66 72 66 6e 67 6f 5f 66 72 5f 77 61 ...sfrfngo_fr_wa + 00000360: 70 32 5f 77 61 70 31 2d 31 35 00 00 03 82 49 1c p2_wap1-15....I. + 00000370: 40 0b 00 17 73 66 72 66 6e 67 6f 5f 66 72 5f 77 @...sfrfngo_fr_w + 00000380: 61 70 32 5f 77 61 70 31 2d 31 36 00 00 03 83 49 ap2_wap1-16....I + 00000390: 1c 40 0b 00 17 73 66 72 66 6e 67 6f 5f 66 72 5f .@...sfrfngo_fr_ + 000003a0: 77 61 70 32 5f 77 61 70 31 2d 31 38 00 00 03 84 wap2_wap1-18.... + 000003b0: 49 1c 40 0b 00 17 73 66 72 66 6e 67 6f 5f 66 72 I.@...sfrfngo_fr + 000003c0: 5f 77 61 70 32 5f 77 61 70 31 2d 31 39 00 00 03 _wap2_wap1-19... + 000003d0: 85 49 1c 40 0b 00 17 73 66 72 66 6e 67 6f 5f 66 .I.@...sfrfngo_f + 000003e0: 72 5f 77 61 70 32 5f 77 61 70 31 2d 32 31 00 00 r_wap2_wap1-21.. + 000003f0: 03 86 .. + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 188 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 86 ........... +<<< URB 168 + 00000000: 00 00 0c 00 13 05 01 00 22 00 00 00 ........"... +<<< URB 170 + 00000000: 05 00 06 00 03 e4 ...... +<<< URB 171 + 00000000: 05 00 e8 03 00 00 00 29 00 00 03 86 49 80 76 45 .......)....I.vE + 00000010: 00 10 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e ..DocsToGoCommon + 00000020: 34 37 00 00 03 87 49 80 76 45 00 12 44 6f 63 73 47....I.vE..Docs + 00000030: 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 2d 32 00 00 ToGoCommon47-2.. + 00000040: 03 88 49 80 76 45 00 12 44 6f 63 73 54 6f 47 6f ..I.vE..DocsToGo + 00000050: 43 6f 6d 6d 6f 6e 34 37 2d 31 00 00 03 89 49 80 Common47-1....I. + 00000060: 76 45 00 12 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d vE..DocsToGoComm + 00000070: 6f 6e 34 37 2d 33 00 00 03 8a 49 80 76 45 00 13 on47-3....I.vE.. + 00000080: 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 DocsToGoCommon47 + 00000090: 2d 31 33 00 00 03 8b 49 80 76 45 00 12 44 6f 63 -13....I.vE..Doc + 000000a0: 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 2d 34 00 sToGoCommon47-4. + 000000b0: 00 03 8c 49 80 76 45 00 12 44 6f 63 73 54 6f 47 ...I.vE..DocsToG + 000000c0: 6f 43 6f 6d 6d 6f 6e 34 37 2d 36 00 00 03 8d 49 oCommon47-6....I + 000000d0: 80 76 45 00 12 44 6f 63 73 54 6f 47 6f 43 6f 6d .vE..DocsToGoCom + 000000e0: 6d 6f 6e 34 37 2d 37 00 00 03 8e 49 80 76 45 00 mon47-7....I.vE. + 000000f0: 12 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 .DocsToGoCommon4 + 00000100: 37 2d 35 00 00 03 8f 49 80 76 45 00 12 44 6f 63 7-5....I.vE..Doc + 00000110: 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 2d 38 00 sToGoCommon47-8. + 00000120: 00 03 90 49 80 76 45 00 12 44 6f 63 73 54 6f 47 ...I.vE..DocsToG + 00000130: 6f 43 6f 6d 6d 6f 6e 34 37 2d 39 00 00 03 91 49 oCommon47-9....I + 00000140: 80 76 45 00 13 44 6f 63 73 54 6f 47 6f 43 6f 6d .vE..DocsToGoCom + 00000150: 6d 6f 6e 34 37 2d 31 30 00 00 03 92 49 80 76 45 mon47-10....I.vE + 00000160: 00 13 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e ..DocsToGoCommon + 00000170: 34 37 2d 31 31 00 00 03 93 49 80 76 45 00 13 44 47-11....I.vE..D + 00000180: 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 2d ocsToGoCommon47- + 00000190: 31 32 00 00 03 94 49 88 24 4f 00 09 56 69 69 67 12....I.$O..Viig + 000001a0: 6f 5f 41 70 69 00 00 03 95 49 88 24 4f 00 0b 56 o_Api....I.$O..V + 000001b0: 69 69 67 6f 5f 41 70 69 2d 36 00 00 03 96 49 88 iigo_Api-6....I. + 000001c0: 24 4f 00 0b 56 69 69 67 6f 5f 41 70 69 2d 37 00 $O..Viigo_Api-7. + 000001d0: 00 03 97 49 88 24 4f 00 0b 56 69 69 67 6f 5f 41 ...I.$O..Viigo_A + 000001e0: 70 69 2d 34 00 00 03 98 49 88 24 4f 00 0b 56 69 pi-4....I.$O..Vi + 000001f0: 69 67 6f 5f 41 70 69 2d 33 00 00 03 99 49 88 24 igo_Api-3....I.$ + 00000200: 47 00 0a 56 69 69 67 6f 5f 48 65 63 6c 00 00 03 G..Viigo_Hecl... + 00000210: 9a 49 88 24 47 00 0c 56 69 69 67 6f 5f 48 65 63 .I.$G..Viigo_Hec + 00000220: 6c 2d 31 00 00 03 9b 49 88 24 4f 00 0b 56 69 69 l-1....I.$O..Vii + 00000230: 67 6f 5f 41 70 69 2d 31 00 00 03 9c 49 88 24 4f go_Api-1....I.$O + 00000240: 00 0b 56 69 69 67 6f 5f 41 70 69 2d 32 00 00 03 ..Viigo_Api-2... + 00000250: 9d 49 88 24 4f 00 0b 56 69 69 67 6f 5f 41 70 69 .I.$O..Viigo_Api + 00000260: 2d 35 00 00 03 9e 49 88 24 4f 00 0b 56 69 69 67 -5....I.$O..Viig + 00000270: 6f 5f 41 70 69 2d 38 00 00 03 9f 49 88 24 42 00 o_Api-8....I.$B. + 00000280: 15 56 69 69 67 6f 5f 42 72 61 6e 64 5f 52 65 73 .Viigo_Brand_Res + 00000290: 6f 75 72 63 65 73 00 00 03 a0 49 1c 34 ef 00 0b ources....I.4... + 000002a0: 6d 69 6e 69 74 75 62 65 5f 62 62 00 00 03 a1 49 minitube_bb....I + 000002b0: 1c 34 ef 00 0d 6d 69 6e 69 74 75 62 65 5f 62 62 .4...minitube_bb + 000002c0: 2d 31 00 00 03 a2 49 1c 34 ef 00 0d 6d 69 6e 69 -1....I.4...mini + 000002d0: 74 75 62 65 5f 62 62 2d 32 00 00 03 a3 49 1c 34 tube_bb-2....I.4 + 000002e0: ef 00 0d 6d 69 6e 69 74 75 62 65 5f 62 62 2d 33 ...minitube_bb-3 + 000002f0: 00 00 03 a4 49 1c 34 ef 00 0d 6d 69 6e 69 74 75 ....I.4...minitu + 00000300: 62 65 5f 62 62 2d 34 00 00 03 a5 49 1c 34 ef 00 be_bb-4....I.4.. + 00000310: 0d 6d 69 6e 69 74 75 62 65 5f 62 62 2d 35 00 00 .minitube_bb-5.. + 00000320: 03 a6 49 1c 34 ef 00 0d 6d 69 6e 69 74 75 62 65 ..I.4...minitube + 00000330: 5f 62 62 2d 36 00 00 03 a7 49 1c 34 ef 00 0d 6d _bb-6....I.4...m + 00000340: 69 6e 69 74 75 62 65 5f 62 62 2d 37 00 00 03 a8 initube_bb-7.... + 00000350: 49 80 76 a4 00 0a 57 6f 72 64 54 6f 47 6f 34 37 I.v...WordToGo47 + 00000360: 00 00 03 a9 49 80 76 a4 00 0c 57 6f 72 64 54 6f ....I.v...WordTo + 00000370: 47 6f 34 37 2d 31 00 00 03 aa 49 80 76 a4 00 0c Go47-1....I.v... + 00000380: 57 6f 72 64 54 6f 47 6f 34 37 2d 36 00 00 03 ab WordToGo47-6.... + 00000390: 49 80 76 a4 00 0c 57 6f 72 64 54 6f 47 6f 34 37 I.v...WordToGo47 + 000003a0: 2d 33 00 00 03 ac 49 80 76 a4 00 0c 57 6f 72 64 -3....I.v...Word + 000003b0: 54 6f 47 6f 34 37 2d 34 00 00 03 ad 49 80 76 a4 ToGo47-4....I.v. + 000003c0: 00 0c 57 6f 72 64 54 6f 47 6f 34 37 2d 32 00 00 ..WordToGo47-2.. + 000003d0: 03 ae 49 80 76 a4 00 0c 57 6f 72 64 54 6f 47 6f ..I.v...WordToGo + 000003e0: 34 37 2d 35 00 00 03 af 47-5.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 192 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 af ........... +<<< URB 172 + 00000000: 00 00 0c 00 13 05 01 00 23 00 00 00 ........#... +<<< URB 174 + 00000000: 05 00 06 00 03 e6 ...... +<<< URB 175 + 00000000: 05 00 ea 03 00 00 00 23 00 00 03 af 49 80 76 85 .......#....I.v. + 00000010: 00 0b 53 68 65 65 74 54 6f 47 6f 34 37 00 00 03 ..SheetToGo47... + 00000020: b0 49 80 76 85 00 0d 53 68 65 65 74 54 6f 47 6f .I.v...SheetToGo + 00000030: 34 37 2d 31 00 00 03 b1 49 80 76 85 00 0d 53 68 47-1....I.v...Sh + 00000040: 65 65 74 54 6f 47 6f 34 37 2d 35 00 00 03 b2 49 eetToGo47-5....I + 00000050: 80 76 85 00 0d 53 68 65 65 74 54 6f 47 6f 34 37 .v...SheetToGo47 + 00000060: 2d 36 00 00 03 b3 49 80 76 85 00 0d 53 68 65 65 -6....I.v...Shee + 00000070: 74 54 6f 47 6f 34 37 2d 33 00 00 03 b4 49 80 76 tToGo47-3....I.v + 00000080: 85 00 0d 53 68 65 65 74 54 6f 47 6f 34 37 2d 32 ...SheetToGo47-2 + 00000090: 00 00 03 b5 49 80 76 85 00 0d 53 68 65 65 74 54 ....I.v...SheetT + 000000a0: 6f 47 6f 34 37 2d 34 00 00 03 b6 49 80 76 66 00 oGo47-4....I.vf. + 000000b0: 0f 53 6c 69 64 65 73 68 6f 77 54 6f 47 6f 34 37 .SlideshowToGo47 + 000000c0: 00 00 03 b7 49 80 76 66 00 11 53 6c 69 64 65 73 ....I.vf..Slides + 000000d0: 68 6f 77 54 6f 47 6f 34 37 2d 31 00 00 03 b8 49 howToGo47-1....I + 000000e0: 80 76 66 00 11 53 6c 69 64 65 73 68 6f 77 54 6f .vf..SlideshowTo + 000000f0: 47 6f 34 37 2d 32 00 00 03 b9 49 80 76 66 00 11 Go47-2....I.vf.. + 00000100: 53 6c 69 64 65 73 68 6f 77 54 6f 47 6f 34 37 2d SlideshowToGo47- + 00000110: 33 00 00 03 ba 49 80 76 66 00 11 53 6c 69 64 65 3....I.vf..Slide + 00000120: 73 68 6f 77 54 6f 47 6f 34 37 2d 34 00 00 03 bb showToGo47-4.... + 00000130: 49 88 24 63 00 09 56 69 69 67 6f 5f 41 70 70 00 I.$c..Viigo_App. + 00000140: 00 03 bc 49 88 24 63 00 0b 56 69 69 67 6f 5f 41 ...I.$c..Viigo_A + 00000150: 70 70 2d 31 00 00 03 bd 49 88 24 63 00 0b 56 69 pp-1....I.$c..Vi + 00000160: 69 67 6f 5f 41 70 70 2d 34 00 00 03 be 49 88 24 igo_App-4....I.$ + 00000170: 63 00 0b 56 69 69 67 6f 5f 41 70 70 2d 35 00 00 c..Viigo_App-5.. + 00000180: 03 bf 49 88 24 63 00 0b 56 69 69 67 6f 5f 41 70 ..I.$c..Viigo_Ap + 00000190: 70 2d 32 00 00 03 c0 49 88 24 63 00 0b 56 69 69 p-2....I.$c..Vii + 000001a0: 67 6f 5f 41 70 70 2d 33 00 00 03 c1 49 88 24 77 go_App-3....I.$w + 000001b0: 00 1b 56 69 69 67 6f 5f 41 70 70 5f 52 65 73 6f ..Viigo_App_Reso + 000001c0: 75 72 63 65 73 5f 34 38 30 78 33 32 30 00 00 03 urces_480x320... + 000001d0: c2 49 88 24 77 00 1d 56 69 69 67 6f 5f 41 70 70 .I.$w..Viigo_App + 000001e0: 5f 52 65 73 6f 75 72 63 65 73 5f 34 38 30 78 33 _Resources_480x3 + 000001f0: 32 30 2d 31 00 00 03 c3 49 80 76 79 00 17 53 68 20-1....I.vy..Sh + 00000200: 65 65 74 54 6f 47 6f 34 37 52 65 73 6f 75 72 63 eetToGo47Resourc + 00000210: 65 5f 5f 65 6e 00 00 03 c4 48 a1 2e 46 00 12 43 e__en....H..F..C + 00000220: 72 61 63 6b 42 65 72 72 79 41 70 70 53 74 6f 72 rackBerryAppStor + 00000230: 65 00 00 03 c5 49 80 76 3f 00 1c 44 6f 63 73 54 e....I.v?..DocsT + 00000240: 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 52 65 73 6f 75 oGoCommon47Resou + 00000250: 72 63 65 5f 5f 66 72 00 00 03 c6 49 80 76 39 00 rce__fr....I.v9. + 00000260: 1c 44 6f 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 .DocsToGoCommon4 + 00000270: 37 52 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 7Resource__en... + 00000280: c7 49 80 76 7f 00 17 53 68 65 65 74 54 6f 47 6f .I.v...SheetToGo + 00000290: 34 37 52 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 47Resource__fr.. + 000002a0: 03 c8 49 88 24 82 00 16 56 69 69 67 6f 5f 53 74 ..I.$...Viigo_St + 000002b0: 61 6e 64 61 72 64 5f 34 38 30 78 33 32 30 00 00 andard_480x320.. + 000002c0: 03 c9 49 80 76 9e 00 16 57 6f 72 64 54 6f 47 6f ..I.v...WordToGo + 000002d0: 34 37 52 65 73 6f 75 72 63 65 5f 5f 66 72 00 00 47Resource__fr.. + 000002e0: 03 ca 49 80 76 99 00 16 57 6f 72 64 54 6f 47 6f ..I.v...WordToGo + 000002f0: 34 37 52 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 47Resource__en.. + 00000300: 03 cb 49 88 24 7c 00 12 56 69 69 67 6f 5f 50 6c ..I.$|..Viigo_Pl + 00000310: 61 74 66 6f 72 6d 5f 34 32 30 00 00 03 cc 49 1c atform_420....I. + 00000320: 40 22 00 12 62 62 5f 63 6f 6e 74 61 63 74 73 5f @"..bb_contacts_ + 00000330: 70 6c 75 67 69 6e 00 00 03 cd 49 88 24 7f 00 12 plugin....I.$... + 00000340: 56 69 69 67 6f 5f 50 6c 61 74 66 6f 72 6d 5f 34 Viigo_Platform_4 + 00000350: 37 30 00 00 03 ce 49 80 76 60 00 1b 53 6c 69 64 70....I.v`..Slid + 00000360: 65 73 68 6f 77 54 6f 47 6f 34 37 52 65 73 6f 75 eshowToGo47Resou + 00000370: 72 63 65 5f 5f 66 72 00 00 03 cf 49 80 76 5b 00 rce__fr....I.v[. + 00000380: 1b 53 6c 69 64 65 73 68 6f 77 54 6f 47 6f 34 37 .SlideshowToGo47 + 00000390: 52 65 73 6f 75 72 63 65 5f 5f 65 6e 00 00 03 d0 Resource__en.... + 000003a0: 49 88 6e 30 00 1e 56 69 69 67 6f 5f 42 72 61 6e I.n0..Viigo_Bran + 000003b0: 64 5f 50 75 62 6c 69 63 42 65 74 61 5f 34 38 30 d_PublicBeta_480 + 000003c0: 78 33 32 30 00 00 03 d1 49 80 76 33 00 18 44 6f x320....I.v3..Do + 000003d0: 63 73 54 6f 47 6f 43 6f 6d 6d 6f 6e 34 37 52 65 csToGoCommon47Re + 000003e0: 73 6f 75 72 63 65 00 00 03 d2 source.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 196 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 d2 ........... +<<< URB 176 + 00000000: 00 00 0c 00 13 05 01 00 24 00 00 00 ........$... +<<< URB 178 + 00000000: 05 00 06 00 03 eb ...... +<<< URB 179 + 00000000: 05 00 ef 03 00 00 00 2c 00 00 03 d2 49 80 76 56 .......,....I.vV + 00000010: 00 17 53 6c 69 64 65 73 68 6f 77 54 6f 47 6f 34 ..SlideshowToGo4 + 00000020: 37 52 65 73 6f 75 72 63 65 00 00 03 d3 49 80 76 7Resource....I.v + 00000030: 73 00 13 53 68 65 65 74 54 6f 47 6f 34 37 52 65 s..SheetToGo47Re + 00000040: 73 6f 75 72 63 65 00 00 03 d4 49 80 76 94 00 12 source....I.v... + 00000050: 57 6f 72 64 54 6f 47 6f 34 37 52 65 73 6f 75 72 WordToGo47Resour + 00000060: 63 65 00 00 03 d5 49 88 24 85 00 17 63 6f 6d 5f ce....I.$...com_ + 00000070: 76 69 69 67 6f 5f 76 69 69 67 6f 61 70 70 5f 61 viigo_viigoapp_a + 00000080: 70 70 5f 00 00 03 d6 49 18 0e e0 00 1b 6f 70 65 pp_....I.....ope + 00000090: 72 65 74 74 65 24 32 64 68 69 66 69 24 32 64 34 rette$2dhifi$2d4 + 000000a0: 24 32 65 32 62 65 74 61 00 00 03 d7 49 18 0e e0 $2e2beta....I... + 000000b0: 00 1d 6f 70 65 72 65 74 74 65 24 32 64 68 69 66 ..operette$2dhif + 000000c0: 69 24 32 64 34 24 32 65 32 62 65 74 61 2d 32 00 i$2d4$2e2beta-2. + 000000d0: 00 03 d8 49 18 0e e0 00 1d 6f 70 65 72 65 74 74 ...I.....operett + 000000e0: 65 24 32 64 68 69 66 69 24 32 64 34 24 32 65 32 e$2dhifi$2d4$2e2 + 000000f0: 62 65 74 61 2d 31 00 00 03 d9 49 95 d9 ec 00 0a beta-1....I..... + 00000100: 47 6f 6f 67 6c 65 4d 61 70 73 00 00 03 da 49 95 GoogleMaps....I. + 00000110: d9 ec 00 0c 47 6f 6f 67 6c 65 4d 61 70 73 2d 32 ....GoogleMaps-2 + 00000120: 00 00 03 db 49 95 d9 ec 00 0c 47 6f 6f 67 6c 65 ....I.....Google + 00000130: 4d 61 70 73 2d 37 00 00 03 dc 49 95 d9 ec 00 0c Maps-7....I..... + 00000140: 47 6f 6f 67 6c 65 4d 61 70 73 2d 33 00 00 03 dd GoogleMaps-3.... + 00000150: 49 95 d9 ec 00 0c 47 6f 6f 67 6c 65 4d 61 70 73 I.....GoogleMaps + 00000160: 2d 31 00 00 03 de 49 95 d9 ec 00 0c 47 6f 6f 67 -1....I.....Goog + 00000170: 6c 65 4d 61 70 73 2d 36 00 00 03 df 49 95 d9 ec leMaps-6....I... + 00000180: 00 0c 47 6f 6f 67 6c 65 4d 61 70 73 2d 34 00 00 ..GoogleMaps-4.. + 00000190: 03 e0 49 95 d9 ec 00 0c 47 6f 6f 67 6c 65 4d 61 ..I.....GoogleMa + 000001a0: 70 73 2d 35 00 00 03 e1 49 95 d9 ec 00 0c 47 6f ps-5....I.....Go + 000001b0: 6f 67 6c 65 4d 61 70 73 2d 38 00 00 03 e2 49 95 ogleMaps-8....I. + 000001c0: d9 ec 00 0c 47 6f 6f 67 6c 65 4d 61 70 73 2d 39 ....GoogleMaps-9 + 000001d0: 00 00 03 e3 4a 0d 79 9f 00 0a 42 65 72 72 79 56 ....J.y...BerryV + 000001e0: 43 61 72 64 00 00 03 e4 49 5c 13 d2 00 09 51 75 Card....I\....Qu + 000001f0: 69 63 6b 50 75 6c 6c 00 00 03 e5 49 ed 7c 70 00 ickPull....I.|p. + 00000200: 0a 42 65 72 72 79 4c 65 76 65 6c 00 00 03 e6 49 .BerryLevel....I + 00000210: ed 7c 70 00 0c 42 65 72 72 79 4c 65 76 65 6c 2d .|p..BerryLevel- + 00000220: 31 00 00 03 e7 49 ed 7c 70 00 0c 42 65 72 72 79 1....I.|p..Berry + 00000230: 4c 65 76 65 6c 2d 32 00 00 03 e8 49 ed 7c 70 00 Level-2....I.|p. + 00000240: 0c 42 65 72 72 79 4c 65 76 65 6c 2d 33 00 00 03 .BerryLevel-3... + 00000250: e9 49 95 da b8 00 04 47 49 53 54 00 00 03 ea 49 .I.....GIST....I + 00000260: 95 da b8 00 06 47 49 53 54 2d 31 00 00 03 eb 49 .....GIST-1....I + 00000270: 95 da b8 00 06 47 49 53 54 2d 32 00 00 03 ec 49 .....GIST-2....I + 00000280: 95 da b8 00 06 47 49 53 54 2d 33 00 00 03 ed 49 .....GIST-3....I + 00000290: 95 da b8 00 06 47 49 53 54 2d 34 00 00 03 ee 49 .....GIST-4....I + 000002a0: 95 da b8 00 06 47 49 53 54 2d 35 00 00 03 ef 49 .....GIST-5....I + 000002b0: f1 f0 99 00 0b 42 42 46 69 6c 65 53 63 6f 75 74 .....BBFileScout + 000002c0: 00 00 03 f0 49 f1 f0 99 00 0d 42 42 46 69 6c 65 ....I.....BBFile + 000002d0: 53 63 6f 75 74 2d 31 00 00 03 f1 49 f1 f0 99 00 Scout-1....I.... + 000002e0: 0d 42 42 46 69 6c 65 53 63 6f 75 74 2d 32 00 00 .BBFileScout-2.. + 000002f0: 03 f2 49 f1 f0 99 00 0d 42 42 46 69 6c 65 53 63 ..I.....BBFileSc + 00000300: 6f 75 74 2d 33 00 00 03 f3 49 e4 f7 0a 00 09 6c out-3....I.....l + 00000310: 61 62 79 72 69 6e 74 68 00 00 03 f4 49 e4 f7 0a abyrinth....I... + 00000320: 00 0b 6c 61 62 79 72 69 6e 74 68 2d 31 00 00 03 ..labyrinth-1... + 00000330: f5 49 e4 f7 0a 00 0b 6c 61 62 79 72 69 6e 74 68 .I.....labyrinth + 00000340: 2d 32 00 00 03 f6 49 e4 f7 0a 00 0b 6c 61 62 79 -2....I.....laby + 00000350: 72 69 6e 74 68 2d 33 00 00 03 f7 49 e4 f7 0a 00 rinth-3....I.... + 00000360: 0b 6c 61 62 79 72 69 6e 74 68 2d 34 00 00 03 f8 .labyrinth-4.... + 00000370: 49 e4 f7 0a 00 0b 6c 61 62 79 72 69 6e 74 68 2d I.....labyrinth- + 00000380: 35 00 00 03 f9 49 e4 f7 0a 00 0b 6c 61 62 79 72 5....I.....labyr + 00000390: 69 6e 74 68 2d 36 00 00 03 fa 49 e4 f7 0a 00 0b inth-6....I..... + 000003a0: 6c 61 62 79 72 69 6e 74 68 2d 37 00 00 03 fb 49 labyrinth-7....I + 000003b0: e4 f7 0a 00 0b 6c 61 62 79 72 69 6e 74 68 2d 38 .....labyrinth-8 + 000003c0: 00 00 03 fc 49 e4 f7 0a 00 0b 6c 61 62 79 72 69 ....I.....labyri + 000003d0: 6e 74 68 2d 39 00 00 03 fd 49 e4 f7 0a 00 0c 6c nth-9....I.....l + 000003e0: 61 62 79 72 69 6e 74 68 2d 31 30 00 00 03 fe abyrinth-10.... + +Command SB_COMMAND_JD_GET_MODULES_LIST +-------------------------------------- + +>>> URB 200 + 00000000: 05 00 0b 00 00 05 8d 00 00 03 fe ........... +<<< URB 180 + 00000000: 00 00 0c 00 13 05 01 00 25 00 00 00 ........%... +<<< URB 182 + 00000000: 05 00 06 00 01 64 .....d +<<< URB 183 + 00000000: 05 00 68 01 00 00 00 0e 00 00 03 fe 49 e4 f7 0a ..h.........I... + 00000010: 00 0c 6c 61 62 79 72 69 6e 74 68 2d 31 31 00 00 ..labyrinth-11.. + 00000020: 03 ff 49 a5 b6 46 00 0d 52 65 70 6c 69 47 6f 52 ..I..F..RepliGoR + 00000030: 65 61 64 65 72 00 00 04 00 49 a5 b6 46 00 0f 52 eader....I..F..R + 00000040: 65 70 6c 69 47 6f 52 65 61 64 65 72 2d 31 00 00 epliGoReader-1.. + 00000050: 04 01 49 a5 b6 46 00 0f 52 65 70 6c 69 47 6f 52 ..I..F..RepliGoR + 00000060: 65 61 64 65 72 2d 36 00 00 04 02 49 a5 b6 46 00 eader-6....I..F. + 00000070: 0f 52 65 70 6c 69 47 6f 52 65 61 64 65 72 2d 37 .RepliGoReader-7 + 00000080: 00 00 04 03 49 a5 b6 46 00 0f 52 65 70 6c 69 47 ....I..F..RepliG + 00000090: 6f 52 65 61 64 65 72 2d 34 00 00 04 04 49 a5 b6 oReader-4....I.. + 000000a0: 46 00 0f 52 65 70 6c 69 47 6f 52 65 61 64 65 72 F..RepliGoReader + 000000b0: 2d 35 00 00 04 05 49 a5 b6 46 00 0f 52 65 70 6c -5....I..F..Repl + 000000c0: 69 47 6f 52 65 61 64 65 72 2d 33 00 00 04 06 49 iGoReader-3....I + 000000d0: a5 b6 46 00 0f 52 65 70 6c 69 47 6f 52 65 61 64 ..F..RepliGoRead + 000000e0: 65 72 2d 32 00 00 04 07 49 a5 b6 46 00 0f 52 65 er-2....I..F..Re + 000000f0: 70 6c 69 47 6f 52 65 61 64 65 72 2d 38 00 00 04 pliGoReader-8... + 00000100: 08 49 a5 b6 46 00 0f 52 65 70 6c 69 47 6f 52 65 .I..F..RepliGoRe + 00000110: 61 64 65 72 2d 39 00 00 04 09 49 a5 b6 46 00 10 ader-9....I..F.. + 00000120: 52 65 70 6c 69 47 6f 52 65 61 64 65 72 2d 31 30 RepliGoReader-10 + 00000130: 00 00 04 0a 49 a5 b6 46 00 10 52 65 70 6c 69 47 ....I..F..RepliG + 00000140: 6f 52 65 61 64 65 72 2d 31 31 00 00 04 0b 49 a5 oReader-11....I. + 000002e0: b6 46 00 10 52 65 70 6c 69 47 6f 52 65 61 64 65 .F..RepliGoReade + 000002f0: 72 2d 31 32 00 00 00 00 r-12.... + | + +Command SB_COMMAND_JD_GET_THREADS_LIST +-------------------------------------- + +>>> URB 204 + 00000000: 05 00 07 00 00 01 08 ....... +<<< URB 184 + 00000000: 00 00 0c 00 13 05 01 00 26 00 00 00 ........&... +<<< URB 186 + 00000000: 05 00 06 00 01 c0 ...... +<<< URB 187 + 00000000: 05 00 c4 01 00 00 00 6f e6 a1 e0 00 db f9 20 00 .......o...... . + 00000010: 7e 38 40 00 7b 6d a0 00 4f aa 80 00 4f ab a0 00 ~8@.{m..O...O... + 00000020: 4f ad 40 00 53 05 60 00 35 ee 40 00 35 ee c0 00 O.@.S.`.5.@.5... + 00000030: 36 00 a0 00 41 b0 40 00 41 ca e0 00 4a 41 20 00 6...A.@.A...JA . + 00000040: 4a c7 20 00 4a df 80 00 2d 47 c0 00 e2 5c 20 00 J. .J...-G...\ . + 00000050: 3a 5d 60 00 3e 30 a0 00 3b 84 c0 00 38 b5 40 00 :]`.>0..;...8.@. + 00000060: 38 16 c0 00 35 70 a0 00 33 26 a0 00 31 1c 00 00 8...5p..3&..1... + 00000070: 34 61 00 00 34 5e e0 00 32 a6 80 00 32 92 a0 00 4a..4^..2...2... + 00000080: 32 b4 60 00 32 35 c0 00 6d ef 60 00 6d ef 00 00 2.`.25..m.`.m... + 00000090: 6c 9e c0 00 66 51 a0 00 60 05 20 00 5f 5f c0 00 l...fQ..`. .__.. + 000000a0: 5f 5f a0 00 5f 1a c0 00 5f 2a 80 00 5d 76 a0 00 __.._..._*..]v.. + 000000b0: 39 46 00 00 30 65 e0 00 2e 35 40 00 30 7a 80 00 9F..0e...5@.0z.. + 000000c0: 30 27 40 00 30 29 20 00 2f c1 80 00 2f 57 20 00 0'@.0) ./.../W . + 000000d0: 2f 57 00 00 2f 17 c0 00 2e 95 00 00 29 ab 40 00 /W../.......).@. + 000000e0: 28 eb e0 00 28 eb 40 00 0c f6 60 00 0c f9 a0 00 (...(.@...`..... + 000000f0: 0c f8 80 00 02 4d 60 00 17 10 60 00 16 04 60 00 .....M`...`...`. + 00000100: 11 45 c0 00 11 46 60 00 12 46 60 00 10 09 60 00 .E...F`..F`...`. + 00000110: 0e 3f a0 00 0d 11 00 00 0c b1 40 00 0d 04 20 00 .?........@... . + 00000120: 0d 05 c0 00 0d 08 40 00 02 b1 a0 00 02 ab e0 00 ......@......... + 00000130: 02 a9 80 00 02 a3 00 00 08 02 c0 00 08 56 a0 00 .............V.. + 00000140: e0 e5 20 00 00 3b a0 00 00 9f 40 00 43 b4 c0 00 .. ..;....@.C... + 00000150: 43 bd a0 00 43 ba e0 00 43 8f 40 00 0a fa e0 00 C...C...C.@..... + 00000160: 18 a8 20 00 2e e2 00 00 0b aa 20 00 16 04 20 00 .. ....... ... . + 00000170: 15 ce c0 00 15 a2 a0 00 15 8e 00 00 7b f4 80 00 ............{... + 00000180: 7f 99 40 00 7f 9a 00 00 81 75 20 00 85 8d c0 00 ..@......u ..... + 00000190: 90 3e 20 00 91 e9 80 00 e1 04 40 00 df 87 40 00 .> .......@...@. + 000001a0: 73 f3 60 00 90 27 00 00 91 91 e0 00 cd ec 80 00 s.`..'.......... + 000001b0: 0b 09 40 00 40 cb 40 00 40 ac 80 00 3f 5e e0 00 ..@.@.@.@...?^.. + 000001c0: c9 b6 60 00 ..`. + +Command SB_COMMAND_JD_GET_THREAD_INFO_XXX +----------------------------------------- + +>>> URB 208 + 00000000: 05 00 0b 00 00 05 0e e6 a1 e0 00 ........... +<<< URB 188 + 00000000: 00 00 0c 00 13 05 01 00 27 00 00 00 ........'... +<<< URB 190 + 00000000: 05 00 06 00 00 05 ...... +<<< URB 191 + 00000000: 05 00 09 00 92 e6 a2 20 00 ....... . + +>>> URB 212 + 00000000: 05 00 0b 00 00 05 50 e6 a2 20 00 ......P.. . +<<< URB 192 + 00000000: 00 00 0c 00 13 05 01 00 28 00 00 00 ........(... +<<< URB 194 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 195 + 00000000: 05 00 08 00 00 00 00 00 ........ + +>>> URB 216 + 00000000: 05 00 0b 00 00 05 0d e6 a1 e0 00 ........... +<<< URB 196 + 00000000: 00 00 0c 00 13 05 01 00 29 00 00 00 ........)... +<<< URB 198 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 199 + 00000000: 05 00 08 00 00 00 00 6b .......k + +>>> URB 220 + 00000000: 05 00 0b 00 00 05 85 e6 a1 e0 00 ........... +<<< URB 200 + 00000000: 00 00 0c 00 13 05 01 00 2a 00 00 00 ........*... +<<< URB 202 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 203 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 00 ............ + +>>> URB 224 + 00000000: 05 00 0b 00 00 05 84 e6 a1 e0 00 ........... +<<< URB 204 + 00000000: 00 00 0c 00 13 05 01 00 2b 00 00 00 ........+... +<<< URB 206 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 207 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 05 ............ + +Command SB_COMMAND_JD_GET_THREAD_INFO_XXX +----------------------------------------- + +>>> URB 228 + 00000000: 05 00 0b 00 00 05 0e db f9 20 00 ......... . +<<< URB 208 + 00000000: 00 00 0c 00 13 05 01 00 2c 00 00 00 ........,... +<<< URB 210 + 00000000: 05 00 06 00 00 05 ...... +<<< URB 211 + 00000000: 05 00 09 00 92 db f9 20 00 ....... . + +>>> URB 232 + 00000000: 05 00 0b 00 00 05 50 db f9 20 00 ......P.. . +<<< URB 212 + 00000000: 00 00 0c 00 13 05 01 00 2d 00 00 00 ........-... +<<< URB 214 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 215 + 00000000: 05 00 08 00 00 00 00 00 ........ + +>>> URB 236 + 00000000: 05 00 0b 00 00 05 0d db f9 20 00 ......... . +<<< URB 216 + 00000000: 00 00 0c 00 13 05 01 00 2e 00 00 00 ............ +<<< URB 218 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 219 + 00000000: 05 00 08 00 00 00 00 3e .......> + +>>> URB 240 + 00000000: 05 00 0b 00 00 05 85 db f9 20 00 ......... . +<<< URB 220 + 00000000: 00 00 0c 00 13 05 01 00 2f 00 00 00 ......../... +<<< URB 222 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 223 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 00 ............ + +>>> URB 244 + 00000000: 05 00 0b 00 00 05 84 db f9 20 00 ......... . +<<< URB 224 + 00000000: 00 00 0c 00 13 05 01 00 30 00 00 00 ........0... +<<< URB 226 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 227 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 19 ............ + +Command SB_COMMAND_JD_GET_THREAD_INFO_XXX +----------------------------------------- + +>>> URB 248 + 00000000: 05 00 0b 00 00 05 0e 7e 38 40 00 .......~8@. +<<< URB 228 + 00000000: 00 00 0c 00 13 05 01 00 31 00 00 00 ........1... +<<< URB 230 + 00000000: 05 00 06 00 00 05 ...... +<<< URB 231 + 00000000: 05 00 09 00 92 7e 38 40 00 .....~8@. + +>>> URB 252 + 00000000: 05 00 0b 00 00 05 50 7e 38 40 00 ......P~8@. +<<< URB 232 + 00000000: 00 00 0c 00 13 05 01 00 32 00 00 00 ........2... +<<< URB 234 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 235 + 00000000: 05 00 08 00 00 00 00 00 ........ + +>>> URB 256 + 00000000: 05 00 0b 00 00 05 0d 7e 38 40 00 .......~8@. +<<< URB 236 + 00000000: 00 00 0c 00 13 05 01 00 33 00 00 00 ........3... +<<< URB 238 + 00000000: 05 00 06 00 00 04 ...... +<<< URB 239 + 00000000: 05 00 08 00 00 00 00 33 .......3 + +>>> URB 260 + 00000000: 05 00 0b 00 00 05 85 7e 38 40 00 .......~8@. +<<< URB 240 + 00000000: 00 00 0c 00 13 05 01 00 34 00 00 00 ........4... +<<< URB 242 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 243 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 00 ............ + +>>> URB 264 + 00000000: 05 00 0b 00 00 05 84 7e 38 40 00 .......~8@. +<<< URB 244 + 00000000: 00 00 0c 00 13 05 01 00 35 00 00 00 ........5... +<<< URB 246 + 00000000: 05 00 06 00 00 08 ...... +<<< URB 247 + 00000000: 05 00 0c 00 00 00 00 00 00 00 00 1e ............ + +[...] + +Command SB_COMMAND_JD_UNKNOWN06 +------------------------------- + +>>> URB 2396 + 00000000: 05 00 0b 00 00 05 44 00 00 00 00 ......D.... +<<< URB 2376 + 00000000: 00 00 0c 00 13 05 01 00 4a 02 00 00 ........J... +<<< URB 2378 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_UNKNOWN07 +------------------------------- + +>>> URB 2399 + 00000000: 05 00 0b 00 00 05 45 00 00 00 00 ......E.... +<<< URB 2379 + 00000000: 00 00 0c 00 13 05 01 00 4b 02 00 00 ........K... +<<< URB 2381 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_UNKNOWN08 +------------------------------- + +>>> URB 2402 + 00000000: 05 00 0b 00 00 05 54 00 00 00 00 ......T.... +<<< URB 2382 + 00000000: 00 00 0c 00 13 05 01 00 4c 02 00 00 ........L... +<<< URB 2384 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_UNKNOWN09 +------------------------------- + +>>> URB 2405 + 00000000: 05 00 0b 00 00 05 33 00 00 00 09 ......3.... +<<< URB 2385 + 00000000: 00 00 0c 00 13 05 01 00 4d 02 00 00 ........M... +<<< URB 2387 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_UNKNOWN10 +------------------------------- + +>>> URB 2408 + 00000000: 05 00 0b 00 00 05 46 00 00 00 01 ......F.... +<<< URB 2388 + 00000000: 00 00 0c 00 13 05 01 00 4e 02 00 00 ........N... +<<< URB 2390 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_GO +------------------------ + +>>> URB 2411 + 00000000: 05 00 07 00 00 01 02 ....... +<<< URB 2391 + 00000000: 00 00 0c 00 13 05 01 00 4f 02 00 00 ........O... +<<< URB 2393 + 00000000: 05 00 06 00 00 00 ...... +<<< URB 2394 + 00000000: 05 00 06 00 00 01 ...... +<<< URB 2395 + 00000000: 05 00 05 00 8d ..... + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2416 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2396 + 00000000: 00 00 0c 00 13 05 01 00 50 02 00 00 ........P... +<<< URB 2398 + 00000000: 05 00 06 00 00 0b ...... +<<< URB 2399 + 00000000: 05 00 0f 00 00 09 56 4d 3a 2d 44 41 20 30 0a ......VM:-DA 0. + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2420 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2400 + 00000000: 00 00 0c 00 13 05 01 00 51 02 00 00 ........Q... +<<< URB 2402 + 00000000: 05 00 06 00 00 02 ...... +<<< URB 2403 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_GET_STATUS +-------------------------------- + +>>> URB 2424 + 00000000: 05 00 07 00 00 01 06 ....... +<<< URB 2404 + 00000000: 00 00 0c 00 13 05 01 00 52 02 00 00 ........R... +<<< URB 2406 + 00000000: 05 00 06 00 00 00 ...... +<<< URB 2407 + 00000000: 05 00 06 00 00 01 ...... +<<< URB 2408 + 00000000: 05 00 05 00 8d ..... + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2429 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2409 + 00000000: 00 00 0c 00 13 05 01 00 53 02 00 00 ........S... +<<< URB 2411 + 00000000: 05 00 06 00 00 12 ...... +<<< URB 2412 + 00000000: 05 00 16 00 00 10 61 74 74 61 63 68 3a 20 73 75 ......attach: su + 00000010: 63 63 65 73 73 0a ccess. + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2433 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2413 + 00000000: 00 00 0c 00 13 05 01 00 54 02 00 00 ........T... +<<< URB 2415 + 00000000: 05 00 06 00 00 02 ...... +<<< URB 2416 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_GET_STATUS +-------------------------------- + +>>> URB 2437 + 00000000: 05 00 07 00 00 01 06 ....... +<<< URB 2417 + 00000000: 00 00 0c 00 13 05 01 00 55 02 00 00 ........U... +<<< URB 2419 + 00000000: 05 00 06 00 00 00 ...... +<<< URB 2420 + 00000000: 05 00 06 00 00 01 ...... +<<< URB 2421 + 00000000: 05 00 05 00 8d ..... + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2442 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2422 + 00000000: 00 00 0c 00 13 05 01 00 56 02 00 00 ........V... +<<< URB 2424 + 00000000: 05 00 06 00 00 1d ...... +<<< URB 2425 + 00000000: 05 00 21 00 00 1b 4a 56 4d 3a 20 62 6b 6c 74 20 ..!...JVM: bklt + 00000010: 40 32 36 37 34 36 31 35 34 3a 20 74 69 6d 65 72 @26746154: timer + 00000020: 0a . + + +Command SB_COMMAND_JD_GET_CONSOLE_MSG +------------------------------------- + +>>> URB 2703 + 00000000: 05 00 07 00 00 01 40 ......@ +<<< URB 2708 + 00000000: 00 00 0c 00 13 05 01 00 5a 02 00 00 ........Z... +<<< URB 2710 + 00000000: 05 00 06 00 00 02 ...... +<<< URB 2711 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_GET_STATUS +-------------------------------- + +>>> URB 2707 + 00000000: 05 00 07 00 00 01 06 ....... +<<< URB 2712 + 00000000: 00 00 0c 00 13 05 01 00 5b 02 00 00 ........[... +<<< URB 2714 + 00000000: 05 00 06 00 00 00 ...... + +Command SB_COMMAND_JD_STOP +-------------------------- + +>>> URB 2500 + 00000000: 05 00 06 00 a5 02 ...... +<<< URB 2518 + 00000000: 00 00 0c 00 13 05 01 00 69 02 00 00 ........i... +<<< URB 2520 + 00000000: 05 00 06 00 00 01 ...... +<<< URB 2521 + 00000000: 05 00 05 00 8a ..... + +Command SB_COMMAND_JD_GET_STACK ???? +------------------------------- + +>>> URB 2504 + 00000000: 05 00 07 00 00 01 64 ......d +<<< URB 2522 + 00000000: 00 00 0c 00 13 05 01 00 6a 02 00 00 ........j... +<<< URB 2524 + 00000000: 05 00 06 00 00 53 .....S +<<< URB 2525 + 00000000: 05 00 57 00 c9 b6 60 00 00 00 00 03 00 00 00 09 ..W...`......... + 00000010: 00 00 57 c8 00 00 00 01 cd 00 00 00 00 09 00 00 ..W............. + 00000020: 67 c5 00 00 00 01 01 00 00 00 00 01 00 00 00 2e g............... + 00000030: 00 00 00 01 01 00 00 00 00 05 17 8f c0 00 00 00 ................ + 00000040: 00 00 00 00 00 00 d5 58 40 00 00 00 00 00 00 00 .......X@....... + 00000050: 00 00 00 00 00 00 0a ....... + + + + + + +Close and stop debugger + +>>> URB 2710 + 00000000: 00 00 08 00 0b 05 00 0e ........ +<<< URB 2715 + 00000000: 00 00 08 00 0c 05 00 0e ........ diff -Nru barry-0.14/doc/ReleaseChecklist.txt barry-0.0.20110506/doc/ReleaseChecklist.txt --- barry-0.14/doc/ReleaseChecklist.txt 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/ReleaseChecklist.txt 2011-05-06 12:20:16.000000000 +0000 @@ -1,39 +1,65 @@ Barry Release Checklist: ------------------------ - bump version numbers in + Note: make sure you check all control files below for both current + versions (i.e. libbarry0 (>= 0.18)) and the next version + (i.e. libbarry0 (<< 0.19)) since the binary packages should prevent + interaction with incompatible libraries this way. - configure.ac - src/Makefile.am - src/version.cc + - gui/configure.ac - gui/src/BackupWindow.cc (about dialog) - - src/Doxyfile + - desktop/src/Makefile.am (oswrapper lib version) + - Doxyfile - rpm/barry.spec - debian/changelog + - debian/control (libbarry0 should not depend on minor number) + - opensync-plugin/configure.ac - opensync-plugin/src/barry_sync.cc + - opensync-plugin-0.4x/configure.ac + - opensync-plugin-0.4x/src/barry_sync.cc + - opensync-plugin/debian/control (libbarry-dev) + - opensync-plugin/debian/changelog (libbarry-dev) + - opensync-plugin-0.4x/debian/control (libbarry-dev) + - opensync-plugin-0.4x/debian/changelog (libbarry-dev) + - files under po/ + - desktop/src/barrydesktop.cc +- test ABI / API and bump major or minor version as appropriate - run all tests on a clean git tree, including build test script - write release notes, including contributors, known issues, new features and bugs fixed - include mention of distros that support Barry: (see AUTHORS file for distro list) + - include description at the top of what Barry is - web docs: - - bump version number + - bump version number and release date on index.php - update known issues list - check that all external links work, and point to proper content - upload latest web docs to netdirect project page + - run: ./static.sh netdirect - upload latest doxygen docs to netdirect project page +- update root README file - snip this version's changelog history into its own file -- tag CVS and git repositories with latest version +- tag CVS repo and sign-tag git repo with latest version - run maintainer/tagged-release.sh -- manually push tags to repo.or.cz +- manually push git tags to repo.or.cz and sourceforge.net - upload packages to SourceForge -- update OpenSUSE Build Service with release tarballs + ssh -x -a -2 -t USER,PROJECT@shell.sourceforge.net create + then use sf-help for details + - Ubuntu: 7.10, 8.04, 9.04 + - Fedora: 7, 8, 9, 11 + - Debian: stable (lenny) + - openSUSE: ? - submit tracker news item at SourceForge - send announcement to devel and announce mailing list, including: - release notes - changelog - URLs to sourceforge and OpenSUSE Build Service binary packages - - CVS and git URLs - URL to netdirect doc page - update Freshmeat entry +- update Sourceforge screenshots / icons if applicable +- send identi.ca/cdfrey and blog notices - update source project, bumping revision numbers in source code diff -Nru barry-0.14/doc/screenshot barry-0.0.20110506/doc/screenshot --- barry-0.14/doc/screenshot 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/screenshot 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,502 @@ +ScreenShot reverse +================== + +After Probe process, we have the JavaLoader command + +Legend : + >>> : Sent + <<< : Received + +Open Socket with BlackBerry device, then select the JavaLoader mode. + +URB : >>> + 00000000: 00 00 0c 00 05 ff 00 05 04 00 07 00 ............ + +URB : <<< + 00000000: 00 00 10 00 06 ff 00 05 04 00 07 00 00 02 00 00 ................ + +URB : >>> + 00000000: 00 00 0c 00 05 ff 00 06 04 00 08 00 ............ + +URB : <<< + 00000000: 00 00 10 00 06 ff 00 06 04 00 08 00 00 01 00 00 ................ + +URB : >>> + 00000000: 00 00 0c 00 05 ff 00 07 04 00 0a 00 ............ + +URB : <<< + 00000000: 00 00 10 00 06 ff 00 07 04 00 0a 00 20 f9 04 80 ............ ... + +URB : >>> + 00000000: 00 00 0c 00 05 ff 00 08 04 00 0b 00 ............ + +URB : <<< + 00000000: 00 00 10 00 06 ff 00 08 04 00 0b 00 00 00 00 00 ................ + +URB : >>> + 00000000: 00 00 18 00 07 ff 00 09 52 49 4d 5f 4a 61 76 61 ........RIM_Java + 00000010: 4c 6f 61 64 65 72 00 00 Loader.. + +URB : <<< + 00000000: 00 00 30 00 08 04 00 09 52 49 4d 5f 4a 61 76 61 ..0.....RIM_Java + 00000010: 4c 6f 61 64 65 72 00 00 00 00 00 00 01 00 08 00 Loader.......... + 00000020: 02 00 08 00 03 01 00 00 04 01 00 00 05 10 01 00 ................ + +URB : >>> + 00000000: 00 00 0c 00 0a 04 00 0a 10 03 00 00 ............ + +URB : <<< + 00000000: 00 00 08 00 10 04 00 0a ........ + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 00 00 00 00 ............ + +URB : <<< + 00000000: 04 00 05 00 01 ..... + +Specific command for JavaLoder. +(this follow part is already described in doc/javaloader file) + +Open a new stream. + +URB : >>> + 00000000: 04 00 08 00 64 00 00 00 ....d... + ^^ : command + ^^^^^ : packet size + ^^^^^ : socket ID + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 01 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 65 00 00 00 ....e... + +URB : >>> + 00000000: 04 00 08 00 70 00 01 00 ....p... + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 02 00 00 00 ............ + +URB : >>> + 00000000: 04 00 05 00 00 ..... + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 03 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +ReceiveStream command. + +0x87 is used to receive a screenshot from the handled. + +URB : >>> + 00000000: 04 00 08 00 87 00 04 00 ........ + ^^^^^^^^ : unknown + ^^ : command to receive a stream + ^^^^^ : packet size + ^^^^^ : socket ID + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 04 00 00 00 ............ + +URB : >>> + 00000000: 04 00 08 00 00 00 00 00 ........ + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 05 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 64 00 10 00 ....d... + ^^^^^ : size of next packet (0x0014 = 0x0010 + 4) + +The handled gives me the size of next packet (0x0010) + +FIXME : Important packet ! + +This packet contains info about the format screenshot. + +URB : <<< + 00000000: 04 00 14 00 00 05 46 00 40 03 01 68 01 e0 00 10 ......F.@..h.... + ^^^^^ ^^^^^ ^^^^^ : unknown + ^^^^^x^^^^^ : width x height + ^^^^^ : packet size + ^^^^^ : socket ID + 00000010: 00 00 00 00 .... + +Reception loop. Now I'm ready to receipt the raw data. + +URB : >>> + 00000000: 04 00 08 00 68 00 00 00 ....h... + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 06 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 6e 00 f8 07 ....n... + ^^^^^ : size of next packet (0x7FC = 0x7F8 + 4) + +URB : <<< + 00000000: 04 00 fc 07 00 00 00 00 00 00 00 00 00 00 00 00 ................ + ^^^^^^........... raw data + ^^^^^ : size + ^^^^^ : socket ID + 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007f0: 00 00 00 00 00 00 00 00 00 00 00 00 ............ + +I have received the data, so I send an acknowledge. + +URB : >>> + 00000000: 04 00 08 00 68 00 00 00 ....h... + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 07 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 6e 00 f8 07 ....n... + +URB : <<< + 00000000: 04 00 fc 07 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000003f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000004f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000005f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000610: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000006f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000007f0: 00 00 00 00 00 00 00 00 00 00 00 00 ............ + +URB : >>> + 00000000: 04 00 08 00 68 00 00 00 ....h... + +[...] + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 af 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 6e 00 48 03 ....n.H. + +URB : <<< + 00000000: 04 00 4c 03 00 00 00 00 00 00 00 00 00 00 00 00 ..L............. + 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 000002f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00000340: 00 00 00 00 00 00 00 00 00 00 00 00 ............ + +URB : >>> + 00000000: 04 00 08 00 68 00 00 00 ....h... + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 b0 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +URB : >>> + 00000000: 04 00 08 00 8d 00 00 00 ........ + +URB : <<< + 00000000: 00 00 0c 00 13 04 01 00 b1 00 00 00 ............ + +URB : <<< + 00000000: 04 00 08 00 64 00 00 00 ....d... + +URB : >>> + 00000000: 00 00 08 00 0b 04 00 0b ........ + +URB : <<< + 00000000: 00 00 08 00 0c 04 00 0b ........ + diff -Nru barry-0.14/doc/servicebook-notes.txt barry-0.0.20110506/doc/servicebook-notes.txt --- barry-0.14/doc/servicebook-notes.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/servicebook-notes.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,140 @@ +These messages come from these threads: +http://sourceforge.net/mailarchive/forum.php?thread_name=20060610014753.GB27404%40foursquare.net&forum_name=barry-devel +http://sourceforge.net/mailarchive/forum.php?thread_name=20060616183827.GA31426%40foursquare.net&forum_name=barry-devel + + + +From: ron@rongage.org +To: barry-devel@lists.sourceforge.net +Date: Thu, 15 Jun 2006 15:52:18 -0400 +Subject: Re: Service Book parser + +Quoting Chris Frey : + +> On Fri, Jun 09, 2006 at 10:29:57PM -0400, Ron Gage wrote: +>> Type: 0xa3 Data: +>> 00000000: 4e 00 00 00 N... +>> Corresponds to User ID +> +> Is this a string that you entered? My test blackberry doesn't show +> this type. + + +The UserID is now confirmed to be an index value into the SQL database. This +value directly corresponds to the ID field in the UserConfig table on the +BesMGNT database. + +More later - the UserConfig table appears to be the big one - where the crypt +keys are kept amongst other things. Digging deeper... + +Ron + +From: ron@rongage.org +To: barry-devel@lists.sourceforge.net +Date: Thu, 15 Jun 2006 15:31:03 -0400 +Subject: Re: Service Book parser + +Quoting Chris Frey : + +> On Fri, Jun 09, 2006 at 10:29:57PM -0400, Ron Gage wrote: +>> Haven't had much chance to correlate this to all the Service Books yet - +>> it IS getting late here... +>> +>> I have partially decoded the Desktop[CICAL] Service Book: +> +> Thanks! +> +> Btw, What is a DSID? +> +Not sure at this point. Possibly crypt related. Just reporting what +is on the +screen of my 7290. + + +> +>> Type: 0xa3 Data: +>> 00000000: 4e 00 00 00 N... +>> Corresponds to User ID +> +> Is this a string that you entered? My test blackberry doesn't show +> this type. + +Probably related to the user id index on the BES server. UserID on the +service +book page is a straight forward integer. + +> +> +>> Type: 0x6 Data: +>> 00000000: 53 30 30 30 30 30 30 30 S0000000 +>> Corresponds to UID - aka the SRP of the BES server +> +> On my test device, this shows as "ff ff ff ff" in all records. +> +> +Is your test device registered with a BES server or with BB's internet +service? + +Ron + + +From: ron@rongage.org +To: barry-devel@lists.sourceforge.net +Date: Fri, 16 Jun 2006 15:51:26 -0400 +Subject: Re: more ServiceBook parsing + +Quoting Chris Frey : + +> Hi, +> +> I've committed some more code to CVS to parse the service book fields. I've +> tested this against a 72xx device and an 8700r, and the type codes for +> similar fields are different. +> +> I just noticed that the large "type 0x9" field has more variable length +> fields inside it. I'll have to parse that out as well. +> +> - Chris +> +Even more on the 0xa field... + +On my BES server, with probably 2-3 exceptions, all users have this same value +in bytes 4-12 of the CurrentKey field. + +A capabilities field perchance? + + + +From: ron@rongage.org +To: barry-devel@lists.sourceforge.net +Date: Fri, 16 Jun 2006 15:30:29 -0400 +Subject: Re: more ServiceBook parsing + +Quoting Chris Frey : + +> Hi, +> +> I've committed some more code to CVS to parse the service book fields. I've +> tested this against a 72xx device and an 8700r, and the type codes for +> similar fields are different. +> +> I just noticed that the large "type 0x9" field has more variable length +> fields inside it. I'll have to parse that out as well. +> +> - Chris +> +> +More on the significance of the 0xc data type (it's nice to have access +to a BES +server, with credentials to the SQL database...) + +In the BesMGMT database, in the UserConfig table, there is a column (type +varbinary[72]) called CurrentKey. The value in the 0xc data type corresponds +directly to bytes 4 through 12 of this CurrentKey value. + +Data type 0xa3 is listed on the handheld as "UserID" - this value directly +corresponds to the "ID" index value in the UserConfig table of the BesMGMT +database on the BES server. + +Ron + diff -Nru barry-0.14/doc/USB-capture.txt barry-0.0.20110506/doc/USB-capture.txt --- barry-0.14/doc/USB-capture.txt 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/USB-capture.txt 2011-05-06 12:20:16.000000000 +0000 @@ -73,8 +73,8 @@ src directory, and the translate.cc program to help analyze the data. -Capturing: The Linux Way ------------------------- +Capturing: The Linux Way, Method 1 +---------------------------------- Recent versions of the Linux kernel in the 2.6 series provide their own way of getting to the low level USB behaviour. In the usbcore driver/module, @@ -86,6 +86,29 @@ transferred through libusb) will be logged from the kernel. This shows up in dmesg output, and /var/log/kern.log on most systems. +The sheer amount of data that can be generated in this manner can sometimes +overwhelm the dmesg kernel buffer, and some USB messages can be lost. There +are two adjustments you can make to combat this. + + 1) I compile a custom kernel with CONFIG_LOG_BUF_SHIFT=21, + the largest I can make it. I also have a custom + patch that limits the size of the USB capture data. + This patch for kernel 2.6.26.8 is included in the doc/ + directory, and should be relatively easy to apply to + other kernel versions. + + 2) Some distributions have syslog configured to send kernel messages + to multiple logfile destinations. Change this to only + one location, and disable any setting that forces a sync + after each log message. This will boost logging speed, and + reduce the chances of missing messages. + + Normally, this involves a syslog.conf line like this: + kern.* -/var/log/kern.log + + You may only want to disable the sync temporarily, as normally, + you want to guarantee that important kernel messages get saved. + The data captured is very raw, in disorganized hex. Use the ktrans program in the tools/ directory to convert it to something readable. @@ -100,8 +123,60 @@ http://www.vmware.com/download/server/ +Capturing: The Linux Way, Method 2 +---------------------------------- + +Recent versions of the Linux kernel provide a binary interface to the +usbmon logging method. You can simply cat the /sys/kernel/debug/usb/usbmon/1u +file, depending on your bus number, for a text version of the capture, +but the data is limited to 32 bytes. This is not sufficient for +many of the bulk data transfers used by the BlackBerry. + +Wireshark 1.2.x plus libpcap 1.0 or higher will use the /dev/usbmon* +devices to capture the full binary USB traffic. Wireshark can also +export this data in plain text format, if the GUI display does not +work for you. + +It is not guaranteed that the binary interface will capture all data +if the system is really busy. If this is a concern, renice your VM +and wireshark appropriately. + +For more low level information on the usbmon binary interface, see +the file Documentation/usb/usbmon.txt in the Linux kernel sources. + + +Capturing: The VMWare way +------------------------- + +If you're running VMWare anyway, it has a built-in capability to log USB +traffic. + +In addition, the Virtual USB Analyzer project provides a graphical way +of viewing USB traffic, and can be found here: + + http://vusb-analyzer.sourceforge.net/ + +There is a tutorial there, describing how to configure VMWare to log USB +traffic, and how to make use of those logs with vusb-analyzer. + + +Capturing: The RIM way +---------------------- + +It was reported on the mailing list that it is possible to add the +following entries to the Windows Registry to cause RIM's software +to create verbose logs in your temp directory. Apparently this also +enables sniffing the communication with the BlackBerry simulator. + +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RimUsb\Parameters] +"FileDump"=dword:00000001 +"ServiceDebug"=dword:ffffffff + + + Happy Hacking! Chris Frey -February 2007 diff -Nru barry-0.14/doc/VersionNotes barry-0.0.20110506/doc/VersionNotes --- barry-0.14/doc/VersionNotes 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/VersionNotes 2011-05-06 12:20:16.000000000 +0000 @@ -1,42 +1,126 @@ +Preamble +-------- + Barry is primarily intended to be a library, for any application to access Blackberry devices. There will be an OpenSync module built -on top of this, plus some command line utilities, and possibly a GUI, +on top of this, plus some command line utilities, and a GUI, but initially Barry is a library, and must be versioned accordingly. Additional applications built on top of Barry may be versioned separately. -Most operating systems can handle two library version numbers: major.minor. -They use these numbers to determine which library is compatible -and most recent. - -Therefore Barry will be versioned the same way, the major version -number indicating a backward incompatible change to the library. - - -Version Numbering Plan: ------------------------ - - Alpha development will occur on major version 0, incrementing the - minor version only until stability is reached. - - When the 0.x series is stable, as a special case, the highest - stable 0.x version will be released as version 1.00. User- - readable version strings in the library and applications will - be changed to 1.00, 1.01, 1.02, 1.05, etc, but the library - version in src/Makefile.am will stay on the 0.x series. - - Bugfix releases for this stable series will continue from there, - using 1.01 in user strings, and 0.x in the src/Makefile.am. - - A new development branch will be started with the version 1.50, - and both src/Makefile.am and the user strings will match again. - - From then on, development will continue on odd numbered major - versions with incompatible changes allowed. When stable, version - 1.x will become 2.0, and the 3.x branch will be opened. - -Due to limitations in remaining portable across as many operating systems -as possible, Barry will discontinue its 3-number version scheme as of -version 0.4. +Since Barry is a library, applications need to know which versions +they are compatible with. Unix has a version number scheme for this +already. + + +History +------- + +Initially, I had tried to use the old Linux kernel style of version +numbering. One series of version numbers for development, and one +for "stable" releases. Linux has since abandoned this versioning +scheme, and after reality has bumped me about, I'm about to abandon +it too. + +The reason is that all of Barry's releases are generally stable. +They are expected to work on all systems, even in the git tree. +People run Barry from the git repositories regularly, and often +the code in git is more stable or feature complete than the +released tarball. + +The goal of Barry's development style is to always be stable. +Every commit should compile. Every commit should work with all +devices. Every commit should be examined closely for security +issues or buffer overflows. It should be possible to take a +snapshot of Barry's source tree at any time and use it. + +Indeed, Barry's versioning over the past few years since 2005 +has indicated this philosophy. Only 16 versions have been released, +from 0.0.1 to 0.16. The development has been linear, and while +there have been some large changes to the library and tools (such +as the introduction of optional threads) this has not impacted +the stability of the library. Most issues in Barry arrise from +udev permissions problems or interactions with unknown parts of +the Blackberry firmware. There was only one release that was +specifically to fix a bug in Barry itself. (Version 0.11 which +fixed a null pointer bug in 0.10, and which was released the +day after.) + +So in the end, Barry is retaining a versioning feature it does +not need (unstable and stable lines of development) and ignoring +a feature it does need (library versions that indicate backward +compatibility). + + +New Direction +------------- + +To fix this, we're going back to 3 number versioning, but with a +twist: + + logical.libmajor.libminor + +Logical now becomes something of an advertisement. When we have +sufficient features, we can call it version 1. Until then, we +remain version 0. + +Libmajor will start with the old minor, at 17. It represents +a compatible library. All version 17 libraries are linkable to +applications that depend on them. + +Libminor will represent releases that do not affect binary compatibility. + +So the first version using this new scheme will be version 0.17.0 +and the libbarry.so will be named libbarry.so.17.0.0, libbarry.17.0.1, +etc. + + +Managing Version Numbers +------------------------ + +Any changes in the following areas require a bump in libmajor: + + - removing: + - a standalone function call + - a member function + - a member variable from a class + - a global variable + - changing: + - the arguments in an API call + - the size or name of a member variable + - the size or name or a global variable + - the virtual-ness of a member function + - adding: + - a member variable to the middle of the class + - moving: + - a public element from one namespace to another + + +Any changes in the following areas only require a bump in libminor: + + - adding: + - a non-virtual member function to a class + - a standalone function call + - a global variable + - an entirely brand new class + - changing: + - the internal implementation of a non-inline function + - any class or function, in any way, that is not BXEXPORTed + - any non-library code + +As you can see, most of the time we'll be bumping the libmajor +version anyway, just like we've been bumping the minor. But at +least now, distros and library users can separate Barry library +versions, and safely install multiple versions of the Barry +library on their system at the same time. + +This version scheme will in no way impact the freedom to change the API. +If the API needs to be updated, we'll bump the libmajor version with +impunity. + +If you have comments or suggestions or bug reports with regard to +Barry versioning, please post to the barry-devel mailing list. +Chris Frey +October 2010 Binary files /tmp/hrabAk_zAl/barry-0.14/doc/vsm/MyVSM-001 and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/vsm/MyVSM-001 differ diff -Nru barry-0.14/doc/vsm/MyVSM-001.txt barry-0.0.20110506/doc/vsm/MyVSM-001.txt --- barry-0.14/doc/vsm/MyVSM-001.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/vsm/MyVSM-001.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,204 @@ +0000000: 0100 00bc 460b 0000 c3d9 9076 0903 0000 ....F......v.... + ^MagicNumber ^VendorID 0x0309 (777 decimal) + ^resourceSectionLength + ^resourceSectionchecksum +0000010: 0000 0000 0000 0000 0000 0000 0000 dc09 ................ + ^resType 0x0 (splash screen PNG) + ^resLength 0x9dc +0000020: 8950 4e47 0d0a 1a0a 0000 000d 4948 4452 .PNG........IHDR +0000030: 0000 0140 0000 00f0 0802 0000 00fe 4f2a ...@..........O* +0000040: 3c00 0000 0467 414d 4100 00b1 8f0b fc61 <....gAMA......a +0000050: 0500 0009 9349 4441 5478 5eed dd41 761c .....IDATx^..Av. +0000060: 370c 4551 6567 5e9a 76ae c8d1 204e 623b 7.EQeg^.v... Nb; +0000070: 8d22 0812 e4d5 f1c0 0316 c07a fcaf 51dd .".........z..Q. +0000080: 92ad 3f3e 3e3e de7c 2180 4053 029f 02fb ..?>>>.|!.@S.... +0000090: 4200 81a6 04de 9aee dbb6 1140 e0fb e333 B..........@...3 +00000a0: 0a08 20d0 9700 81fb 9e9d 9d23 6002 cb00 .. ........#`... +00000b0: 029d 0998 c09d 4fcf deaf 2740 e0eb 2300 ......O...'@..#. +00000c0: 4067 0204 ee7c 7af6 7e3d 0102 5f1f 0100 @g...|z.~=.._... +00000d0: 3a13 2070 e7d3 b3f7 eb09 10f8 fa08 00d0 :. p............ +00000e0: 9900 813b 9f9e bd5f 4f80 c0d7 4700 80ce ...;..._O...G... +00000f0: 0408 dcf9 f4ec fd7a 0204 be3e 0200 7426 .......z...>..t& +0000100: 40e0 cea7 67ef d713 20f0 f511 00a0 3301 @...g... .....3. +0000110: 0277 3e3d 7bbf 9e00 81af 8f00 009d 0910 .w>={........... +0000120: b8f3 e9d9 fbf5 0408 7c7d 0400 e84c 80c0 ........|}...L.. +0000130: 9d4f cfde af27 40e0 eb23 0040 6702 04ee .O...'@..#.@g... +0000140: 7c7a f67e 3d81 3902 bf7f fbf0 e757 04ae |z.~=.9......W.. +0000150: cf1c 0089 04f2 0466 ec03 0289 27a9 d495 .......f....'... +0000160: 0492 047e 905d 977c 11f0 85c0 0081 0c81 ...~.].|........ +0000170: a938 4860 e0fc 5c7a 3981 6181 07b3 eb72 .8H`..\z9.a....r +0000180: 73f8 7205 c76e 9fc0 7b7c de36 768a aebe s.r..n..{|.6v... +0000190: 96c0 98c0 e667 2281 6b33 e8c6 0708 1078 .....g".k3.....x +00001a0: 8f09 ecd3 ac81 10df 7c29 8109 7c73 fedb ........|)..|s.. +00001b0: dffb 80c0 894f 8f4a 99c0 ed55 5a73 0304 .....O.J...UZs.. +00001c0: 3681 d724 4fd7 1402 0426 704a 9014 5943 6..$O....&pJ..YC +00001d0: 80c0 045e 933c 5d53 0810 98c0 2941 5264 ...^.<]S....)ARd +00001e0: 0d01 0213 784d f274 4d21 4060 02a7 0449 ....xM.tM!@`...I +00001f0: 9135 0408 4ce0 35c9 d335 8500 8109 9c12 .5..L.5..5...... +0000200: 2445 d610 2030 81d7 244f d714 0204 2670 $E.. 0..$O....&p +0000210: 4a90 1459 4380 c004 5e93 3c5d 5308 1098 J..YC...^.<]S... +0000220: c029 4152 640d 0102 1378 4df2 744d 2140 .)ARd....xM.tM!@ +0000230: 6002 a704 4991 3504 084c e035 c9d3 3585 `...I.5..L.5..5. +0000240: 0081 099c 1224 45d6 1020 3081 d724 4fd7 .....$E.. 0..$O. +0000250: 1402 0426 704a 9014 5943 80c0 045e 933c ...&pJ..YC...^.< +0000260: 5d53 0810 98c0 2941 5264 0d01 0213 784d ]S....)ARd....xM +0000270: f274 4d21 4060 02a7 0449 9135 0408 4ce0 .tM!@`...I.5..L. +0000280: 35c9 d335 8500 8109 9c12 2445 d610 2030 5..5......$E.. 0 +0000290: 81d7 244f d714 0204 2670 4a90 1459 4380 ..$O....&pJ..YC. +00002a0: c004 5e93 3c5d 5308 1098 c029 4152 640d ..^.<]S....)ARd. +00002b0: 0102 1378 4df2 744d 2140 6002 a704 4991 ...xM.tM!@`...I. +00002c0: 3504 084c e035 c9d3 3585 0081 099c 1224 5..L.5..5......$ +00002d0: 45d6 1020 3081 d724 4fd7 1402 0426 704a E.. 0..$O....&pJ +00002e0: 9014 5943 e05e 81df bebd fb83 c027 8135 ..YC.^.......'.5 +00002f0: e625 75bd 4b60 7945 e0f7 0492 b4aa 2b73 .%u.K`yE......+s +0000300: 91c0 b28b c02b 04ea e4cb e874 8bc0 af9c .....+.....t.... +0000310: 9c35 087c 11c8 30ab a8c6 1502 cb25 0251 .5.|..0......%.Q +0000320: 0245 fe0d b739 5fe0 e8c9 598f 40a3 214c .E...9_...Y.@.!L +0000330: 609f 4523 f073 02c3 d3b1 a200 81c5 1701 `.E#.s.......... +0000340: 02bf 6ff3 e310 ffd9 8907 4204 9e11 a818 ..o.......B..... +0000350: a0c3 3d0e 9fc0 cf4e ce55 0874 791b 4c60 ..=....N.U.ty.L` +0000360: 0f90 0878 84de f511 da24 41e0 3181 e1c7 ...x.....$A.1... +0000370: db8a 0226 b0f9 8380 096c 02fb a711 c711 ...&.....l...... +0000380: a818 a0c3 3d4c 60f3 0701 13d8 043e 6efe ....=L`......>n. +0000390: 3c7e eb78 cc85 c3d3 b1a2 8009 6cfe 2060 <~.x........l. ` +00003a0: 029b c026 f071 042a 06e8 700f 13d8 fc41 ...&.q.*..p....A +00003b0: c004 3681 8f9b 3fc7 bc95 7d7c 23c3 d3b1 ..6...?...}|#... +00003c0: a280 096c fe20 6002 9bc0 26f0 7104 2a06 ...l. `...&.q.*. +00003d0: e870 0f13 d8fc 41c0 0436 818f 9b3f 8fdf .p....A..6...?.. +00003e0: 3a1e 73e1 f074 ac28 6002 9b3f 0898 c026 :.s..t.(`..?...& +00003f0: b009 7c1c 818a 013a dcc3 0436 7f10 3081 ..|....:...6..0. +0000400: 4de0 e3e6 cf31 6f65 1fdf c8f0 74ac 2860 M....1oe....t.(` +0000410: 029b 3f08 98c0 26b0 097c 1c81 8a01 3adc ..?...&..|....:. +0000420: c304 367f 1030 814d e0e3 e6cf e3b7 8ec7 ..6..0.M........ +0000430: 5c38 3c1d 2b0a 98c0 e60f 0226 b009 6c02 \8<.+......&..l. +0000440: 1f47 a062 800e f730 81cd 1f04 4c60 13f8 .G.b...0....L`.. +0000450: b8f9 73cc 5bd9 c737 323c 1d2b 0a98 c0e6 ..s.[..72<.+.... +0000460: 0f02 26b0 096c 021f 47a0 6280 0ef7 3081 ..&..l..G.b...0. +0000470: cd9f 1e04 3ede de1f fc79 fcfc ec97 9b6d ....>....y.....m +0000480: f10b 4747 cecf b5cb 093c 30f6 3797 446f ..GG.....<0.7.Do +0000490: 6778 3a56 1430 817b cc9f 68f8 0e58 9f6b gx:V.0.{..h..X.k +00004a0: ef57 b510 960a ff86 7b10 3876 a8a1 0458 .W......{.8v...X +00004b0: fc98 c00c 7ba3 0e0f cb55 5180 c004 de8e ....{....UQ..... +00004c0: c03c 7b43 0e57 f837 dc83 c0db c5f7 f1d4 .<{C.W.7........ +00004d0: 3ae3 c2d9 f6be eef0 b05c 1505 084c e0bd :........\...L.. +00004e0: 0810 38e4 3d81 f78a ef19 5374 e42e 084c ..8.=.....St...L +00004f0: e0bf bf83 3592 24d7 2e21 4060 0213 b8eb ....5.$..!@`.... +0000500: 6345 8dbd 2f7e 3f29 24d2 aac5 1ea1 bb66 cE../~?)$......f +0000510: 7dc9 789c dd94 c0d1 1702 0213 7823 0204 }.x.........x#.. +0000520: 26f0 3f7e 8473 f6c4 503f 9700 8109 4ce0 &.?~.s..P?....L. +0000530: 8d26 6a54 6f02 1398 c004 feff 7fb7 f4ca .&jTo........... +0000540: 2b4b d4a5 25eb bd07 6e1c f757 52d8 6b8d +K..%...n..WR.k. +0000550: 091c 7d15 2030 8137 2240 6002 7b84 de48 ..}. 0.7"@`.{..H +0000560: c8e8 fc27 3081 094c 60ef 815f 791d d8f5 ...'0..L`.._y... +0000570: ffc1 faf8 6163 d109 60fd 5a02 26f0 2be6 ....ac..`.Z.&.+. +0000580: fdb8 c67b e0c6 f36a ad6c 33ba 1398 c01e ...{...j.l3..... +0000590: a11b bf24 1198 c0ff fecf f466 0c0a 3527 ...$.......f..5' +00005a0: 1120 3081 096c 02fb 10eb 95d7 810e 1f62 . 0..l.........b +00005b0: 7d7e a035 6956 283b 8380 09fc 8a79 177d }~.5iV(;.....y.} +00005c0: 8845 e019 9acd abb9 8fc0 5191 56ad 3ffc .E........Q.V.?. +00005d0: 53e8 af6f 29cd 0b9c cab9 0408 1c7d 21b8 S..o)........}!. +00005e0: 4260 0ee7 6a36 afda 2602 472d 5ab8 fe16 B`..j6..&.G-Z... +00005f0: 8139 3ccf bac4 ca3b 08bc d0c6 07ad 2f12 .9<....;....../. +0000600: 98c3 89a6 4d2a b55c e007 0aad bde4 2e81 ....M*.\........ +0000610: 7ffc 29cb edfe be36 089b 747f f42b 089f ..)....6..t..+.. +0000620: 68bf c9fd 0e6f 83c0 5bfc 16c5 efaf 26be h....o..[.....&. +0000630: 3e09 1038 1803 0213 3818 99a9 cb09 1cc4 >..8....8....... +0000640: 4b60 0207 2333 7539 8183 7809 4ce0 6064 K`..#3u9..x.L.`d +0000650: a62e 2770 102f 8109 1c8c ccd4 e504 0ee2 ..'p./.......... +0000660: 2530 8183 9199 ba9c c041 bc04 2670 3032 %0.......A..&p02 +0000670: 5397 1338 8897 c004 0e46 66ea 7202 07f1 S..8.....Ff.r... +0000680: 1298 c0c1 c84c 5d4e e020 5e02 1338 1899 .....L]N. ^..8.. +0000690: a9cb 091c c44b 6002 0723 3375 3981 8378 .....K`..#3u9..x +00006a0: 094c e060 64a6 2e27 7010 2f81 091c 8ccc .L.`d..'p./..... +00006b0: d4e5 040e e225 3081 8391 99ba 9cc0 41bc .....%0.......A. +00006c0: 0426 7030 3253 9713 3888 97c0 040e 4666 .&p02S..8.....Ff +00006d0: ea72 0207 f112 98c0 c1c8 4c5d 4ee0 205e .r........L]N. ^ +00006e0: 0213 3818 99a9 cb09 1cc4 4b60 0207 2333 ..8.......K`..#3 +00006f0: 7539 8183 7809 4ce0 6064 a62e 2770 102f u9..x.L.`d..'p./ +0000700: 8109 1c8c ccd4 e504 0ee2 2530 8183 9199 ..........%0.... +0000710: ba9c c041 bc04 2670 3032 5397 1338 8897 ...A..&p02S..8.. +0000720: c004 0e46 66ea 7202 07f1 1298 c0c1 c84c ...Ff.r........L +0000730: 5d4e e020 5e02 1338 1899 a9cb 091c c44b ]N. ^..8.......K +0000740: 6002 0723 3375 3981 8378 094c e060 64a6 `..#3u9..x.L.`d. +0000750: 2e27 7010 2f81 091c 8ccc d4e5 040e e225 .'p./..........% +0000760: 3081 8391 99ba 9cc0 41bc 0426 7030 3253 0.......A..&p02S +0000770: 9713 3888 97c0 040e 4666 ea72 0207 f112 ..8.....Ff.r.... +0000780: 98c0 c1c8 cc5e 5ee3 f0ec bba8 aa4f 6002 .....^^......O`. +0000790: 5765 edc5 3e04 7e11 d45f cb08 4ce0 485e We..>.~.._..L.H^ +00007a0: 0ad6 1238 0299 c004 8ee4 a560 2d81 2390 ...8.......`-.#. +00007b0: 094c e048 5e6a d6ce 76b8 e62e 4aba 1098 .L.H^j..v...J... +00007c0: c025 418b 3699 e770 7427 7baf 2730 8177 .%A.6..pt'{.'0.w +00007d0: 4de8 0c87 77bd d7c7 fb22 3081 1f87 67fe M...w...."0...g. +00007e0: 85b9 0ecf df6f 7d07 0213 b83e 753a a611 .....o}....>u:.. +00007f0: 2030 81d3 c2a4 503d 0102 13b8 3e75 3aa6 0....P=....>u:. +0000800: 1120 3081 d3c2 a450 3d01 0213 b83e 753a . 0....P=....>u: +0000810: a611 2030 81d3 c2a4 503d 0102 13b8 3e75 .. 0....P=....>u +0000820: 3aa6 1120 3081 d3c2 a450 3d01 0213 b83e :.. 0....P=....> +0000830: 753a a611 2030 81d3 c2a4 503d 0102 13b8 u:.. 0....P=.... +0000840: 3e75 3aa6 1120 3081 d3c2 a450 3d01 0213 >u:.. 0....P=... +0000850: b83e 753a a611 2030 81d3 c2a4 503d 0102 .>u:.. 0....P=.. +0000860: 13b8 3e75 3aa6 1120 3081 d3c2 a450 3d01 ..>u:.. 0....P=. +0000870: 0213 b83e 753a a611 2030 81d3 c2a4 503d ...>u:.. 0....P= +0000880: 0102 13b8 3e75 3aa6 1120 3081 d3c2 a450 ....>u:.. 0....P +0000890: 3d01 0213 b83e 753a a611 2030 81d3 c2a4 =....>u:.. 0.... +00008a0: 503d 0102 13b8 3e75 3aa6 1120 3081 d3c2 P=....>u:.. 0... +00008b0: a450 3d01 0213 b83e 753a a611 2030 81d3 .P=....>u:.. 0.. +00008c0: c2a4 503d 0102 13b8 3e75 3aa6 1118 10f8 ..P=....>u:..... +00008d0: 730f efdb a4ff 809d a49d a942 1711 20f0 s..........B.. . +00008e0: 36af 4117 a5ce ada6 1120 3081 d3c2 a450 6.A...... 0....P +00008f0: 3d81 3181 3d45 673d bad7 9fbc 8e47 1020 =.1.=Eg=.....G. +0000900: f01e 13f8 8830 b989 7a02 c302 1bc2 e343 .....0..z......C +0000910: b8fe d875 3c85 4086 c01c 1e71 f894 24b9 ...u<.@....q..$. +0000920: 8f25 0492 04e6 f033 8797 9cb9 a607 11c8 .%.....3........ +0000930: 13f8 2028 6e05 812e 0408 dce5 a4ec 1381 .. (n........... +0000940: 9f10 20b0 5820 d098 0081 1b1f 9ead 2340 .. .X ........#@ +0000950: 6019 40a0 3101 0237 3e3c 5b47 80c0 3280 `.@.1..7><[G..2. +0000960: 4063 0204 6e7c 78b6 8e00 8165 0081 c604 @c..n|x....e.... +0000970: 08dc f8f0 6c1d 0102 cb00 028d 0910 b8f1 ....l........... +0000980: e1d9 3a02 0496 0104 1a13 2070 e3c3 b375 ..:....... p...u +0000990: 0408 2c03 0834 2640 e0c6 8767 eb08 1058 ..,..4&@...g...X +00009a0: 0610 684c 80c0 8d0f cfd6 1120 b00c 20d0 ..hL....... .. . +00009b0: 9800 811b 1f9e ad23 4060 1940 a031 0102 .......#@`.@.1.. +00009c0: 373e 3c5b 4780 c032 8040 6302 046e 7c78 7><[G..2.@c..n|x +00009d0: b68e 0081 6500 81c6 0408 dcf8 f06c 1d01 ....e........l.. +00009e0: 02cb 0002 8d09 fc09 9066 8998 59ce 348d .........f..Y.4. +00009f0: 0000 0000 4945 4e44 ae42 6082 0100 0200 ....IEND.B`..... + ^resType 0x1 (splash screen duration) + ^resLength 0x2 +0000a00: a00f 0310 1000 5765 6c63 6f6d 6520 746f ......Welcome to + ^0xfa0 = 4000 milliseconds + ^resType 0x1003 (Welcome message subject) + ^resLength 0x10 + ^resData "Welcome to Barry" +0000a10: 2042 6172 7279 0410 df00 5468 616e 6b73 Barry....Thanks + ^resType 0x1004 (Welcome message body) + ^resLength 0xdf + ^resData "Thanks for..." +0000a20: 2066 6f72 2069 6e73 7461 6c6c 696e 6720 for installing +0000a30: 7468 6520 7361 6d70 6c65 2062 7261 6e64 the sample brand +0000a40: 696e 6720 6669 6c65 2066 6f72 2074 6865 ing file for the +0000a50: 2042 6172 7279 2070 726f 6a65 6374 2e20 Barry project. +0000a60: 2044 6972 6563 7420 796f 7572 2062 726f Direct your bro +0000a70: 7773 6572 2074 6f20 6874 7470 3a2f 2f73 wser to http://s +0000a80: 6f75 7263 6566 6f72 6765 2e6e 6574 2f70 ourceforge.net/p +0000a90: 726f 6a65 6374 732f 6261 7272 7920 616e rojects/barry an +0000aa0: 6420 6874 7470 3a2f 2f77 7777 2e6e 6574 d http://www.net +0000ab0: 6469 7265 6374 2e63 612f 736f 6674 7761 direct.ca/softwa +0000ac0: 7265 2f70 6163 6b61 6765 732f 6261 7272 re/packages/barr +0000ad0: 792f 2074 6f20 6c65 6172 6e20 6d6f 7265 y/ to learn more +0000ae0: 2061 626f 7574 2074 6865 2042 6172 7279 about the Barry +0000af0: 2070 726f 6a65 6374 2e00 0510 1000 4261 project......Ba + ^resType 0x1005 (Welcome message from) + ^resLength 0x10 + ^resData "Barry Developers." +0000b00: 7272 7920 4465 7665 6c6f 7065 7273 0020 rry Developers. + ^resType 0x2000 (Escreen message) +0000b10: 5000 5468 6973 2042 6c61 636b 4265 7272 P.This BlackBerr + ^resLength 0x50 + ^resData "This Blackberry..." +0000b20: 7920 6861 7320 6265 656e 2063 7573 746f y has been custo +0000b30: 6d69 7a65 6420 7769 7468 2061 2062 7261 mized with a bra +0000b40: 6e64 696e 6720 6669 6c65 2066 726f 6d20 nding file from +0000b50: 7468 6520 4261 7272 7920 7072 6f6a 6563 the Barry projec +0000b60: 742e t. + diff -Nru barry-0.14/doc/vsm/VSM_analysis.txt barry-0.0.20110506/doc/vsm/VSM_analysis.txt --- barry-0.14/doc/vsm/VSM_analysis.txt 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/vsm/VSM_analysis.txt 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,336 @@ +Analysis of the file format for Vendor Splash Media files +========================================================= + +VSM files start with the bytes 01 00 00 bc which appear to be nothing +more than a magic number. Changing any of these first four bytes causes +the file to not be recognized as a VSM file. + +Next are four bytes that give the length of the resource section in +little-endian order so 46 0b 00 00 signifies that the length is 0x00000b46 +or 2886 bytes long. + +The next four bytes are calculated by taking 0xffffffff - (the CRC-32 of +the resource section). For my sample VSM file, the CRC-32 of the resource +section is 0x896f263c. 0xffffffff - 0x896f263c = 0x7690d9c3 so the four +bytes are c3 d9 90 76. + +The Vendor ID takes the next two bytes. Remember that little-endian +order is used, so 36 01 is used to represent the vendor id 310 for Wind +Italy. The Vendor ID MAY be changed without affecting the file signature +or the checksum. + +The next two bytes are always zero. + +There is a single byte value of unknown purpose followed by two bytes +of zero followed by a byte that is zero when the unknown value is zero, +and one when the unknown value is non-zero. + +There are eight bytes of zero before the resource section begins. This +may be reserved for future use. + +The resource section may be empty, but most often it contains +resources. Each resource starts with two bytes that specify the resource +type, followed by a two byte resource length value, followed by the +resource data. If the last byte of the resource falls on an even-numbered +address offset (assuming the first byte in the file is considered offset +zero) then there is a pad null byte between the two resources. The pad +byte is not figured into the length of either resource, but is included in +the value for the total resource section length found in the file header. + +The resouces may be listed in any order, however changing any byte in the +resource section including resource order will cause the file signature +to be invalid. + +Following the resource section there may or may not be a footer and +signature. The footer is the byte sequence: 1F 2D C8 D7 33 00 00 00 80 +00 00 00. I am not sure of the function of the first eight bytes, but I +believe the 80 00 specifies that the signature is of length 0x0080 or +128 bytes. There are two null bytes followed by a 128 byte (1024 bit) +signature. + +The following table lists the values to use to define a field type +followed by a name for each. There are also some values for flags listed +after the field for which they are used. + +0x0 FIELD_BITMAP_1_DATA +0x1 FIELD_BITMAP_1_TIMEOUT +0x2 FIELD_BITMAP_2_DATA +0x10 FIELD_ENGINEERING_UNIT +0x11 FIELD_SUPPRESS_SOS +0x13 FIELD_BETA_TEST +0x14 FIELD_EVALUATION_UNIT +0x15 FIELD_SUPPORT_DIRECT_DIAL_SEND +0x16 FIELD_ONS_RENDER_MODE +0x17 FIELD_DISABLE_VOLUME_BOOST +0x18 FIELD_DISABLE_BLACKBERRY_PROTECTION_MODE +0x1000 FIELD_WELCOME_MESSAGE_SUBJECT_ISO8859 +0x1001 FIELD_WELCOME_MESSAGE_BODY_ISO8859 +0x1002 FIELD_WELCOME_MESSAGE_FROM_ISO8859 +0x1003 FIELD_WELCOME_MESSAGE_SUBJECT +0x1004 FIELD_WELCOME_MESSAGE_BODY +0x1005 FIELD_WELCOME_MESSAGE_FROM +0x1100 FIELD_DEVICE_MESSAGE_SUBJECT +0x1101 FIELD_DEVICE_MESSAGE_BODY +0x1102 FIELD_DEVICE_MESSAGE_FROM +0x1200 FIELD_TOP_TIPS_MESSAGE_SUBJECT +0x1201 FIELD_TOP_TIPS_MESSAGE_BODY +0x1202 FIELD_TOP_TIPS_MESSAGE_FROM +0x2000 FIELD_ESCREEN_HELP_MSG +0x3000 FIELD_PROVISIONING_IP +0x3001 FIELD_PROVISIONING_DEST_PORT +0x3002 FIELD_PROVISIONING_SRC_PORT +0x3003 FIELD_PROVISIONING_APN +0x3004 FIELD_PROVISIONING_DEVICE_CLASS +0x3005 FIELD_PROVISIONING_APN_USERNAME +0x3006 FIELD_PROVISIONING_APN_PASSWORD +0x3007 FIELD_PROVISIONING_FLAGS +0x1 FLAG_PROVISIONING_DONT_SEND_MSISDN +0x2 FLAG_PROVISIONING_DONT_SEND_ICCID +0x4 FLAG_PROVISIONING_SEND_SPN +0x8 FLAG_PROVISIONING_RIM +0x10 FLAG_PROVISIONING_SEND_EMPLOYEE_ROLE_FEATURE_INFO +0x20 FLAG_PROVISIONING_DONT_SEND_AIRTIME_USAGE_STATS +0x40 FLAG_PROVISIONING_INFO_LEVEL_1 +0x80 FLAG_PROVISIONING_INFO_LEVEL_2 +0x3100 FIELD_2ND_PROVISIONING_IP +0x3101 FIELD_2ND_PROVISIONING_DEST_PORT +0x3102 FIELD_2ND_PROVISIONING_SRC_PORT +0x3103 FIELD_2ND_PROVISIONING_APN +0x3104 FIELD_2ND_PROVISIONING_DEVICE_CLASS +0x3105 FIELD_2ND_PROVISIONING_APN_USERNAME +0x3106 FIELD_2ND_PROVISIONING_APN_PASSWORD +0x3107 FIELD_2ND_PROVISIONING_FLAGS +0x3500 TCP_APN_DEFAULT_APNNAME +0x3501 TCP_APN_DEFAULT_USERNAME +0x3502 TCP_APN_DEFAULT_PASSWORD +0x3600 FIELD_CDMA_IIF_APN +0x3601 FIELD_CDMA_IIF_APN_USERNAME +0x3602 FIELD_CDMA_IIF_APN_PASSWORD +0x3800 FIELD_PRIMARY_WIRELESS_ACCESS_FAMILY +0x1 WAF_3GPP +0x2 WAF_CDMA +0x3 WAF_WLAN +0x4 WAF_IDEN +0x4000 FIELD_BRANDING_WAP_ICON +0x4001 FIELD_BRANDING_TUNE +0x4002 FIELD_BRANDING_TUNE_NAME +0x4003 FIELD_BRANDING_KEY +0x4004 FIELD_BRANDING_TUNE_MIDI +0x4005 FIELD_BRANDING_WAP_SPLASH +0x4006 FIELD_BRANDING_TUNE_CONTENT_DATA +0x4007 FIELD_BRANDING_TUNE_CONTENT_TYPE +0x4100 FIELD_BRANDING_BROWSER_ICON_0 +0x4101 FIELD_BRANDING_BROWSER_ICON_1 +0x4102 FIELD_BRANDING_BROWSER_ICON_2 +0x4103 FIELD_BRANDING_BROWSER_ICON_3 +0x4104 FIELD_BRANDING_BROWSER_ICON_4 +0x4105 FIELD_BRANDING_BROWSER_ICON_5 +0x4106 FIELD_BRANDING_BROWSER_ICON_6 +0x4107 FIELD_BRANDING_BROWSER_ICON_7 +0x4108 FIELD_BRANDING_BROWSER_ICON_8 +0x4109 FIELD_BRANDING_BROWSER_ICON_9 +0x4200 FIELD_IDLESCREEN_CONTENT_TYPE +0x4201 FIELD_IDLESCREEN_CONTENT_DATA +0x4202 FIELD_BRANDING_IGNORE_INTEL_SPLASH +0x4300 FIELD_BROWSER_UAPROF_URI +0x5000 FIELD_HELP_WMLC +0x5100 FIELD_PREFERRED_PLMN_FEATURE +0x0 VALUE_PREFERRED_PLMN_DISABLED +0x1 VALUE_PREFERRED_PLMN_ENABLED +0x5200 PHONE_BOOT_URL +0x5201 PHONE_BOOT_NAIURL +0x5202 BROWSER_DOMAIN_TRUSTED +0x5203 BROWSER_PROXY_WDP +0x5300 FIELD_CELL_BROADCAST +0x5301 FIELD_CELL_BROADCAST_ALWAYS_POPUP +0x6000 FIELD_MESSAGE_LIST_OPTIONS_AUTO_ATTACHMENT_DOWNLOAD_ENABLED +0x6001 FIELD_MESSAGE_LIST_OPTIONS_AUTO_ATTACHMENT_DOWNLOAD +0x6002 FIELD_MESSAGE_LIST_OPTIONS_AUTO_ATTACHMENT_DOWNLOAD_HIGH_SPEED_NETWORK +0x7000 FIELD_OMA_CLIENT_PROVISIONING_DOCUMENT +0x7010 FIELD_GAN_SECURE_GATEWAY +0x7011 FIELD_GAN_CONTROLLER +0x7020 FIELD_GAN_ROOT_CERT_1 +0x7021 FIELD_GAN_ROOT_CERT_2 +0x7022 FIELD_GAN_ROOT_CERT_3 +0x7023 FIELD_GAN_ROOT_CERT_4 +0x7026 FIELD_GAN_WLAN_THRESHOLD +0x0 VALUE_GAN_ROVE_THRESHOLD_LOW +0x1 VALUE_GAN_ROVE_THRESHOLD_MEDIUM +0x2 VALUE_GAN_ROVE_THRESHOLD_HIGH +0x7027 FIELD_GAN_SIGNAL_STRENGTH_THRESHOLD +0x7028 FIELD_GAN_SIGNAL_QUALITY_THRESHOLD +0x7029 FIELD_GAN_PROTOCOL_VERSION +0x0 VALUE_GAN_PROTOCOL_VERSION_UMA_1_0_0 +0x1 VALUE_GAN_PROTOCOL_VERSION_UMA_1_0_1 +0x2 VALUE_GAN_PROTOCOL_VERSION_UMA_1_0_2 +0x3 VALUE_GAN_PROTOCOL_VERSION_UMA_1_0_3 +0x4 VALUE_GAN_PROTOCOL_VERSION_UMA_1_0_4 +0x5 VALUE_GAN_PROTOCOL_VERSION_3GPP_rev6 +0x7030 FIELD_WLAN_DISABLED +0x7031 FIELD_WLAN_ENTERPRISE_DATA_DISABLED +0x7032 FIELD_WLAN_ENTERPRISE_DATA_FLAG_OVERRIDES_IT_POLICY +0x7033 FIELD_WLAN_LAYER3_AUTH_KEY + +Below is a list of Vendor ID values in both hex and decimal. +0x01 1 RIM +0x64 100 T_MOBILE_US +0x65 101 CINGULAR_WIRELESS +0x66 102 AT_T_WIRELESS +0x67 103 NEXTEL +0x68 104 SPRINT_PCS +0x69 105 VERIZON_WIRELESS +0x6a 106 ALLTEL +0x6b 107 ROGERS_AT_T +0x6c 108 MICROCELL +0x6d 109 BELL_MOBILITY +0x6e 110 BT_CELLNET +0x6f 111 O2_GERMANY +0x70 112 DIGIFONE +0x71 113 TELFORT +0x72 114 T_MOBILE_GERMANY_AUSTRIA +0x73 115 TIM_ITALY +0x74 116 HUTCHISON +0x75 117 BOUYGUES_TELECOM +0x76 118 VODAFONE_SFR_FRANCE +0x77 119 ORANGE_FRANCE +0x78 120 VODAFONE_UK_NETHERLANDS +0x79 121 TELCEL_MEXICO +0x7a 122 TELSTRA +0x7b 123 T_MOBILE_UK +0x7c 124 VODAFONE_GERMANY +0x7d 125 O2_UK_IRELAND_ISLE_OF_MAN_NETHERLANDS +0x7e 126 TELUS +0x7f 127 SMART +0x80 128 STARHUB +0x81 129 TELEFONICA_SPAIN +0x82 130 VODAFONE_SWITZERLAND_SWISSCOM +0x83 131 CABLE_WIRELESS_WEST_INDIES +0x84 132 VODAFONE_ITALY +0x85 133 VODAFONE_SPAIN +0x86 134 T_MOBILE_NETHERLANDS +0x87 135 CINCINNATI_BELL +0x88 136 TELEFONICA_MEXICO +0x89 137 VODAFONE_AUSTRIA +0x8a 138 VODAFONE_AUSTRALIA_FIJI +0x8b 139 VODAFONE_IRELAND +0x8c 140 TELENOR_SWEDEN +0x8d 141 CSL +0x8e 142 ORANGE_UK +0x8f 143 VODAFONE_NEW_ZEALAND +0x90 144 SINGTEL +0x91 145 GLOBE +0x92 146 OPTUS +0x93 147 ORANGE_BE_MOBISTAR +0x94 148 VODAFONE_HUNGARY +0x95 149 BHARTI +0x96 150 KPN_NL +0x97 151 WIND_HELLAS_TIM_GREECE +0x98 152 VODAFONE_BELGIUM +0x99 153 VODAFONE_PORTUGAL +0x9a 154 TIM_BRAZIL +0x9b 155 BT_MOBILE +0x9c 156 EARTHLINK +0x9d 157 AETHER +0x9e 158 E_PLUS +0x9f 159 BASE +0xa0 160 DOBSON_COMMUNICATIONS +0xa1 161 VODAFONE_EGYPT +0xa2 162 ORANGE_SWITZERLAND +0xa3 163 RIM_WLAN +0xa4 164 T_MOBILE_SUNCOM +0xa5 165 MAXIS +0xa6 166 VODAFONE_DENMARK_TDC +0xa7 167 VODAFONE_SINGAPORE_M1 +0xa8 168 VODACOM_SOUTH_AFRICA +0xa9 169 T_MOBILE_POLAND +0xaa 170 T_MOBILE_CZECH +0xab 171 T_MOBILE_HUNGARY +0xac 172 AT_T_SPRINT +0xad 173 MTN_SOUTH AFRICA +0xae 174 TIM_CHILE_ENTEL_PCS +0xaf 175 ORANGE_SPAIN +0xb0 176 VODAFONE_SMARTONE_HONG_KONG +0xb1 177 TCS_TELECOMMUNICATION_SYSTEMS +0xb2 178 AVEA +0xb3 179 FAST_100 +0xb4 180 TURKCELL +0xb5 181 PARTNER_COMMUNICATIONS +0xb7 183 ORANGE_ROMANIA +0xba 186 TELKOMSEL +0xbc 188 VODAFONE_GREECE +0xbd 189 UNITED_STATES_CELLULAR_CORP +0xbe 190 MOBILINK +0xbf 191 VELOCITA_WIRELESS +0xc0 192 VODAFONE_CROATIA +0xc1 193 VODAFONE_SLOVENIA +0xc2 194 VODAFONE_LUXEMBOURG +0xc3 195 VODAFONE_ICELAND +0xc4 196 VODAFONE_FIJI +0xc5 197 VODAFONE_ROMANIA +0xc6 198 VODAFONE_CZECH +0xc7 199 VODAFONE_BAHRAIN +0xc8 200 VODAFONE_KUWAIT +0xc9 201 T_MOBILE_CROATIA +0xca 202 T_MOBILE_SLOVAKIA +0xcb 203 NORTEL +0xcc 204 CHINA_MOBILE +0xcd 205 MOVILNET +0xd1 209 SYMPAC +0xd2 210 PERSONAL_ARGENTINA +0xd4 212 ETISALAT_UAE +0xd5 213 CBEYOND +0xd6 214 AMX +0xd7 215 TELEFONICA_VENEZUELA +0xd8 216 TELEFONICA_BRAZIL +0xd9 217 ORANGE_ROMANIA +0xda 218 KTPOWERTEL_KOREA +0xdb 219 ROLLING_STONES +0xdc 220 DOCOMO +0xde 222 VODAFONE_BULGARIA +0xdf 223 NEXTEL_INTERNATIONAL +0xe0 224 PCCW_SUNDAY +0xe1 225 HAWAIIAN_TELCOM_CREDO_MOBILE +0xe2 226 VERIZON_MVNO +0xe3 227 MOBILY +0xe4 228 BWA +0xe5 229 O2_CZECH_REPUBLIC +0xe6 230 HUTCHISON_INDIA +0xe7 231 CELCOM +0xea 234 DIALOG +0xeb 235 XL +0xec 236 RELIANCE +0xed 237 VERIZON_WIRELESS_WHOLESALE +0xee 238 VODAFONE_TURKEY +0xef 239 TELEFONICA_MOROCCO_MEDITEL +0xf0 240 INDOSAT +0xf1 241 ALCATEL_SHANGHAI_BELL +0xf5 245 3_UK_ITALY_SWEDEN_DENMARK_AUSTRIA_IRELAND +0xf7 247 VODAFONE_ESSAR +0xf8 248 CENTENNIAL_WIRELESS +0xfa 250 T_MOBILE_AUSTRIA +0xfe 254 OI_BRAZIL +0xff 255 TELECOM_NEW_ZEALAND +0x102 258 HUTCHINSON_3G_AUSTRALIA +0x103 259 CABLE_&_WIRELESS_TRINIDAD_TOBAGO +0x10c 268 BMOBILE +0x10d 269 TATA_TELESERVICES_INDIA +0x10f 271 T_MOBILE_CROATIA +0x111 273 BT_ITALY +0x112 274 1&1 +0x115 277 MTS_MOBILITY +0x116 278 VIRGIN_MOBILE +0x118 280 ORANGE_SLOVAKIA +0x11a 282 TAIWAN_MOBILE +0x11d 285 ORANGE_AUSTRIA +0x11e 286 VODAFONE_MALTA +0x120 288 BASE_JIM_MOBILE +0x127 295 CMCC_PEOPLES +0x12a 298 DIGITEL_WIRELESS +0x12b 299 SK_TELECOM +0x12c 300 SOLO_MOBILE +0x12d 301 CARPHONE_WAREHOUSE +0x12e 302 20:20_MOBILE_GROUP +0x134 308 XL_INDONESIA +0x135 309 FIDO_SOLUTIONS +0x136 310 WIND_ITALY + Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/backup.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/backup.png differ diff -Nru barry-0.14/doc/www/backups.html barry-0.0.20110506/doc/www/backups.html --- barry-0.14/doc/www/backups.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/backups.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Introduction
- -

Backups are currently performed using the Barry Backup GUI program, located -in the gui/ directory of the source tarball. Instructions for building the -GUI can be found on the Install - page.

- - -
Backup Interface
- - -

When Backup starts, it scans the USB bus for Blackberry devices. If it -finds one, it assumes that is the device you want to work with. If it -finds two, it prompts you to select the device to backup.

- -

When connecting to a device for the first time, you are prompted to -give the device a name. This will be linked to the device's PIN number -for easy identification later.

- -

The main screen presents you with two options: Backup and Restore.

- - - -

When backing up your device, your data is saved in a compressed tar file -in your home directory, under ~/.barry, organized by PIN number. Each tar -backup file is given a timestamp in its filename.

- -

When the backup starts, you are prompted to give the backup an optional -name. If you specify a name, it will be used as part of the tar filename.

- - - -
Restore
- -

Pressing the Restore button will show a File Open dialog, pointing -to your ~/.barry directory, for the current device PIN.

- - - -

You are not limited to the tar files in this directory, nor are you -limited to backup files from the same device. You can use this tool -to copy data from one device to another.

- -

The restore is governed by your current configuration, which determines -what databases are restored. Any database that is restored will be -completely erased before the backup data is re-written.

- -

There are some databases that are read-only on the BlackBerry. -In addition, if your device is connected to a BES, you may not be -able to restore your data. If you get errors when trying to -restore a certain read-only database, disable that database in -the Restore Configuration dialog, as described below.

- - - -
Configuration
- -

Configuration is performed via the Edit menu, and provides two -filters for determining what databases are accessed during backup and -restore operations. You can also change the device name here, and turn -off the backup name prompt.

- - - -

Each configure button provides essentially the same dialog, containing a -list of databases available on your device, as well as checkboxes to -enable them.

- -

For the backup filter, only the enabled databases will be saved. -For the restore filter, only the enabled databases will be restored, -even if the backup file contains more data.

- - - -

This configuration is saved per device PIN. If you backup a different -device, you will need to configure its backup strategy again. You can only -change the configuration for the current device with these dialogs.

- - - - - - - diff -Nru barry-0.14/doc/www/backups.php barry-0.0.20110506/doc/www/backups.php --- barry-0.14/doc/www/backups.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/backups.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,45 +1,80 @@ - - + + -
Introduction
+

Backups are currently performed using the Barry Backup GUI program, located in the gui/ directory of the source tarball. Instructions for building the -GUI can be found on the page.

+GUI can be found on the and + pages.

+ + + + +

The Barry Backup GUI program is written using the GTK+ library. If you +do not use the Gnome desktop, then the default theme for GTK+ applications +often looks terrible.

+ +

Themes can be chosen for GTK+ apps without Gnome's settings +or daemons interfering with your desktop of choice.

+ +

Search under the /usr/share/themes directory for 'gtkrc' files. Pick +the one you like best, and then include it by reference in your .gtkrc-2.0 +config file in your home directory.

+ +

For example, suppose you want to use the GTK+ Clearlooks theme. +Your .gtkrc-2.0 file would contain:

+ +
+	include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"
+
+ + -
Backup Interface
+

When Backup starts, it scans the USB bus for all the Blackberry devices +it can find and lists them in the main screen. The first device listed +is automatically connected and highlighted.

-

When Backup starts, it scans the USB bus for Blackberry devices. If it -finds one, it assumes that is the device you want to work with. If it -finds two, it prompts you to select the device to backup.

+

You can connect to different devices on the fly by selecting the +desired device in the list. The currently highlighted device determines +what device the buttons to the right will operate on.

When connecting to a device for the first time, you are prompted to give the device a name. This will be linked to the device's PIN number for easy identification later.

-

The main screen presents you with two options: Backup and Restore.

+

The main screen presents you with a number of options.

- + -

When backing up your device, your data is saved in a compressed tar file -in your home directory, under ~/.barry, organized by PIN number. Each tar -backup file is given a timestamp in its filename.

+ + + + +

The Backup button initiates the backup process for the currently selected +device. Multiple backups and restores can be run at once.

+ +

When backing up your device, your data is saved by default in a +compressed tar file in your home directory, under ~/.barry, organized by +PIN number. Each tar backup file is given a timestamp in its filename. +The destination directory can be changed per device, using the Config... +button.

When the backup starts, you are prompted to give the backup an optional name. If you specify a name, it will be used as part of the tar filename.

-
Restore
+

Pressing the Restore button will show a File Open dialog, pointing to your ~/.barry directory, for the current device PIN.

- +

You are not limited to the tar files in this directory, nor are you limited to backup files from the same device. You can use this tool @@ -47,7 +82,9 @@

The restore is governed by your current configuration, which determines what databases are restored. Any database that is restored will be -completely erased before the backup data is re-written.

+completely erased before the backup data is re-written. If the source +backup file contains no data for that database, then the database +will merely be erased.

There are some databases that are read-only on the BlackBerry. In addition, if your device is connected to a BES, you may not be @@ -57,26 +94,46 @@ -

Configuration
+ + +

Pressing the Config button opens the config options dialog as shown +below.

+ + -

Configuration is performed via the Edit menu, and provides two -filters for determining what databases are accessed during backup and -restore operations. You can also change the device name here, and turn -off the backup name prompt.

+

You can rename your device here, set a different backup target directory, +and select whether backups should have labels or not. If this checkbox +is selected, you will be prompted for an optional label each time you +create a new backup.

- + -

Each configure button provides essentially the same dialog, containing a -list of databases available on your device, as well as checkboxes to -enable them.

+

Both backup and restore operations have their own database filters +which can be configured here. For the backup filter, only the enabled +databases will be saved. For the restore filter, only the enabled +databases will be restored, even if the backup file contains more data.

-

For the backup filter, only the enabled databases will be saved. -For the restore filter, only the enabled databases will be restored, -even if the backup file contains more data.

+

Each filter configure button provides essentially the same dialog, +containing a list of databases available on your device, as well as +checkboxes to enable them.

- +

This configuration is saved per device PIN. If you backup a different device, you will need to configure its backup strategy again. You can only change the configuration for the current device with these dialogs.

+ + + + +

The Disconnect and Disconnect All buttons let you escape the device's +Desktop mode while keeping the program running. It is possible to disconnect +during a backup or restore, but this may leave your device data in an +unknown state.

+ + + +

This button refreshes the device list, which is useful when a new device +has been plugged in.

+ diff -Nru barry-0.14/doc/www/barry.inc barry-0.0.20110506/doc/www/barry.inc --- barry-0.14/doc/www/barry.inc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/barry.inc 2011-05-06 12:20:16.000000000 +0000 @@ -1,13 +1,59 @@ - $title
"; + echo "
"; + echo "
"; + } +} + +function createSubHeader($title) { + global $doc_mode; + + if( !strcmp($doc_mode, "netdirect") ) { + echo "

$title

"; + } + else { + echo '
' . $title . '
'; + } +} + function createLink($name, $desc) { global $extension; - if( strlen($extension) > 0 ) { - echo '' . $desc . "\n"; + global $barry_page_path; + + echo '' . $desc . "\n"; +} + +function createFileLink($name, $desc) { + global $files_path; + + echo '' . $desc . "\n"; +} + +function createPureFileLink($name) { + global $doc_mode; + global $files_path; + + if( !strcmp($doc_mode, "netdirect") ) { + createFileLink($name, basename($name)); } else { - echo '' . $desc . "\n"; + echo '' . basename($name) . "\n"; } } -?> +function createImage($filename) { + global $image_path; + + echo ''; +} + +?> diff -Nru barry-0.14/doc/www/bugs.html barry-0.0.20110506/doc/www/bugs.html --- barry-0.14/doc/www/bugs.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/bugs.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Information to Report
- -

When reporting a bug, it is helpful to include as much information as you -can about your system, and the circumstances surrounding the bug.

- -

-Information to include, if applicable: -

    -
  • The exact error message you get, if any, when you encounter - the problem
  • -
  • Version of Barry
  • -
  • How you installed Barry
  • -
  • Any sample data that may help in reproducing the problem
  • -
  • Name and version of your operating system
  • -
  • Architecture of your system (32 bit? 64 bit? Intel? iMac?)
  • -
-

- -

Once you have all this information, -send it to us -.

- -

If you also have a patch that solves the problem, see the page on -submitting patches -.

- - - - - - - diff -Nru barry-0.14/doc/www/bugs.php barry-0.0.20110506/doc/www/bugs.php --- barry-0.14/doc/www/bugs.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/bugs.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
Information to Report
+

When reporting a bug, it is helpful to include as much information as you can about your system, and the circumstances surrounding the bug.

diff -Nru barry-0.14/doc/www/clean.sh barry-0.0.20110506/doc/www/clean.sh --- barry-0.14/doc/www/clean.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/clean.sh 2011-05-06 12:20:16.000000000 +0000 @@ -4,3 +4,5 @@ rm -f $f.html done +rm -rf www.netdirect.ca + diff -Nru barry-0.14/doc/www/codingguide.html barry-0.0.20110506/doc/www/codingguide.html --- barry-0.14/doc/www/codingguide.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/codingguide.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Style Guide
- -

I use plain old vim for editing files. As such, tabs are standard 8 -spaces wide. When aligning the code, indents are always tabs. -

-	if( something ) {
-		// tab to indent
-	}
-
-

- -

Sometimes I need spaces to align function call parameters: -

-	void ClassName::Function(int lots,
-				 int of,
-				 int parameters,
-				 int that_need_spaces_and_tabs,
-				 int to_align_perfectly)
-	{
-		// tab again
-	}
-

- - -

I even use tabs to align the beginning parts of comments: -

-	///
-	/// \file	tab_to_filename.cc
-	///		Tab to the doxygen description
-	///
-

- -

I also use tabs to align things like simple #define numbers: -

-	#define ASDF_NAME	0x01	// tab between name and number
-	#define ASDF_BODY	0x02	// tab between number and comment
-
-

- -

The main place where I don't use tabs is inside tables that have to -be aligned, especially where there's not enough space to fit things in -one line when using tabs. For example, in the record classes, those -FieldLink<> tables might use tabs for the initial indent, -but everything else is spaces, to keep things lined up, and compact: -

-	FieldLink TaskFieldLinks[] = {
-	   { TSKFC_TITLE,      "Summary",     0, 0, &Task::Summary, 0, 0 },
-	   { TSKFC_NOTES,      "Notes",       0, 0, &Task::Notes, 0, 0 },
-	   { TSKFC_START_TIME, "Start Time",  0, 0, 0, 0, &Task::StartTime },
-	   { TSKFC_DUE_TIME,   "Due Time",    0, 0, 0, 0, &Task::DueTime },
-	   { TSKFC_ALARM_TIME, "Alarm Time",  0, 0, 0, 0, &Task::AlarmTime },
-	   { TSKFC_CATEGORIES, "Categories",  0, 0, &Task::Categories, 0, 0 },
-	   { TSKFC_END,        "End of List", 0, 0, 0, 0, 0 },
-	};
-

- -

As for coding style, I keep opening braces on the statement line: -

-	for( ... ) {
-	}
-
-	if( something ) {
-	}
-	else {
-	}
-

- -

Except for switches, because that's just wrong. :-) -

-	switch( something )
-	{
-	case 1:
-		break;
-	case 2:
-		break;
-	default:
-		break;
-	}
-

- -

I put spaces inside the parentheses too.

- -

For reeeeeally long lines, I sometimes favour keeping it all on one line -and things wrap. This is flexible... whichever looks best. But also -remember that grep is broken by wrapped lines, so if you're writing -code that could conceivably be grepped later, decide whether breaking -the line is worth it. I usually try to keep error message strings on -one line, even if they are long, since it makes it easier to grep for -them when bug reports come in. -

-        // example error message....
-	dout("Error 1234: too many rules");
-

- - -

I think that covers it. You may see some funky for() statements sometimes, -due to size: -

-	for(	FieldLink<Task> *b = TaskFieldLinks;
-		b->type != TSKFC_END;
-		b++ )
-	{
-	}
-

- -

As long as it is clear to read, I'm generally ok. You'll notice the -fixation on tabs again in this example. I'm less fussy about that, -if it's clear to read. -

- -

Sometimes spaces are used to align ostream output as well: -

-	os << "something"
-	   << "something more"
-	   << std::hex << some_number;
-

- -

Chris Frey

- - - - - - - diff -Nru barry-0.14/doc/www/codingguide.php barry-0.0.20110506/doc/www/codingguide.php --- barry-0.14/doc/www/codingguide.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/codingguide.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
Style Guide
+

I use plain old vim for editing files. As such, tabs are standard 8 spaces wide. When aligning the code, indents are always tabs. @@ -97,6 +96,24 @@ dout("Error 1234: too many rules");

+

For pointer and reference variables, the pointer and reference symbol +goes next to the variable, not the the type: + +

+	Data* data;           // wrong
+
+	Data *data;           // right
+
+ +The reason for this becomes obvious when you consider what a multi-variable +declaration looks like. The first style confuses things. The second +flows naturally: + +
+	Data* block1, block2;  // wrong, declares a pointer and an object
+
+	Data *block1, *block2; // right, declares two pointers
+

I think that covers it. You may see some funky for() statements sometimes, due to size: Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/config-backup.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/config-backup.png differ Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/config.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/config.png differ diff -Nru barry-0.14/doc/www/contact.html barry-0.0.20110506/doc/www/contact.html --- barry-0.14/doc/www/contact.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/contact.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - - - Barry Documentation - - - - - - - -


- - - - -
Email
- -

The best way to reach the Barry developers is through the -barry-devel mailing list. -Subscribe and then post your query or comment. This is the best -place for sending patches, reporting bugs, or asking for support.

- -

If you need to contact Chris Frey, Barry's lead developer, privately, -you can send email to cdfrey @ foursquare . net. Mention the name and -the version of the Barry package you are using when contacting Chris -directly.

- - -
Web
- -

If you cannot use email for some reason, you can also post support -requests and bug reports on the Sourceforge -tracker page. -

- - - - - - - diff -Nru barry-0.14/doc/www/contact.php barry-0.0.20110506/doc/www/contact.php --- barry-0.14/doc/www/contact.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/contact.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
Email
+

The best way to reach the Barry developers is through the barry-devel mailing list. @@ -16,10 +15,16 @@ directly.

-
Web
+

If you cannot use email for some reason, you can also post support requests and bug reports on the Sourceforge tracker page.

+ + + +

Barry developers and users occasionally hang out on the IRC channel +#barry on irc.freenode.net.

+ diff -Nru barry-0.14/doc/www/content_list barry-0.0.20110506/doc/www/content_list --- barry-0.14/doc/www/content_list 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/content_list 2011-05-06 12:20:16.000000000 +0000 @@ -14,4 +14,7 @@ bugs sync troubleshooting +logs +devices +rawchannel diff -Nru barry-0.14/doc/www/cvs.html barry-0.0.20110506/doc/www/cvs.html --- barry-0.14/doc/www/cvs.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/cvs.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,268 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Dependencies
- -

See the software dependencies - page for -detailed information on the software that Barry needs.

- - -
Getting the Source
- -

There are 3 ways to get the source code: -

-

- - -
Using The Tarball Release
- -

There are multiple source packages available on the Sourceforge download page. -The main tarball is always the tar.bz2 package. This contains everything in -CVS, including pre-built configure scripts and website documentation.

- -

As an alternative, the tar.gz packages are Debian-specific. This comes as -an "orig" tarball, with the debian/ subdirectory contained in the diff.gz file. -A .dsc file is included as well, for ease of Debian package building. These -files can be expanded into a Debian style source tree with the following -command, for example: -

-	dpkg-source -x barry_0.13-1.dsc
-
-

- -

Once the tar.gz and diff.gz files are combined, you will have a tree -identical to what comes with the tar.bz2 package.

- -

See Building the Source below for instructions on building the -resulting tree.

- -

Finally, there are rpm source packages, in the form of src.rpm files. -This can be installed and built as usual, using the rpm and rpmbuild -commands.

- - -
Using CVS
- -

Up to date instructions for connecting to Sourceforge CVS repositories -are available on the -CVS page. This -usually involves commands like this: - -

-	cvs -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry login
-	(press enter when it asks for password)
-	cvs -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry co -P barry
-
-

- -

This will place the Barry sources in the barry directory. To update -your source tree periodically, do the following: -

-	cd barry
-	./buildgen.sh cleanall      (optional)
-	cvs update -Pd
-
-

- - -
Using git
- -

The same development tree is also available via git, and can be browsed -on the web at the Barry git page. -You can clone the repository like this: - -

-	git clone git://repo.or.cz/barry.git barry
-
-

- -

This will place the Barry sources in the barry directory. To update -your source tree periodically, do the following: - -

-	cd barry
-	./buildgen.sh cleanall      (optional)
-	git checkout master
-	git pull origin
-
-

- - - - - -
Preparing Development Sources for Configure
- -

If you're using a development tree, you'll need to build the usual -./configure script before you can proceed. To do this, you will need -autoconf, automake, and libtool as stated on the dependencies page. -The correct sequence of commands to build ./configure is already stored -in the ./buildgen.sh shell script in the root level directory of the -Barry tree. - -

-	cd barry
-	./buildgen.sh
-
- - - - -
Building the Source
- -

At this point, or if you are using a source tarball, building Barry -is a matter of the common set of commands: -

-	./configure
-	make
-	make install          (possibly as root)
-
-

- -

The top level configure script has two options: -

    -
  • --enable-gui
  • -
  • --enable-opensync-plugin
  • -
-

- -

Each option will recurse into the gui/ (Backup application) and -opensync-plugin/ directories respectively, and build the subprojects -located there automatically. Make sure you have the needed software -dependencies installed beforehand.

- -

If you want to generate doxygen documentation, run 'doxygen' from -root source directory. The resulting files will be in doc/www/doxygen/html/. -Doxygen 1.5.1 has been used to do this, but presumably more recent versions -will work as well.

- - - -
Build Everything!
- -

An example that will build everything, including the Boost features in -btool: -

-	cd barry
-	./buildgen.sh cleanall         (this will make a pristine tree)
-	./buildgen.sh                  (this creates configure)
-	./configure --with-boost=/usr --enable-gui --enable-opensync-plugin
-	make
-	make install
-	doxygen
-
- -

This will give you a set of command line tools (bcharge, btool, breset, -bidentify, pppob), as well as the backup GUI (barrybackup), and will install the -opensync plugin into the system directory for opensync plugins (usually -/usr/lib/opensync/plugins). Available man pages are also installed.

- -

You can use 'btool' to explore your device from the command line. -Use the -h switch for help on its command line options. Some good ones to -start with are -l to list the devices found, and -t -to list the Database Database.

- - -
Configure udev to Run bcharge Automatically
- -

The makefiles do not install udev rules automatically. There are sample -udev rules files in the udev/ directory. For a Debian system, copy the -udev/10-blackberry.rules.Debian file to /etc/udev/rules.d/10-blackberry.rules, -and copy the file modprobe/blacklist-berry_charge to -/etc/modprobe.d/blacklist-berry_charge. -

-	cd barry
-	(become root)
-	cp udev/10-blackberry.rules.Debian /etc/udev/rules.d/10-blackberry.rules
-	cp modprobe/blacklist-berry_charge /etc/modprobe.d/blacklist-berry_charge
-
-

- -

Make sure that bcharge was installed to /usr/sbin. If you used a different ---prefix option on the ./configure command line, you will need to update -your 10-blackberry.rules file to match.

- - -
Configure PPP chat scripts for your system
- -

The source tree comes with sample PPP chat scripts for using your -Blackberry as a modem. These sample scripts are located under ppp/ in -your source directory. -The binary packages install all the ppp options files under /etc/ppp/peers/ -and all the chat scripts (with the *.chat extensions) under -/etc/chatscripts/. These directories are important, since the pppd -program expects to find options files under peers/ and the options files -reference the chatscripts.

- -

Copy the above samples to their appropriate directories to install -modem support for your system. Make sure you have pppd installed as well.

- -

If you install Barry in a location other than /usr, you will need -to edit the options files to correct the hard coded paths in these -files. The files assume that pppob is located in /usr/sbin/pppob.

- -

See the modem usage - page for more -information on using your Blackberry as a modem.

- - -
Building Barry RPMs from CVS
- -

Paul Dugas reports on the mailing list that he uses the following -steps for building RPMs from CVS:

- -
-	$ cd ~/work
-	$ cvs ... login
-	$ cvs ... co barry
-	$ cd barry
-	$ ./buildgen.sh
-	$ ./configure --enable-gui --enable-opensync-plugin
-	$ make dist
-	$ rpmbuild -tb barry-0.13.tar.gz
-
-	I prefer running rpmbuild from the tarball as it's typically the way
-	non-developers would build them.  I have ~/.rpmmacros setting %_topdir
-	to %(echo $HOME)/.rpmbuild so the RPM building can run as me and not
-	root.  The resulting RPMs end up in ~/.rpmbuild/RPMS/x86_64.
-
- - -
Building Barry DEBs from Source
- -

Once you have ./configure generated as detailed above, you can -create Debian-style binary packages for your system by running the -following: -

-	cd barry
-	fakeroot -- debian/rules binary
-
-

- - - - - - - diff -Nru barry-0.14/doc/www/cvs.php barry-0.0.20110506/doc/www/cvs.php --- barry-0.14/doc/www/cvs.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/cvs.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,33 +1,30 @@ - - + -
Dependencies
+

See the page for detailed information on the software that Barry needs.

-
Getting the Source
+ -

There are 3 ways to get the source code: +

There are 2 ways to get the source code:

-
Using The Tarball Release
+

There are multiple source packages available on the Sourceforge download page. The main tarball is always the tar.bz2 package. This contains everything in -CVS, including pre-built configure scripts and website documentation.

+git, including pre-built configure scripts and website documentation.

As an alternative, the tar.gz packages are Debian-specific. This comes as an "orig" tarball, with the debian/ subdirectory contained in the diff.gz file. @@ -35,7 +32,7 @@ files can be expanded into a Debian style source tree with the following command, for example:

-	dpkg-source -x barry_0.13-1.dsc
+	dpkg-source -x barry_0.15-0.dsc
 

@@ -45,36 +42,12 @@

See Building the Source below for instructions on building the resulting tree.

-

Finally, there are rpm source packages, in the form of src.rpm files. -This can be installed and built as usual, using the rpm and rpmbuild +

Alternatively, there are rpm source packages, in the form of src.rpm files. +These packages can be installed and built as usual, using the rpm and rpmbuild commands.

-
Using CVS
- -

Up to date instructions for connecting to Sourceforge CVS repositories -are available on the -CVS page. This -usually involves commands like this: - -

-	cvs -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry login
-	(press enter when it asks for password)
-	cvs -d:pserver:anonymous@barry.cvs.sourceforge.net:/cvsroot/barry co -P barry
-
-

- -

This will place the Barry sources in the barry directory. To update -your source tree periodically, do the following: -

-	cd barry
-	./buildgen.sh cleanall      (optional)
-	cvs update -Pd
-
-

- - -
Using git
+

The same development tree is also available via git, and can be browsed on the web at the Barry git page. @@ -100,7 +73,7 @@ -

Preparing Development Sources for Configure
+

If you're using a development tree, you'll need to build the usual ./configure script before you can proceed. To do this, you will need @@ -117,7 +90,7 @@ -

Building the Source
+

At this point, or if you are using a source tarball, building Barry is a matter of the common set of commands: @@ -128,7 +101,7 @@

-

The top level configure script has two options: +

The top level configure script has two sub-package options:

  • --enable-gui
  • --enable-opensync-plugin
  • @@ -141,13 +114,13 @@ dependencies installed beforehand.

    If you want to generate doxygen documentation, run 'doxygen' from -root source directory. The resulting files will be in doc/www/doxygen/html/. -Doxygen 1.5.1 has been used to do this, but presumably more recent versions -will work as well.

    +the root source directory. The resulting files will be in +doc/www/doxygen/html/. Doxygen 1.5.6 has been used to do this, +but presumably more recent versions will work as well.

    -
    Build Everything!
    +

    An example that will build everything, including the Boost features in btool: @@ -155,16 +128,17 @@ cd barry ./buildgen.sh cleanall (this will make a pristine tree) ./buildgen.sh (this creates configure) - ./configure --with-boost=/usr --enable-gui --enable-opensync-plugin + ./configure --enable-boost --enable-gui --enable-opensync-plugin make make install doxygen

    This will give you a set of command line tools (bcharge, btool, breset, -bidentify, pppob), as well as the backup GUI (barrybackup), and will install the -opensync plugin into the system directory for opensync plugins (usually -/usr/lib/opensync/plugins). Available man pages are also installed.

    +bidentify, bjavaloader, pppob), as well as the backup GUI (barrybackup), +and will install the opensync plugin into the system directory for opensync +plugins (usually /usr/lib/opensync/plugins). Available man pages are also +installed.

    You can use 'btool' to explore your device from the command line. Use the -h switch for help on its command line options. Some good ones to @@ -172,17 +146,17 @@ to list the Database Database.

    -
    Configure udev to Run bcharge Automatically
    +

    The makefiles do not install udev rules automatically. There are sample udev rules files in the udev/ directory. For a Debian system, copy the -udev/10-blackberry.rules.Debian file to /etc/udev/rules.d/10-blackberry.rules, +udev/debian/10-blackberry.rules file to /etc/udev/rules.d/10-blackberry.rules, and copy the file modprobe/blacklist-berry_charge to /etc/modprobe.d/blacklist-berry_charge.

     	cd barry
     	(become root)
    -	cp udev/10-blackberry.rules.Debian /etc/udev/rules.d/10-blackberry.rules
    +	cp udev/debian/10-blackberry.rules /etc/udev/rules.d/10-blackberry.rules
     	cp modprobe/blacklist-berry_charge /etc/modprobe.d/blacklist-berry_charge
     

    @@ -192,7 +166,7 @@ your 10-blackberry.rules file to match.

    -
    Configure PPP chat scripts for your system
    +

    The source tree comes with sample PPP chat scripts for using your Blackberry as a modem. These sample scripts are located under ppp/ in @@ -214,15 +188,14 @@ information on using your Blackberry as a modem.

    -
    Building Barry RPMs from CVS
    +

    Paul Dugas reports on the mailing list that he uses the following -steps for building RPMs from CVS:

    +steps for building RPMs from git:

     	$ cd ~/work
    -	$ cvs ... login
    -	$ cvs ... co barry
    +	$ git clone...
     	$ cd barry
     	$ ./buildgen.sh
     	$ ./configure --enable-gui --enable-opensync-plugin
    @@ -235,8 +208,12 @@
     	root.  The resulting RPMs end up in ~/.rpmbuild/RPMS/x86_64.
     
    +

    On an RPM based system, install rpm-build and rpmdevtools, +then run rpmdev-setuptree to create an "rpmbuild" directory in your +home directory.

    + -
    Building Barry DEBs from Source
    +

    Once you have ./configure generated as detailed above, you can create Debian-style binary packages for your system by running the diff -Nru barry-0.14/doc/www/default.css barry-0.0.20110506/doc/www/default.css --- barry-0.14/doc/www/default.css 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/default.css 2011-05-06 12:20:16.000000000 +0000 @@ -52,7 +52,7 @@ .itemHeader { font-family: Arial,Helvetica,Sans-Serif; font-size: 10pt; font-weight: bold; - margin-top: 10px; + margin-top: 10px; } .note { font-family: Arial,Helvetica,Sans-Serif; diff -Nru barry-0.14/doc/www/dependencies.html barry-0.0.20110506/doc/www/dependencies.html --- barry-0.14/doc/www/dependencies.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/dependencies.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ - - - - Barry Documentation - - - - - - - -


    - - - -
    System Specific
    - -

    Fedora systems: -

      -
    • ConsoleKit - required for accessing the - Blackberry without root privileges.
    • -
    -

    - -

    Debian systems: -

      -
    • fakeroot - optional program to assist building your own - Debian binary packages without root privileges
    • -
    -

    - -

    OpenBSD systems: -

      -
    • Uberry - the uberry kernel module conflicts with the ugen - interface that libusb uses to talk to the device. To work - around this, you will need to boot your kernel with "boot -c" - and disable the uberry module. Suggestions for better ways - to work around this conflict are welcome.
    • -
    -

    - -
    Master List of Dependencies
    - -

    The following list contains all software that Barry depends on, and -the reason for it. Some are only needed for building the source, and -some are only needed for building CVS. - -

      -
    • C and C++ compilers - 4.1.x or higher, for the tr1 includes (source build)
    • -
    • pkg-config (source build: so configure can autodetect library locations)
    • -
    • libusb, stable (0.1.x) - found at http://libusb.sourceforge.net/
    • -
    • pthread -
    • boost version 1.33 or higher (optional, needed for the serialization library, which you need if you want to save downloads for later uploads to the device, using btool) http://www.boost.org
    • -
    • automake version 1.9 (CVS builds only)
    • -
    • autoconf version 2.61 (CVS builds only)
    • -
    • libtool version 1.5.22 (CVS builds only)
    • -
    • doxygen suggested version 1.4.5, only for building API documentation
    • -
    • gtkmm, glademm, glibmm C++ versions of the GTK libraries (needed for the barrybackup GUI)
    • -
    • libtar (barrybackup GUI)
    • -
    • zlib (barrybackup GUI)
    • -
    • libopensync version 0.22 only (needed for syncing)
    • -
    • sqlite, glib2, libxml2 (needed for syncing, required by OpenSync)
    • -
    -

    - -
    The Case of the Broken libtar
    - -

    Well meaning people, in efforts to port the libtar examples to 64-bit -systems have introduced a bug that causes libtar to mismatch standard -read() and write() function call prototypes.

    - -

    This bug has been seen in the Mandriva, ArchLinux, and Gentoo distros. -Depending on your system, and how up to date it is, it may already have been -fixed.

    - -

    The curious can read more about this bug -here and -here.

    - -

    Of course, you probably don't want to read the intricate details of -distro bugs. You just want it to work! For such systems, I usually -grab the libtar source RPM package from -here and then run: -

    -(become root)
    -rpm -i libtar-1.2.11-9.fc8.src.rpm
    -cd /usr/src/packages/SPECS
    -rpmbuild -ba libtar.spec
    -rpm -i ../RPMS/*/libtar*rpm
    -
    -

    - - -
    Dependency Packages for Common Distros
    - -

    The following is a list of packages you'll need to install to build Barry -from source, if you are using one of the below common distributions. Other -distributions should have similar package names. - -

      - -

      Fedora 5 and 6:

      -

      Use the yum package manager to install the following: -

        -
      • pkgconfig
      • -
      • libusb-devel
      • -
      • boost-devel (optional)
      • -
      • libtar (libtar-devel on Fedora 6)
      • -
      • gtkmm24-devel
      • -
      • glibmm24-devel
      • -
      • libglademm24-devel
      • -
      • zlib-devel
      • -
      - -

      Debian stable:

      -

      Use the apt-get package manager to install the following: -

        -
      • pkg-config
      • -
      • libusb-dev
      • -
      • libssl-dev
      • -
      • libboost-serialization-dev
      • -
      • libtar-dev
      • -
      • libgtkmm-2.4-dev
      • -
      • libglibmm-2.4-dev
      • -
      • libglademm-2.4-dev
      • -
      • zlib1g-dev
      • -
      - -
    - - - - - - - diff -Nru barry-0.14/doc/www/dependencies.php barry-0.0.20110506/doc/www/dependencies.php --- barry-0.14/doc/www/dependencies.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/dependencies.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,8 @@ - - -
    System Specific
    + + +

    Fedora systems:

      @@ -28,7 +28,18 @@

    -
    Master List of Dependencies
    +

    Mac OSX systems: +

      +
    • gettext - the default gettext autoconf scripts do not + always do a very good job of detecting gettext and libintl + libraries on the Mac. If it cannot find libintl, it will + automatically disable NLS support. If this is important + to you, add --with-libintl-prefix=/opt/local/ to the + configure command line when building from source.
    • +
    +

    + +

    The following list contains all software that Barry depends on, and the reason for it. Some are only needed for building the source, and @@ -36,23 +47,40 @@

    • C and C++ compilers - 4.1.x or higher, for the tr1 includes (source build)
    • +
    • ccache - completely optional, but useful if you plan on compiling repeatedly
    • pkg-config (source build: so configure can autodetect library locations)
    • -
    • libusb, stable (0.1.x) - found at http://libusb.sourceforge.net/
    • +
    • libusb, stable (0.1.x) - found at http://www.libusb.org/
    • pthread -
    • boost version 1.33 or higher (optional, needed for the serialization library, which you need if you want to save downloads for later uploads to the device, using btool) http://www.boost.org
    • +
    • boost version 1.33 or higher (optional, Boost serialization support.) http://www.boost.org
    • automake version 1.9 (CVS builds only)
    • autoconf version 2.61 (CVS builds only)
    • libtool version 1.5.22 (CVS builds only)
    • -
    • doxygen suggested version 1.4.5, only for building API documentation
    • +
    • autopoint on some systems, this is a separate package, yet + on others, it is part of gettext (CVS builds only)
    • +
    • doxygen suggested version 1.5.6, only for building API documentation
    • gtkmm, glademm, glibmm C++ versions of the GTK libraries (needed for the barrybackup GUI)
    • libtar (barrybackup GUI)
    • -
    • zlib (barrybackup GUI)
    • -
    • libopensync version 0.22 only (needed for syncing)
    • +
    • zlib, needed for CRC32 checksums in library COD file support, + and used by the barrybackup GUI
    • +
    • libopensync version 0.22 or, optionally, if building from source, latest opensync SVN tree
    • sqlite, glib2, libxml2 (needed for syncing, required by OpenSync)
    • +
    • libfuse version 2.5 or higher (optional)
    • +
    • libiconv, needed for international charset conversions... most + Linux distros have this as part of libc. If you are using another + OS such as FreeBSD, you'll have to install this separately.
    • +
    • libxml++ version 2.6 for the desktop
    • +
    • gettext, needed for the iconv.m4 file, on some systems, + when building from CVS to generate configure.
    • +
    • php5, needed for generating static HTML documentation (CVS builds only)
    • +
    • rpmdevtools and rpm-build, if building RPMs yourself
    • +
    • fakeroot, if building DEB packages yourself
    • +
    • wxWidgets, if building the Barry Desktop
    • +
    • libgcal, version 0.9.6 or higher, if building the + Barry Desktop

    -
    The Case of the Broken libtar
    +

    Well meaning people, in efforts to port the libtar examples to 64-bit systems have introduced a bug that causes libtar to mismatch standard @@ -63,56 +91,81 @@ fixed.

    The curious can read more about this bug -here and -here.

    +here and +here.

    Of course, you probably don't want to read the intricate details of distro bugs. You just want it to work! For such systems, I usually grab the libtar source RPM package from -here and then run: +here and then run:

    -(become root)
    -rpm -i libtar-1.2.11-9.fc8.src.rpm
    -cd /usr/src/packages/SPECS
    +rpmdev-setuptree (if this is your first time)
    +rpm -i libtar-1.2.11-11.fc10.src.rpm
    +cd ~/rpmbuild/SPECS
     rpmbuild -ba libtar.spec
     rpm -i ../RPMS/*/libtar*rpm
     

    -
    Dependency Packages for Common Distros
    +

    The following is a list of packages you'll need to install to build Barry from source, if you are using one of the below common distributions. Other distributions should have similar package names. +

    You can also find scripts to automate this in the source tree under +maintainer/depscripts.

    +
      -

      Fedora 5 and 6:

      +

      Fedora 11:

      Use the yum package manager to install the following:

      • pkgconfig
      • +
      • libtool
      • libusb-devel
      • boost-devel (optional)
      • -
      • libtar (libtar-devel on Fedora 6)
      • +
      • libtar-devel
      • gtkmm24-devel
      • glibmm24-devel
      • libglademm24-devel
      • +
      • fuse-devel
      • zlib-devel
      • +
      • libxml++-devel
      • +
      • gettext-devel
      • +
      • libopensync-devel (0.22)
      • +
      • ccache (optional)
      • +
      • doxygen (optional)
      • +
      • php-cli (optional, for generating docs)
      • +
      • wxGTK-devel (optional, for Barry Desktop)
      -

      Debian stable:

      +

      Debian:

      Use the apt-get package manager to install the following:

      • pkg-config
      • +
      • fakeroot
      • +
      • cdbs
      • +
      • autoconf
      • +
      • automake
      • +
      • autopoint (only on some newer Debian/Ubuntu systems)
      • +
      • libtool
      • libusb-dev
      • -
      • libssl-dev
      • libboost-serialization-dev
      • libtar-dev
      • libgtkmm-2.4-dev
      • libglibmm-2.4-dev
      • libglademm-2.4-dev
      • +
      • libfuse-dev
      • +
      • libxml++2.6-dev
      • zlib1g-dev
      • +
      • gettext
      • +
      • libopensync0-dev
      • +
      • ccache (optional)
      • +
      • doxygen (optional)
      • +
      • php5-cli (optional, for generating docs)
      • +
      • libwxgtk2.8-dev and wx-common (optional, for Barry Desktop)
    diff -Nru barry-0.14/doc/www/design.html barry-0.0.20110506/doc/www/design.html --- barry-0.14/doc/www/design.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/design.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - -
    Architecture
    - -

    Barry is designed to be modular in many ways. - -

    First the core protocols will be stored in a library so that it can -be used in other applications. - -

    Second, a command-line tool will be used to present the user with a -scriptable option in dealing with the BlackBerry ™ device. This -will come in handy in conjunction with hotplug. - -

    Third, a GUI tool will be used to allow users to directly manage -devices and make backups of their data. - -

    Fourth, an OpenSync Plugin -will provide general synchronization support for Contacts, Calendar, -Tasks, and Memos; and the OpenSync framework will provide the synchronization -support for the other side othe equation. (Evolution, Sunbird, etc.) - - -

    Design Goals
    - -

    Flexible Synchronization Targets: The main goal of barry is to -synchronize data. This is complicated by the fact that the data on a -user's computer could be stored in many different formats. Email, contact, -calendar entries, notes, and bookmarks are the main data that we are -concerned with and users may be using one of many programs to manage -their data. To address this barry needs to be flexible in how it supports -synchronization. It should be easy to add new synchronization targets -to barry and easy to select these targets from the user interface.

    - -

    Open Data Formats: Backup of the BlackBerry ™ data should be -stored and read in open data formats. LDIF for example is a suitable -format for contacts, mbox format is a perfect format for email data, -text files are a good format for notes, and HTML is a suitable format -for bookmarks. The backup GUI stores its raw backup data in gzipped tar file -format.

    - -

    Multi-Device: A user may need to manage more than one device -on a single user profile. Barry will be able to treat each device -independantly to allow it to sync differently, backup/restore to different -targets, etc. This will come in handy when users are upgrading to a -new device, or when one user handles backup for more than one person. - -

    Device Support: initially we will be supporting the 7750 devices, -because that's what we are using. We do have a 6750 here as well, -but since it is a discontinued product we are not testing on it. The -7750 has a USB interface to the PC and we expect that there will not be -significant changes between devices.

    - - - - - - - diff -Nru barry-0.14/doc/www/design.php barry-0.0.20110506/doc/www/design.php --- barry-0.14/doc/www/design.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/design.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,8 @@ - - -
    Architecture
    + + +

    Barry is designed to be modular in many ways. @@ -19,10 +19,10 @@

    Fourth, an OpenSync Plugin will provide general synchronization support for Contacts, Calendar, Tasks, and Memos; and the OpenSync framework will provide the synchronization -support for the other side othe equation. (Evolution, Sunbird, etc.) +support for the other side of the equation. (Evolution, Sunbird, etc.) -

    Design Goals
    +

    Flexible Synchronization Targets: The main goal of barry is to synchronize data. This is complicated by the fact that the data on a diff -Nru barry-0.14/doc/www/devices.php barry-0.0.20110506/doc/www/devices.php --- barry-0.14/doc/www/devices.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/devices.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,59 @@ + + + + + + +

    This list is intended as a rough guide and record of past success +when using Barry with various versions of the BlackBerry handheld. +It is not guaranteed to be complete, and is based on feedback from +users such as yourself.

    + +
    + +

    Please note: A very large majority of BlackBerry devices +work with Barry by default, and so a compatibility list like this is +somewhat redundant. Please try Barry with your device, and + +any issues you may have. Please keep in mind the + on the main page when testing +and reporting.

    + +
    + +

    If you wish to contribute a report, please send +it to the .

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Device ModelFirmware VersionBarry VersionDistro / MachineBackup/Restore DatabasesDevice Charges?Reported By
    Storm 9530v4.7.0.48, v4.7.0.141, v4.7.0.151 (current)0.15-git20090710Debian Sid on Intel Core Duo 32 bitsAll. Sync with 0.4x: Memos, Calendar, Address Book, TasksYes, bchargeNicolas Vivien
    ...more to come as time permits..................
    + diff -Nru barry-0.14/doc/www/doxygen/html/annotated.html barry-0.0.20110506/doc/www/doxygen/html/annotated.html --- barry-0.14/doc/www/doxygen/html/annotated.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/annotated.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ - - -Barry: Class List - - - - - - -

    Barry Class List

    Here are the classes, structs, unions and interfaces with brief descriptions: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Barry::Protocol::AttributeFetch
    Barry::BadDataThrown by record classes if their data is invalid and cannot be uploaded to the Blackberry
    Barry::BadPasswordA bad or unknown password when talking to the device
    Barry::BadSizeUnexpected packet size, or not enough data
    base64_input
    base64_output
    Barry::BuilderBase class for the builder functor hierarchy
    Barry::Calendar
    Barry::Protocol::CalendarRecurrenceDataField
    Barry::Protocol::CalendarRecurrenceDataField::Additional
    Barry::Protocol::CalendarRecurrenceDataField::Additional::Day
    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate
    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay
    Barry::Protocol::CalendarRecurrenceDataField::Additional::Week
    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
    ChecksumParser
    Barry::CommandTable
    Barry::CommandTableCommand
    Barry::Protocol::CommandTableField
    Barry::Protocol::CommonField
    Barry::Protocol::CommonField::CommonFieldData
    Usb::ConfigDesc
    Usb::ConfigDiscovery
    Barry::Contact
    Contact2Ldif
    Barry::ContactGroupLink
    Barry::ContactLdifClass for generating LDIF output based on a Barry::Contact record object
    Barry::ContactLdif::AccessPair
    Barry::ContactLdif::LdifAttribute
    Barry::ContactLdif::NameToFuncUsed to create a List of supported Barry field names, including calculated names, such as full postal address
    Barry::ControllerThe main interface class
    Barry::Data
    Barry::DatabaseDatabase
    Barry::DatabaseItem
    DataDumpParser
    Barry::DataHandleStd::auto_ptr like class that handles pointers to Data, but instead of freeing them completely, the Data objects are turned to the SocketRoutingQueue from whence they came
    Barry::DataQueueThis class provides a thread aware fifo queue for Data objects, providing memory management for all Data object pointers it contains
    Barry::Date
    Barry::Protocol::DBAccess
    Barry::Protocol::DBAccess::DBData
    Barry::Protocol::DBC_IndexedUpload
    Barry::Protocol::DBC_Record
    Barry::Protocol::DBC_RecordFlags
    Barry::Protocol::DBC_TaggedUpload
    Barry::Protocol::DBCommand
    Barry::Protocol::DBCommand::Parameters
    Barry::Protocol::DBDBField
    Barry::DBPacketProvides an API for building and analyzing raw DB protocol packets
    Barry::Protocol::DBR_DBDBRecord
    Barry::Protocol::DBR_OldDBDBRecord
    Barry::Protocol::DBR_OldTaggedRecord
    Barry::Protocol::DBR_OldTaggedRecord::TaggedData
    Barry::Protocol::DBResponse
    Barry::Protocol::DBResponse::Parameters
    Barry::Mode::DesktopThe main interface class to the device databases
    Usb::Device
    Usb::DeviceDiscovery
    Barry::Diff
    Barry::EmailAddress
    Usb::EndpointDiscovery
    Usb::EndpointPair
    Barry::ErrnoErrorSystem error that provides an errno error code
    Barry::ErrorThe base class for any future derived exceptions
    Usb::ErrorThrown on low level USB errors
    Barry::FieldLink< RecordT >
    Barry::Folder
    Barry::Protocol::GroupLink
    Usb::Interface
    Usb::InterfaceDesc
    Usb::InterfaceDiscovery
    Barry::Mode::IpModem
    Barry::LogLockRAII locking class used to protect the logStream passed into Barry::Init() (common.h)
    Usb::Match
    Barry::Memo
    Barry::Message
    Barry::Protocol::MessageAddress
    Barry::Protocol::MessageRecord
    Barry::Modem
    Barry::Protocol::ModeSelect
    Barry::Protocol::ModeSelect::ResponseBlock
    Barry::Protocol::OldDBDBField
    Barry::Protocol::PackedField_02
    Barry::Protocol::PackedField_10
    Barry::Protocol::Packet
    Barry::Packet
    Barry::Protocol::Packet::PacketData
    Barry::ParserBase class for the parser hierarchy
    Barry::Protocol::PasswordChallenge
    Barry::Protocol::PasswordChallenge::Hash
    Barry::PINMessage
    Barry::PostalAddress
    Barry::PppFilter
    Barry::Probe
    Barry::ProbeResult
    Barry::RecordBuilder< RecordT, StorageT >Template class for easy creation of specific protocol packet builder objects
    Barry::RecordFetch< RecordT >Generic record fetch class, to help with using records without builder classes
    Barry::RecordParser< RecordT, StorageT >Template class for easy creation of specific parser objects
    Barry::RecordStateTable
    Barry::Protocol::RecordStateTableField
    Barry::RecordStateTableState
    Barry::SavedMessage
    Barry::scoped_lock
    Barry::Protocol::SequenceCommand
    Barry::Mode::Serial
    Barry::ServiceBook
    Barry::ServiceBookConfig
    Barry::Protocol::ServiceBookConfigField
    Barry::SHA_CTX
    Barry::Protocol::SizePacket
    Barry::SocketEncapsulates a "logical socket" in the Blackberry USB protocol
    Barry::Protocol::SocketCommand
    Barry::Protocol::SocketCommand::PacketData
    Barry::SocketRoutingQueue
    Barry::SocketRoutingQueue::QueueEntry
    Barry::SocketZero
    StateTableCommand
    Store< Record >
    Barry::Task
    Usb::Timeout
    Barry::Timezone
    Barry::TimeZone
    Barry::UnknownData
    Barry::UnknownField
    Barry::ZeroPacketProvides an API for building and analyzing socket-0 protocol packets
    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/barry_8h.html barry-0.0.20110506/doc/www/doxygen/html/barry_8h.html --- barry-0.14/doc/www/doxygen/html/barry_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/barry_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: barry.h File Reference - - - - - - - -

    barry.h File Reference


    Detailed Description

    -Main header file for applications. -

    - -

    -Definition in file barry.h. -

    -#include "data.h"
    -#include "usbwrap.h"
    -#include "common.h"
    -#include "error.h"
    -#include "probe.h"
    -#include "dataqueue.h"
    -#include "socket.h"
    -#include "router.h"
    -#include "protocol.h"
    -#include "parser.h"
    -#include "builder.h"
    -#include "record.h"
    -#include "ldif.h"
    -#include "controller.h"
    -#include "m_desktop.h"
    -#include "m_desktoptmpl.h"
    -#include "m_ipmodem.h"
    -#include "m_serial.h"
    -#include "version.h"
    -#include "log.h"
    -#include "sha1.h"
    - -

    -Go to the source code of this file. - -
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/barry_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/barry_8h-source.html --- barry-0.14/doc/www/doxygen/html/barry_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/barry_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - -Barry: barry.h Source File - - - - - - - -

    barry.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       barry.h
    -00003 ///             Main header file for applications
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_BARRY_H__
    -00023 #define __BARRY_BARRY_H__
    -00024 
    -00025 /**
    -00026 
    -00027         \mainpage Barry Reference Manual
    -00028 
    -00029 
    -00030         \section getting_started Getting Started
    -00031 
    -00032         Welcome to the Barry reference manual.  This entire manual was
    -00033         generated via Doxygen from comments in the code.  You can view
    -00034         the code here as well, in the Files section.
    -00035 
    -00036         The best place to get started at the moment is to examine the
    -00037         source code to the Barry command line tool: btool.cc
    -00038 
    -00039 
    -00040         \section classes Major Classes
    -00041 
    -00042         To get started with the API, see the Barry::Controller class.
    -00043 
    -00044 */
    -00045 
    -00046 
    -00047 // This lists all the headers that the application needs.
    -00048 // Only these headers get installed.
    -00049 
    -00050 #include "data.h"
    -00051 #include "usbwrap.h"                    // to be moved to libusb someday
    -00052 #include "common.h"                     // Init()
    -00053 #include "error.h"                      // exceptions
    -00054 #include "probe.h"                      // device prober class
    -00055 #include "dataqueue.h"
    -00056 #include "socket.h"
    -00057 #include "router.h"
    -00058 #include "protocol.h"                   // application-safe header
    -00059 #include "parser.h"
    -00060 #include "builder.h"
    -00061 #include "record.h"
    -00062 #include "ldif.h"
    -00063 #include "controller.h"
    -00064 #include "m_desktop.h"
    -00065 #include "m_desktoptmpl.h"
    -00066 #include "m_ipmodem.h"
    -00067 #include "m_serial.h"
    -00068 #include "version.h"
    -00069 #include "log.h"
    -00070 #include "sha1.h"
    -00071 
    -00072 #ifdef __BARRY_BOOST_MODE__
    -00073 // Boost serialization seems to be picky about header order, do them all here
    -00074 #include <iomanip>
    -00075 #include <iostream>
    -00076 #include <fstream>
    -00077 #include <vector>
    -00078 #include <string>
    -00079 #include <boost/archive/text_iarchive.hpp>
    -00080 #include <boost/archive/text_oarchive.hpp>
    -00081 #include <boost/archive/archive_exception.hpp>
    -00082 #include "s11n-boost.h"
    -00083 #endif
    -00084 
    -00085 #endif
    -00086 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/base64_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/base64_8cc-source.html --- barry-0.14/doc/www/doxygen/html/base64_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/base64_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ - - -Barry: base64.cc Source File - - - - - - - -

    base64.cc

    00001 /*
    -00002  * Encode or decode file as MIME base64 (RFC 1341)
    -00003  * Public domain by John Walker, August 11 1997
    -00004  *           http://www.fourmilab.ch/
    -00005  * Modified slightly for the Citadel/UX system, June 1999
    -00006  *
    -00007  * Taken from the Citadel/UX GPL source tree, at version 6.01
    -00008  * Modified into a C++ API by Chris Frey for Net Direct Inc., November 2005
    -00009  *           http://www.netdirect.ca/
    -00010  *
    -00011  */
    -00012 
    -00013 #include "base64.h"
    -00014 #include <string>
    -00015 #include <iterator>
    -00016 
    -00017 #define TRUE  1
    -00018 #define FALSE 0
    -00019 
    -00020 #define LINELEN 72                    /* Encoded line length (max 76) */
    -00021 
    -00022 typedef unsigned char byte;           /* Byte type */
    -00023 
    -00024 static byte dtable[256];              /* Encode / decode table */
    -00025 //static char eol[] = "\r\n";           /* End of line sequence */
    -00026 static int errcheck = TRUE;           /* Check decode input for errors ? */
    -00027 
    -00028 
    -00029 /*  INCHAR  --  Return next character from input  */
    -00030 
    -00031 class base64_input
    -00032 {
    -00033         std::string::const_iterator begin, end;
    -00034 public:
    -00035         base64_input(const std::string &input)
    -00036                 : begin(input.begin()), end(input.end()) {}
    -00037         
    -00038         int operator()()
    -00039         {
    -00040                 if (begin == end) {
    -00041                         return EOF;
    -00042                 }
    -00043                 return *begin++;
    -00044         }
    -00045 };
    -00046 
    -00047 
    -00048 /*  OCHAR  --  Output an encoded character, inserting line breaks
    -00049                where required.  */
    -00050 
    -00051 class base64_output
    -00052 {
    -00053         std::back_insert_iterator<std::string> insert;
    -00054         int linelength;                 /* Length of encoded output line */
    -00055 
    -00056 public:
    -00057         base64_output(std::string &output)
    -00058                 : insert(back_inserter(output)),
    -00059                 linelength(0)
    -00060         {}
    -00061 
    -00062         void operator()(int c)
    -00063         {
    -00064                 if (linelength >= LINELEN) {
    -00065                         *insert++ = '\n';
    -00066                         *insert++ = ' ';
    -00067                         linelength = 0;
    -00068                 }
    -00069                 *insert++ = (unsigned char) c;
    -00070                 linelength++;
    -00071         }
    -00072 };
    -00073 
    -00074 /*  ENCODE  --  Encode binary file into base64.  */
    -00075 
    -00076 static bool encode(base64_input &inchar, base64_output &ochar)
    -00077 {
    -00078     int i, hiteof = FALSE;
    -00079 
    -00080     /*  Fill dtable with character encodings.  */
    -00081 
    -00082     for (i = 0; i < 26; i++) {
    -00083         dtable[i] = 'A' + i;
    -00084         dtable[26 + i] = 'a' + i;
    -00085     }
    -00086     for (i = 0; i < 10; i++) {
    -00087         dtable[52 + i] = '0' + i;
    -00088     }
    -00089     dtable[62] = '+';
    -00090     dtable[63] = '/';
    -00091 
    -00092     while (!hiteof) {
    -00093         byte igroup[3], ogroup[4];
    -00094         int c, n;
    -00095 
    -00096         igroup[0] = igroup[1] = igroup[2] = 0;
    -00097         for (n = 0; n < 3; n++) {
    -00098             c = inchar();
    -00099             if (c == EOF) {
    -00100                 hiteof = TRUE;
    -00101                 break;
    -00102             }
    -00103             igroup[n] = (byte) c;
    -00104         }
    -00105         if (n > 0) {
    -00106             ogroup[0] = dtable[igroup[0] >> 2];
    -00107             ogroup[1] = dtable[((igroup[0] & 3) << 4) | (igroup[1] >> 4)];
    -00108             ogroup[2] = dtable[((igroup[1] & 0xF) << 2) | (igroup[2] >> 6)];
    -00109             ogroup[3] = dtable[igroup[2] & 0x3F];
    -00110 
    -00111             /* Replace characters in output stream with "=" pad
    -00112                characters if fewer than three characters were
    -00113                read from the end of the input stream. */
    -00114 
    -00115             if (n < 3) {
    -00116                 ogroup[3] = '=';
    -00117                 if (n < 2) {
    -00118                     ogroup[2] = '=';
    -00119                 }
    -00120             }
    -00121             for (i = 0; i < 4; i++) {
    -00122                 ochar(ogroup[i]);
    -00123             }
    -00124         }
    -00125     }
    -00126     return true;
    -00127 }
    -00128 
    -00129 /*  INSIG  --  Return next significant input  */
    -00130 
    -00131 static int insig(base64_input &inchar)
    -00132 {
    -00133     int c;
    -00134 
    -00135     /*CONSTANTCONDITION*/
    -00136     while (TRUE) {
    -00137         c = inchar();
    -00138         if (c == EOF || (c > ' ')) {
    -00139             return c;
    -00140         }
    -00141     }
    -00142     /*NOTREACHED*/
    -00143 }
    -00144 
    -00145 /*  DECODE  --  Decode base64.  */
    -00146 
    -00147 static bool decode(base64_input &inchar, base64_output &ochar)
    -00148 {
    -00149     int i;
    -00150 
    -00151     for (i = 0; i < 255; i++) {
    -00152         dtable[i] = 0x80;
    -00153     }
    -00154     for (i = 'A'; i <= 'Z'; i++) {
    -00155         dtable[i] = 0 + (i - 'A');
    -00156     }
    -00157     for (i = 'a'; i <= 'z'; i++) {
    -00158         dtable[i] = 26 + (i - 'a');
    -00159     }
    -00160     for (i = '0'; i <= '9'; i++) {
    -00161         dtable[i] = 52 + (i - '0');
    -00162     }
    -00163     dtable[(int)'+'] = 62;
    -00164     dtable[(int)'/'] = 63;
    -00165     dtable[(int)'='] = 0;
    -00166 
    -00167     /*CONSTANTCONDITION*/
    -00168     while (TRUE) {
    -00169         byte a[4], b[4], o[3];
    -00170 
    -00171         for (i = 0; i < 4; i++) {
    -00172             int c = insig(inchar);
    -00173 
    -00174             if (c == EOF) {
    -00175                 // fprintf(stderr, "Input file incomplete.\n");
    -00176                 return false;
    -00177             }
    -00178             if (dtable[c] & 0x80) {
    -00179                 if (errcheck) {
    -00180                     //fprintf(stderr, "Illegal character '%c' in input file.\n", c);
    -00181                     return false;
    -00182                 }
    -00183                 /* Ignoring errors: discard invalid character. */
    -00184                 i--;
    -00185                 continue;
    -00186             }
    -00187             a[i] = (byte) c;
    -00188             b[i] = (byte) dtable[c];
    -00189         }
    -00190         o[0] = (b[0] << 2) | (b[1] >> 4);
    -00191         o[1] = (b[1] << 4) | (b[2] >> 2);
    -00192         o[2] = (b[2] << 6) | b[3];
    -00193         i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
    -00194         for (int w = 0; w < i; w++ )
    -00195             ochar(o[w]);
    -00196         if (i < 3) {
    -00197             return true;
    -00198         }
    -00199     }
    -00200 }
    -00201 
    -00202 // in-memory encode / decode API
    -00203 bool base64_encode(const std::string &in, std::string &out)
    -00204 {
    -00205         out.clear();
    -00206         base64_input input(in);
    -00207         base64_output output(out);
    -00208         return encode(input, output);
    -00209 }
    -00210 
    -00211 bool base64_decode(const std::string &in, std::string &out)
    -00212 {
    -00213         out.clear();
    -00214         base64_input input(in);
    -00215         base64_output output(out);
    -00216         return decode(input, output);
    -00217 }
    -00218 
    -00219 
    -00220 #ifdef __TEST_MODE__
    -00221 
    -00222 #include <iostream>
    -00223 using namespace std;
    -00224 
    -00225 /*  Main program  */
    -00226 
    -00227 int main()
    -00228 {
    -00229         string test = "This is a test.", encoded, decoded;
    -00230         base64_encode(test, encoded);
    -00231         base64_decode(encoded, decoded);
    -00232         if( test != decoded )
    -00233                 cerr << "Test failed" << endl;
    -00234         else
    -00235                 cerr << "Success" << endl;
    -00236 }
    -00237 
    -00238 #endif
    -00239 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/base64_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/base64_8h-source.html --- barry-0.14/doc/www/doxygen/html/base64_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/base64_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: base64.h Source File - - - - - - - -

    base64.h

    00001 #ifndef __BARRY_BASE64_H__
    -00002 #define __BARRY_BASE64_H__
    -00003 
    -00004 #include <string>
    -00005 
    -00006 // in-memory encode / decode
    -00007 bool base64_encode(const std::string &in, std::string &out);
    -00008 bool base64_decode(const std::string &in, std::string &out);
    -00009 
    -00010 #endif
    -00011 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bcharge_8cc.html barry-0.0.20110506/doc/www/doxygen/html/bcharge_8cc.html --- barry-0.14/doc/www/doxygen/html/bcharge_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bcharge_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ - - -Barry: bcharge.cc File Reference - - - - - - - -

    bcharge.cc File Reference


    Detailed Description

    -Talk to the Blackberry just enough to change the Max Power to 500mA. -

    -Cycles through all devices attached to USB, attempting to set all matching Blackberry devices to charge.

    -This file is part of the Barry project:

    -http://www.netdirect.ca/software/packages/barry/index.php http://sourceforge.net/projects/barry

    -Compile with the following command (needs libusb):

    -g++ -o bcharge bcharge.cc -lusb -

    -Definition in file bcharge.cc. -

    -#include <usb.h>
    -#include <stdio.h>
    -#include <string.h>
    -#include <unistd.h>
    -#include <errno.h>
    -#include <sys/types.h>
    -#include <sys/stat.h>
    -#include <fcntl.h>
    -#include <string>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Defines

    -#define VENDOR_RIM   0x0fca
    -#define PRODUCT_RIM_BLACKBERRY   0x0001
    -#define PRODUCT_RIM_PEARL_DUAL   0x0004
    -#define PRODUCT_RIM_PEARL_8120   0x8004
    -#define PRODUCT_RIM_PEARL   0x0006
    -#define IPRODUCT_RIM_HANDHELD   2
    -#define IPRODUCT_RIM_MASS_STORAGE   4
    -#define IPRODUCT_RIM_COMPOSITE   5
    -#define BLACKBERRY_INTERFACE   0
    -#define BLACKBERRY_CONFIGURATION   1

    Functions

    -void Usage ()
    -void control (usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout)
    -void charge (struct usb_dev_handle *handle)
    -void pearl_mode (struct usb_dev_handle *handle)
    -int find_mass_storage_interface (struct usb_dev_handle *handle)
    -void driver_conflict (struct usb_dev_handle *handle)
    -bool process (struct usb_device *dev, bool is_pearl)
    -bool power_write (const std::string &file, const std::string &value)
    -void resume ()
    -int main (int argc, char *argv[])

    Variables

    -bool old_style_pearl = false
    -bool force_dual = false
    -std::string udev_devpath
    -std::string sysfs_path = "/sys"
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bcharge_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/bcharge_8cc-source.html --- barry-0.14/doc/www/doxygen/html/bcharge_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bcharge_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,441 +0,0 @@ - - -Barry: bcharge.cc Source File - - - - - - - -

    bcharge.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       bcharge.cc
    -00003 ///             Talk to the Blackberry just enough to change the Max Power
    -00004 ///             to 500mA.  Cycles through all devices attached to USB,
    -00005 ///             attempting to set all matching Blackberry devices to charge.
    -00006 ///
    -00007 ///             This file is part of the Barry project:
    -00008 ///
    -00009 ///             http://www.netdirect.ca/software/packages/barry/index.php
    -00010 ///             http://sourceforge.net/projects/barry
    -00011 ///
    -00012 ///             Compile with the following command (needs libusb):
    -00013 ///
    -00014 ///             g++ -o bcharge bcharge.cc -lusb
    -00015 ///
    -00016 
    -00017 /*
    -00018     Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00019 
    -00020     This program is free software; you can redistribute it and/or modify
    -00021     it under the terms of the GNU General Public License as published by
    -00022     the Free Software Foundation; either version 2 of the License, or
    -00023     (at your option) any later version.
    -00024 
    -00025     This program is distributed in the hope that it will be useful,
    -00026     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00027     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00028 
    -00029     See the GNU General Public License in the COPYING file at the
    -00030     root directory of this project for more details.
    -00031 */
    -00032 
    -00033 #include <usb.h>
    -00034 #include <stdio.h>
    -00035 #include <string.h>
    -00036 #include <unistd.h>
    -00037 #include <errno.h>
    -00038 #include <sys/types.h>
    -00039 #include <sys/stat.h>
    -00040 #include <fcntl.h>
    -00041 #include <string>
    -00042 
    -00043 #define VENDOR_RIM              0x0fca
    -00044 #define PRODUCT_RIM_BLACKBERRY  0x0001
    -00045 #define PRODUCT_RIM_PEARL_DUAL  0x0004
    -00046 #define PRODUCT_RIM_PEARL_8120  0x8004
    -00047 #define PRODUCT_RIM_PEARL       0x0006
    -00048 
    -00049 #define IPRODUCT_RIM_HANDHELD           2
    -00050 #define IPRODUCT_RIM_MASS_STORAGE       4
    -00051 #define IPRODUCT_RIM_COMPOSITE          5
    -00052 
    -00053 #define BLACKBERRY_INTERFACE            0
    -00054 #define BLACKBERRY_CONFIGURATION        1
    -00055 
    -00056 bool old_style_pearl = false;
    -00057 bool force_dual = false;
    -00058 std::string udev_devpath;
    -00059 std::string sysfs_path = "/sys";
    -00060 
    -00061 void Usage()
    -00062 {
    -00063         printf(
    -00064         "bcharge - Adjust Blackberry charging modes\n"
    -00065         "          Copyright 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00066         "\n"
    -00067         "   -d          Dual mode (mode 0004) (default)\n"
    -00068         "   -o          Set a Pearl to old Blackberry mode (0001)\n"
    -00069         "\n"
    -00070         "   -h          This help message\n"
    -00071         "   -p devpath  The devpath argument from udev.  If specified, will attempt\n"
    -00072         "               to adjust USB suspend settings to keep the device charging.\n"
    -00073         "   -s path     The path where sysfs is mounted.  Defaults to '/sys'\n"
    -00074         "\n"
    -00075         );
    -00076 }
    -00077 
    -00078 void control(usb_dev_handle *dev, int requesttype, int request, int value,
    -00079         int index, char *bytes, int size, int timeout)
    -00080 {
    -00081         int result = usb_control_msg(dev, requesttype, request, value, index,
    -00082                 bytes, size, timeout);
    -00083         if( result < 0 ) {
    -00084                 printf("\nusb_control_msg failed: code: %d, %s\n", result,
    -00085                         usb_strerror());
    -00086         }
    -00087 }
    -00088 
    -00089 void charge(struct usb_dev_handle *handle)
    -00090 {
    -00091         // the special sauce... these steps seem to do the trick
    -00092         // for the 7750 series... needs testing on others
    -00093         char buffer[2];
    -00094         control(handle, 0xc0, 0xa5, 0, 1, buffer, 2, 100);
    -00095         control(handle, 0x40, 0xa2, 0, 1, buffer, 0, 100);
    -00096 }
    -00097 
    -00098 void pearl_mode(struct usb_dev_handle *handle)
    -00099 {
    -00100         char buffer[2];
    -00101         if( old_style_pearl ) {
    -00102                 // use this for "old style" interface: product ID 0001
    -00103                 control(handle, 0xc0, 0xa9, 0, 1, buffer, 2, 100);
    -00104         }
    -00105         else {
    -00106                 // Product ID 0004
    -00107                 control(handle, 0xc0, 0xa9, 1, 1, buffer, 2, 100);
    -00108         }
    -00109 }
    -00110 
    -00111 int find_mass_storage_interface(struct usb_dev_handle *handle)
    -00112 {
    -00113         // search the configuration descriptor for a Mass Storage
    -00114         // interface (class 8)
    -00115         struct usb_device *dev = usb_device(handle);
    -00116         struct usb_config_descriptor *cfg = dev ? dev->config : 0;
    -00117 
    -00118         if( cfg ) {
    -00119 
    -00120                 for( unsigned i = 0; cfg->interface && i < cfg->bNumInterfaces; i++ ) {
    -00121                         struct usb_interface *iface = &cfg->interface[i];
    -00122                         for( int a = 0; iface->altsetting && a < iface->num_altsetting; a++ ) {
    -00123                                 struct usb_interface_descriptor *id = &iface->altsetting[a];
    -00124                                 if( id->bInterfaceClass == USB_CLASS_MASS_STORAGE )
    -00125                                         return id->bInterfaceNumber;
    -00126                         }
    -00127                 }
    -00128         }
    -00129 
    -00130         // if we get here, then we didn't find the Mass Storage interface
    -00131         // ... this should never happen, but if it does, assume
    -00132         // the device is s showing product ID 0006, and the Mass Storage
    -00133         // interface is interface #0
    -00134         printf("Can't find Mass Storage interface, assuming 0.\n");
    -00135         return 0;
    -00136 }
    -00137 
    -00138 void driver_conflict(struct usb_dev_handle *handle)
    -00139 {
    -00140         // this is called if the first usb_set_configuration()
    -00141         // failed... this most probably means that usb_storage
    -00142         // has already claimed the Mass Storage interface,
    -00143         // in which case we politely tell it to away.
    -00144 
    -00145 #if LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
    -00146         printf("Detecting possible kernel driver conflict, trying to resolve...\n");
    -00147 
    -00148         int iface = find_mass_storage_interface(handle);
    -00149         if( usb_detach_kernel_driver_np(handle, iface) < 0 )
    -00150                 printf("usb_detach_kernel_driver_np() failed: %s\n", usb_strerror());
    -00151 
    -00152         if( usb_set_configuration(handle, BLACKBERRY_CONFIGURATION) < 0 )
    -00153                 printf("usb_set_configuration() failed: %s\n", usb_strerror());
    -00154 #endif
    -00155 }
    -00156 
    -00157 // returns true if device mode was modified, false otherwise
    -00158 bool process(struct usb_device *dev, bool is_pearl)
    -00159 {
    -00160         bool apply = false;
    -00161         printf("Found device #%s...", dev->filename);
    -00162 
    -00163         // open
    -00164         usb_dev_handle *handle = usb_open(dev);
    -00165         if( !handle ) {
    -00166                 printf("unable to open device\n");
    -00167                 return false;
    -00168         }
    -00169 
    -00170         // adjust power
    -00171         if( dev->config &&
    -00172             dev->descriptor.bNumConfigurations >= 1 &&
    -00173             dev->config[0].MaxPower < 250 ) {
    -00174                 printf("adjusting charge setting");
    -00175                 charge(handle);
    -00176                 apply = true;
    -00177         }
    -00178         else {
    -00179                 printf("already at 500mA");
    -00180         }
    -00181 
    -00182         // adjust Pearl mode
    -00183         if( is_pearl || force_dual ) {
    -00184                 int desired_mode = old_style_pearl
    -00185                         ? PRODUCT_RIM_BLACKBERRY : PRODUCT_RIM_PEARL_DUAL;
    -00186 
    -00187                 if( desired_mode != dev->descriptor.idProduct ) {
    -00188                         printf("...adjusting Pearl mode to %s",
    -00189                                 old_style_pearl ? "single" : "dual");
    -00190                         pearl_mode(handle);
    -00191                         apply = true;
    -00192                 }
    -00193                 else {
    -00194                         printf("...already in desired Pearl mode");
    -00195                 }
    -00196         }
    -00197         else {
    -00198                 printf("...no Pearl adjustment");
    -00199         }
    -00200 
    -00201         // apply changes
    -00202         if( apply ) {
    -00203                 if( usb_set_configuration(handle, BLACKBERRY_CONFIGURATION) < 0 )
    -00204                         driver_conflict(handle);
    -00205 
    -00206                 // the Blackberry Pearl doesn't reset itself after the above,
    -00207                 // so do it ourselves
    -00208                 if( is_pearl || force_dual ) {
    -00209                         //
    -00210                         // It has been observed that the 8830 behaves both like
    -00211                         // a Pearl device (in that it has mass storage +
    -00212                         // database modes) as well as a Classic device in
    -00213                         // that it resets itself and doesn't need an explicit
    -00214                         // reset call.
    -00215                         //
    -00216                         // In order to deal with this, we insert a brief sleep.
    -00217                         // If it is an 8830, it will reset itself and the
    -00218                         // following reset call will fail.  If it is a Pearl,
    -00219                         // the reset will work as normal.
    -00220                         //
    -00221                         sleep(1);
    -00222                         if( usb_reset(handle) < 0 ) {
    -00223                                 printf("\nusb_reset failed: %s\n", usb_strerror());
    -00224                         }
    -00225                 }
    -00226 
    -00227                 printf("...done\n");
    -00228         }
    -00229         else {
    -00230                 printf("...no change\n");
    -00231         }
    -00232 
    -00233         // cleanup
    -00234         usb_close(handle);
    -00235         return apply;
    -00236 }
    -00237 
    -00238 bool power_write(const std::string &file, const std::string &value)
    -00239 {
    -00240         // attempt to open the state file
    -00241         int fd = open(file.c_str(), O_RDWR);
    -00242         if( fd == -1 ) {
    -00243                 printf("autosuspend adjustment failure: (file: %s): %s\n",
    -00244                         file.c_str(),
    -00245                         strerror(errno));
    -00246                 return false;
    -00247         }
    -00248 
    -00249         int written = write(fd, value.data(), value.size());
    -00250         int error = errno;
    -00251         close(fd);
    -00252 
    -00253         if( written < 0 || (size_t)written != value.size() ) {
    -00254                 printf("autosuspend adjustment failure (write): (file: %s): %s\n",
    -00255                         file.c_str(),
    -00256                         strerror(error));
    -00257                 return false;
    -00258         }
    -00259 
    -00260         printf("autosuspend adjustment: wrote %s to %s\n",
    -00261                 value.c_str(), file.c_str());
    -00262         return true;
    -00263 }
    -00264 
    -00265 //
    -00266 // Checks for USB suspend, and enables the device if suspended.
    -00267 //
    -00268 // Kernel 2.6.21 behaves with autosuspend=0 meaning off, while 2.6.22
    -00269 // and higher needs autosuspend=-1 to turn it off.  In 2.6.22, a value
    -00270 // of 0 means "immediate" instead of "never".
    -00271 //
    -00272 // Version 2.6.22 adds variables internal to the system called
    -00273 // autosuspend_disabled and autoresume_disabled.  These are controlled by the
    -00274 // /sys/class/usb_device/*/device/power/level file.  (See below)
    -00275 // 
    -00276 // Here's a summary of files under device/power.  These may or may not exist
    -00277 // depending on your kernel version and configuration.
    -00278 // 
    -00279 // 
    -00280 //        autosuspend
    -00281 //                -1 or 0 means off, depending on kernel,
    -00282 //                otherwise it is the number of seconds to
    -00283 //                autosuspend
    -00284 //
    -00285 //        level
    -00286 //                with the settings:
    -00287 //
    -00288 //                on      - suspend is disabled, device is fully powered
    -00289 //                auto    - suspend is controlled by the kernel (default)
    -00290 //                suspend - suspend is enabled permanently
    -00291 //
    -00292 //                You can write these strings to the file to control
    -00293 //                behaviour on a per-device basis.
    -00294 //
    -00295 //                echo on > /sys/usb_device/.../device/power/level
    -00296 //
    -00297 //        state
    -00298 //                current state of device
    -00299 //                0 - fully powered
    -00300 //                2 - suspended
    -00301 //
    -00302 //                You can write these numbers to control behaviour, but
    -00303 //                any change you make here might change automatically
    -00304 //                if autosuspend is on.
    -00305 //
    -00306 //                echo -n 0 > /sys/usb_device/.../device/power/state
    -00307 //
    -00308 //        wakeup
    -00309 //                unknown
    -00310 //
    -00311 //
    -00312 // Given the above facts, use the following heuristics to try to disable
    -00313 // autosuspend for the Blackberry:
    -00314 //
    -00315 //      - if level exists, write "on" to it
    -00316 //      - if autosuspend exists, write -1 to it
    -00317 //              - if error, write 0 to it
    -00318 //      - if neither of the above work, and state exists, write 0 to it
    -00319 //
    -00320 void resume()
    -00321 {
    -00322         if( udev_devpath.size() == 0 )
    -00323                 return; // nothing to do
    -00324 
    -00325         // let sysfs settle a bit
    -00326         sleep(5);
    -00327 
    -00328         std::string power_path = sysfs_path + "/" + udev_devpath + "/device/power/";
    -00329 
    -00330         if( !power_write(power_path + "level", "on\n") )
    -00331                 if( !power_write(power_path + "autosuspend", "-1\n") )
    -00332                         if( !power_write(power_path + "autosuspend", "0\n") )
    -00333                                 power_write(power_path + "state", "0");
    -00334 }
    -00335 
    -00336 int main(int argc, char *argv[])
    -00337 {
    -00338         struct usb_bus *busses;
    -00339 
    -00340         //
    -00341         // allow -o command line switch to choose which mode to use for
    -00342         // Blackberry Pearls:
    -00343         //      Dual(default):  0004    -d
    -00344         //      With switch:    0001    -o
    -00345         //
    -00346 
    -00347         // process command line options
    -00348         for(;;) {
    -00349                 int cmd = getopt(argc, argv, "dop:s:h");
    -00350                 if( cmd == -1 )
    -00351                         break;
    -00352 
    -00353                 switch( cmd )
    -00354                 {
    -00355                 case 'd':       // Dual (default)
    -00356                         force_dual = true;
    -00357                         old_style_pearl = false;
    -00358                         break;
    -00359 
    -00360                 case 'o':       // Old style pearl
    -00361                         force_dual = false;
    -00362                         old_style_pearl = true;
    -00363                         break;
    -00364 
    -00365                 case 'p':       // udev devpath
    -00366                         udev_devpath = optarg;
    -00367                         break;
    -00368 
    -00369                 case 's':       // where sysfs is mounted
    -00370                         sysfs_path = optarg;
    -00371                         break;
    -00372 
    -00373                 case 'h':       // help!
    -00374                 default:
    -00375                         Usage();
    -00376                         return 0;
    -00377                 }
    -00378         }
    -00379 
    -00380         usb_init();
    -00381         if( usb_find_busses() < 0 || usb_find_devices() < 0 ) {
    -00382                 printf("\nUnable to scan devices: %s\n", usb_strerror());
    -00383                 return 1;
    -00384         }
    -00385         busses = usb_get_busses();
    -00386 
    -00387         printf("Scanning for Blackberry devices...\n");
    -00388 
    -00389         struct usb_bus *bus;
    -00390         for( bus = busses; bus; bus = bus->next ) {
    -00391                 struct usb_device *dev;
    -00392 
    -00393                 for (dev = bus->devices; dev; dev = dev->next) {
    -00394                         // Is this a blackberry?
    -00395                         if( dev->descriptor.idVendor == VENDOR_RIM ) {
    -00396                                 switch(dev->descriptor.idProduct)
    -00397                                 {
    -00398                                 case PRODUCT_RIM_BLACKBERRY:
    -00399                                         if( !process(dev, false) )
    -00400                                                 resume();
    -00401                                         break;
    -00402 
    -00403                                 case PRODUCT_RIM_PEARL_DUAL:
    -00404                                 case PRODUCT_RIM_PEARL:
    -00405                                         if( !process(dev, true) )
    -00406                                                 resume();
    -00407                                         break;
    -00408                                 }
    -00409                         }
    -00410                 }
    -00411         }
    -00412 }
    -00413 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bidentify_8cc.html barry-0.0.20110506/doc/www/doxygen/html/bidentify_8cc.html --- barry-0.14/doc/www/doxygen/html/bidentify_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bidentify_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: bidentify.cc File Reference - - - - - - - -

    bidentify.cc File Reference


    Detailed Description

    -Tool for probing identifying Blackberry devices. -

    - -

    -Definition in file bidentify.cc. -

    -#include <barry/barry.h>
    -#include <iostream>
    -#include <iomanip>
    -#include <getopt.h>
    - -

    -Go to the source code of this file. - - - - - - -

    Functions

    -void Usage ()
    -int main (int argc, char *argv[])
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bidentify_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/bidentify_8cc-source.html --- barry-0.14/doc/www/doxygen/html/bidentify_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bidentify_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ - - -Barry: bidentify.cc Source File - - - - - - - -

    bidentify.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       bidentify.cc
    -00003 ///             Tool for probing identifying Blackberry devices
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include <barry/barry.h>
    -00023 #include <iostream>
    -00024 #include <iomanip>
    -00025 #include <getopt.h>
    -00026 
    -00027 using namespace std;
    -00028 using namespace Barry;
    -00029 
    -00030 void Usage()
    -00031 {
    -00032    int major, minor;
    -00033    const char *Version = Barry::Version(major, minor);
    -00034 
    -00035    cerr
    -00036    << "bidentify - USB Blackberry Identifier Tool\n"
    -00037    << "            Copyright 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00038    << "            Using: " << Version << "\n"
    -00039    << "\n"
    -00040    << "   -B bus    Specify which USB bus to search on\n"
    -00041    << "   -N dev    Specify which system device, using system specific string\n"
    -00042    << "\n"
    -00043    << "   -h        This help\n"
    -00044    << "   -v        Dump protocol data during operation\n"
    -00045    << endl;
    -00046 }
    -00047 
    -00048 int main(int argc, char *argv[])
    -00049 {
    -00050         cout.sync_with_stdio(true);     // leave this on, since libusb uses
    -00051                                         // stdio for debug messages
    -00052 
    -00053         try {
    -00054 
    -00055                 bool data_dump = false;
    -00056                 string busname;
    -00057                 string devname;
    -00058 
    -00059                 // process command line options
    -00060                 for(;;) {
    -00061                         int cmd = getopt(argc, argv, "B:hN:v");
    -00062                         if( cmd == -1 )
    -00063                                 break;
    -00064 
    -00065                         switch( cmd )
    -00066                         {
    -00067                         case 'B':       // busname
    -00068                                 busname = optarg;
    -00069                                 break;
    -00070 
    -00071                         case 'N':       // Devname
    -00072                                 devname = optarg;
    -00073                                 break;
    -00074 
    -00075                         case 'v':       // data dump on
    -00076                                 data_dump = true;
    -00077                                 break;
    -00078 
    -00079                         case 'h':       // help
    -00080                         default:
    -00081                                 Usage();
    -00082                                 return 0;
    -00083                         }
    -00084                 }
    -00085 
    -00086                 Barry::Init(data_dump);
    -00087                 Barry::Probe probe(busname.c_str(), devname.c_str());
    -00088 
    -00089                 // show any errors during probe first
    -00090                 if( probe.GetFailCount() ) {
    -00091                         cerr << "Blackberry device errors with errors during probe:" << endl;
    -00092                         for( int i = 0; i < probe.GetFailCount(); i++ ) {
    -00093                                 cerr << probe.GetFailMsg(i) << endl;
    -00094                         }
    -00095                 }
    -00096 
    -00097                 // show all successfully found devices
    -00098                 for( int i = 0; i < probe.GetCount(); i++ ) {
    -00099                         const ProbeResult &pr = probe.Get(i);
    -00100                         cout    << hex << pr.m_pin << ", "
    -00101                                 << pr.m_description << endl;
    -00102                 }
    -00103 
    -00104                 return probe.GetFailCount();
    -00105 
    -00106         }
    -00107         catch( std::exception &e ) {
    -00108                 cerr << "exception caught: " << e.what() << endl;
    -00109                 return 1;
    -00110         }
    -00111 }
    -00112 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bktrans_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/bktrans_8cc-source.html --- barry-0.14/doc/www/doxygen/html/bktrans_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bktrans_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ - - -Barry: bktrans.cc Source File - - - - - - - -

    bktrans.cc

    00001 //
    -00002 // ktrans.cc - print human readable version of usbfs_snoop kernel log
    -00003 //
    -00004 
    -00005 /*
    -00006     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00007 
    -00008     This program is free software; you can redistribute it and/or modify
    -00009     it under the terms of the GNU General Public License as published by
    -00010     the Free Software Foundation; either version 2 of the License, or
    -00011     (at your option) any later version.
    -00012 
    -00013     This program is distributed in the hope that it will be useful,
    -00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00016 
    -00017     See the GNU General Public License in the COPYING file at the
    -00018     root directory of this project for more details.
    -00019 */
    -00020 
    -00021 #include <iostream>
    -00022 #include <iomanip>
    -00023 #include <sstream>
    -00024 #include <string>
    -00025 #include <string.h>
    -00026 #include <barry/data.h>
    -00027 
    -00028 using namespace std;
    -00029 
    -00030 void Usage()
    -00031 {
    -00032         cout << "ktrans - usbfs_snoop kernel log translator\n"
    -00033                 "\n"
    -00034                 "\tUsage:   ktrans logmarker < log\n"
    -00035                 "\n"
    -00036                 "\tExample:  ktrans \"kernel: \" < /var/log/kern.log\n"
    -00037                 "\n";
    -00038 }
    -00039 
    -00040 bool IsHexData(const char *logmarker, const char *str)
    -00041 {
    -00042         str = strstr(str, logmarker);
    -00043         if( !str )
    -00044                 return false;
    -00045         str += strlen(logmarker);
    -00046 
    -00047         if( strstr(str, "data ") || strstr(str, "data: ") ) {
    -00048                 // looks like a data line, make sure data from there on out
    -00049                 // is hex data
    -00050 
    -00051                 // skip "data"
    -00052                 str = strstr(str, "data") + 4;
    -00053                 for( ; *str == ':' || *str == ' '; str++ )
    -00054                         ;
    -00055 
    -00056                 while( *str ) {
    -00057                         if( !( isdigit(*str) || *str == ' ' ||
    -00058                             (*str >= 'a' && *str <= 'f')) )
    -00059                                 return false;
    -00060                         str++;
    -00061                 }
    -00062 
    -00063                 return true;
    -00064         }
    -00065         else {
    -00066                 while( *str ) {
    -00067                         if( !( isdigit(*str) || *str == ' ' ||
    -00068                             (*str >= 'a' && *str <= 'f')) )
    -00069                                 return false;
    -00070                         str++;
    -00071                 }
    -00072                 return true;    // all data is numeric, so this is a continuation line
    -00073         }
    -00074 }
    -00075 
    -00076 void SplitHex(const char *logmarker, const char *str, Barry::Data &data)
    -00077 {
    -00078         const char *hexptr = strstr(str, logmarker);
    -00079         if( !hexptr ) {
    -00080                 cout << str << endl;
    -00081                 return;
    -00082         }
    -00083         hexptr += strlen(logmarker);
    -00084         std::string readable(str, hexptr - str);
    -00085 
    -00086         str = hexptr;
    -00087 
    -00088         hexptr = strstr(str, "data ");
    -00089         if( hexptr ) {
    -00090                 hexptr += 5;
    -00091         }
    -00092         else {
    -00093                 hexptr = strstr(str, "data: ");
    -00094                 if( hexptr )
    -00095                         hexptr += 6;
    -00096         }
    -00097 
    -00098         if( !hexptr )
    -00099                 hexptr = str;
    -00100 
    -00101         for( ; *hexptr == ':' || *hexptr == ' '; hexptr++ )
    -00102                 ;
    -00103 
    -00104         readable.append(str, hexptr - str);
    -00105         cout << readable << endl;
    -00106 
    -00107         data.AppendHexString(hexptr);
    -00108 }
    -00109 
    -00110 int main(int argc, char *argv[])
    -00111 {
    -00112         cout.sync_with_stdio(false);
    -00113 
    -00114         if( argc < 2 ) {
    -00115                 Usage();
    -00116                 return 0;
    -00117         }
    -00118 
    -00119         Barry::Data data;
    -00120         while( cin ) {
    -00121                 std::string buff;
    -00122                 getline(cin, buff);
    -00123                 if( IsHexData(argv[1], buff.c_str()) ) {
    -00124                         SplitHex(argv[1], buff.c_str(), data);
    -00125                 }
    -00126                 else {
    -00127                         if( data.GetSize() ) {
    -00128                                 cout << data;
    -00129                                 data.Zap();
    -00130                         }
    -00131                         cout << buff << "\n";
    -00132                 }
    -00133         }
    -00134 
    -00135         if( data.GetSize() ) {
    -00136                 cout << data;
    -00137         }
    -00138 }
    -00139 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/brecsum_8cc.html barry-0.0.20110506/doc/www/doxygen/html/brecsum_8cc.html --- barry-0.14/doc/www/doxygen/html/brecsum_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/brecsum_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: brecsum.cc File Reference - - - - - - - -

    brecsum.cc File Reference


    Detailed Description

    -Generate SHA1 sums of raw Blackberry database records. -

    -This is mostly useful for data verification during testing. -

    -Definition in file brecsum.cc. -

    -#include <barry/barry.h>
    -#include <iomanip>
    -#include <iostream>
    -#include <vector>
    -#include <string>
    -#include <getopt.h>
    - -

    -Go to the source code of this file. - - - - - - - - - -

    Classes

    class  ChecksumParser

    Functions

    -void Usage ()
    -int main (int argc, char *argv[])
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/brecsum_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/brecsum_8cc-source.html --- barry-0.14/doc/www/doxygen/html/brecsum_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/brecsum_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ - - -Barry: brecsum.cc Source File - - - - - - - -

    brecsum.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       brecsum.cc
    -00003 ///             Generate SHA1 sums of raw Blackberry database records.
    -00004 ///             This is mostly useful for data verification during testing.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include <barry/barry.h>
    -00024 #include <iomanip>
    -00025 #include <iostream>
    -00026 #include <vector>
    -00027 #include <string>
    -00028 #include <getopt.h>
    -00029 
    -00030 using namespace std;
    -00031 using namespace Barry;
    -00032 
    -00033 void Usage()
    -00034 {
    -00035    int major, minor;
    -00036    const char *Version = Barry::Version(major, minor);
    -00037 
    -00038    cerr
    -00039    << "brecsum - Generate SHA1 sums of raw Blackberry database records.\n"
    -00040    << "        Copyright 2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00041    << "        Using: " << Version << "\n"
    -00042    << "\n"
    -00043    << "   -d db     Read database 'db' and sum all its records.\n"
    -00044    << "             Can be used multiple times to fetch more than one DB\n"
    -00045    << "   -h        This help\n"
    -00046    << "   -i        Include Type and Unique record IDs in the checksums\n"
    -00047    << "   -p pin    PIN of device to talk with\n"
    -00048    << "             If only one device is plugged in, this flag is optional\n"
    -00049    << "   -P pass   Simplistic method to specify device password\n"
    -00050    << "   -v        Dump protocol data during operation\n"
    -00051    << endl;
    -00052 }
    -00053 
    -00054 class ChecksumParser : public Barry::Parser
    -00055 {
    -00056         bool m_IncludeIds;
    -00057         SHA_CTX m_ctx;
    -00058 
    -00059 public:
    -00060         explicit ChecksumParser(bool IncludeIds)
    -00061                 : m_IncludeIds(IncludeIds)
    -00062         {}
    -00063 
    -00064         virtual void Clear()
    -00065         {
    -00066                 SHA1_Init(&m_ctx);
    -00067         }
    -00068 
    -00069         virtual void SetIds(uint8_t RecType, uint32_t UniqueId)
    -00070         {
    -00071                 if( m_IncludeIds ) {
    -00072                         SHA1_Update(&m_ctx, &RecType, sizeof(RecType));
    -00073                         SHA1_Update(&m_ctx, &UniqueId, sizeof(UniqueId));
    -00074                 }
    -00075         }
    -00076         virtual void ParseFields(const Barry::Data &data, size_t &offset)
    -00077         {
    -00078                 int len = data.GetSize() - offset;
    -00079                 SHA1_Update(&m_ctx, data.GetData() + offset, len);
    -00080                 offset += len;
    -00081         }
    -00082 
    -00083         virtual void Store()
    -00084         {
    -00085                 unsigned char sha1[SHA_DIGEST_LENGTH];
    -00086                 SHA1_Final(sha1, &m_ctx);
    -00087 
    -00088                 for( int i = 0; i < SHA_DIGEST_LENGTH; i++ ) {
    -00089                         cout << hex << setfill('0') << setw(2)
    -00090                                 << (unsigned int) sha1[i];
    -00091                 }
    -00092                 cout << endl;
    -00093         }
    -00094 };
    -00095 
    -00096 int main(int argc, char *argv[])
    -00097 {
    -00098         cout.sync_with_stdio(true);     // leave this on, since libusb uses
    -00099                                         // stdio for debug messages
    -00100 
    -00101         try {
    -00102 
    -00103                 uint32_t pin = 0;
    -00104                 bool
    -00105                         data_dump = false,
    -00106                         include_ids = false;
    -00107                 string password;
    -00108                 vector<string> dbNames;
    -00109 
    -00110                 // process command line options
    -00111                 for(;;) {
    -00112                         int cmd = getopt(argc, argv, "d:hip:P:v");
    -00113                         if( cmd == -1 )
    -00114                                 break;
    -00115 
    -00116                         switch( cmd )
    -00117                         {
    -00118                         case 'd':       // show dbname
    -00119                                 dbNames.push_back(string(optarg));
    -00120                                 break;
    -00121 
    -00122                         case 'i':       // Include IDs
    -00123                                 include_ids = true;
    -00124                                 break;
    -00125 
    -00126                         case 'p':       // Blackberry PIN
    -00127                                 pin = strtoul(optarg, NULL, 16);
    -00128                                 break;
    -00129 
    -00130                         case 'P':       // Device password
    -00131                                 password = optarg;
    -00132                                 break;
    -00133 
    -00134                         case 'v':       // data dump on
    -00135                                 data_dump = true;
    -00136                                 break;
    -00137 
    -00138                         case 'h':       // help
    -00139                         default:
    -00140                                 Usage();
    -00141                                 return 0;
    -00142                         }
    -00143                 }
    -00144 
    -00145                 // Display usage info if user appears confused
    -00146                 if( !dbNames.size() ) {
    -00147                         Usage();
    -00148                         return 0;
    -00149                 }
    -00150 
    -00151                 // Initialize the barry library.  Must be called before
    -00152                 // anything else.
    -00153                 Barry::Init(data_dump);
    -00154 
    -00155                 // Probe the USB bus for Blackberry devices and display.
    -00156                 Barry::Probe probe;
    -00157                 int activeDevice = probe.FindActive(pin);
    -00158                 if( activeDevice == -1 ) {
    -00159                         cerr << "No device selected, or PIN not found" << endl;
    -00160                         return 1;
    -00161                 }
    -00162 
    -00163                 // Create our controller object
    -00164                 Barry::Controller con(probe.Get(activeDevice));
    -00165                 Barry::Mode::Desktop desktop(con);
    -00166 
    -00167                 // Sum all specified databases
    -00168                 if( dbNames.size() ) {
    -00169                         vector<string>::iterator b = dbNames.begin();
    -00170                         ChecksumParser parser(include_ids);
    -00171 
    -00172                         desktop.Open(password.c_str());
    -00173                         for( ; b != dbNames.end(); b++ ) {
    -00174                                 unsigned int id = desktop.GetDBID(*b);
    -00175                                 desktop.LoadDatabase(id, parser);
    -00176                         }
    -00177                 }
    -00178 
    -00179         }
    -00180         catch( std::exception &e ) {
    -00181                 std::cerr << e.what() << endl;
    -00182                 return 1;
    -00183         }
    -00184 
    -00185         return 0;
    -00186 }
    -00187 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/breset_8cc.html barry-0.0.20110506/doc/www/doxygen/html/breset_8cc.html --- barry-0.14/doc/www/doxygen/html/breset_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/breset_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - -Barry: breset.cc File Reference - - - - - - - -

    breset.cc File Reference


    Detailed Description

    -Attempt to reset all connected Blackberry devices via software. -

    -This file is part of the Barry project:

    -http://www.netdirect.ca/software/packages/barry/index.php http://sourceforge.net/projects/barry

    -Compile with the following command (needs libusb):

    -g++ -o breset breset.cc -lusb -

    -Definition in file breset.cc. -

    -#include <usb.h>
    -#include <stdio.h>
    -#include <unistd.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - -

    Defines

    -#define VENDOR_RIM   0x0fca
    -#define PRODUCT_RIM_BLACKBERRY   0x0001
    -#define PRODUCT_RIM_PEARL_DUAL   0x0004
    -#define PRODUCT_RIM_PEARL_8120   0x8004
    -#define PRODUCT_RIM_PEARL   0x0006
    -#define BLACKBERRY_INTERFACE   0
    -#define BLACKBERRY_CONFIGURATION   1

    Functions

    -bool reset (struct usb_device *dev)
    -int main ()
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/breset_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/breset_8cc-source.html --- barry-0.14/doc/www/doxygen/html/breset_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/breset_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ - - -Barry: breset.cc Source File - - - - - - - -

    breset.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       breset.cc
    -00003 ///             Attempt to reset all connected Blackberry devices via software
    -00004 ///
    -00005 ///             This file is part of the Barry project:
    -00006 ///
    -00007 ///             http://www.netdirect.ca/software/packages/barry/index.php
    -00008 ///             http://sourceforge.net/projects/barry
    -00009 ///
    -00010 ///             Compile with the following command (needs libusb):
    -00011 ///
    -00012 ///             g++ -o breset breset.cc -lusb
    -00013 ///
    -00014 
    -00015 /*
    -00016     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00017 
    -00018     This program is free software; you can redistribute it and/or modify
    -00019     it under the terms of the GNU General Public License as published by
    -00020     the Free Software Foundation; either version 2 of the License, or
    -00021     (at your option) any later version.
    -00022 
    -00023     This program is distributed in the hope that it will be useful,
    -00024     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00025     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00026 
    -00027     See the GNU General Public License in the COPYING file at the
    -00028     root directory of this project for more details.
    -00029 */
    -00030 
    -00031 #include <usb.h>
    -00032 #include <stdio.h>
    -00033 #include <unistd.h>
    -00034 
    -00035 #define VENDOR_RIM              0x0fca
    -00036 #define PRODUCT_RIM_BLACKBERRY  0x0001
    -00037 #define PRODUCT_RIM_PEARL_DUAL  0x0004
    -00038 #define PRODUCT_RIM_PEARL_8120  0x8004
    -00039 #define PRODUCT_RIM_PEARL       0x0006
    -00040 
    -00041 #define BLACKBERRY_INTERFACE            0
    -00042 #define BLACKBERRY_CONFIGURATION        1
    -00043 
    -00044 bool reset(struct usb_device *dev)
    -00045 {
    -00046         usb_dev_handle *handle = usb_open(dev);
    -00047         if( !handle )
    -00048                 return false;
    -00049 
    -00050         bool ret = usb_reset(handle) == 0;
    -00051         usb_close(handle);
    -00052         return ret;
    -00053 }
    -00054 
    -00055 int main()
    -00056 {
    -00057         struct usb_bus *busses;
    -00058 
    -00059         usb_init();
    -00060         usb_find_busses();
    -00061         usb_find_devices();
    -00062         busses = usb_get_busses();
    -00063 
    -00064         printf("Scanning for Blackberry devices...\n");
    -00065         int found = 0;
    -00066 
    -00067         struct usb_bus *bus;
    -00068         for( bus = busses; bus; bus = bus->next ) {
    -00069                 struct usb_device *dev;
    -00070 
    -00071                 for (dev = bus->devices; dev; dev = dev->next) {
    -00072                         // Is this a blackberry?
    -00073                         if( dev->descriptor.idVendor == VENDOR_RIM &&
    -00074                             (dev->descriptor.idProduct == PRODUCT_RIM_BLACKBERRY ||
    -00075                              dev->descriptor.idProduct == PRODUCT_RIM_PEARL ||
    -00076                              dev->descriptor.idProduct == PRODUCT_RIM_PEARL_8120 ||
    -00077                              dev->descriptor.idProduct == PRODUCT_RIM_PEARL_DUAL ) ) {
    -00078                                 printf("Found...");
    -00079                                 printf("attempting to reset.\n");
    -00080                                 if( reset(dev) )
    -00081                                         found++;
    -00082                                 else
    -00083                                         printf("Can't reset device on bus %s, devnum %u\n", bus->dirname, (unsigned int) dev->devnum);
    -00084                         }
    -00085                 }
    -00086         }
    -00087 
    -00088         printf("%d device%s reset.\n", found, found > 1 ? "s" : "");
    -00089 }
    -00090 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bs11nread_8cc.html barry-0.0.20110506/doc/www/doxygen/html/bs11nread_8cc.html --- barry-0.14/doc/www/doxygen/html/bs11nread_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bs11nread_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - -Barry: bs11nread.cc File Reference - - - - - - - -

    bs11nread.cc File Reference


    Detailed Description

    -Reads an boost serialization file and dumps to stdout. -

    - -

    -Definition in file bs11nread.cc. -

    -#include <barry/barry.h>
    -#include <iomanip>
    -#include <iostream>
    -#include <fstream>
    -#include <sstream>
    -#include <vector>
    -#include <string>
    -#include <algorithm>
    -#include <getopt.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - -

    Defines

    -#define __BARRY_BOOST_MODE__

    Functions

    -void Usage ()
    -template<class Record>
    bool Dump (const std::string &dbName, ifstream &ifs)
    -void DumpDB (const string &filename)
    -void ShowParsers ()
    -int main (int argc, char *argv[])
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/bs11nread_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/bs11nread_8cc-source.html --- barry-0.14/doc/www/doxygen/html/bs11nread_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/bs11nread_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ - - -Barry: bs11nread.cc Source File - - - - - - - -

    bs11nread.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       bs11nread.cc
    -00003 ///             Reads an boost serialization file and dumps to stdout.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #define __BARRY_BOOST_MODE__    // this program always requires BOOST
    -00023 #include <barry/barry.h>
    -00024 #include <iomanip>
    -00025 #include <iostream>
    -00026 #include <fstream>
    -00027 #include <sstream>
    -00028 #include <vector>
    -00029 #include <string>
    -00030 #include <algorithm>
    -00031 #include <getopt.h>
    -00032 
    -00033 
    -00034 using namespace std;
    -00035 using namespace Barry;
    -00036 
    -00037 void Usage()
    -00038 {
    -00039    int major, minor;
    -00040    const char *Version = Barry::Version(major, minor);
    -00041 
    -00042    cerr
    -00043    << "bs11nread - Reads a boost serialization file (from btool)\n"
    -00044    << "            and dumps data to stdout\n"
    -00045    << "        Copyright 2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00046    << "        Using: " << Version << "\n"
    -00047    << "\n"
    -00048    << "   -f file   Filename to save or load handheld data to/from\n"
    -00049    << "   -h        This help\n"
    -00050    << "   -S        Show list of supported database parsers\n"
    -00051    << endl;
    -00052 }
    -00053 
    -00054 template <class Record>
    -00055 bool Dump(const std::string &dbName, ifstream &ifs)
    -00056 {
    -00057         if( dbName != Record::GetDBName() )
    -00058                 return false;
    -00059 
    -00060         std::vector<Record> records;
    -00061         boost::archive::text_iarchive ia(ifs);
    -00062         ia >> records;
    -00063         cout << records.size()
    -00064              << " records loaded" << endl;
    -00065         sort(records.begin(), records.end());
    -00066 
    -00067         typename std::vector<Record>::const_iterator
    -00068                 beg = records.begin(), end = records.end();
    -00069         for( ; beg != end; beg++ ) {
    -00070                 cout << (*beg) << endl;
    -00071         }
    -00072 
    -00073         return true;
    -00074 }
    -00075 
    -00076 void DumpDB(const string &filename)
    -00077 {
    -00078         // filename is available, attempt to load
    -00079         ifstream ifs(filename.c_str());
    -00080         std::string dbName;
    -00081         getline(ifs, dbName);
    -00082 
    -00083         // check for recognized database names
    -00084         Dump<Contact>           (dbName, ifs) ||
    -00085         Dump<Message>           (dbName, ifs) ||
    -00086         Dump<Calendar>          (dbName, ifs) ||
    -00087         Dump<ServiceBook>       (dbName, ifs) ||
    -00088         Dump<Memo>              (dbName, ifs) ||
    -00089         Dump<Task>              (dbName, ifs) ||
    -00090         Dump<PINMessage>        (dbName, ifs) ||
    -00091         Dump<SavedMessage>      (dbName, ifs) ||
    -00092         Dump<Folder>            (dbName, ifs) ||
    -00093         Dump<Timezone>          (dbName, ifs) ||
    -00094                 cerr << "Unknown database name: " << dbName << endl;
    -00095 }
    -00096 
    -00097 void ShowParsers()
    -00098 {
    -00099         cout << "Supported Database parsers:\n"
    -00100         << "   Address Book\n"
    -00101         << "   Messages\n"
    -00102         << "   Calendar\n"
    -00103         << "   Service Book\n"
    -00104         << "   Memos\n"
    -00105         << "   Tasks\n"
    -00106         << "   PIN Messages\n"
    -00107         << "   Saved Email Messages\n"
    -00108         << "   Folders\n"
    -00109         << "   Time Zones\n"
    -00110         << endl;
    -00111 }
    -00112 
    -00113 int main(int argc, char *argv[])
    -00114 {
    -00115         try {
    -00116                 string filename;
    -00117 
    -00118                 // process command line options
    -00119                 for(;;) {
    -00120                         int cmd = getopt(argc, argv, "f:hS");
    -00121                         if( cmd == -1 )
    -00122                                 break;
    -00123 
    -00124                         switch( cmd )
    -00125                         {
    -00126                         case 'f':       // filename
    -00127                                 filename = optarg;
    -00128                                 break;
    -00129 
    -00130                         case 'S':       // show supported databases
    -00131                                 ShowParsers();
    -00132                                 return 0;
    -00133 
    -00134                         case 'h':       // help
    -00135                         default:
    -00136                                 Usage();
    -00137                                 return 0;
    -00138                         }
    -00139                 }
    -00140 
    -00141                 // Initialize the barry library.  Must be called before
    -00142                 // anything else.
    -00143                 Barry::Init();
    -00144 
    -00145                 if( !filename.size() ) {
    -00146                         cerr << "Filename must be specified" << endl;
    -00147                         return 1;
    -00148                 }
    -00149 
    -00150                 DumpDB(filename);
    -00151 
    -00152         }
    -00153         catch( boost::archive::archive_exception &ae ) {
    -00154                 cerr << "Archive exception: "
    -00155                      << ae.what() << endl;
    -00156                 return 1;
    -00157         }
    -00158         catch( Usb::Error &ue) {
    -00159                 std::cerr << "Usb::Error caught: " << ue.what() << endl;
    -00160                 return 1;
    -00161         }
    -00162         catch( Barry::Error &se ) {
    -00163                 std::cerr << "Barry::Error caught: " << se.what() << endl;
    -00164                 return 1;
    -00165         }
    -00166         catch( std::exception &e ) {
    -00167                 std::cerr << "std::exception caught: " << e.what() << endl;
    -00168                 return 1;
    -00169         }
    -00170 
    -00171         return 0;
    -00172 }
    -00173 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/btool_8cc.html barry-0.0.20110506/doc/www/doxygen/html/btool_8cc.html --- barry-0.14/doc/www/doxygen/html/btool_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/btool_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ - - -Barry: btool.cc File Reference - - - - - - - -

    btool.cc File Reference


    Detailed Description

    -Barry library tester. -

    - -

    -Definition in file btool.cc. -

    -#include <barry/barry.h>
    -#include <iomanip>
    -#include <iostream>
    -#include <fstream>
    -#include <sstream>
    -#include <vector>
    -#include <string>
    -#include <algorithm>
    -#include <getopt.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Contact2Ldif
    struct  Store< Record >
    class  DataDumpParser
    struct  StateTableCommand

    Functions

    -void Usage ()
    -auto_ptr< ParserGetParser (const string &name, const string &filename, bool null_parser)
    -auto_ptr< BuilderGetBuilder (const string &name, const string &filename)
    -void ShowParsers ()
    -bool SplitMap (const string &map, string &ldif, string &read, string &write)
    -void DoMapping (ContactLdif &ldif, const vector< string > &mapCommands)
    -bool ParseEpOverride (const char *arg, Usb::EndpointPair *epp)
    -int main (int argc, char *argv[])
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/btool_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/btool_8cc-source.html --- barry-0.14/doc/www/doxygen/html/btool_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/btool_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,845 +0,0 @@ - - -Barry: btool.cc Source File - - - - - - - -

    btool.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       btool.cc
    -00003 ///             Barry library tester
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include <barry/barry.h>
    -00023 #include <iomanip>
    -00024 #include <iostream>
    -00025 #include <fstream>
    -00026 #include <sstream>
    -00027 #include <vector>
    -00028 #include <string>
    -00029 #include <algorithm>
    -00030 #include <getopt.h>
    -00031 
    -00032 
    -00033 using namespace std;
    -00034 using namespace Barry;
    -00035 
    -00036 void Usage()
    -00037 {
    -00038    int major, minor;
    -00039    const char *Version = Barry::Version(major, minor);
    -00040 
    -00041    cerr
    -00042    << "btool - Command line USB Blackberry Test Tool\n"
    -00043    << "        Copyright 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00044    << "        Using: " << Version << "\n"
    -00045    << "        Compiled "
    -00046 #ifdef __BARRY_BOOST_MODE__
    -00047    << "with"
    -00048 #else
    -00049    << "without"
    -00050 #endif
    -00051    << " Boost support\n"
    -00052    << "\n"
    -00053    << "   -B bus    Specify which USB bus to search on\n"
    -00054    << "   -N dev    Specify which system device, using system specific string\n"
    -00055    << "\n"
    -00056    << "   -c dn     Convert address book database to LDIF format, using the\n"
    -00057    << "             specified baseDN\n"
    -00058    << "   -C dnattr LDIF attribute name to use when building the FQDN\n"
    -00059    << "             Defaults to 'cn'\n"
    -00060    << "   -d db     Load database 'db' FROM device and dump to screen\n"
    -00061    << "             Can be used multiple times to fetch more than one DB\n"
    -00062    << "   -e epp    Override endpoint pair detection.  'epp' is a single\n"
    -00063    << "             string separated by a comma, holding the read,write\n"
    -00064    << "             endpoint pair.  Example: -e 83,5\n"
    -00065    << "             Note: Endpoints are specified in hex.\n"
    -00066    << "             You should never need to use this option.\n"
    -00067 #ifdef __BARRY_BOOST_MODE__
    -00068    << "   -f file   Filename to save or load handheld data to/from\n"
    -00069 #endif
    -00070    << "   -h        This help\n"
    -00071    << "   -l        List devices\n"
    -00072    << "   -L        List Contact field names\n"
    -00073    << "   -m        Map LDIF name to Contact field / Unmap LDIF name\n"
    -00074    << "                Map: ldif,read,write - maps ldif to read/write Contact fields\n"
    -00075    << "                Unmap: ldif name alone\n"
    -00076    << "   -M        List current LDIF mapping\n"
    -00077    << "   -n        Use null parser on all databases.\n"
    -00078    << "   -p pin    PIN of device to talk with\n"
    -00079    << "             If only one device is plugged in, this flag is optional\n"
    -00080    << "   -P pass   Simplistic method to specify device password\n"
    -00081    << "   -s db     Save database 'db' TO device from data loaded from -f file\n"
    -00082    << "   -S        Show list of supported database parsers\n"
    -00083    << "   -t        Show database database table\n"
    -00084    << "   -T db     Show record state table for given database\n"
    -00085    << "   -v        Dump protocol data during operation\n"
    -00086    << "   -X        Reset device\n"
    -00087    << "   -z        Use non-threaded sockets\n"
    -00088    << "   -Z        Use threaded socket router (default)\n"
    -00089    << "\n"
    -00090    << " -d Command modifiers:   (can be used multiple times for more than 1 record)\n"
    -00091    << "\n"
    -00092    << "   -r #      Record index number as seen in the -T state table.\n"
    -00093    << "             This overrides the default -d behaviour, and only\n"
    -00094    << "             downloads the one specified record, sending to stdout.\n"
    -00095    << "   -R #      Same as -r, but also clears the record's dirty flags.\n"
    -00096    << "   -D #      Record index number as seen in the -T state table,\n"
    -00097    << "             which indicates the record to delete.  Used with the -d\n"
    -00098    << "             command to specify the database.\n"
    -00099    << endl;
    -00100 }
    -00101 
    -00102 class Contact2Ldif
    -00103 {
    -00104 public:
    -00105         Barry::ContactLdif &ldif;
    -00106 
    -00107         Contact2Ldif(Barry::ContactLdif &ldif) : ldif(ldif) {}
    -00108 
    -00109         void operator()(const Contact &rec)
    -00110         {
    -00111                 ldif.DumpLdif(cout, rec);
    -00112         }
    -00113 };
    -00114 
    -00115 template <class Record>
    -00116 struct Store
    -00117 {
    -00118         std::vector<Record> records;
    -00119         mutable typename std::vector<Record>::const_iterator rec_it;
    -00120         std::string filename;
    -00121         bool load;
    -00122         int count;
    -00123 
    -00124         Store(const string &filename, bool load)
    -00125                 : rec_it(records.end()),
    -00126                 filename(filename),
    -00127                 load(load),
    -00128                 count(0)
    -00129         {
    -00130 #ifdef __BARRY_BOOST_MODE__
    -00131                 try {
    -00132 
    -00133                         if( load && filename.size() ) {
    -00134                                 // filename is available, attempt to load
    -00135                                 cout << "Loading: " << filename << endl;
    -00136                                 ifstream ifs(filename.c_str());
    -00137                                 std::string dbName;
    -00138                                 getline(ifs, dbName);
    -00139                                 boost::archive::text_iarchive ia(ifs);
    -00140                                 ia >> records;
    -00141                                 cout << records.size()
    -00142                                      << " records loaded from '"
    -00143                                      << filename << "'" << endl;
    -00144                                 sort(records.begin(), records.end());
    -00145                                 rec_it = records.begin();
    -00146 
    -00147                                 // debugging aid
    -00148                                 typename std::vector<Record>::const_iterator beg = records.begin(), end = records.end();
    -00149                                 for( ; beg != end; beg++ ) {
    -00150                                         cout << (*beg) << endl;
    -00151                                 }
    -00152                         }
    -00153 
    -00154                 } catch( boost::archive::archive_exception &ae ) {
    -00155                         cerr << "Archive exception in ~Store(): "
    -00156                              << ae.what() << endl;
    -00157                 }
    -00158 #endif
    -00159         }
    -00160         ~Store()
    -00161         {
    -00162                 cout << "Store counted " << dec << count << " records." << endl;
    -00163 #ifdef __BARRY_BOOST_MODE__
    -00164                 try {
    -00165 
    -00166                         if( !load && filename.size() ) {
    -00167                                 // filename is available, attempt to save
    -00168                                 cout << "Saving: " << filename << endl;
    -00169                                 const std::vector<Record> &r = records;
    -00170                                 ofstream ofs(filename.c_str());
    -00171                                 ofs << Record::GetDBName() << endl;
    -00172                                 boost::archive::text_oarchive oa(ofs);
    -00173                                 oa << r;
    -00174                                 cout << dec << r.size() << " records saved to '"
    -00175                                         << filename << "'" << endl;
    -00176                         }
    -00177 
    -00178                 } catch( boost::archive::archive_exception &ae ) {
    -00179                         cerr << "Archive exception in ~Store(): "
    -00180                              << ae.what() << endl;
    -00181                 }
    -00182 #endif
    -00183         }
    -00184 
    -00185         // storage operator
    -00186         void operator()(const Record &rec)
    -00187         {
    -00188                 count++;
    -00189                 std::cout << rec << std::endl;
    -00190                 records.push_back(rec);
    -00191         }
    -00192 
    -00193         // retrieval operator
    -00194         bool operator()(Record &rec, unsigned int databaseId) const
    -00195         {
    -00196                 if( rec_it == records.end() )
    -00197                         return false;
    -00198                 rec = *rec_it;
    -00199                 rec_it++;
    -00200                 return true;
    -00201         }
    -00202 };
    -00203 
    -00204 class DataDumpParser : public Barry::Parser
    -00205 {
    -00206         uint32_t m_id;
    -00207 
    -00208 public:
    -00209         virtual void SetIds(uint8_t RecType, uint32_t UniqueId)
    -00210         {
    -00211                 m_id = UniqueId;
    -00212         }
    -00213 
    -00214         virtual void ParseFields(const Barry::Data &data, size_t &offset)
    -00215         {
    -00216                 std::cout << "Raw record dump for record: "
    -00217                         << std::hex << m_id << std::endl;
    -00218                 std::cout << data << std::endl;
    -00219         }
    -00220 };
    -00221 
    -00222 auto_ptr<Parser> GetParser(const string &name, const string &filename, bool null_parser)
    -00223 {
    -00224         if( null_parser ) {
    -00225                 // use null parser
    -00226                 return auto_ptr<Parser>( new DataDumpParser );
    -00227         }
    -00228         // check for recognized database names
    -00229         else if( name == Contact::GetDBName() ) {
    -00230                 return auto_ptr<Parser>(
    -00231                         new RecordParser<Contact, Store<Contact> > (
    -00232                                 new Store<Contact>(filename, false)));
    -00233         }
    -00234         else if( name == Message::GetDBName() ) {
    -00235                 return auto_ptr<Parser>(
    -00236                         new RecordParser<Message, Store<Message> > (
    -00237                                 new Store<Message>(filename, false)));
    -00238         }
    -00239         else if( name == Calendar::GetDBName() ) {
    -00240                 return auto_ptr<Parser>(
    -00241                         new RecordParser<Calendar, Store<Calendar> > (
    -00242                                 new Store<Calendar>(filename, false)));
    -00243         }
    -00244         else if( name == ServiceBook::GetDBName() ) {
    -00245                 return auto_ptr<Parser>(
    -00246                         new RecordParser<ServiceBook, Store<ServiceBook> > (
    -00247                                 new Store<ServiceBook>(filename, false)));
    -00248         }
    -00249 
    -00250         else if( name == Memo::GetDBName() ) {
    -00251                 return auto_ptr<Parser>(
    -00252                         new RecordParser<Memo, Store<Memo> > (
    -00253                                 new Store<Memo>(filename, false)));
    -00254         }
    -00255         else if( name == Task::GetDBName() ) {
    -00256                 return auto_ptr<Parser>(
    -00257                         new RecordParser<Task, Store<Task> > (
    -00258                                 new Store<Task>(filename, false)));
    -00259         }
    -00260         else if( name == PINMessage::GetDBName() ) {
    -00261                 return auto_ptr<Parser>(
    -00262                         new RecordParser<PINMessage, Store<PINMessage> > (
    -00263                                 new Store<PINMessage>(filename, false)));
    -00264         }
    -00265         else if( name == SavedMessage::GetDBName() ) {
    -00266                 return auto_ptr<Parser>(
    -00267                         new RecordParser<SavedMessage, Store<SavedMessage> > (
    -00268                                 new Store<SavedMessage>(filename, false)));
    -00269         }
    -00270         else if( name == Folder::GetDBName() ) {
    -00271                 return auto_ptr<Parser>(
    -00272                         new RecordParser<Folder, Store<Folder> > (
    -00273                                 new Store<Folder>(filename, false)));
    -00274         }
    -00275         else if( name == Timezone::GetDBName() ) {
    -00276                 return auto_ptr<Parser>(
    -00277                         new RecordParser<Timezone, Store<Timezone> > (
    -00278                                 new Store<Timezone>(filename, false)));
    -00279         }
    -00280         else {
    -00281                 // unknown database, use null parser
    -00282                 return auto_ptr<Parser>( new DataDumpParser );
    -00283         }
    -00284 }
    -00285 
    -00286 auto_ptr<Builder> GetBuilder(const string &name, const string &filename)
    -00287 {
    -00288         // check for recognized database names
    -00289         if( name == Contact::GetDBName() ) {
    -00290                 return auto_ptr<Builder>(
    -00291                         new RecordBuilder<Contact, Store<Contact> > (
    -00292                                 new Store<Contact>(filename, true)));
    -00293         }
    -00294         else if( name == Calendar::GetDBName() ) {
    -00295                 return auto_ptr<Builder>(
    -00296                         new RecordBuilder<Calendar, Store<Calendar> > (
    -00297                                 new Store<Calendar>(filename, true)));
    -00298         }
    -00299 /*
    -00300         else if( name == "Messages" ) {
    -00301                 return auto_ptr<Parser>(
    -00302                         new RecordParser<Message, Store<Message> > (
    -00303                                 new Store<Message>(filename, true)));
    -00304         }
    -00305         else if( name == "Service Book" ) {
    -00306                 return auto_ptr<Parser>(
    -00307                         new RecordParser<ServiceBook, Store<ServiceBook> > (
    -00308                                 new Store<ServiceBook>(filename, true)));
    -00309         }
    -00310         else if( name == "Memos" ) {
    -00311                 return auto_ptr<Parser>(
    -00312                         new RecordParser<Memo, Store<Memo> > (
    -00313                                 new Store<Memo>(filename, true)));
    -00314         }
    -00315         else if( name == "Tasks" ) {
    -00316                 return auto_ptr<Parser>(
    -00317                         new RecordParser<Task, Store<Task> > (
    -00318                                 new Store<Task>(filename, true)));
    -00319         }
    -00320 */
    -00321         else {
    -00322                 throw std::runtime_error("No Builder available for database");
    -00323         }
    -00324 }
    -00325 
    -00326 void ShowParsers()
    -00327 {
    -00328         cout << "Supported Database parsers:\n"
    -00329         << "   Address Book\n"
    -00330         << "   Messages\n"
    -00331         << "   Calendar\n"
    -00332         << "   Service Book\n"
    -00333         << "   Memos\n"
    -00334         << "   Tasks\n"
    -00335         << "   PIN Messages\n"
    -00336         << "   Saved Email Messages\n"
    -00337         << "   Folders\n"
    -00338         << "   Time Zones (read only)\n"
    -00339         << "\n"
    -00340         << "Supported Database builders:\n"
    -00341         << "   Address Book\n"
    -00342         << "   Calendar\n"
    -00343         << endl;
    -00344 }
    -00345 
    -00346 struct StateTableCommand
    -00347 {
    -00348         char flag;
    -00349         bool clear;
    -00350         unsigned int index;
    -00351 
    -00352         StateTableCommand(char f, bool c, unsigned int i)
    -00353                 : flag(f), clear(c), index(i) {}
    -00354 };
    -00355 
    -00356 bool SplitMap(const string &map, string &ldif, string &read, string &write)
    -00357 {
    -00358         string::size_type a = map.find(',');
    -00359         if( a == string::npos )
    -00360                 return false;
    -00361 
    -00362         string::size_type b = map.find(',', a+1);
    -00363         if( b == string::npos )
    -00364                 return false;
    -00365 
    -00366         ldif.assign(map, 0, a);
    -00367         read.assign(map, a + 1, b - a - 1);
    -00368         write.assign(map, b + 1, map.size() - b - 1);
    -00369 
    -00370         return ldif.size() && read.size() && write.size();
    -00371 }
    -00372 
    -00373 void DoMapping(ContactLdif &ldif, const vector<string> &mapCommands)
    -00374 {
    -00375         for(    vector<string>::const_iterator i = mapCommands.begin();
    -00376                 i != mapCommands.end();
    -00377                 ++i )
    -00378         {
    -00379                 // single names mean unmapping
    -00380                 if( i->find(',') == string::npos ) {
    -00381                         // unmap
    -00382                         cerr << "Unmapping: " << *i << endl;
    -00383                         ldif.Unmap(*i);
    -00384                 }
    -00385                 else {
    -00386                         cerr << "Mapping: " << *i << endl;
    -00387 
    -00388                         // map... extract ldif/read/write names
    -00389                         string ldifname, read, write;
    -00390                         if( SplitMap(*i, ldifname, read, write) ) {
    -00391                                 if( !ldif.Map(ldifname, read, write) ) {
    -00392                                         cerr << "Read/Write name unknown: " << *i << endl;
    -00393                                 }
    -00394                         }
    -00395                         else {
    -00396                                 cerr << "Invalid map format: " << *i << endl;
    -00397                         }
    -00398                 }
    -00399         }
    -00400 }
    -00401 
    -00402 bool ParseEpOverride(const char *arg, Usb::EndpointPair *epp)
    -00403 {
    -00404         int read, write;
    -00405         char comma;
    -00406         istringstream iss(arg);
    -00407         iss >> hex >> read >> comma >> write;
    -00408         if( !iss )
    -00409                 return false;
    -00410         epp->read = read;
    -00411         epp->write = write;
    -00412         return true;
    -00413 }
    -00414 
    -00415 int main(int argc, char *argv[])
    -00416 {
    -00417         cout.sync_with_stdio(true);     // leave this on, since libusb uses
    -00418                                         // stdio for debug messages
    -00419 
    -00420         try {
    -00421 
    -00422                 uint32_t pin = 0;
    -00423                 bool    list_only = false,
    -00424                         show_dbdb = false,
    -00425                         ldif_contacts = false,
    -00426                         data_dump = false,
    -00427                         reset_device = false,
    -00428                         list_contact_fields = false,
    -00429                         list_ldif_map = false,
    -00430                         epp_override = false,
    -00431                         threaded_sockets = true,
    -00432                         record_state = false,
    -00433                         null_parser = false;
    -00434                 string ldifBaseDN, ldifDnAttr;
    -00435                 string filename;
    -00436                 string password;
    -00437                 string busname;
    -00438                 string devname;
    -00439                 vector<string> dbNames, saveDbNames, mapCommands;
    -00440                 vector<StateTableCommand> stCommands;
    -00441                 Usb::EndpointPair epOverride;
    -00442 
    -00443                 // process command line options
    -00444                 for(;;) {
    -00445                         int cmd = getopt(argc, argv, "B:c:C:d:D:e:f:hlLm:MnN:p:P:r:R:Ss:tT:vXzZ");
    -00446                         if( cmd == -1 )
    -00447                                 break;
    -00448 
    -00449                         switch( cmd )
    -00450                         {
    -00451                         case 'B':       // busname
    -00452                                 busname = optarg;
    -00453                                 break;
    -00454 
    -00455                         case 'c':       // contacts to ldap ldif
    -00456                                 ldif_contacts = true;
    -00457                                 ldifBaseDN = optarg;
    -00458                                 break;
    -00459 
    -00460                         case 'C':       // DN Attribute for FQDN
    -00461                                 ldifDnAttr = optarg;
    -00462                                 break;
    -00463 
    -00464                         case 'd':       // show dbname
    -00465                                 dbNames.push_back(string(optarg));
    -00466                                 break;
    -00467 
    -00468                         case 'D':       // delete record
    -00469                                 stCommands.push_back(
    -00470                                         StateTableCommand('D', false, atoi(optarg)));
    -00471                                 break;
    -00472 
    -00473                         case 'e':       // endpoint override
    -00474                                 if( !ParseEpOverride(optarg, &epOverride) ) {
    -00475                                         Usage();
    -00476                                         return 1;
    -00477                                 }
    -00478                                 epp_override = true;
    -00479                                 break;
    -00480 
    -00481                         case 'f':       // filename
    -00482 #ifdef __BARRY_BOOST_MODE__
    -00483                                 filename = optarg;
    -00484 #else
    -00485                                 cerr << "-f option not supported - no Boost "
    -00486                                         "serialization support available\n";
    -00487                                 return 1;
    -00488 #endif
    -00489                                 break;
    -00490                         case 'l':       // list only
    -00491                                 list_only = true;
    -00492                                 break;
    -00493 
    -00494                         case 'L':       // List Contact field names
    -00495                                 list_contact_fields = true;
    -00496                                 break;
    -00497 
    -00498                         case 'm':       // Map / Unmap
    -00499                                 mapCommands.push_back(string(optarg));
    -00500                                 break;
    -00501 
    -00502                         case 'M':       // List LDIF map
    -00503                                 list_ldif_map = true;
    -00504                                 break;
    -00505 
    -00506                         case 'n':       // use null parser
    -00507                                 null_parser = true;
    -00508                                 break;
    -00509 
    -00510                         case 'N':       // Devname
    -00511                                 devname = optarg;
    -00512                                 break;
    -00513 
    -00514                         case 'p':       // Blackberry PIN
    -00515                                 pin = strtoul(optarg, NULL, 16);
    -00516                                 break;
    -00517 
    -00518                         case 'P':       // Device password
    -00519                                 password = optarg;
    -00520                                 break;
    -00521 
    -00522                         case 'r':       // get specific record index
    -00523                                 stCommands.push_back(
    -00524                                         StateTableCommand('r', false, atoi(optarg)));
    -00525                                 break;
    -00526 
    -00527                         case 'R':       // same as 'r', and clears dirty
    -00528                                 stCommands.push_back(
    -00529                                         StateTableCommand('r', true, atoi(optarg)));
    -00530                                 break;
    -00531 
    -00532                         case 's':       // save dbname
    -00533                                 saveDbNames.push_back(string(optarg));
    -00534                                 break;
    -00535 
    -00536                         case 'S':       // show supported databases
    -00537                                 ShowParsers();
    -00538                                 return 0;
    -00539 
    -00540                         case 't':       // display database database
    -00541                                 show_dbdb = true;
    -00542                                 break;
    -00543 
    -00544                         case 'T':       // show RecordStateTable
    -00545                                 record_state = true;
    -00546                                 dbNames.push_back(string(optarg));
    -00547                                 break;
    -00548 
    -00549                         case 'v':       // data dump on
    -00550                                 data_dump = true;
    -00551                                 break;
    -00552 
    -00553                         case 'X':       // reset device
    -00554                                 reset_device = true;
    -00555                                 break;
    -00556 
    -00557                         case 'z':       // non-threaded sockets
    -00558                                 threaded_sockets = false;
    -00559                                 break;
    -00560 
    -00561                         case 'Z':       // threaded socket router
    -00562                                 threaded_sockets = true;
    -00563                                 break;
    -00564 
    -00565                         case 'h':       // help
    -00566                         default:
    -00567                                 Usage();
    -00568                                 return 0;
    -00569                         }
    -00570                 }
    -00571 
    -00572                 // Initialize the barry library.  Must be called before
    -00573                 // anything else.
    -00574                 Barry::Init(data_dump);
    -00575 
    -00576                 // LDIF class... only needed if ldif output turned on
    -00577                 ContactLdif ldif(ldifBaseDN);
    -00578                 DoMapping(ldif, mapCommands);
    -00579                 if( ldifDnAttr.size() ) {
    -00580                         if( !ldif.SetDNAttr(ldifDnAttr) ) {
    -00581                                 cerr << "Unable to set DN Attr: " << ldifDnAttr << endl;
    -00582                         }
    -00583                 }
    -00584 
    -00585                 // Probe the USB bus for Blackberry devices and display.
    -00586                 // If user has specified a PIN, search for it in the
    -00587                 // available device list here as well
    -00588                 Barry::Probe probe(busname.c_str(), devname.c_str());
    -00589                 int activeDevice = -1;
    -00590 
    -00591                 // show any errors during probe first
    -00592                 if( probe.GetFailCount() ) {
    -00593                         if( ldif_contacts )
    -00594                                 cout << "# ";
    -00595                         cout << "Blackberry device errors with errors during probe:" << endl;
    -00596                         for( int i = 0; i < probe.GetFailCount(); i++ ) {
    -00597                                 if( ldif_contacts )
    -00598                                         cout << "# ";
    -00599                                 cout << probe.GetFailMsg(i) << endl;
    -00600                         }
    -00601                 }
    -00602 
    -00603                 // show all successfully found devices
    -00604                 if( ldif_contacts )
    -00605                         cout << "# ";
    -00606                 cout << "Blackberry devices found:" << endl;
    -00607                 for( int i = 0; i < probe.GetCount(); i++ ) {
    -00608                         if( ldif_contacts )
    -00609                                 cout << "# ";
    -00610                         if( data_dump )
    -00611                                 probe.Get(i).DumpAll(cout);
    -00612                         else
    -00613                                 cout << probe.Get(i);
    -00614                         cout << endl;
    -00615                         if( probe.Get(i).m_pin == pin )
    -00616                                 activeDevice = i;
    -00617                 }
    -00618 
    -00619                 if( list_only )
    -00620                         return 0;       // done
    -00621 
    -00622                 if( activeDevice == -1 ) {
    -00623                         if( pin == 0 ) {
    -00624                                 // can we default to single device?
    -00625                                 if( probe.GetCount() == 1 )
    -00626                                         activeDevice = 0;
    -00627                                 else {
    -00628                                         cerr << "No device selected" << endl;
    -00629                                         return 1;
    -00630                                 }
    -00631                         }
    -00632                         else {
    -00633                                 cerr << "PIN " << setbase(16) << pin
    -00634                                         << " not found" << endl;
    -00635                                 return 1;
    -00636                         }
    -00637                 }
    -00638 
    -00639                 if( ldif_contacts )
    -00640                         cout << "# ";
    -00641                 cout << "Using device (PIN): " << setbase(16)
    -00642                         << probe.Get(activeDevice).m_pin << endl;
    -00643 
    -00644                 if( reset_device ) {
    -00645                         Usb::Device dev(probe.Get(activeDevice).m_dev);
    -00646                         dev.Reset();
    -00647                         return 0;
    -00648                 }
    -00649 
    -00650                 // Override device endpoints if user asks
    -00651                 Barry::ProbeResult device = probe.Get(activeDevice);
    -00652                 if( epp_override ) {
    -00653                         device.m_ep.read = epOverride.read;
    -00654                         device.m_ep.write = epOverride.write;
    -00655                         device.m_ep.type = 2;   // FIXME - override this too?
    -00656                         cout << "Endpoint pair (read,write) overridden with: "
    -00657                              << hex
    -00658                              << (unsigned int) device.m_ep.read << ","
    -00659                              << (unsigned int) device.m_ep.write << endl;
    -00660                 }
    -00661 
    -00662                 //
    -00663                 // Create our controller object
    -00664                 //
    -00665                 // Order is important in the following auto_ptr<> objects,
    -00666                 // since Controller must get destroyed before router.
    -00667                 // Normally you'd pick one method, and not bother
    -00668                 // with auto_ptr<> and so the normal C++ constructor
    -00669                 // rules would guarantee this safety for you, but
    -00670                 // here we want the user to pick.
    -00671                 //
    -00672                 auto_ptr<SocketRoutingQueue> router;
    -00673                 auto_ptr<Barry::Controller> pcon;
    -00674                 if( threaded_sockets ) {
    -00675                         router.reset( new SocketRoutingQueue );
    -00676                         router->SpinoffSimpleReadThread();
    -00677                         pcon.reset( new Barry::Controller(device, *router) );
    -00678                 }
    -00679                 else {
    -00680                         pcon.reset( new Barry::Controller(device) );
    -00681                 }
    -00682 
    -00683                 Barry::Controller &con = *pcon;
    -00684                 Barry::Mode::Desktop desktop(con);
    -00685 
    -00686                 //
    -00687                 // execute each mode that was turned on
    -00688                 //
    -00689 
    -00690 
    -00691                 // Dump list of all databases to stdout
    -00692                 if( show_dbdb ) {
    -00693                         // open desktop mode socket
    -00694                         desktop.Open(password.c_str());
    -00695                         cout << desktop.GetDBDB() << endl;
    -00696                 }
    -00697 
    -00698                 // Dump list of Contact field names
    -00699                 if( list_contact_fields ) {
    -00700                         for( const ContactLdif::NameToFunc *n = ldif.GetFieldNames(); n->name; n++ ) {
    -00701                                 cout.fill(' ');
    -00702                                 cout << "  " << left << setw(20) << n->name << ": "
    -00703                                         << n->description << endl;
    -00704                         }
    -00705                 }
    -00706 
    -00707                 // Dump current LDIF mapping
    -00708                 if( list_ldif_map ) {
    -00709                         cout << ldif << endl;
    -00710                 }
    -00711 
    -00712                 // Dump list of contacts to an LDAP LDIF file
    -00713                 // This uses the Controller convenience templates
    -00714                 if( ldif_contacts ) {
    -00715                         // make sure we're in desktop mode
    -00716                         desktop.Open(password.c_str());
    -00717 
    -00718                         // create a storage functor object that accepts
    -00719                         // Barry::Contact objects as input
    -00720                         Contact2Ldif storage(ldif);
    -00721 
    -00722                         // load all the Contact records into storage
    -00723                         desktop.LoadDatabaseByType<Barry::Contact>(storage);
    -00724                 }
    -00725 
    -00726                 // Dump record state table to stdout
    -00727                 if( record_state ) {
    -00728                         if( dbNames.size() == 0 ) {
    -00729                                 cout << "No db names to process" << endl;
    -00730                                 return 1;
    -00731                         }
    -00732 
    -00733                         desktop.Open(password.c_str());
    -00734 
    -00735                         vector<string>::iterator b = dbNames.begin();
    -00736                         for( ; b != dbNames.end(); b++ ) {
    -00737                                 unsigned int id = desktop.GetDBID(*b);
    -00738                                 RecordStateTable state;
    -00739                                 desktop.GetRecordStateTable(id, state);
    -00740                                 cout << "Record state table for: " << *b << endl;
    -00741                                 cout << state;
    -00742                         }
    -00743                         return 0;
    -00744                 }
    -00745 
    -00746                 // Get Record mode overrides the default name mode
    -00747                 if( stCommands.size() ) {
    -00748                         if( dbNames.size() != 1 ) {
    -00749                                 cout << "Must have 1 db name to process" << endl;
    -00750                                 return 1;
    -00751                         }
    -00752 
    -00753                         desktop.Open(password.c_str());
    -00754                         unsigned int id = desktop.GetDBID(dbNames[0]);
    -00755                         auto_ptr<Parser> parse = GetParser(dbNames[0],filename,null_parser);
    -00756 
    -00757                         for( unsigned int i = 0; i < stCommands.size(); i++ ) {
    -00758                                 desktop.GetRecord(id, stCommands[i].index, *parse.get());
    -00759 
    -00760                                 if( stCommands[i].flag == 'r' && stCommands[i].clear ) {
    -00761                                         cout << "Clearing record's dirty flags..." << endl;
    -00762                                         desktop.ClearDirty(id, stCommands[i].index);
    -00763                                 }
    -00764 
    -00765                                 if( stCommands[i].flag == 'D' ) {
    -00766                                         desktop.DeleteRecord(id, stCommands[i].index);
    -00767                                 }
    -00768                         }
    -00769 
    -00770                         return 0;
    -00771                 }
    -00772 
    -00773                 // Dump contents of selected databases to stdout, or
    -00774                 // to file if specified.
    -00775                 // This is retrieving data from the Blackberry.
    -00776                 if( dbNames.size() ) {
    -00777                         vector<string>::iterator b = dbNames.begin();
    -00778 
    -00779                         desktop.Open(password.c_str());
    -00780                         for( ; b != dbNames.end(); b++ ) {
    -00781                                 auto_ptr<Parser> parse = GetParser(*b,filename,null_parser);
    -00782                                 unsigned int id = desktop.GetDBID(*b);
    -00783                                 desktop.LoadDatabase(id, *parse.get());
    -00784                         }
    -00785                 }
    -00786 
    -00787                 // Save contents of file to specified databases
    -00788                 // This is writing data to the Blackberry.
    -00789                 if( saveDbNames.size() ) {
    -00790                         vector<string>::iterator b = saveDbNames.begin();
    -00791 
    -00792                         desktop.Open(password.c_str());
    -00793                         for( ; b != saveDbNames.end(); b++ ) {
    -00794                                 auto_ptr<Builder> build =
    -00795                                         GetBuilder(*b, filename);
    -00796                                 unsigned int id = desktop.GetDBID(*b);
    -00797                                 desktop.SaveDatabase(id, *build);
    -00798                         }
    -00799                 }
    -00800 
    -00801         }
    -00802         catch( Usb::Error &ue) {
    -00803                 std::cerr << "Usb::Error caught: " << ue.what() << endl;
    -00804                 return 1;
    -00805         }
    -00806         catch( Barry::Error &se ) {
    -00807                 std::cerr << "Barry::Error caught: " << se.what() << endl;
    -00808                 return 1;
    -00809         }
    -00810         catch( std::exception &e ) {
    -00811                 std::cerr << "std::exception caught: " << e.what() << endl;
    -00812                 return 1;
    -00813         }
    -00814 
    -00815         return 0;
    -00816 }
    -00817 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/btranslate_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/btranslate_8cc-source.html --- barry-0.14/doc/www/doxygen/html/btranslate_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/btranslate_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ - - -Barry: btranslate.cc Source File - - - - - - - -

    btranslate.cc

    00001 /*
    -00002     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00003 
    -00004     This program is free software; you can redistribute it and/or modify
    -00005     it under the terms of the GNU General Public License as published by
    -00006     the Free Software Foundation; either version 2 of the License, or
    -00007     (at your option) any later version.
    -00008 
    -00009     This program is distributed in the hope that it will be useful,
    -00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00012 
    -00013     See the GNU General Public License in the COPYING file at the
    -00014     root directory of this project for more details.
    -00015 */
    -00016 
    -00017 #include <iostream>
    -00018 #include <iomanip>
    -00019 #include <sstream>
    -00020 #include <string.h>
    -00021 #include <stdlib.h>
    -00022 #include <limits.h>
    -00023 
    -00024 using namespace std;
    -00025 
    -00026 bool IsHexData(const char *str)
    -00027 {
    -00028         for( int i = 0; i < 4 && *str; str++, i++ )
    -00029                 if( *str != ' ' )
    -00030                         return false;
    -00031 
    -00032         for( int i = 0; i < 8 && *str; str++, i++ )
    -00033                 if( !isdigit(*str) && !(*str >= 'a' && *str <= 'f') )
    -00034                         return false;
    -00035 
    -00036         if( *str != ':' )
    -00037                 return false;
    -00038 
    -00039         return true;
    -00040 }
    -00041 
    -00042 void PrintHex(const char *str)
    -00043 {
    -00044         cout << setiosflags(ios::left) << setw(14 + 16 * 3 + 1) << str;
    -00045         cout << setw(0);
    -00046         str += 14;
    -00047         char *endpos = (char*) str;
    -00048         while( *endpos ) {
    -00049                 long c = strtol(str, &endpos, 16);
    -00050                 if( c == LONG_MIN || c == LONG_MAX )
    -00051                         break;
    -00052                 if( isprint(c) )
    -00053                         cout << (char)c;
    -00054                 else
    -00055                         cout << '.';
    -00056                 str = endpos;
    -00057         }
    -00058         cout << '\n';
    -00059 }
    -00060 
    -00061 int main()
    -00062 {
    -00063         cout.sync_with_stdio(false);
    -00064 
    -00065         while( cin ) {
    -00066                 char buff[1024];
    -00067                 cin.getline(buff, sizeof(buff));
    -00068                 if( IsHexData(buff) ) {
    -00069                         // strip whitespace
    -00070                         size_t sln = strlen(buff);
    -00071                         while( sln && (buff[sln] == 0 || isspace(buff[sln])) ){
    -00072                                 buff[sln--] = 0;
    -00073                         }
    -00074                         PrintHex(buff);
    -00075                 }
    -00076                 else {
    -00077                         cout << buff << "\n";
    -00078                 }
    -00079 
    -00080                 if( cin.fail() && !cin.eof() ) {
    -00081                         // getline busted its buffer... discard the
    -00082                         // rest of the line.
    -00083                         while( cin.fail() && !cin.eof() ) {
    -00084                                 cin.clear();
    -00085                                 cin.getline(buff, sizeof(buff));
    -00086                         }
    -00087                 }
    -00088         }
    -00089 }
    -00090 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/builder_8h.html barry-0.0.20110506/doc/www/doxygen/html/builder_8h.html --- barry-0.14/doc/www/doxygen/html/builder_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/builder_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: builder.h File Reference - - - - - - - -

    builder.h File Reference


    Detailed Description

    -Virtual protocol packet builder wrapper. -

    - -

    -Definition in file builder.h. -

    -#include "dll.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Builder
     Base class for the builder functor hierarchy. More...
    class  Barry::RecordBuilder< RecordT, StorageT >
     Template class for easy creation of specific protocol packet builder objects. More...
    class  Barry::RecordFetch< RecordT >
     Generic record fetch class, to help with using records without builder classes. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/builder_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/builder_8h-source.html --- barry-0.14/doc/www/doxygen/html/builder_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/builder_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ - - -Barry: builder.h Source File - - - - - - - -

    builder.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       builder.h
    -00003 ///             Virtual protocol packet builder wrapper
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_BUILDER_H__
    -00023 #define __BARRY_BUILDER_H__
    -00024 
    -00025 #include "dll.h"
    -00026 
    -00027 namespace Barry {
    -00028 
    -00029 //
    -00030 // Builder class
    -00031 //
    -00032 /// Base class for the builder functor hierarchy.
    -00033 ///
    -00034 /// This defines the API used by the Controller and Packet classes
    -00035 /// for building a raw device record to write to the device.
    -00036 ///
    -00037 class BXEXPORT Builder
    -00038 {
    -00039 public:
    -00040         Builder() {}
    -00041         virtual ~Builder() {}
    -00042 
    -00043         /// Called first in the sequence, to allow the application to
    -00044         /// load the needed data from memory, disk, etc.  If successful,
    -00045         /// return true.  If at the end of the series, return false.
    -00046         virtual bool Retrieve(unsigned int databaseId) = 0;
    -00047 
    -00048         /// Called to retrive the unique ID for this record.
    -00049         virtual uint8_t GetRecType() const = 0;
    -00050         virtual uint32_t GetUniqueId() const = 0;
    -00051 
    -00052         /// Called before BuildFields() in order to build the header
    -00053         /// for this record.  Store the raw data in data, at the
    -00054         /// offset given in offset.  When finished, update offset to
    -00055         /// point to the next spot to put new data.
    -00056         virtual void BuildHeader(Data &data, size_t &offset) = 0;
    -00057 
    -00058         /// Called to build the record field data.  Store the raw data
    -00059         /// in data, using offset to know where to write.  Be sure to
    -00060         /// update offset, and be sure to adjust the size of the data
    -00061         /// packet (possibly with Data::ReleaseBuffer()).
    -00062         virtual void BuildFields(Data &data, size_t &offset) = 0;
    -00063 };
    -00064 
    -00065 
    -00066 //
    -00067 // RecordBuilder template class
    -00068 //
    -00069 /// Template class for easy creation of specific protocol packet builder
    -00070 /// objects.  This template takes the following template arguments:
    -00071 ///
    -00072 ///     - RecordT: One of the record classes in record.h
    -00073 ///     - StorageT: A custom storage functor class.  An object of this type
    -00074 ///             will be called as a function with empty Record as an
    -00075 ///             argument.  The storage class is expected to fill the
    -00076 ///             record object in preparation for building the packet
    -00077 ///             out of that data.  These calls happen on the fly as the data
    -00078 ///             is sent to the device over USB, so it should not block forever.
    -00079 ///
    -00080 /// Example SaveDatabase() call:
    -00081 ///
    -00082 /// <pre>
    -00083 /// FIXME
    -00084 /// </pre>
    -00085 ///
    -00086 template <class RecordT, class StorageT>
    -00087 class RecordBuilder : public Builder
    -00088 {
    -00089         StorageT *m_storage;
    -00090         bool m_owned;
    -00091         RecordT m_rec;
    -00092 
    -00093 public:
    -00094         /// Constructor that references an externally managed storage object.
    -00095         RecordBuilder(StorageT &storage)
    -00096                 : m_storage(&storage), m_owned(false) {}
    -00097 
    -00098         /// Constructor that references a locally managed storage object.
    -00099         /// The pointer passed in will be stored, and freed when this class
    -00100         /// is destroyed.  It is safe to call this constructor with
    -00101         /// a 'new'ly created storage object.
    -00102         RecordBuilder(StorageT *storage)
    -00103                 : m_storage(storage), m_owned(true) {}
    -00104 
    -00105         ~RecordBuilder()
    -00106         {
    -00107                 if( this->m_owned )
    -00108                         delete m_storage;
    -00109         }
    -00110 
    -00111         virtual bool Retrieve(unsigned int databaseId)
    -00112         {
    -00113                 return (*m_storage)(m_rec, databaseId);
    -00114         }
    -00115 
    -00116         virtual uint8_t GetRecType() const
    -00117         {
    -00118                 return m_rec.GetRecType();
    -00119         }
    -00120 
    -00121         virtual uint32_t GetUniqueId() const
    -00122         {
    -00123                 return m_rec.GetUniqueId();
    -00124         }
    -00125 
    -00126         /// Functor member called by Controller::SaveDatabase() during
    -00127         /// processing.
    -00128         virtual void BuildHeader(Data &data, size_t &offset)
    -00129         {
    -00130                 m_rec.BuildHeader(data, offset);
    -00131         }
    -00132 
    -00133         virtual void BuildFields(Data &data, size_t &offset)
    -00134         {
    -00135                 m_rec.BuildFields(data, offset);
    -00136         }
    -00137 };
    -00138 
    -00139 
    -00140 //
    -00141 // RecordFetch template class
    -00142 //
    -00143 /// Generic record fetch class, to help with using records without
    -00144 /// builder classes.
    -00145 ///
    -00146 template <class RecordT>
    -00147 class RecordFetch
    -00148 {
    -00149         const RecordT &m_rec;
    -00150         mutable bool m_done;
    -00151 
    -00152 public:
    -00153         RecordFetch(const RecordT &rec) : m_rec(rec), m_done(false) {}
    -00154         bool operator()(RecordT &rec, unsigned int dbId) const
    -00155         {
    -00156                 if( m_done )
    -00157                         return false;
    -00158                 rec = m_rec;
    -00159                 m_done = true;
    -00160                 return true;
    -00161         }
    -00162 };
    -00163 
    -00164 
    -00165 } // namespace Barry
    -00166 
    -00167 #endif
    -00168 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/cbarry_8h.html barry-0.0.20110506/doc/www/doxygen/html/cbarry_8h.html --- barry-0.14/doc/www/doxygen/html/cbarry_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/cbarry_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,246 +0,0 @@ - - -Barry: cbarry.h File Reference - - - - - - - -

    cbarry.h File Reference


    Detailed Description

    -Main header file for Barry C API - incomplete. -

    - -

    -Definition in file cbarry.h. -

    -#include "dll.h"
    -#include <stdint.h>
    -#include <time.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Defines

    -#define BARRY_RECORD_CONTACT   1
    -#define BARRY_RECORD_MESSAGE   2
    -#define BARRY_RECORD_CALENDAR   3
    -#define BARRY_RECORD_SERVICEBOOK   4
    -#define BARRY_FIELDTYPE_NUMBER   1
    -#define BARRY_FIELDTYPE_STRING   2
    -#define BARRY_FIELDTYPE_TIME   3
    -#define IS_NUMBER(fieldcode)   (((fieldcode & 0xff0000) == 0x010000)
    -#define IS_STRING(fieldcode)   (((fieldcode & 0xff0000) == 0x020000)
    -#define IS_TIME(fieldcode)   (((fieldcode & 0xff0000) == 0x030000)
    -#define BARRY_CONTACT_RECORDID   0x010101
    -#define BARRY_CONTACT_EMAIL   0x020102
    -#define BARRY_CONTACT_PHONE   0x020103
    -#define BARRY_CONTACT_FAX   0x020104
    -#define BARRY_CONTACT_WORKPHONE   0x020105
    -#define BARRY_CONTACT_HOMEPHONE   0x020106
    -#define BARRY_CONTACT_MOBILEPHONE   0x020107
    -#define BARRY_CONTACT_PAGER   0x020108
    -#define BARRY_CONTACT_PIN   0x020109
    -#define BARRY_CONTACT_FIRSTNAME   0x02010a
    -#define BARRY_CONTACT_LASTNAME   0x02010b
    -#define BARRY_CONTACT_COMPANY   0x02010c
    -#define BARRY_CONTACT_DEFAULTCOMMMETHOD   0x02010d
    -#define BARRY_CONTACT_ADDRESS1   0x02010e
    -#define BARRY_CONTACT_ADDRESS2   0x02010f
    -#define BARRY_CONTACT_ADDRESS3   0x020110
    -#define BARRY_CONTACT_CITY   0x020111
    -#define BARRY_CONTACT_PROVINCE   0x020112
    -#define BARRY_CONTACT_POSTALCODE   0x020113
    -#define BARRY_CONTACT_COUNTRY   0x020114
    -#define BARRY_CONTACT_TITLE   0x020115
    -#define BARRY_CONTACT_PUBLICKEY   0x020116
    -#define BARRY_CONTACT_NOTES   0x020117
    -#define BARRY_MESSAGE_FROM_NAME   0x020201
    -#define BARRY_MESSAGE_FROM_EMAIL   0x020202
    -#define BARRY_MESSAGE_TO_NAME   0x020203
    -#define BARRY_MESSAGE_TO_EMAIL   0x020204
    -#define BARRY_MESSAGE_CC_NAME   0x020205
    -#define BARRY_MESSAGE_CC_EMAIL   0x020206
    -#define BARRY_MESSAGE_SUBJECT   0x020207
    -#define BARRY_MESSAGE_BODY   0x020208
    -#define BARRY_CALENDAR_ALLDAYEVENT   0x010301
    -#define BARRY_CALENDAR_SUBJECT   0x020302
    -#define BARRY_CALENDAR_NOTES   0x020303
    -#define BARRY_CALENDAR_LOCATION   0x020304
    -#define BARRY_CALENDAR_NOTIFICATIONTIME   0x030305
    -#define BARRY_CALENDAR_STARTTIME   0x030306
    -#define BARRY_CALENDAR_ENDTIME   0x030307
    -#define BARRY_CALENDAR_INTERVAL   0x010308
    -#define BARRY_CALENDAR_RECURRINGENDTIME   0x030309
    -#define BARRY_CALENDAR_PERPETUAL   0x01030a
    -#define BARRY_CALENDAR_TIMEZONE   0x01030b
    -#define BARRY_SERVICEBOOK_RECORDID   0x010401
    -#define BARRY_SERVICEBOOK_NAME   0x020402
    -#define BARRY_SERVICEBOOK_HIDDENNAME   0x020403
    -#define BARRY_SERVICEBOOK_DESCRIPTION   0x020404
    -#define BARRY_SERVICEBOOK_DSID   0x020405
    -#define BARRY_SERVICEBOOK_BESDOMAIN   0x020406
    -#define BARRY_SERVICEBOOK_UNIQUEID   0x020407
    -#define BARRY_SERVICEBOOK_CONTENTID   0x020408
    -#define BARRY_SERVICEBOOK_CONFIG_FORMAT   0x010409

    Typedefs

    -typedef void * probe_handle_t
    -typedef void * con_handle_t
    -typedef void * state_table_handle_t
    -typedef void * record_handle_t
    -typedef void(*) process_record_callback_t (int record_type, record_handle_t filled_record)
    -typedef void(*) fill_record_callback_t (int record_type, record_handle_t empty_record)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/cbarry_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/cbarry_8h-source.html --- barry-0.14/doc/www/doxygen/html/cbarry_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/cbarry_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,248 +0,0 @@ - - -Barry: cbarry.h Source File - - - - - - - -

    cbarry.h

    Go to the documentation of this file.
    00001 /**
    -00002  * \file        cbarry.h
    -00003  *              Main header file for Barry C API - incomplete
    -00004  */
    -00005 
    -00006 /*
    -00007     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_CBARRY_H__
    -00023 #define __BARRY_CBARRY_H__
    -00024 
    -00025 /*
    -00026  * Supporting C headers
    -00027  */
    -00028 #include "dll.h"
    -00029 #include <stdint.h>
    -00030 #include <time.h>
    -00031 
    -00032 #ifdef __cplusplus
    -00033 extern "C" {
    -00034 #endif
    -00035 
    -00036 /*
    -00037  * Barry C API
    -00038  *
    -00039  * All functions that can fail will either return a handle, which can
    -00040  * be compared to NULL, or return int, which will == -1 on error.
    -00041  *
    -00042  * Functions that return a "count" can also fail, but rarely (such as
    -00043  * if you pass in a bad handle).
    -00044  */
    -00045 
    -00046 /* Handle types */
    -00047 typedef void* probe_handle_t;
    -00048 typedef void* con_handle_t;
    -00049 typedef void* state_table_handle_t;
    -00050 typedef void* record_handle_t;
    -00051 typedef void (*process_record_callback_t)(int record_type,
    -00052         record_handle_t filled_record);
    -00053 typedef void (*fill_record_callback_t)(int record_type,
    -00054         record_handle_t empty_record);
    -00055 
    -00056 /* Record type codes */
    -00057 #define BARRY_RECORD_CONTACT            1
    -00058 #define BARRY_RECORD_MESSAGE            2
    -00059 #define BARRY_RECORD_CALENDAR           3
    -00060 #define BARRY_RECORD_SERVICEBOOK        4
    -00061 
    -00062 /* Record field type codes */
    -00063 #define BARRY_FIELDTYPE_NUMBER          1       /* uint32_t */
    -00064 #define BARRY_FIELDTYPE_STRING          2       /* null terminated or raw str */
    -00065 #define BARRY_FIELDTYPE_TIME            3       /* time_t */
    -00066 
    -00067 #define IS_NUMBER(fieldcode)    (((fieldcode & 0xff0000) == 0x010000)
    -00068 #define IS_STRING(fieldcode)    (((fieldcode & 0xff0000) == 0x020000)
    -00069 #define IS_TIME(fieldcode)      (((fieldcode & 0xff0000) == 0x030000)
    -00070 
    -00071 /* Contact record field codes */
    -00072 #define BARRY_CONTACT_RECORDID          0x010101        /* uint32_t */
    -00073 #define BARRY_CONTACT_EMAIL             0x020102        /* strings below... */
    -00074 #define BARRY_CONTACT_PHONE             0x020103
    -00075 #define BARRY_CONTACT_FAX               0x020104
    -00076 #define BARRY_CONTACT_WORKPHONE         0x020105
    -00077 #define BARRY_CONTACT_HOMEPHONE         0x020106
    -00078 #define BARRY_CONTACT_MOBILEPHONE       0x020107
    -00079 #define BARRY_CONTACT_PAGER             0x020108
    -00080 #define BARRY_CONTACT_PIN               0x020109
    -00081 #define BARRY_CONTACT_FIRSTNAME         0x02010a
    -00082 #define BARRY_CONTACT_LASTNAME          0x02010b
    -00083 #define BARRY_CONTACT_COMPANY           0x02010c
    -00084 #define BARRY_CONTACT_DEFAULTCOMMMETHOD 0x02010d
    -00085 #define BARRY_CONTACT_ADDRESS1          0x02010e
    -00086 #define BARRY_CONTACT_ADDRESS2          0x02010f
    -00087 #define BARRY_CONTACT_ADDRESS3          0x020110
    -00088 #define BARRY_CONTACT_CITY              0x020111
    -00089 #define BARRY_CONTACT_PROVINCE          0x020112
    -00090 #define BARRY_CONTACT_POSTALCODE        0x020113
    -00091 #define BARRY_CONTACT_COUNTRY           0x020114
    -00092 #define BARRY_CONTACT_TITLE             0x020115
    -00093 #define BARRY_CONTACT_PUBLICKEY         0x020116
    -00094 #define BARRY_CONTACT_NOTES             0x020117
    -00095 
    -00096 /* Message record field codes */
    -00097 #define BARRY_MESSAGE_FROM_NAME         0x020201        /* all strings */
    -00098 #define BARRY_MESSAGE_FROM_EMAIL        0x020202
    -00099 #define BARRY_MESSAGE_TO_NAME           0x020203
    -00100 #define BARRY_MESSAGE_TO_EMAIL          0x020204
    -00101 #define BARRY_MESSAGE_CC_NAME           0x020205
    -00102 #define BARRY_MESSAGE_CC_EMAIL          0x020206
    -00103 #define BARRY_MESSAGE_SUBJECT           0x020207
    -00104 #define BARRY_MESSAGE_BODY              0x020208        /* string or raw */
    -00105 
    -00106 /* Calendar record field codes */
    -00107 #define BARRY_CALENDAR_ALLDAYEVENT      0x010301        /* true/false number */
    -00108 #define BARRY_CALENDAR_SUBJECT          0x020302        /* strings... */
    -00109 #define BARRY_CALENDAR_NOTES            0x020303
    -00110 #define BARRY_CALENDAR_LOCATION         0x020304
    -00111 #define BARRY_CALENDAR_NOTIFICATIONTIME 0x030305        /* time_t... */
    -00112 #define BARRY_CALENDAR_STARTTIME        0x030306
    -00113 #define BARRY_CALENDAR_ENDTIME          0x030307
    -00114 #define BARRY_CALENDAR_INTERVAL         0x010308        /* number */
    -00115 #define BARRY_CALENDAR_RECURRINGENDTIME 0x030309        /* time_t */
    -00116 #define BARRY_CALENDAR_PERPETUAL        0x01030a        /* true/false number */
    -00117 #define BARRY_CALENDAR_TIMEZONE         0x01030b        /* numeric code */
    -00118 
    -00119 /* Service Book record field codes */
    -00120 #define BARRY_SERVICEBOOK_RECORDID      0x010401        /* number */
    -00121 #define BARRY_SERVICEBOOK_NAME          0x020402        /* strings... */
    -00122 #define BARRY_SERVICEBOOK_HIDDENNAME    0x020403
    -00123 #define BARRY_SERVICEBOOK_DESCRIPTION   0x020404
    -00124 #define BARRY_SERVICEBOOK_DSID          0x020405
    -00125 #define BARRY_SERVICEBOOK_BESDOMAIN     0x020406
    -00126 #define BARRY_SERVICEBOOK_UNIQUEID      0x020407
    -00127 #define BARRY_SERVICEBOOK_CONTENTID     0x020408
    -00128 #define BARRY_SERVICEBOOK_CONFIG_FORMAT 0x010409        /* number */
    -00129 
    -00130 /* Initialization */
    -00131 BXEXPORT void barry_init(int data_dump_mode);
    -00132 BXEXPORT const char *barry_version(int *major, int *minor);
    -00133 
    -00134 /* Error string retrieval */
    -00135 BXEXPORT const char *barry_get_last_error();
    -00136 
    -00137 /* Probe API */
    -00138 BXEXPORT probe_handle_t barry_probe(void);
    -00139 BXEXPORT void barry_probe_close(probe_handle_t handle);
    -00140 BXEXPORT int barry_probe_count(probe_handle_t handle);
    -00141 BXEXPORT int barry_probe_find_active(probe_handle_t handle, uint32_t pin);
    -00142 BXEXPORT void barry_probe_result(probe_handle_t handle, int index,
    -00143         struct ProbeResult *result);
    -00144 
    -00145 /* Controller API */
    -00146 BXEXPORT con_handle_t barry_con_open(struct ProbeResult *result);
    -00147 BXEXPORT void barry_con_close(con_handle_t handle);
    -00148 BXEXPORT int barry_con_mode(con_handle_t handle, int mode);
    -00149 BXEXPORT int barry_con_get_dbid(con_handle_t handle, const char *dbname);
    -00150 BXEXPORT int barry_con_get_db_count(con_handle_t handle);
    -00151 BXEXPORT int barry_con_get_db_info(con_handle_t handle, int index,
    -00152         unsigned int *number, unsigned int *record_count,
    -00153         char *name, int name_buf_size);
    -00154 BXEXPORT int barry_con_add_record(con_handle_t handle, unsigned int dbid,
    -00155         record_handle_t rec);
    -00156 BXEXPORT int barry_con_get_record(con_handle_t handle, unsigned int dbid,
    -00157         unsigned int state_table_index, record_handle_t *rec);
    -00158 BXEXPORT int barry_con_set_record(con_handle_t handle, unsigned int dbid,
    -00159         unsigned int state_table_index, record_handle_t rec);
    -00160 BXEXPORT int barry_con_clear_dirty(con_handle_t handle, unsigned int dbid,
    -00161         unsigned int state_table_index);
    -00162 BXEXPORT int barry_con_delete_record(con_handle_t handle, unsigned int dbid,
    -00163         unsigned int state_table_index);
    -00164 BXEXPORT int barry_con_load_database(con_handle_t handle, unsigned int dbid,
    -00165         process_record_callback_t callback);
    -00166 BXEXPORT int barry_con_save_database(con_handle_t handle, unsigned int dbid,
    -00167         fill_record_callback_t callback);
    -00168 
    -00169 /* State table API */
    -00170 BXEXPORT state_table_handle_t barry_get_state_table(con_handle_t handle,
    -00171         unsigned int dbid);
    -00172 BXEXPORT void barry_free_state_table(state_table_handle_t handle);
    -00173 BXEXPORT int barry_make_new_record_id(state_table_handle_t handle);
    -00174 BXEXPORT int barry_get_state_count(state_handle_t handle);
    -00175 BXEXPORT int barry_get_state(state_table_handle_t handle, unsigned int index,
    -00176         uint32_t *record_id, int *dirty_flag);
    -00177         /* note: not every index from 0 to "state_count" is guaranteed to
    -00178            exist... check the return value */
    -00179 BXEXPORT int barry_get_state_by_record_id(state_table_handle_t handle, unsigned int rec,
    -00180         unsigned int *index, int *dirty_flag);
    -00181 
    -00182 /* Record API */
    -00183 BXEXPORT record_handle_t barry_create_record(int record_type);
    -00184 BXEXPORT void barry_free_record(record_handle_t handle);
    -00185 BXEXPORT uint32_t barry_rec_get_num(record_handle_t handle, int field_type);
    -00186 BXEXPORT int barry_rec_set_num(record_handle_t handle, int field_type, uint32_t val);
    -00187 BXEXPORT const char *barry_rec_get_str(record_handle_t handle, int field_type);
    -00188 BXEXPORT int barry_rec_set_str(record_handle_t handle, int field_type, const char *str);
    -00189 BXEXPORT const char *barry_rec_get_raw(record_handle_t handle, int field_type,
    -00190         int *raw_size);
    -00191 BXEXPORT int barry_rec_set_raw(record_handle_t handle, int field_type,
    -00192         const char *buf, int size);
    -00193 BXEXPORT time_t barry_rec_get_time(record_handle_t handle, int field_type);
    -00194 BXEXPORT int barry_rec_set_time(record_handle_t handle, int field_type, time_t t);
    -00195 
    -00196 /* Calendar record special API */
    -00197 BXEXPORT int barry_calendar_set_daily(record_handle_t handle);
    -00198 BXEXPORT int barry_calendar_set_monthly_by_date(record_handle_t handle,
    -00199         int day_of_month);
    -00200 BXEXPORT int barry_calendar_set_monthly_by_day(record_handle_t handle,
    -00201         int day_of_week, int week_of_month);
    -00202 BXEXPORT int barry_calendar_set_yearly_by_date(record_handle_t handle,
    -00203         int day_of_month, int month_of_year);
    -00204 BXEXPORT int barry_calendar_set_yearly_by_day(record_handle_t handle,
    -00205         int day_of_week, int week_of_month, int month_of_year);
    -00206 BXEXPORT int barry_calendar_set_weekly(record_handle_t handle, int weekday_bits);
    -00207 BXEXPORT int barry_calendar_get_fixme_need_read_access_to_this
    -00208 
    -00209 /* Time zone API */
    -00210 BXEXPORT const TimeZone* barry_get_time_zone_table();
    -00211 BXEXPORT const TimeZone* barry_get_time_zone(unsigned short code);
    -00212 BXEXPORT unsigned short barry_get_time_zone_code(signed short hour_offset,
    -00213         signed short min_offset);       /* returns TIME_ZONE_CODE_ERR on error*/
    -00214 
    -00215 #ifdef __cplusplus
    -00216 }
    -00217 #endif
    -00218 
    -00219 #endif
    -00220 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadData.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadData.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: Barry::BadData Class Reference - - - - - - - -

    Barry::BadData Class Reference
    - -[Exceptions] -

    #include <error.h> -

    -

    Inheritance diagram for Barry::BadData: -

    - -Barry::Error - -List of all members.

    Detailed Description

    -Thrown by record classes if their data is invalid and cannot be uploaded to the Blackberry. -

    - -

    -Definition at line 82 of file error.h. - - - - -

    Public Member Functions

    BadData (const std::string &str)
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadData-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadData-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::BadData Member List

    This is the complete list of members for Barry::BadData, including all inherited members.

    - - -
    BadData(const std::string &str)Barry::BadData [inline]
    Error(const std::string &str)Barry::Error [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1BadData.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadData.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadPassword.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadPassword.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadPassword.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadPassword.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ - - -Barry: Barry::BadPassword Class Reference - - - - - - - -

    Barry::BadPassword Class Reference
    - -[Exceptions] -

    #include <error.h> -

    -

    Inheritance diagram for Barry::BadPassword: -

    - -Barry::Error - -List of all members.

    Detailed Description

    -A bad or unknown password when talking to the device. -

    -Can be thrown in the following instances:

    -

      -
    • no password provided and the device requests one
    • device rejected the available password
    • too few remaining tries left... Barry will refuse to keep trying passwords if there are fewer than BARRY_MIN_PASSWORD_TRIES tries remaining. In this case, out_of_tries() will return true.
    - -

    - -

    -Definition at line 60 of file error.h. - - - - - - - - -

    Public Member Functions

    BadPassword (const std::string &str, int remaining_tries, bool out_of_tries)
    -int remaining_tries () const
    -bool out_of_tries () const
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadPassword-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadPassword-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadPassword-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadPassword-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::BadPassword Member List

    This is the complete list of members for Barry::BadPassword, including all inherited members.

    - - - - -
    BadPassword(const std::string &str, int remaining_tries, bool out_of_tries)Barry::BadPassword [inline]
    Error(const std::string &str)Barry::Error [inline]
    out_of_tries() constBarry::BadPassword [inline]
    remaining_tries() constBarry::BadPassword [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1BadPassword.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadPassword.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadSize.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadSize.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadSize.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadSize.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ - - -Barry: Barry::BadSize Class Reference - - - - - - - -

    Barry::BadSize Class Reference
    - -[Exceptions] -

    #include <error.h> -

    -

    Inheritance diagram for Barry::BadSize: -

    - -Barry::Error - -List of all members.

    Detailed Description

    -Unexpected packet size, or not enough data. -

    - -

    -Definition at line 95 of file error.h. - - - - - - - - - - -

    Public Member Functions

    BadSize (unsigned int packet_size, unsigned int data_buf_size, unsigned int required_size)
    -unsigned int packet_size () const
    -unsigned int data_buf_size () const
    -unsigned int required_size () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1BadSize-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadSize-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1BadSize-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadSize-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::BadSize Member List

    This is the complete list of members for Barry::BadSize, including all inherited members.

    - - - - - -
    BadSize(unsigned int packet_size, unsigned int data_buf_size, unsigned int required_size)Barry::BadSize [inline]
    data_buf_size() constBarry::BadSize [inline]
    Error(const std::string &str)Barry::Error [inline]
    packet_size() constBarry::BadSize [inline]
    required_size() constBarry::BadSize [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1BadSize.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1BadSize.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Builder.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Builder.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Builder.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Builder.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ - - -Barry: Barry::Builder Class Reference - - - - - - - -

    Barry::Builder Class Reference

    #include <builder.h> -

    -

    Inheritance diagram for Barry::Builder: -

    - -Barry::RecordBuilder< RecordT, StorageT > - -List of all members.

    Detailed Description

    -Base class for the builder functor hierarchy. -

    -This defines the API used by the Controller and Packet classes for building a raw device record to write to the device. -

    - -

    -Definition at line 37 of file builder.h. - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Builder ()
    -virtual ~Builder ()
    virtual bool Retrieve (unsigned int databaseId)=0
     Called first in the sequence, to allow the application to load the needed data from memory, disk, etc.
    virtual uint8_t GetRecType () const=0
     Called to retrive the unique ID for this record.
    virtual void BuildHeader (Data &data, size_t &offset)=0
     Called before BuildFields() in order to build the header for this record.
    virtual void BuildFields (Data &data, size_t &offset)=0
     Called to build the record field data.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    virtual bool Barry::Builder::Retrieve (unsigned int  databaseId  )  [pure virtual]
    -
    -
    - -

    -Called first in the sequence, to allow the application to load the needed data from memory, disk, etc. -

    -If successful, return true. If at the end of the series, return false. -

    -Implemented in Barry::RecordBuilder< RecordT, StorageT >. -

    -Referenced by Barry::DBPacket::SetRecord(), and Barry::DBPacket::SetRecordByIndex(). -

    -

    - -

    -
    - - - - - - - - -
    virtual uint8_t Barry::Builder::GetRecType (  )  const [pure virtual]
    -
    -
    - -

    -Called to retrive the unique ID for this record. -

    - -

    -Implemented in Barry::RecordBuilder< RecordT, StorageT >. -

    -Referenced by Barry::DBPacket::SetRecord(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::Builder::BuildHeader (Data data,
    size_t &  offset 
    ) [pure virtual]
    -
    -
    - -

    -Called before BuildFields() in order to build the header for this record. -

    -Store the raw data in data, at the offset given in offset. When finished, update offset to point to the next spot to put new data. -

    -Implemented in Barry::RecordBuilder< RecordT, StorageT >. -

    -Referenced by Barry::DBPacket::SetRecord(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::Builder::BuildFields (Data data,
    size_t &  offset 
    ) [pure virtual]
    -
    -
    - -

    -Called to build the record field data. -

    -Store the raw data in data, using offset to know where to write. Be sure to update offset, and be sure to adjust the size of the data packet (possibly with Data::ReleaseBuffer()). -

    -Implemented in Barry::RecordBuilder< RecordT, StorageT >. -

    -Referenced by Barry::DBPacket::SetRecord(), and Barry::DBPacket::SetRecordByIndex(). -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Builder-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Builder-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Builder-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Builder-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Builder Member List

    This is the complete list of members for Barry::Builder, including all inherited members.

    - - - - - - -
    Builder()Barry::Builder [inline]
    BuildFields(Data &data, size_t &offset)=0Barry::Builder [pure virtual]
    BuildHeader(Data &data, size_t &offset)=0Barry::Builder [pure virtual]
    GetRecType() const=0Barry::Builder [pure virtual]
    Retrieve(unsigned int databaseId)=0Barry::Builder [pure virtual]
    ~Builder()Barry::Builder [inline, virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Builder.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Builder.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Calendar.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Calendar.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Calendar.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Calendar.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,276 +0,0 @@ - - -Barry: Barry::Calendar Class Reference - - - - - - - -

    Barry::Calendar Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 45 of file r_calendar.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  FreeBusyFlagType
     Free Busy Flag. More...
    enum  ClassFlagType
     Class Flag. More...
    enum  RecurringCodeType
     Recurring data. More...
    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    -void ParseRecurrenceData (const void *data)
    -void BuildRecurrenceData (void *data) const
    Calendar ()
    ~Calendar ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    void BuildFields (Data &data, size_t &offset) const
     Build fields part of record.
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Calendar &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -bool AllDayEvent
    -std::string Subject
    -std::string Notes
    -std::string Location
    -time_t NotificationTime
    -time_t StartTime
    -time_t EndTime
    -FreeBusyFlagType FreeBusyFlag
    -ClassFlagType ClassFlag
    -bool Recurring
    -RecurringCodeType RecurringType
    -unsigned short Interval
    -time_t RecurringEndTime
    -bool Perpetual
    -unsigned short TimeZoneCode
    -bool TimeZoneValid
    -unsigned short DayOfWeek
    -unsigned short WeekOfMonth
    -unsigned short DayOfMonth
    -unsigned short MonthOfYear
    -unsigned char WeekDays
    -UnknownsType Unknowns
    -


    Member Enumeration Documentation

    - -
    - -
    - -

    -Free Busy Flag. -

    -This lists the available settings found in the device. This list is based on information from MS Outlook 2007 (Free ==0 and Busy == 2) This is FBTYPE in RFC2445 and is defined as FREE, BUSY, BUSY-UNAVAILABLE and BUSY-TENTATIVE -

    -Definition at line 71 of file r_calendar.h. -

    -

    - -

    - -
    - -

    -Class Flag. -

    -This is also called classification in Evolution and it is the equivilant of public or private in outlook Private is set to 0x2 in Outlook RFC2445 CLASS is PUBLIC, PRIVATE, CONFIDENTIAL -

    -Definition at line 87 of file r_calendar.h. -

    -

    - -

    - -
    - -

    -Recurring data. -

    -Note: interval can be used on all of these recurring types to make it happen "every other time" or more, etc. -

    -Definition at line 101 of file r_calendar.h. -

    -

    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Calendar::BuildFields (Data data,
    size_t &  offset 
    ) const
    -
    - -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Calendar-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Calendar-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Calendar-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Calendar-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Calendar Member List

    This is the complete list of members for Barry::Calendar, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AllDayEventBarry::Calendar
    BuildFields(Data &data, size_t &offset) constBarry::Calendar
    BuildHeader(Data &data, size_t &offset) constBarry::Calendar
    BuildRecurrenceData(void *data) constBarry::Calendar
    Calendar()Barry::Calendar
    ClassFlagBarry::Calendar
    ClassFlagType enum nameBarry::Calendar
    Clear()Barry::Calendar
    DayOfMonthBarry::Calendar
    DayOfWeekBarry::Calendar
    Dump(std::ostream &os) constBarry::Calendar
    EndTimeBarry::Calendar
    FreeBusyFlagBarry::Calendar
    FreeBusyFlagType enum nameBarry::Calendar
    GetDBName()Barry::Calendar [inline, static]
    GetDefaultRecType()Barry::Calendar [inline, static]
    GetRecType() constBarry::Calendar [inline]
    GetUniqueId() constBarry::Calendar [inline]
    IntervalBarry::Calendar
    LocationBarry::Calendar
    MonthOfYearBarry::Calendar
    NotesBarry::Calendar
    NotificationTimeBarry::Calendar
    operator<(const Calendar &other) constBarry::Calendar [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Calendar
    ParseFields(const Data &data, size_t &offset)Barry::Calendar
    ParseHeader(const Data &data, size_t &offset)Barry::Calendar
    ParseRecurrenceData(const void *data)Barry::Calendar
    PerpetualBarry::Calendar
    RecordIdBarry::Calendar
    RecTypeBarry::Calendar
    RecurringBarry::Calendar
    RecurringCodeType enum nameBarry::Calendar
    RecurringEndTimeBarry::Calendar
    RecurringTypeBarry::Calendar
    SetIds(uint8_t Type, uint32_t Id)Barry::Calendar [inline]
    StartTimeBarry::Calendar
    SubjectBarry::Calendar
    TimeZoneCodeBarry::Calendar
    TimeZoneValidBarry::Calendar
    UnknownsBarry::Calendar
    UnknownsType typedefBarry::Calendar
    WeekDaysBarry::Calendar
    WeekOfMonthBarry::Calendar
    ~Calendar()Barry::Calendar


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1CommandTable.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1CommandTable.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1CommandTable.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1CommandTable.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - -Barry: Barry::CommandTable Class Reference - - - - - - - -

    Barry::CommandTable Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 55 of file record.h. - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef CommandTableCommand Command
    -typedef std::vector< CommandCommandArrayType

    Public Member Functions

    CommandTable ()
    ~CommandTable ()
    -void Parse (const Data &data, size_t offset)
    -void Clear ()
    -unsigned int GetCommand (const std::string &name) const
    -void Dump (std::ostream &os) const

    Public Attributes

    -CommandArrayType Commands
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1CommandTable-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1CommandTable-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1CommandTable-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1CommandTable-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::CommandTable Member List

    This is the complete list of members for Barry::CommandTable, including all inherited members.

    - - - - - - - - - -
    Clear()Barry::CommandTable
    Command typedefBarry::CommandTable
    CommandArrayType typedefBarry::CommandTable
    CommandsBarry::CommandTable
    CommandTable()Barry::CommandTable
    Dump(std::ostream &os) constBarry::CommandTable
    GetCommand(const std::string &name) constBarry::CommandTable
    Parse(const Data &data, size_t offset)Barry::CommandTable
    ~CommandTable()Barry::CommandTable


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Contact.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Contact.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Contact.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Contact.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ - - -Barry: Barry::Contact Class Reference - - - - - - - -

    Barry::Contact Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 56 of file r_contact.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef Barry::CategoryList CategoryList
    -typedef ContactGroupLink GroupLink
    -typedef std::vector< GroupLinkGroupLinksType
    -typedef std::vector< UnknownFieldUnknownsType
    -typedef std::string EmailType
    -typedef std::vector< EmailTypeEmailList

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    Contact ()
    ~Contact ()
    -uint32_t GetID () const
    std::string GetFullName () const
     Helper function that returns a formatted full name.
    const std::string & GetEmail (unsigned int index=0) const
     Helper function that always returns a valid string.
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    void BuildFields (Data &data, size_t &offset) const
     Build fields part of record.
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Contact &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()
    -static void SplitName (const std::string &full, std::string &first, std::string &last)
    -static void CategoryStr2List (const std::string &str, Barry::CategoryList &list)
    -static void CategoryList2Str (const Barry::CategoryList &list, std::string &str)

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -EmailList EmailAddresses
    -std::string Phone
    -std::string Fax
    -std::string WorkPhone
    -std::string HomePhone
    -std::string MobilePhone
    -std::string Pager
    -std::string PIN
    -std::string Radio
    -std::string WorkPhone2
    -std::string HomePhone2
    -std::string OtherPhone
    -std::string FirstName
    -std::string LastName
    -std::string Company
    -std::string DefaultCommunicationsMethod
    -std::string JobTitle
    -std::string PublicKey
    -std::string URL
    -std::string Prefix
    -std::string Notes
    -std::string UserDefined1
    -std::string UserDefined2
    -std::string UserDefined3
    -std::string UserDefined4
    -std::string Image
    -Date Birthday
    -Date Anniversary
    -PostalAddress WorkAddress
    -PostalAddress HomeAddress
    -CategoryList Categories
    -GroupLinksType GroupLinks
    -UnknownsType Unknowns
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    std::string Barry::Contact::GetFullName (  )  const
    -
    -
    - -

    -Helper function that returns a formatted full name. -

    - -

    -Definition at line 412 of file r_contact.cc. -

    -References FirstName, and LastName. -

    -Referenced by BuildFields(), and Barry::ContactLdif::FullName(). -

    -

    - -

    -
    - - - - - - - - - -
    const std::string & Barry::Contact::GetEmail (unsigned int  index = 0  )  const
    -
    -
    - -

    -Helper function that always returns a valid string. -

    -The string may be empty if there is no address at the specified index. -

    -Definition at line 427 of file r_contact.cc. -

    -References EmailAddresses. -

    -Referenced by Barry::ContactLdif::Email(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Contact::BuildFields (Data data,
    size_t &  offset 
    ) const
    -
    - -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ContactLdif.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ContactLdif.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ContactLdif.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ContactLdif.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,399 +0,0 @@ - - -Barry: Barry::ContactLdif Class Reference - - - - - - - -

    Barry::ContactLdif Class Reference

    #include <ldif.h> -

    -List of all members.


    Detailed Description

    -Class for generating LDIF output based on a Barry::Contact record object. -

    -This class supports LDIF attribute mapping, and a heuristics mechanism for parsing LDIF fields that may not have consistent data.

    -To use this class, create an instance of it, then call DumpLdif(), passing the Contact record object to base the work on. Output will be written to the stream you provide. ReadLdif() goes in the other direction.

    -To override LDIF attribute mapping, call Map() or Unmap() as appropriate.

    -To get a list of supported Barry::Contact field names, call GetFieldNames(). This function returns a pointer to an array of ContactLdif::NameToFunc structures, ending with NameToFunc::name as null. You can cycle through the array with code like this:

    -

    -   	for( ContactLdif::NameToFunc *n = o.GetFieldNames(); n->name; n++ ) {
    -   		...
    -   	}
    -    

    -Note that all Get/Set functions used in attribute mapping are virtual, and can be overridden by a derived class. This includes the heuristics functions, which are called by DumpLdif(). -

    - -

    -Definition at line 64 of file ldif.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::string(ContactLdif::*) GetFunctionType (const Barry::Contact &) const
    -typedef void(ContactLdif::*) SetFunctionType (Barry::Contact &, const std::string &) const
    -typedef std::map< LdifAttribute,
    - AccessPair
    AccessMapType
    -typedef std::map< std::string,
    - std::string * > 
    HookMapType

    Public Member Functions

    ContactLdif (const std::string &baseDN)
    -virtual ~ContactLdif ()
    -const NameToFuncGetFieldNames () const
    -const NameToFuncGetField (const std::string &fieldname) const
    -std::string GetFieldReadName (GetFunctionType read) const
    -std::string GetFieldWriteName (SetFunctionType write) const
    -bool Map (const LdifAttribute &ldifname, const std::string &readField, const std::string &writeField)
    -void Map (const LdifAttribute &ldifname, GetFunctionType read, SetFunctionType write)
    -void Unmap (const LdifAttribute &ldifname)
    -void SetBaseDN (const std::string &baseDN)
    bool SetDNAttr (const LdifAttribute &name)
     Sets the LDIF attribute name to use when constructing the FQDN.
    -bool SetObjectClass (const LdifAttribute &name, const std::string &objectClass)
    -bool SetObjectOrder (const LdifAttribute &name, int order)
    -virtual std::string Email (const Barry::Contact &con) const
    -virtual std::string Phone (const Barry::Contact &con) const
    -virtual std::string Fax (const Barry::Contact &con) const
    -virtual std::string WorkPhone (const Barry::Contact &con) const
    -virtual std::string HomePhone (const Barry::Contact &con) const
    -virtual std::string MobilePhone (const Barry::Contact &con) const
    -virtual std::string Pager (const Barry::Contact &con) const
    -virtual std::string PIN (const Barry::Contact &con) const
    -virtual std::string FirstName (const Barry::Contact &con) const
    -virtual std::string LastName (const Barry::Contact &con) const
    -virtual std::string Company (const Barry::Contact &con) const
    -virtual std::string DefaultCommunicationsMethod (const Barry::Contact &con) const
    -virtual std::string Address1 (const Barry::Contact &con) const
    -virtual std::string Address2 (const Barry::Contact &con) const
    -virtual std::string Address3 (const Barry::Contact &con) const
    -virtual std::string City (const Barry::Contact &con) const
    -virtual std::string Province (const Barry::Contact &con) const
    -virtual std::string PostalCode (const Barry::Contact &con) const
    -virtual std::string Country (const Barry::Contact &con) const
    -virtual std::string JobTitle (const Barry::Contact &con) const
    -virtual std::string PublicKey (const Barry::Contact &con) const
    -virtual std::string Notes (const Barry::Contact &con) const
    -virtual std::string PostalAddress (const Barry::Contact &con) const
    -virtual std::string FullName (const Barry::Contact &con) const
    -virtual std::string FQDN (const Barry::Contact &con) const
    -virtual bool IsArrayFunc (GetFunctionType getf) const
    -void ClearArrayState () const
    -virtual void SetEmail (Barry::Contact &con, const std::string &val) const
    -virtual void SetPhone (Barry::Contact &con, const std::string &val) const
    -virtual void SetFax (Barry::Contact &con, const std::string &val) const
    -virtual void SetWorkPhone (Barry::Contact &con, const std::string &val) const
    -virtual void SetHomePhone (Barry::Contact &con, const std::string &val) const
    -virtual void SetMobilePhone (Barry::Contact &con, const std::string &val) const
    -virtual void SetPager (Barry::Contact &con, const std::string &val) const
    -virtual void SetPIN (Barry::Contact &con, const std::string &val) const
    -virtual void SetFirstName (Barry::Contact &con, const std::string &val) const
    -virtual void SetLastName (Barry::Contact &con, const std::string &val) const
    -virtual void SetCompany (Barry::Contact &con, const std::string &val) const
    -virtual void SetDefaultCommunicationsMethod (Barry::Contact &con, const std::string &val) const
    -virtual void SetAddress1 (Barry::Contact &con, const std::string &val) const
    -virtual void SetAddress2 (Barry::Contact &con, const std::string &val) const
    -virtual void SetAddress3 (Barry::Contact &con, const std::string &val) const
    -virtual void SetCity (Barry::Contact &con, const std::string &val) const
    -virtual void SetProvince (Barry::Contact &con, const std::string &val) const
    -virtual void SetPostalCode (Barry::Contact &con, const std::string &val) const
    -virtual void SetCountry (Barry::Contact &con, const std::string &val) const
    -virtual void SetJobTitle (Barry::Contact &con, const std::string &val) const
    -virtual void SetPublicKey (Barry::Contact &con, const std::string &val) const
    -virtual void SetNotes (Barry::Contact &con, const std::string &val) const
    -virtual void SetPostalAddress (Barry::Contact &con, const std::string &val) const
    -virtual void SetFullName (Barry::Contact &con, const std::string &val) const
    -virtual void SetFQDN (Barry::Contact &con, const std::string &val) const
    -virtual void ClearHeuristics ()
    -virtual bool RunHeuristics (Barry::Contact &con)
    void DumpLdif (std::ostream &os, const Barry::Contact &contact) const
     Output contact data to os in LDAP LDIF format.
    -bool ReadLdif (std::istream &is, Barry::Contact &contact)
    -void DumpMap (std::ostream &os) const

    Static Public Member Functions

    -static std::string MakeLdifData (const std::string &str)
    -static bool NeedsEncoding (const std::string &str)

    Protected Member Functions

    -void DoWrite (Barry::Contact &con, const std::string &attr, const std::string &data)
    -void Hook (const std::string &ldifname, std::string *var)

    Protected Attributes

    -AccessMapType m_map
    -std::string m_baseDN
    -HookMapType m_hookMap
    -LdifAttribute m_dnAttr
    -unsigned int m_emailIndex
    -std::string m_cn
    -std::string m_displayName
    -std::string m_sn
    -std::string m_givenName

    Static Protected Attributes

    -static const NameToFunc FieldMap []

    Classes

    struct  AccessPair
    struct  LdifAttribute
    struct  NameToFunc
     Used to create a List of supported Barry field names, including calculated names, such as full postal address. More...
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    bool Barry::ContactLdif::SetDNAttr (const LdifAttribute name  ) 
    -
    -
    - -

    -Sets the LDIF attribute name to use when constructing the FQDN. -

    -The FQDN field will take this name, and combine it with the baseDN from the constructor to produce a FQDN for the record. -

    -Definition at line 240 of file ldif.cc. -

    -References m_dnAttr, and m_map. -

    -Referenced by ContactLdif(), and main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::ContactLdif::DumpLdif (std::ostream &  os,
    const Barry::Contact contact 
    ) const
    -
    -
    - -

    -Output contact data to os in LDAP LDIF format. -

    - -

    -Definition at line 616 of file ldif.cc. -

    -References ClearArrayState(), FirstName(), FullName(), Barry::Contact::GetID(), IsArrayFunc(), LastName(), m_map, and MakeLdifData(). -

    -Referenced by Contact2Ldif::operator()(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ContactLdif-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ContactLdif-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ContactLdif-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ContactLdif-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ContactLdif Member List

    This is the complete list of members for Barry::ContactLdif, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AccessMapType typedefBarry::ContactLdif
    Address1(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Address2(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Address3(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    City(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    ClearArrayState() constBarry::ContactLdif
    ClearHeuristics()Barry::ContactLdif [virtual]
    Company(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    ContactLdif(const std::string &baseDN)Barry::ContactLdif [explicit]
    Country(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    DefaultCommunicationsMethod(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    DoWrite(Barry::Contact &con, const std::string &attr, const std::string &data)Barry::ContactLdif [protected]
    DumpLdif(std::ostream &os, const Barry::Contact &contact) constBarry::ContactLdif
    DumpMap(std::ostream &os) constBarry::ContactLdif
    Email(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Fax(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    FieldMapBarry::ContactLdif [protected, static]
    FirstName(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    FQDN(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    FullName(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    GetField(const std::string &fieldname) constBarry::ContactLdif
    GetFieldNames() constBarry::ContactLdif [inline]
    GetFieldReadName(GetFunctionType read) const Barry::ContactLdif
    GetFieldWriteName(SetFunctionType write) constBarry::ContactLdif
    GetFunctionType typedefBarry::ContactLdif
    HomePhone(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Hook(const std::string &ldifname, std::string *var)Barry::ContactLdif [protected]
    HookMapType typedefBarry::ContactLdif
    IsArrayFunc(GetFunctionType getf) const Barry::ContactLdif [virtual]
    JobTitle(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    LastName(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    m_baseDNBarry::ContactLdif [protected]
    m_cnBarry::ContactLdif [protected]
    m_displayNameBarry::ContactLdif [protected]
    m_dnAttrBarry::ContactLdif [protected]
    m_emailIndexBarry::ContactLdif [mutable, protected]
    m_givenNameBarry::ContactLdif [protected]
    m_hookMapBarry::ContactLdif [protected]
    m_mapBarry::ContactLdif [protected]
    m_snBarry::ContactLdif [protected]
    MakeLdifData(const std::string &str)Barry::ContactLdif [static]
    Map(const LdifAttribute &ldifname, const std::string &readField, const std::string &writeField)Barry::ContactLdif
    Map(const LdifAttribute &ldifname, GetFunctionType read, SetFunctionType write)Barry::ContactLdif
    MobilePhone(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    NeedsEncoding(const std::string &str)Barry::ContactLdif [static]
    Notes(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Pager(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Phone(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    PIN(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    PostalAddress(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    PostalCode(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    Province(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    PublicKey(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    ReadLdif(std::istream &is, Barry::Contact &contact)Barry::ContactLdif
    RunHeuristics(Barry::Contact &con)Barry::ContactLdif [virtual]
    SetAddress1(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetAddress2(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetAddress3(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetBaseDN(const std::string &baseDN)Barry::ContactLdif [inline]
    SetCity(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetCompany(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetCountry(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetDefaultCommunicationsMethod(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetDNAttr(const LdifAttribute &name)Barry::ContactLdif
    SetEmail(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetFax(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetFirstName(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetFQDN(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetFullName(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetFunctionType typedefBarry::ContactLdif
    SetHomePhone(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetJobTitle(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetLastName(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetMobilePhone(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetNotes(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetObjectClass(const LdifAttribute &name, const std::string &objectClass)Barry::ContactLdif
    SetObjectOrder(const LdifAttribute &name, int order)Barry::ContactLdif
    SetPager(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetPhone(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetPIN(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetPostalAddress(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetPostalCode(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetProvince(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetPublicKey(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    SetWorkPhone(Barry::Contact &con, const std::string &val) const Barry::ContactLdif [virtual]
    Unmap(const LdifAttribute &ldifname)Barry::ContactLdif
    WorkPhone(const Barry::Contact &con) constBarry::ContactLdif [virtual]
    ~ContactLdif()Barry::ContactLdif [virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Contact-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Contact-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Contact-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Contact-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Contact Member List

    This is the complete list of members for Barry::Contact, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AnniversaryBarry::Contact
    BirthdayBarry::Contact
    BuildFields(Data &data, size_t &offset) constBarry::Contact
    BuildHeader(Data &data, size_t &offset) constBarry::Contact
    CategoriesBarry::Contact
    CategoryList typedefBarry::Contact
    CategoryList2Str(const Barry::CategoryList &list, std::string &str)Barry::Contact [static]
    CategoryStr2List(const std::string &str, Barry::CategoryList &list)Barry::Contact [static]
    Clear()Barry::Contact
    CompanyBarry::Contact
    Contact()Barry::Contact
    DefaultCommunicationsMethodBarry::Contact
    Dump(std::ostream &os) constBarry::Contact
    EmailAddressesBarry::Contact
    EmailList typedefBarry::Contact
    EmailType typedefBarry::Contact
    FaxBarry::Contact
    FirstNameBarry::Contact
    GetDBName()Barry::Contact [inline, static]
    GetDefaultRecType()Barry::Contact [inline, static]
    GetEmail(unsigned int index=0) constBarry::Contact
    GetFullName() constBarry::Contact
    GetID() constBarry::Contact [inline]
    GetRecType() constBarry::Contact [inline]
    GetUniqueId() constBarry::Contact [inline]
    GroupLink typedefBarry::Contact
    GroupLinksBarry::Contact
    GroupLinksType typedefBarry::Contact
    HomeAddressBarry::Contact
    HomePhoneBarry::Contact
    HomePhone2Barry::Contact
    ImageBarry::Contact
    JobTitleBarry::Contact
    LastNameBarry::Contact
    MobilePhoneBarry::Contact
    NotesBarry::Contact
    operator<(const Contact &other) const Barry::Contact [inline]
    OtherPhoneBarry::Contact
    PagerBarry::Contact
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Contact
    ParseFields(const Data &data, size_t &offset)Barry::Contact
    ParseHeader(const Data &data, size_t &offset)Barry::Contact
    PhoneBarry::Contact
    PINBarry::Contact
    PrefixBarry::Contact
    PublicKeyBarry::Contact
    RadioBarry::Contact
    RecordIdBarry::Contact
    RecTypeBarry::Contact
    SetIds(uint8_t Type, uint32_t Id)Barry::Contact [inline]
    SplitName(const std::string &full, std::string &first, std::string &last)Barry::Contact [static]
    UnknownsBarry::Contact
    UnknownsType typedefBarry::Contact
    URLBarry::Contact
    UserDefined1Barry::Contact
    UserDefined2Barry::Contact
    UserDefined3Barry::Contact
    UserDefined4Barry::Contact
    WorkAddressBarry::Contact
    WorkPhoneBarry::Contact
    WorkPhone2Barry::Contact
    ~Contact()Barry::Contact


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Controller.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Controller.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Controller.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Controller.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ - - -Barry: Barry::Controller Class Reference - - - - - - - -

    Barry::Controller Class Reference

    #include <controller.h> -

    -List of all members.


    Detailed Description

    -The main interface class. -

    -This class coordinates the communication to a single handheld. This class also owns the only Usb::Device object the handheld. All other classes reference this one for the low level device object. This class owns the only SocketZero object as well, which is the object that any SocketRoutingQueue is plugged into if constructed that way.

    -To use this class, use the following steps:

    -

      -
    • Probe the USB bus for matching devices with the Probe class
    • Create an optional SocketRoutingQueue object and create a read thread for it, or use its default read thread.
    • Pass one of the probe results into the Controller constructor to connect to the USB device. Pass the routing queue to the Controller constructor here too, if needed.
    • Create the Mode object of your choice. See m_desktop.h and m_serial.h for these mode classes. You pass your controller object into these mode constructors to create the mode.
    - -

    - -

    -Definition at line 67 of file controller.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  ModeType
     Handheld mode type. More...

    Public Member Functions

     Controller (const ProbeResult &device)
     Constructor for the Controller class.
     Controller (const ProbeResult &device, SocketRoutingQueue &queue)
     Constructor for the Controller class.
    ~Controller ()
    -bool HasQueue () const
    -const ProbeResultGetProbeResult () const

    Protected Member Functions

    -uint16_t SelectMode (ModeType mode)

    Friends

    -class Barry::Mode::Desktop
    -class Barry::Mode::IpModem
    -class Barry::Mode::Serial
    -


    Member Enumeration Documentation

    - -
    -
    - - - - -
    enum Barry::Controller::ModeType
    -
    -
    - -

    -Handheld mode type. -

    - -

    -Definition at line 75 of file controller.h. -

    -

    -


    Constructor & Destructor Documentation

    - -
    -
    - - - - - - - - - -
    Barry::Controller::Controller (const ProbeResult device  )  [explicit]
    -
    -
    - -

    -Constructor for the Controller class. -

    -Requires a valid ProbeResult object to find the USB device to talk to.

    -

    Parameters:
    - - -
    [in] device One of the ProbeResult objects from the Probe class.
    -
    - -

    -Definition at line 45 of file controller.cc. -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    Barry::Controller::Controller (const ProbeResult device,
    SocketRoutingQueue queue 
    )
    -
    -
    - -

    -Constructor for the Controller class. -

    -Requires a valid ProbeResult object to find the USB device to talk to.

    -

    Parameters:
    - - - -
    [in] device One of the ProbeResult objects from the Probe class.
    [in] queue Plugin router object for reading data from sockets.
    -
    - -

    -Definition at line 68 of file controller.cc. -

    -References Barry::ProbeResult::m_ep, Usb::EndpointPair::read, Barry::SocketRoutingQueue::SetUsbDevice(), and Usb::EndpointPair::write. -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Controller-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Controller-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Controller-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Controller-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Controller Member List

    This is the complete list of members for Barry::Controller, including all inherited members.

    - - - - - - - - - - -
    Barry::Mode::Desktop classBarry::Controller [friend]
    Barry::Mode::IpModem classBarry::Controller [friend]
    Barry::Mode::Serial classBarry::Controller [friend]
    Controller(const ProbeResult &device)Barry::Controller [explicit]
    Controller(const ProbeResult &device, SocketRoutingQueue &queue)Barry::Controller
    GetProbeResult() constBarry::Controller [inline]
    HasQueue() constBarry::Controller [inline]
    ModeType enum nameBarry::Controller
    SelectMode(ModeType mode)Barry::Controller [protected]
    ~Controller()Barry::Controller


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - -Barry: Barry::DatabaseDatabase Class Reference - - - - - - - -

    Barry::DatabaseDatabase Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 139 of file record.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef DatabaseItem Database
    -typedef std::vector< DatabaseDatabaseArrayType

    Public Member Functions

    DatabaseDatabase ()
    ~DatabaseDatabase ()
    -void Parse (const Data &data)
    -void Clear ()
    -bool GetDBNumber (const std::string &name, unsigned int &number) const
    -bool GetDBName (unsigned int number, std::string &name) const
    -void Dump (std::ostream &os) const

    Public Attributes

    -DatabaseArrayType Databases
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DatabaseDatabase-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::DatabaseDatabase Member List

    This is the complete list of members for Barry::DatabaseDatabase, including all inherited members.

    - - - - - - - - - - -
    Clear()Barry::DatabaseDatabase
    Database typedefBarry::DatabaseDatabase
    DatabaseArrayType typedefBarry::DatabaseDatabase
    DatabaseDatabase()Barry::DatabaseDatabase
    DatabasesBarry::DatabaseDatabase
    Dump(std::ostream &os) constBarry::DatabaseDatabase
    GetDBName(unsigned int number, std::string &name) constBarry::DatabaseDatabase
    GetDBNumber(const std::string &name, unsigned int &number) constBarry::DatabaseDatabase
    Parse(const Data &data)Barry::DatabaseDatabase
    ~DatabaseDatabase()Barry::DatabaseDatabase


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DataHandle.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataHandle.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DataHandle.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataHandle.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Barry::DataHandle Class Reference - - - - - - - -

    Barry::DataHandle Class Reference

    #include <router.h> -

    -List of all members.


    Detailed Description

    -std::auto_ptr like class that handles pointers to Data, but instead of freeing them completely, the Data objects are turned to the SocketRoutingQueue from whence they came. -

    - -

    -Definition at line 179 of file router.h. - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    DataHandle (SocketRoutingQueue &q, Data *data)
    DataHandle (const DataHandle &other)
    ~DataHandle ()
    -Dataget ()
    -Datarelease ()
    -Dataoperator-> ()
    -const Dataoperator-> () const
    -DataHandleoperator= (const DataHandle &other)

    Protected Member Functions

    -void clear ()
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DataHandle-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataHandle-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DataHandle-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataHandle-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::DataHandle Member List

    This is the complete list of members for Barry::DataHandle, including all inherited members.

    - - - - - - - - - -
    clear()Barry::DataHandle [inline, protected]
    DataHandle(SocketRoutingQueue &q, Data *data)Barry::DataHandle [inline]
    DataHandle(const DataHandle &other)Barry::DataHandle [inline]
    get()Barry::DataHandle [inline]
    operator->()Barry::DataHandle [inline]
    operator->() constBarry::DataHandle [inline]
    operator=(const DataHandle &other)Barry::DataHandle [inline]
    release()Barry::DataHandle [inline]
    ~DataHandle()Barry::DataHandle [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Data.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Data.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Data.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Data.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ - - -Barry: Barry::Data Class Reference - - - - - - - -

    Barry::Data Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 31 of file data.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Data ()
    Data (int endpoint, size_t startsize=0x4000)
    Data (const void *ValidData, size_t size)
    Data (const Data &other)
    ~Data ()
    -void InputHexLine (std::istream &is)
    -void DumpHexLine (std::ostream &os, size_t index, size_t size) const
    -void DumpHex (std::ostream &os) const
    -int GetEndpoint () const
    -const unsigned char * GetData () const
    -size_t GetSize () const
    -unsigned char * GetBuffer (size_t requiredsize=0)
    -size_t GetBufSize () const
    -void ReleaseBuffer (int datasize=-1)
    void AppendHexString (const char *str)
     Append bytes of data based on str.
    void Zap ()
     set buffer to 0 and remove all data
    -Dataoperator= (const Data &other)

    Static Public Member Functions

    -static void PrintAscii (bool setting)
    -static bool PrintAscii ()

    Protected Member Functions

    -void MakeSpace (size_t desiredsize)
    -void CopyOnWrite (size_t desiredsize)
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    void Barry::Data::AppendHexString (const char *  str  ) 
    -
    -
    - -

    -Append bytes of data based on str. -

    - -

    -Definition at line 249 of file data.cc. -

    -References CopyOnWrite(), and MakeSpace(). -

    -

    - -

    -
    - - - - - - - - -
    void Barry::Data::Zap (  ) 
    -
    -
    - -

    -set buffer to 0 and remove all data -

    - -

    -Definition at line 263 of file data.cc. -

    -Referenced by Barry::Contact::BuildFields(), Barry::Calendar::BuildFields(), and Barry::Socket::Packet(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Data-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Data-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Data-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Data-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Data Member List

    This is the complete list of members for Barry::Data, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - -
    AppendHexString(const char *str)Barry::Data
    CopyOnWrite(size_t desiredsize)Barry::Data [protected]
    Data()Barry::Data
    Data(int endpoint, size_t startsize=0x4000)Barry::Data [explicit]
    Data(const void *ValidData, size_t size)Barry::Data
    Data(const Data &other)Barry::Data
    DumpHex(std::ostream &os) constBarry::Data
    DumpHexLine(std::ostream &os, size_t index, size_t size) const Barry::Data
    GetBuffer(size_t requiredsize=0)Barry::Data
    GetBufSize() constBarry::Data [inline]
    GetData() constBarry::Data [inline]
    GetEndpoint() constBarry::Data [inline]
    GetSize() constBarry::Data [inline]
    InputHexLine(std::istream &is)Barry::Data
    MakeSpace(size_t desiredsize)Barry::Data [protected]
    operator=(const Data &other)Barry::Data
    PrintAscii(bool setting)Barry::Data [inline, static]
    PrintAscii()Barry::Data [inline, static]
    ReleaseBuffer(int datasize=-1)Barry::Data
    Zap()Barry::Data
    ~Data()Barry::Data


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DataQueue.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataQueue.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DataQueue.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataQueue.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,228 +0,0 @@ - - -Barry: Barry::DataQueue Class Reference - - - - - - - -

    Barry::DataQueue Class Reference

    #include <dataqueue.h> -

    -List of all members.


    Detailed Description

    -This class provides a thread aware fifo queue for Data objects, providing memory management for all Data object pointers it contains. -

    -It uses similar member names as std::queue<>, for consistency. -

    - -

    -Definition at line 40 of file dataqueue.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    DataQueue ()
    ~DataQueue ()
    void push (Data *data)
     Pushes data into the end of the queue.
    Datapop ()
     Pops the next element off the front of the queue.
    Datawait_pop (int timeout=-1)
     Pops the next element off the front of the queue, and waits until one exists if empty.
    void append_from (DataQueue &other)
     Pops all data from other and appends it to this.
    bool empty () const
     Returns true if the queue is empty.
    size_t size () const
     Returns number of items in the queue.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    void Barry::DataQueue::push (Data data  ) 
    -
    -
    - -

    -Pushes data into the end of the queue. -

    -The queue owns this pointer as soon as the function is called. In the case of an exception, it will be freed. Performs a thread broadcast once new data has been added. -

    -Definition at line 60 of file dataqueue.cc. -

    -Referenced by Barry::SocketRoutingQueue::AllocateBuffers(), Barry::SocketRoutingQueue::DoRead(), and Barry::SocketRoutingQueue::ReturnBuffer(). -

    -

    - -

    -
    - - - - - - - - -
    Data * Barry::DataQueue::pop (  ) 
    -
    -
    - -

    -Pops the next element off the front of the queue. -

    -Returns 0 if empty. The queue no longer owns this pointer upon return. -

    -Definition at line 87 of file dataqueue.cc. -

    -Referenced by Barry::SocketRoutingQueue::DoRead(). -

    -

    - -

    -
    - - - - - - - - - -
    Data * Barry::DataQueue::wait_pop (int  timeout = -1  ) 
    -
    -
    - -

    -Pops the next element off the front of the queue, and waits until one exists if empty. -

    -If still no data on timeout, returns null. (unlock the access mutex while waiting!)

    -Timeout specified in milliseconds. Default is wait forever. -

    -Definition at line 109 of file dataqueue.cc. -

    -References size(). -

    -Referenced by Barry::SocketRoutingQueue::DefaultRead(), and Barry::SocketRoutingQueue::SocketRead(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::DataQueue::append_from (DataQueue other  ) 
    -
    -
    - -

    -Pops all data from other and appends it to this. -

    -After calling this function, other will be empty, and this will contain all its data.

    -In the case of an exception, any uncopied data will remain in other.

    -This is a locking optimization, so all copying can happen inside one lock, instead of locking for each copy. -

    -Definition at line 182 of file dataqueue.cc. -

    -References m_accessMutex, and m_queue. -

    -Referenced by Barry::SocketRoutingQueue::UnregisterInterest(). -

    -

    - -

    -
    - - - - - - - - -
    bool Barry::DataQueue::empty (  )  const
    -
    -
    - -

    -Returns true if the queue is empty. -

    - -

    -Definition at line 201 of file dataqueue.cc. -

    -

    - -

    -
    - - - - - - - - -
    size_t Barry::DataQueue::size (  )  const
    -
    -
    - -

    -Returns number of items in the queue. -

    - -

    -Definition at line 212 of file dataqueue.cc. -

    -Referenced by Barry::SocketRoutingQueue::AllocateBuffers(), and wait_pop(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DataQueue-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataQueue-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DataQueue-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DataQueue-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::DataQueue Member List

    This is the complete list of members for Barry::DataQueue, including all inherited members.

    - - - - - - - - -
    append_from(DataQueue &other)Barry::DataQueue
    DataQueue()Barry::DataQueue
    empty() constBarry::DataQueue
    pop()Barry::DataQueue
    push(Data *data)Barry::DataQueue
    size() constBarry::DataQueue
    wait_pop(int timeout=-1)Barry::DataQueue
    ~DataQueue()Barry::DataQueue


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DBPacket.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DBPacket.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DBPacket.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DBPacket.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,466 +0,0 @@ - - -Barry: Barry::DBPacket Class Reference - - - - - - - -

    Barry::DBPacket Class Reference

    #include <packet.h> -

    -

    Inheritance diagram for Barry::DBPacket: -

    - -Barry::Packet - -List of all members.

    Detailed Description

    -Provides an API for building and analyzing raw DB protocol packets. -

    -This class relies on 3 external objects: a Mode::Desktop object, a send Data buffer, and a receive data buffer. Socket and connection details are retrieved on a readonly basis from the Mode::Desktop object, but both send and receive buffers can be modified.

    -Note that the receive buffer may be modified during a packet send, and this DBPacket class provides API helpers to analyze the results. -

    - -

    -Definition at line 118 of file packet.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    DBPacket (Mode::Desktop &con, Data &send, Data &receive)
    ~DBPacket ()
    void ClearDatabase (unsigned int dbId)
     Builds a command packet for the CLEAR_DATABASE command code, placing the data in the send buffer.
    void GetDBDB ()
     Builds a command packet for the GET_DBDB command code, placing the data in m_send.
    void GetRecordStateTable (unsigned int dbId)
     Builds a command packet in the send buffer for the GET_RECORD_STATE_TABLE command.
    void SetRecordFlags (unsigned int dbId, unsigned int stateTableIndex, uint8_t flag1)
     Builds a command packet in the send buffer for the SET_RECORD_FLAGS command code.
    void DeleteRecordByIndex (unsigned int dbId, unsigned int stateTableIndex)
     Builds a command packet in the send buffer for the DELETE_RECORD_BY_INDEX command code.
    void GetRecordByIndex (unsigned int dbId, unsigned int stateTableIndex)
     Builds a command packet in the send buffer for the GET_RECORD_BY_INDEX command code.
    bool SetRecordByIndex (unsigned int dbId, unsigned int stateTableIndex, Builder &build)
     Builds a command packet in the m_send buffer for the SET_RECORD_BY_INDEX command code.
    void GetRecords (unsigned int dbId)
     Builds a command packet in the send buffer for the GET_RECORDS command code.
    bool SetRecord (unsigned int dbId, Builder &build)
     Builds a command packet in the m_send buffer for the SET_RECORD command code.
    -unsigned int ReturnCode () const
    unsigned int DBOperation () const
     Returns the database operation code from the receive packet, assuming that receive contains a response packet.
    bool Parse (Parser &parser)
     Parses the data in the receive buffer, and attempts to be smart about it, using the last send command as guidance for what to expect in the response.

    Friends

    -class Socket
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    void Barry::DBPacket::ClearDatabase (unsigned int  dbId  ) 
    -
    -
    - -

    -Builds a command packet for the CLEAR_DATABASE command code, placing the data in the send buffer. -

    - -

    -Definition at line 162 of file packet.cc. -

    -References Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, and SB_DBOP_CLEAR_DATABASE. -

    -Referenced by Barry::Mode::Desktop::SaveDatabase(). -

    -

    - -

    -
    - - - - - - - - -
    void Barry::DBPacket::GetDBDB (  ) 
    -
    -
    - -

    -Builds a command packet for the GET_DBDB command code, placing the data in m_send. -

    - -

    -Definition at line 186 of file packet.cc. -

    -References Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, and SB_DBOP_OLD_GET_DBDB. -

    -Referenced by Barry::Mode::Desktop::LoadDBDB(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::DBPacket::GetRecordStateTable (unsigned int  dbId  ) 
    -
    -
    - -

    -Builds a command packet in the send buffer for the GET_RECORD_STATE_TABLE command. -

    - -

    -Definition at line 210 of file packet.cc. -

    -References Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, and SB_DBOP_GET_RECORD_STATE_TABLE. -

    -Referenced by Barry::Mode::Desktop::GetRecordStateTable(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void Barry::DBPacket::SetRecordFlags (unsigned int  dbId,
    unsigned int  stateTableIndex,
    uint8_t  flag1 
    )
    -
    -
    - -

    -Builds a command packet in the send buffer for the SET_RECORD_FLAGS command code. -

    -FIXME - this API call is incomplete, since there are unknown flags in the SetRecordFlags protocol packet. Currently it is only used to set all flags to zero. -

    -Definition at line 238 of file packet.cc. -

    -References DBC_RECORD_FLAGS_SIZE, Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, SB_DBOP_SET_RECORD_FLAGS, and SB_PACKET_COMMAND_HEADER_SIZE. -

    -Referenced by Barry::Mode::Desktop::ClearDirty(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::DBPacket::DeleteRecordByIndex (unsigned int  dbId,
    unsigned int  stateTableIndex 
    )
    -
    -
    - -

    -Builds a command packet in the send buffer for the DELETE_RECORD_BY_INDEX command code. -

    - -

    -Definition at line 267 of file packet.cc. -

    -References DBC_RECORD_HEADER_SIZE, Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, SB_DBOP_DELETE_RECORD_BY_INDEX, and SB_PACKET_COMMAND_HEADER_SIZE. -

    -Referenced by Barry::Mode::Desktop::DeleteRecord(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::DBPacket::GetRecordByIndex (unsigned int  dbId,
    unsigned int  stateTableIndex 
    )
    -
    -
    - -

    -Builds a command packet in the send buffer for the GET_RECORD_BY_INDEX command code. -

    - -

    -Definition at line 293 of file packet.cc. -

    -References Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, and SB_DBOP_GET_RECORD_BY_INDEX. -

    -Referenced by Barry::Mode::Desktop::GetRecord(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool Barry::DBPacket::SetRecordByIndex (unsigned int  dbId,
    unsigned int  stateTableIndex,
    Builder build 
    )
    -
    -
    - -

    -Builds a command packet in the m_send buffer for the SET_RECORD_BY_INDEX command code. -

    -

    Returns:
    bool
      -
    • true means success
    • false means no data available from Builder object
    -
    - -

    -Definition at line 322 of file packet.cc. -

    -References Barry::Builder::BuildFields(), DBC_INDEXED_UPLOAD_HEADER_SIZE, Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), Barry::Data::GetSize(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), Barry::Builder::Retrieve(), SB_COMMAND_DB_DATA, SB_DBOP_SET_RECORD_BY_INDEX, and SB_PACKET_COMMAND_HEADER_SIZE. -

    -Referenced by Barry::Mode::Desktop::SetRecord(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::DBPacket::GetRecords (unsigned int  dbId  ) 
    -
    -
    - -

    -Builds a command packet in the send buffer for the GET_RECORDS command code. -

    - -

    -Definition at line 360 of file packet.cc. -

    -References Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_DB_DATA, and SB_DBOP_OLD_GET_RECORDS. -

    -Referenced by Barry::Mode::Desktop::LoadDatabase(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    bool Barry::DBPacket::SetRecord (unsigned int  dbId,
    Builder build 
    )
    -
    -
    - -

    -Builds a command packet in the m_send buffer for the SET_RECORD command code. -

    -

    Returns:
    bool
      -
    • true means success
    • false means no data available from Builder object
    -
    - -

    -Definition at line 388 of file packet.cc. -

    -References Barry::Builder::BuildFields(), Barry::Builder::BuildHeader(), DBC_TAGGED_UPLOAD_HEADER_SIZE, Barry::Data::GetBuffer(), Barry::Mode::Desktop::GetDBCommand(), Barry::Builder::GetRecType(), Barry::Data::GetSize(), Barry::Builder::GetUniqueId(), htobl, htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), Barry::Builder::Retrieve(), SB_COMMAND_DB_DATA, SB_DBOP_SET_RECORD, and SB_PACKET_COMMAND_HEADER_SIZE. -

    -Referenced by Barry::Mode::Desktop::AddRecord(), and Barry::Mode::Desktop::SaveDatabase(). -

    -

    - -

    -
    - - - - - - - - -
    unsigned int Barry::DBPacket::DBOperation (  )  const
    -
    -
    - -

    -Returns the database operation code from the receive packet, assuming that receive contains a response packet. -

    -If receive isn't large enough, throws Error. -

    -Definition at line 442 of file packet.cc. -

    -References Barry::Protocol::CheckSize(), Barry::Packet::m_receive, MAKE_PACKET, and SB_PACKET_RESPONSE_HEADER_SIZE. -

    -

    - -

    -
    - - - - - - - - - -
    bool Barry::DBPacket::Parse (Parser parser  ) 
    -
    -
    - -

    -Parses the data in the receive buffer, and attempts to be smart about it, using the last send command as guidance for what to expect in the response. -

    -

    Returns:
    bool true - packet was recognized and parse was attempted false - packet was not recognized
    - -

    -Definition at line 459 of file packet.cc. -

    -References btohl, Barry::Protocol::CheckSize(), Barry::Parser::Clear(), DBR_OLD_TAGGED_RECORD_HEADER_SIZE, Barry::Packet::m_receive, MAKE_PACKET, Barry::Parser::ParseFields(), Barry::Parser::ParseHeader(), SB_DBOP_GET_RECORD_BY_INDEX, SB_DBOP_OLD_GET_RECORDS, SB_PACKET_RESPONSE_HEADER_SIZE, Barry::Parser::SetIds(), and Barry::Parser::Store(). -

    -Referenced by Barry::Mode::Desktop::GetRecord(), and Barry::Mode::Desktop::LoadDatabase(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1DBPacket-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DBPacket-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1DBPacket-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DBPacket-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::DBPacket Member List

    This is the complete list of members for Barry::DBPacket, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - -
    ClearDatabase(unsigned int dbId)Barry::DBPacket
    Command() constBarry::Packet
    DBOperation() constBarry::DBPacket
    DBPacket(Mode::Desktop &con, Data &send, Data &receive)Barry::DBPacket
    DeleteRecordByIndex(unsigned int dbId, unsigned int stateTableIndex)Barry::DBPacket
    GetDBDB()Barry::DBPacket
    GetReceive()Barry::Packet [inline, protected]
    GetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex)Barry::DBPacket
    GetRecords(unsigned int dbId)Barry::DBPacket
    GetRecordStateTable(unsigned int dbId)Barry::DBPacket
    GetSend()Barry::Packet [inline, protected]
    m_receiveBarry::Packet [protected]
    m_sendBarry::Packet [protected]
    Packet(Data &send, Data &receive)Barry::Packet [inline]
    Parse(Parser &parser)Barry::DBPacket
    ReturnCode() constBarry::DBPacket
    SetRecord(unsigned int dbId, Builder &build)Barry::DBPacket
    SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex, Builder &build)Barry::DBPacket
    SetRecordFlags(unsigned int dbId, unsigned int stateTableIndex, uint8_t flag1)Barry::DBPacket
    Socket classBarry::DBPacket [friend]
    ~DBPacket()Barry::DBPacket
    ~Packet()Barry::Packet [inline, virtual]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1DBPacket.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1DBPacket.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Diff.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Diff.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Diff.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Diff.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Diff Class Reference - - - - - - - -

    Barry::Diff Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 85 of file data.h. - - - - - - -

    Public Member Functions

    Diff (const Data &old, const Data &new_)
    -void Dump (std::ostream &os) const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Diff-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Diff-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Diff-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Diff-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Diff Member List

    This is the complete list of members for Barry::Diff, including all inherited members.

    - - -
    Diff(const Data &old, const Data &new_)Barry::Diff
    Dump(std::ostream &os) constBarry::Diff


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ErrnoError.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ErrnoError.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ErrnoError.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ErrnoError.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: Barry::ErrnoError Class Reference - - - - - - - -

    Barry::ErrnoError Class Reference
    - -[Exceptions] -

    #include <error.h> -

    -

    Inheritance diagram for Barry::ErrnoError: -

    - -Barry::Error - -List of all members.

    Detailed Description

    -System error that provides an errno error code. -

    - -

    -Definition at line 122 of file error.h. - - - - - - -

    Public Member Functions

    ErrnoError (const std::string &msg, int err)
    -int error_code () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ErrnoError-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ErrnoError-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ErrnoError-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ErrnoError-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ErrnoError Member List

    This is the complete list of members for Barry::ErrnoError, including all inherited members.

    - - - -
    ErrnoError(const std::string &msg, int err)Barry::ErrnoError [inline]
    Error(const std::string &str)Barry::Error [inline]
    error_code() constBarry::ErrnoError [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1ErrnoError.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ErrnoError.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Error.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Error.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Error.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Error.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: Barry::Error Class Reference - - - - - - - -

    Barry::Error Class Reference
    - -[Exceptions] -

    #include <error.h> -

    -

    Inheritance diagram for Barry::Error: -

    - -Barry::BadData -Barry::BadPassword -Barry::BadSize -Barry::ErrnoError -Usb::Error -Usb::Timeout - -List of all members.

    Detailed Description

    -The base class for any future derived exceptions. -

    -Can be thrown on any protocol error. -

    - -

    -Definition at line 39 of file error.h. - - - - -

    Public Member Functions

    Error (const std::string &str)
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Error-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Error-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Error-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Error-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Error Member List

    This is the complete list of members for Barry::Error, including all inherited members.

    - -
    Error(const std::string &str)Barry::Error [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Error.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Error.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Folder.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Folder.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Folder.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Folder.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ - - -Barry: Barry::Folder Class Reference - - - - - - - -

    Barry::Folder Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 34 of file r_folder.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  FolderTypeEnum
    enum  FolderStatusType
    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    Folder ()
    ~Folder ()
    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Folder &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -std::string FolderName
    -uint16_t FolderNumber
    -uint16_t FolderLevel
    -FolderTypeEnum FolderType
    -UnknownsType Unknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Folder-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Folder-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Folder-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Folder-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Folder Member List

    This is the complete list of members for Barry::Folder, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - -
    Clear()Barry::Folder
    Dump(std::ostream &os) constBarry::Folder
    Folder()Barry::Folder
    FolderLevelBarry::Folder
    FolderNameBarry::Folder
    FolderNumberBarry::Folder
    FolderStatusType enum nameBarry::Folder
    FolderTypeBarry::Folder
    FolderTypeEnum enum nameBarry::Folder
    GetDBName()Barry::Folder [inline, static]
    GetDefaultRecType()Barry::Folder [inline, static]
    GetRecType() constBarry::Folder [inline]
    GetUniqueId() constBarry::Folder [inline]
    operator<(const Folder &other) const Barry::Folder [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Folder
    ParseFields(const Data &data, size_t &offset)Barry::Folder
    ParseHeader(const Data &data, size_t &offset)Barry::Folder
    RecordIdBarry::Folder
    RecTypeBarry::Folder
    SetIds(uint8_t Type, uint32_t Id)Barry::Folder [inline]
    UnknownsBarry::Folder
    UnknownsType typedefBarry::Folder
    ~Folder()Barry::Folder


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1LogLock.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1LogLock.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1LogLock.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1LogLock.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: Barry::LogLock Class Reference - - - - - - - -

    Barry::LogLock Class Reference

    #include <log.h> -

    -List of all members.


    Detailed Description

    -RAII locking class used to protect the logStream passed into Barry::Init() (common.h). -

    -If the application uses the same stream for its own logging, it should use this lock class, or use the macros in log.h. -

    - -

    -Definition at line 38 of file log.h. - - - - - - -

    Public Member Functions

    LogLock ()
    ~LogLock ()
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1LogLock-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1LogLock-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1LogLock-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1LogLock-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::LogLock Member List

    This is the complete list of members for Barry::LogLock, including all inherited members.

    - - -
    LogLock()Barry::LogLock
    ~LogLock()Barry::LogLock


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Memo.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Memo.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Memo.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Memo.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ - - -Barry: Barry::Memo Class Reference - - - - - - - -

    Barry::Memo Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 34 of file r_memo.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    Memo ()
    ~Memo ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Memo &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -uint8_t MemoType
    -std::string Title
    -std::string Body
    -std::string Category
    -UnknownsType Unknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Memo-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Memo-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Memo-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Memo-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Memo Member List

    This is the complete list of members for Barry::Memo, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - -
    BodyBarry::Memo
    CategoryBarry::Memo
    Clear()Barry::Memo
    Dump(std::ostream &os) constBarry::Memo
    GetDBName()Barry::Memo [inline, static]
    GetDefaultRecType()Barry::Memo [inline, static]
    GetRecType() constBarry::Memo [inline]
    GetUniqueId() constBarry::Memo [inline]
    Memo()Barry::Memo
    MemoTypeBarry::Memo
    operator<(const Memo &other) constBarry::Memo [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Memo
    ParseFields(const Data &data, size_t &offset)Barry::Memo
    ParseHeader(const Data &data, size_t &offset)Barry::Memo
    RecordIdBarry::Memo
    RecTypeBarry::Memo
    SetIds(uint8_t Type, uint32_t Id)Barry::Memo [inline]
    TitleBarry::Memo
    UnknownsBarry::Memo
    UnknownsType typedefBarry::Memo
    ~Memo()Barry::Memo


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Message.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Message.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Message.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Message.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - - -Barry: Barry::Message Class Reference - - - - - - - -

    Barry::Message Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 43 of file r_message.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  MessagePriorityType
    enum  MessageSensitivityType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    Message ()
    ~Message ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    -void BuildFields (Data &data, size_t &offset) const
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Message &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -EmailAddress From
    -EmailAddress To
    -EmailAddress Cc
    -EmailAddress Bcc
    -EmailAddress Sender
    -EmailAddress ReplyTo
    -std::string Subject
    -std::string Body
    -std::string Attachment
    -uint32_t MessageRecordId
    -uint32_t MessageReplyTo
    -time_t MessageDateSent
    -time_t MessageDateReceived
    -bool MessageTruncated
    -bool MessageRead
    -bool MessageReply
    -bool MessageSaved
    -bool MessageSavedDeleted
    -MessagePriorityType MessagePriority
    -MessageSensitivityType MessageSensitivity
    -std::vector< UnknownFieldUnknowns

    Protected Member Functions

    -std::string SimpleEmailAddress () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Message-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Message-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Message-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Message-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Message Member List

    This is the complete list of members for Barry::Message, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttachmentBarry::Message
    BccBarry::Message
    BodyBarry::Message
    BuildFields(Data &data, size_t &offset) constBarry::Message
    BuildHeader(Data &data, size_t &offset) constBarry::Message
    CcBarry::Message
    Clear()Barry::Message
    Dump(std::ostream &os) constBarry::Message
    FromBarry::Message
    GetDBName()Barry::Message [inline, static]
    GetDefaultRecType()Barry::Message [inline, static]
    GetRecType() constBarry::Message
    GetUniqueId() constBarry::Message
    Message()Barry::Message
    MessageDateReceivedBarry::Message
    MessageDateSentBarry::Message
    MessagePriorityBarry::Message
    MessagePriorityType enum nameBarry::Message
    MessageReadBarry::Message
    MessageRecordIdBarry::Message
    MessageReplyBarry::Message
    MessageReplyToBarry::Message
    MessageSavedBarry::Message
    MessageSavedDeletedBarry::Message
    MessageSensitivityBarry::Message
    MessageSensitivityType enum nameBarry::Message
    MessageTruncatedBarry::Message
    operator<(const Message &other) const Barry::Message [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Message
    ParseFields(const Data &data, size_t &offset)Barry::Message
    ParseHeader(const Data &data, size_t &offset)Barry::Message
    RecordIdBarry::Message
    RecTypeBarry::Message
    ReplyToBarry::Message
    SenderBarry::Message
    SetIds(uint8_t Type, uint32_t Id)Barry::Message [inline]
    SimpleEmailAddress() constBarry::Message [protected]
    SubjectBarry::Message
    ToBarry::Message
    UnknownsBarry::Message
    ~Message()Barry::Message


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,571 +0,0 @@ - - -Barry: Barry::Mode::Desktop Class Reference - - - - - - - -

    Barry::Mode::Desktop Class Reference

    #include <m_desktop.h> -

    -List of all members.


    Detailed Description

    -The main interface class to the device databases. -

    -To use this class, use the following steps:

    -

    - -

    - -

    -Definition at line 53 of file m_desktop.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  CommandType

    Public Member Functions

    Desktop (Controller &con)
    ~Desktop ()
    void Open (const char *password=0)
     Select device mode.
    void RetryPassword (const char *password)
     Retry a failed password attempt from the first call to Open().
    const DatabaseDatabaseGetDBDB () const
     Returns DatabaseDatabase object for this connection.
    unsigned int GetDBID (const std::string &name) const
     Get numeric database ID by name.
    unsigned int GetDBCommand (CommandType ct)
     Get database command from command table.
    void GetRecordStateTable (unsigned int dbId, RecordStateTable &result)
     Retrieve the record state table from the handheld device, using the given database ID.
    void AddRecord (unsigned int dbId, Builder &build)
     Adds a record to the specified database.
    void GetRecord (unsigned int dbId, unsigned int stateTableIndex, Parser &parser)
     Retrieves a specific record from the specified database.
    void SetRecord (unsigned int dbId, unsigned int stateTableIndex, Builder &build)
     Overwrites a specific record in the device as identified by the stateTableIndex.
    void ClearDirty (unsigned int dbId, unsigned int stateTableIndex)
     Clears the dirty flag on the specified record in the specified database.
    void DeleteRecord (unsigned int dbId, unsigned int stateTableIndex)
     Deletes the specified record in the specified database.
    void LoadDatabase (unsigned int dbId, Parser &parser)
     Retrieve a database from the handheld device, using the given parser to parse the resulting data, and optionally store it.
    -void SaveDatabase (unsigned int dbId, Builder &builder)
    -template<class RecordT, class StorageT>
    void LoadDatabaseByType (StorageT &store)
    -template<class RecordT, class StorageT>
    void SaveDatabaseByType (StorageT &store)
    -template<class StorageT>
    void LoadDatabaseByName (const std::string &name, StorageT &store)
    -template<class StorageT>
    void SaveDatabaseByName (const std::string &name, StorageT &store)
    -template<class RecordT>
    void AddRecordByType (uint32_t recordId, const RecordT &rec)

    Protected Member Functions

    -void LoadCommandTable ()
    -void LoadDBDB ()
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    void Barry::Mode::Desktop::Open (const char *  password = 0  ) 
    -
    -
    - -

    -Select device mode. -

    -This is required before using any other mode-based operations, such as GetDBDB() and LoadDatabase().

    -This function opens a socket to the device for communicating in Desktop mode. If the device requires it, specify the password with a const char* string in password. The password will not be stored in memory inside this class, only a hash will be generated from it. After using the hash, the hash memory will be set to 0. The application is responsible for safely handling the raw password data.

    -You can retry the password by catching Barry::BadPassword and calling RetryPassword() with the new password.

    -

    Exceptions:
    - - - - -
    Barry::Error Thrown on protocol error.
    std::logic_error() Thrown if unsupported mode is requested, or if socket already open.
    Barry::BadPassword Thrown when password is invalid or if not enough retries left in the device.
    -
    - -

    -Definition at line 140 of file m_desktop.cc. -

    -References RetryPassword(), and Barry::Controller::SelectMode(). -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::Mode::Desktop::RetryPassword (const char *  password  ) 
    -
    -
    - -

    -Retry a failed password attempt from the first call to Open(). -

    -Only call this function in response to Barry::BadPassword exceptions that are thrown from Open().

    -

    Exceptions:
    - - - - -
    Barry::Error Thrown on protocol error.
    std::logic_error() Thrown if in unsupported mode, or if socket already open.
    Barry::BadPassword Thrown when password is invalid or if not enough retries left in the device.
    -
    - -

    -Definition at line 169 of file m_desktop.cc. -

    -References LoadCommandTable(), LoadDBDB(), Barry::Controller::m_zero, and Barry::SocketZero::Open(). -

    -Referenced by Open(). -

    -

    - -

    -
    - - - - - - - - -
    const DatabaseDatabase& Barry::Mode::Desktop::GetDBDB (  )  const [inline]
    -
    -
    - -

    -Returns DatabaseDatabase object for this connection. -

    -Must call Open() first, which loads the DBDB. -

    -Definition at line 88 of file m_desktop.h. -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - -
    unsigned int Barry::Mode::Desktop::GetDBID (const std::string &  name  )  const
    -
    -
    - -

    -Get numeric database ID by name. -

    -

    Parameters:
    - - -
    [in] name Name of database, which matches one of the names listed in GetDBDB()
    -
    -
    Exceptions:
    - - -
    Barry::Error Thrown if name not found.
    -
    - -

    -Definition at line 192 of file m_desktop.cc. -

    -References Barry::DatabaseDatabase::GetDBNumber(). -

    -Referenced by AddRecordByType(), LoadDatabaseByType(), main(), and SaveDatabaseByType(). -

    -

    - -

    -
    - - - - - - - - - -
    unsigned int Barry::Mode::Desktop::GetDBCommand (CommandType  ct  ) 
    -
    - -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::GetRecordStateTable (unsigned int  dbId,
    RecordStateTable result 
    )
    -
    -
    - -

    -Retrieve the record state table from the handheld device, using the given database ID. -

    -Results will be stored in result, which will be cleared before adding. -

    -Definition at line 239 of file m_desktop.cc. -

    -References Barry::RecordStateTable::Clear(), Barry::Packet::Command(), Barry::DBPacket::GetRecordStateTable(), Barry::RecordStateTable::Parse(), and SB_COMMAND_DB_DONE. -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::AddRecord (unsigned int  dbId,
    Builder build 
    )
    -
    -
    - -

    -Adds a record to the specified database. -

    -RecordId is retrieved from build, and duplicate IDs are allowed by the device (i.e. you can have two records with the same ID) but *not* recommended! -

    -Definition at line 266 of file m_desktop.cc. -

    -References SB_COMMAND_DB_DONE, and Barry::DBPacket::SetRecord(). -

    -Referenced by AddRecordByType(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::GetRecord (unsigned int  dbId,
    unsigned int  stateTableIndex,
    Parser parser 
    )
    -
    -
    - -

    -Retrieves a specific record from the specified database. -

    -The stateTableIndex comes from the GetRecordStateTable() function. GetRecord() does not clear the dirty flag. -

    -Definition at line 302 of file m_desktop.cc. -

    -References Barry::Packet::Command(), Barry::DBPacket::GetRecordByIndex(), Barry::Data::GetSize(), Barry::DBPacket::Parse(), SB_COMMAND_DB_DATA, SB_COMMAND_DB_DONE, and SB_PACKET_RESPONSE_HEADER_SIZE. -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::SetRecord (unsigned int  dbId,
    unsigned int  stateTableIndex,
    Builder build 
    )
    -
    -
    - -

    -Overwrites a specific record in the device as identified by the stateTableIndex. -

    - -

    -Definition at line 350 of file m_desktop.cc. -

    -References Barry::Packet::Command(), Barry::DBPacket::ReturnCode(), SB_COMMAND_DB_DONE, and Barry::DBPacket::SetRecordByIndex(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::ClearDirty (unsigned int  dbId,
    unsigned int  stateTableIndex 
    )
    -
    -
    - -

    -Clears the dirty flag on the specified record in the specified database. -

    - -

    -Definition at line 387 of file m_desktop.cc. -

    -References Barry::Packet::Command(), SB_COMMAND_DB_DONE, and Barry::DBPacket::SetRecordFlags(). -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::DeleteRecord (unsigned int  dbId,
    unsigned int  stateTableIndex 
    )
    -
    -
    - -

    -Deletes the specified record in the specified database. -

    - -

    -Definition at line 407 of file m_desktop.cc. -

    -References Barry::Packet::Command(), Barry::DBPacket::DeleteRecordByIndex(), and SB_COMMAND_DB_DONE. -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Mode::Desktop::LoadDatabase (unsigned int  dbId,
    Parser parser 
    )
    -
    -
    - -

    -Retrieve a database from the handheld device, using the given parser to parse the resulting data, and optionally store it. -

    -See the RecordParser<> template to create a parser object. The RecordParser<> template allows custom storage based on the type of database record retrieved. The database ID and the parser Record type must match.

    -

    Parameters:
    - - - -
    [in] dbId Database Database ID - use GetDBID()
    [out] parser Parser object which parses the resulting protocol data, and optionally stores it in a custom fashion. See the RecordParser<> template.
    -
    -
    Exceptions:
    - - - -
    Barry::Error Thrown on protocol error.
    std::logic_error Thrown if not in Desktop mode.
    -
    - -

    -Definition at line 445 of file m_desktop.cc. -

    -References Barry::Packet::Command(), Barry::DBPacket::GetRecords(), Barry::DBPacket::Parse(), SB_COMMAND_DB_DATA, and SB_COMMAND_DB_DONE. -

    -Referenced by LoadDatabaseByType(), and main(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Desktop-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Mode::Desktop Member List

    This is the complete list of members for Barry::Mode::Desktop, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - -
    AddRecord(unsigned int dbId, Builder &build)Barry::Mode::Desktop
    AddRecordByType(uint32_t recordId, const RecordT &rec)Barry::Mode::Desktop
    ClearDirty(unsigned int dbId, unsigned int stateTableIndex)Barry::Mode::Desktop
    CommandType enum nameBarry::Mode::Desktop
    DeleteRecord(unsigned int dbId, unsigned int stateTableIndex)Barry::Mode::Desktop
    Desktop(Controller &con)Barry::Mode::Desktop
    GetDBCommand(CommandType ct)Barry::Mode::Desktop
    GetDBDB() constBarry::Mode::Desktop [inline]
    GetDBID(const std::string &name) constBarry::Mode::Desktop
    GetRecord(unsigned int dbId, unsigned int stateTableIndex, Parser &parser)Barry::Mode::Desktop
    GetRecordStateTable(unsigned int dbId, RecordStateTable &result)Barry::Mode::Desktop
    LoadCommandTable()Barry::Mode::Desktop [protected]
    LoadDatabase(unsigned int dbId, Parser &parser)Barry::Mode::Desktop
    LoadDatabaseByName(const std::string &name, StorageT &store)Barry::Mode::Desktop
    LoadDatabaseByType(StorageT &store)Barry::Mode::Desktop
    LoadDBDB()Barry::Mode::Desktop [protected]
    Open(const char *password=0)Barry::Mode::Desktop
    RetryPassword(const char *password)Barry::Mode::Desktop
    SaveDatabase(unsigned int dbId, Builder &builder)Barry::Mode::Desktop
    SaveDatabaseByName(const std::string &name, StorageT &store)Barry::Mode::Desktop
    SaveDatabaseByType(StorageT &store)Barry::Mode::Desktop
    SetRecord(unsigned int dbId, unsigned int stateTableIndex, Builder &build)Barry::Mode::Desktop
    ~Desktop()Barry::Mode::Desktop


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ - - -Barry: Barry::Mode::IpModem Class Reference - - - - - - - -

    Barry::Mode::IpModem Class Reference

    Inheritance diagram for Barry::Mode::IpModem: -

    - -Barry::Modem - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 40 of file m_ipmodem.h. - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef void(*) DeviceDataCallback (void *context, const unsigned char *data, int len)

    Public Member Functions

    IpModem (Controller &con, DeviceDataCallback callback, void *callback_context)
    ~IpModem ()
    -void Open (const char *password=0)
    -void Close ()
    -void Write (const Data &data, int timeout=-1)

    Static Protected Member Functions

    -static void * DataReadThread (void *userptr)
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Mode::IpModem Member List

    This is the complete list of members for Barry::Mode::IpModem, including all inherited members.

    - - - - - - - - -
    Close()Barry::Mode::IpModem [virtual]
    DataReadThread(void *userptr)Barry::Mode::IpModem [protected, static]
    DeviceDataCallback typedefBarry::Mode::IpModem
    IpModem(Controller &con, DeviceDataCallback callback, void *callback_context)Barry::Mode::IpModem
    Open(const char *password=0)Barry::Mode::IpModem [virtual]
    Write(const Data &data, int timeout=-1)Barry::Mode::IpModem [virtual]
    ~IpModem()Barry::Mode::IpModem
    ~Modem()Barry::Modem [inline, virtual]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1IpModem.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - - -Barry: Barry::Mode::Serial Class Reference - - - - - - - -

    Barry::Mode::Serial Class Reference

    Inheritance diagram for Barry::Mode::Serial: -

    - -Barry::Modem - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 38 of file m_serial.h. - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef void(*) DeviceDataCallback (void *context, const unsigned char *data, int len)

    Public Member Functions

    Serial (Controller &con, DeviceDataCallback callback, void *callback_context)
    ~Serial ()
    -void Open (const char *password=0)
    -void Close ()
    -void Write (const Data &data, int timeout=-1)

    Static Protected Member Functions

    -static void DataCallback (void *context, Data *data)
    -static void CtrlCallback (void *context, Data *data)
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Mode::Serial Member List

    This is the complete list of members for Barry::Mode::Serial, including all inherited members.

    - - - - - - - - - -
    Close()Barry::Mode::Serial [virtual]
    CtrlCallback(void *context, Data *data)Barry::Mode::Serial [protected, static]
    DataCallback(void *context, Data *data)Barry::Mode::Serial [protected, static]
    DeviceDataCallback typedefBarry::Mode::Serial
    Open(const char *password=0)Barry::Mode::Serial [virtual]
    Serial(Controller &con, DeviceDataCallback callback, void *callback_context)Barry::Mode::Serial
    Write(const Data &data, int timeout=-1)Barry::Mode::Serial [virtual]
    ~Modem()Barry::Modem [inline, virtual]
    ~Serial()Barry::Mode::Serial


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Mode_1_1Serial.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Modem.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Modem.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Modem.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Modem.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Modem Class Reference - - - - - - - -

    Barry::Modem Class Reference

    Inheritance diagram for Barry::Modem: -

    - -Barry::Mode::IpModem -Barry::Mode::Serial - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 32 of file modem.h. - - - - -

    Public Member Functions

    -virtual ~Modem ()
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Modem-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Modem-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Modem-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Modem-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Modem Member List

    This is the complete list of members for Barry::Modem, including all inherited members.

    - -
    ~Modem()Barry::Modem [inline, virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Modem.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Modem.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Packet.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Packet.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Packet.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Packet.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ - - -Barry: Barry::Packet Class Reference - - - - - - - -

    Barry::Packet Class Reference

    Inheritance diagram for Barry::Packet: -

    - -Barry::DBPacket -Barry::ZeroPacket - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 42 of file packet.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Packet (Data &send, Data &receive)
    -virtual ~Packet ()
    unsigned int Command () const
     Returns the command value of the receive packet.

    Protected Member Functions

    -DataGetSend ()
    -DataGetReceive ()

    Protected Attributes

    -Datam_send
    -Datam_receive

    Friends

    -class SocketZero
    -class Socket
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    unsigned int Barry::Packet::Command (  )  const
    -
    - -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Packet-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Packet-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Packet-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Packet-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Packet Member List

    This is the complete list of members for Barry::Packet, including all inherited members.

    - - - - - - - - - -
    Command() constBarry::Packet
    GetReceive()Barry::Packet [inline, protected]
    GetSend()Barry::Packet [inline, protected]
    m_receiveBarry::Packet [protected]
    m_sendBarry::Packet [protected]
    Packet(Data &send, Data &receive)Barry::Packet [inline]
    Socket classBarry::Packet [friend]
    SocketZero classBarry::Packet [friend]
    ~Packet()Barry::Packet [inline, virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Packet.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Packet.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Parser.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Parser.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Parser.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Parser.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ - - -Barry: Barry::Parser Class Reference - - - - - - - -

    Barry::Parser Class Reference

    #include <parser.h> -

    -

    Inheritance diagram for Barry::Parser: -

    - -Barry::RecordParser< RecordT, StorageT > -ChecksumParser -DataDumpParser - -List of all members.

    Detailed Description

    -Base class for the parser hierarchy. -

    -If in debug mode, this class can be used as a null parser. Call Init() and the protocol will be dumped to stdout and no parsing will be done.

    -This class provides the interface that the Controller class uses to pass raw data it reads from the device. The Controller, along with the Packet class, calls each of the virtual functions below in the same order. -

    - -

    -Definition at line 48 of file parser.h. - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Parser ()
    -virtual ~Parser ()
    virtual void Clear ()
     Reset and prepare for a new raw data packet.
    virtual void SetIds (uint8_t RecType, uint32_t UniqueId)
     Stores the IDs.
    virtual void ParseHeader (const Data &data, size_t &offset)
     Called to parse the header portion of the raw data packet.
    virtual void ParseFields (const Data &data, size_t &offset)
     Called to parse sub fields in the raw data packet.
    virtual void Store ()
     Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    virtual void Barry::Parser::Clear (  )  [inline, virtual]
    -
    -
    - -

    -Reset and prepare for a new raw data packet. -

    - -

    -Reimplemented in Barry::RecordParser< RecordT, StorageT >, and ChecksumParser. -

    -Definition at line 55 of file parser.h. -

    -Referenced by Barry::DBPacket::Parse(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::Parser::SetIds (uint8_t  RecType,
    uint32_t  UniqueId 
    ) [inline, virtual]
    -
    -
    - -

    -Stores the IDs. -

    - -

    -Reimplemented in Barry::RecordParser< RecordT, StorageT >, ChecksumParser, and DataDumpParser. -

    -Definition at line 58 of file parser.h. -

    -Referenced by Barry::DBPacket::Parse(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::Parser::ParseHeader (const Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse the header portion of the raw data packet. -

    -data contains the entire packet, and offset contains the location at which to start parsing. -

    -Reimplemented in Barry::RecordParser< RecordT, StorageT >. -

    -Definition at line 63 of file parser.h. -

    -Referenced by Barry::DBPacket::Parse(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::Parser::ParseFields (const Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse sub fields in the raw data packet. -

    -The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing. -

    -Reimplemented in Barry::RecordParser< RecordT, StorageT >, ChecksumParser, and DataDumpParser. -

    -Definition at line 69 of file parser.h. -

    -Referenced by Barry::DBPacket::Parse(). -

    -

    - -

    -
    - - - - - - - - -
    virtual void Barry::Parser::Store (  )  [inline, virtual]
    -
    -
    - -

    -Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc. -

    - -

    -Reimplemented in Barry::RecordParser< RecordT, StorageT >, and ChecksumParser. -

    -Definition at line 73 of file parser.h. -

    -Referenced by Barry::DBPacket::Parse(). -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Parser-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Parser-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Parser-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Parser-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Parser Member List

    This is the complete list of members for Barry::Parser, including all inherited members.

    - - - - - - - -
    Clear()Barry::Parser [inline, virtual]
    ParseFields(const Data &data, size_t &offset)Barry::Parser [inline, virtual]
    ParseHeader(const Data &data, size_t &offset)Barry::Parser [inline, virtual]
    Parser()Barry::Parser [inline]
    SetIds(uint8_t RecType, uint32_t UniqueId)Barry::Parser [inline, virtual]
    Store()Barry::Parser [inline, virtual]
    ~Parser()Barry::Parser [inline, virtual]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1Parser.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Parser.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1PINMessage.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PINMessage.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1PINMessage.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PINMessage.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ - - -Barry: Barry::PINMessage Class Reference - - - - - - - -

    Barry::PINMessage Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 44 of file r_pin_message.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  MessagePriorityType
    enum  MessageSensitivityType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    PINMessage ()
    ~PINMessage ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    -void BuildFields (Data &data, size_t &offset) const
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const PINMessage &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -EmailAddress From
    -EmailAddress To
    -EmailAddress Cc
    -EmailAddress Bcc
    -std::string Subject
    -std::string Body
    -uint32_t MessageRecordId
    -uint32_t MessageReplyTo
    -time_t MessageDateSent
    -time_t MessageDateReceived
    -bool MessageTruncated
    -bool MessageRead
    -bool MessageReply
    -bool MessageSaved
    -bool MessageSavedDeleted
    -MessagePriorityType MessagePriority
    -MessageSensitivityType MessageSensitivity
    -std::vector< UnknownFieldUnknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1PINMessage-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PINMessage-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1PINMessage-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PINMessage-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::PINMessage Member List

    This is the complete list of members for Barry::PINMessage, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    BccBarry::PINMessage
    BodyBarry::PINMessage
    BuildFields(Data &data, size_t &offset) constBarry::PINMessage
    BuildHeader(Data &data, size_t &offset) constBarry::PINMessage
    CcBarry::PINMessage
    Clear()Barry::PINMessage
    Dump(std::ostream &os) constBarry::PINMessage
    FromBarry::PINMessage
    GetDBName()Barry::PINMessage [inline, static]
    GetDefaultRecType()Barry::PINMessage [inline, static]
    GetRecType() constBarry::PINMessage [inline]
    GetUniqueId() constBarry::PINMessage [inline]
    MessageDateReceivedBarry::PINMessage
    MessageDateSentBarry::PINMessage
    MessagePriorityBarry::PINMessage
    MessagePriorityType enum nameBarry::PINMessage
    MessageReadBarry::PINMessage
    MessageRecordIdBarry::PINMessage
    MessageReplyBarry::PINMessage
    MessageReplyToBarry::PINMessage
    MessageSavedBarry::PINMessage
    MessageSavedDeletedBarry::PINMessage
    MessageSensitivityBarry::PINMessage
    MessageSensitivityType enum nameBarry::PINMessage
    MessageTruncatedBarry::PINMessage
    operator<(const PINMessage &other) constBarry::PINMessage [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::PINMessage
    ParseFields(const Data &data, size_t &offset)Barry::PINMessage
    ParseHeader(const Data &data, size_t &offset)Barry::PINMessage
    PINMessage()Barry::PINMessage
    RecordIdBarry::PINMessage
    RecTypeBarry::PINMessage
    SetIds(uint8_t Type, uint32_t Id)Barry::PINMessage [inline]
    SubjectBarry::PINMessage
    ToBarry::PINMessage
    UnknownsBarry::PINMessage
    ~PINMessage()Barry::PINMessage


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1PppFilter.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PppFilter.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1PppFilter.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PppFilter.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: Barry::PppFilter Class Reference - - - - - - - -

    Barry::PppFilter Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 33 of file pppfilter.h. - - - - - - - - - - - - -

    Public Member Functions

    PppFilter ()
    -bool PppMode () const
    const DataWrite (const Data &data)
     If PPP mode has not been detected, just return the data buffer.
    DataWrite (const Data &data, unsigned int prepend)
     Same as Write(data), but makes sure that prepend bytes are available at the beginning of the returned buffer.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    const Data & Barry::PppFilter::Write (const Data data  ) 
    -
    -
    - -

    -If PPP mode has not been detected, just return the data buffer. -

    -If in PPP mode, then filter data into internal write buffer, inserting any missing 0x7e characters and return reference to internal write buffer. -

    -Definition at line 86 of file pppfilter.cc. -

    -References Barry::Data::GetData(), and Barry::Data::GetSize(). -

    -Referenced by Barry::Mode::Serial::Write(), and Barry::Mode::IpModem::Write(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    Data & Barry::PppFilter::Write (const Data data,
    unsigned int  prepend 
    )
    -
    -
    - -

    -Same as Write(data), but makes sure that prepend bytes are available at the beginning of the returned buffer. -

    -If not in PPP mode, the extra bytes are still provided. -

    -Definition at line 116 of file pppfilter.cc. -

    -References Barry::Data::GetBuffer(), Barry::Data::GetData(), Barry::Data::GetSize(), and Barry::Data::ReleaseBuffer(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1PppFilter-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PppFilter-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1PppFilter-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1PppFilter-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::PppFilter Member List

    This is the complete list of members for Barry::PppFilter, including all inherited members.

    - - - - -
    PppFilter()Barry::PppFilter
    PppMode() constBarry::PppFilter [inline]
    Write(const Data &data)Barry::PppFilter
    Write(const Data &data, unsigned int prepend)Barry::PppFilter


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Probe.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Probe.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Probe.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Probe.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - - -Barry: Barry::Probe Class Reference - - - - - - - -

    Barry::Probe Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 53 of file probe.h. - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Probe (const char *busname=0, const char *devname=0)
    -int GetCount () const
    -int GetFailCount () const
    -const std::string & GetFailMsg (int index) const
    -const ProbeResultGet (int index) const
    -int FindActive (uint32_t pin=0) const

    Protected Member Functions

    -void ProbeMatching (int vendor, int product, const char *busname, const char *devname)
    -void ProbeDevice (Usb::DeviceIDType devid)
    -bool ProbePair (Usb::Device &dev, const Usb::EndpointPair &ep, uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequence)
    -bool ProbeModem (Usb::Device &dev, const Usb::EndpointPair &ep)
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Probe-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Probe-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Probe-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Probe-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Probe Member List

    This is the complete list of members for Barry::Probe, including all inherited members.

    - - - - - - - - - - -
    FindActive(uint32_t pin=0) constBarry::Probe
    Get(int index) constBarry::Probe [inline]
    GetCount() constBarry::Probe [inline]
    GetFailCount() constBarry::Probe [inline]
    GetFailMsg(int index) constBarry::Probe [inline]
    Probe(const char *busname=0, const char *devname=0)Barry::Probe
    ProbeDevice(Usb::DeviceIDType devid)Barry::Probe [protected]
    ProbeMatching(int vendor, int product, const char *busname, const char *devname)Barry::Probe [protected]
    ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep)Barry::Probe [protected]
    ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep, uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequence)Barry::Probe [protected]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordBuilder.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordBuilder.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordBuilder.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordBuilder.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ - - -Barry: Barry::RecordBuilder< RecordT, StorageT > Class Template Reference - - - - - - - -

    Barry::RecordBuilder< RecordT, StorageT > Class Template Reference

    #include <builder.h> -

    -

    Inheritance diagram for Barry::RecordBuilder< RecordT, StorageT >: -

    - -Barry::Builder - -List of all members.

    Detailed Description

    -

    template<class RecordT, class StorageT>
    - class Barry::RecordBuilder< RecordT, StorageT >

    - -Template class for easy creation of specific protocol packet builder objects. -

    -This template takes the following template arguments:

    -

      -
    • RecordT: One of the record classes in record.h
    • StorageT: A custom storage functor class. An object of this type will be called as a function with empty Record as an argument. The storage class is expected to fill the record object in preparation for building the packet out of that data. These calls happen on the fly as the data is sent to the device over USB, so it should not block forever.
    -

    -Example SaveDatabase() call:

    -

    -    FIXME
    -    
    -

    - -

    -Definition at line 87 of file builder.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

     RecordBuilder (StorageT &storage)
     Constructor that references an externally managed storage object.
     RecordBuilder (StorageT *storage)
     Constructor that references a locally managed storage object.
    ~RecordBuilder ()
    virtual bool Retrieve (unsigned int databaseId)
     Called first in the sequence, to allow the application to load the needed data from memory, disk, etc.
    virtual uint8_t GetRecType () const
     Called to retrive the unique ID for this record.
    -virtual uint32_t GetUniqueId () const
    virtual void BuildHeader (Data &data, size_t &offset)
     Functor member called by Controller::SaveDatabase() during processing.
    virtual void BuildFields (Data &data, size_t &offset)
     Called to build the record field data.
    -


    Constructor & Destructor Documentation

    - -
    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - -
    Barry::RecordBuilder< RecordT, StorageT >::RecordBuilder (StorageT &  storage  )  [inline]
    -
    -
    - -

    -Constructor that references an externally managed storage object. -

    - -

    -Definition at line 95 of file builder.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - -
    Barry::RecordBuilder< RecordT, StorageT >::RecordBuilder (StorageT *  storage  )  [inline]
    -
    -
    - -

    -Constructor that references a locally managed storage object. -

    -The pointer passed in will be stored, and freed when this class is destroyed. It is safe to call this constructor with a 'new'ly created storage object. -

    -Definition at line 102 of file builder.h. -

    -

    -


    Member Function Documentation

    - -
    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - -
    virtual bool Barry::RecordBuilder< RecordT, StorageT >::Retrieve (unsigned int  databaseId  )  [inline, virtual]
    -
    -
    - -

    -Called first in the sequence, to allow the application to load the needed data from memory, disk, etc. -

    -If successful, return true. If at the end of the series, return false. -

    -Implements Barry::Builder. -

    -Definition at line 111 of file builder.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - -
    virtual uint8_t Barry::RecordBuilder< RecordT, StorageT >::GetRecType (  )  const [inline, virtual]
    -
    -
    - -

    -Called to retrive the unique ID for this record. -

    - -

    -Implements Barry::Builder. -

    -Definition at line 116 of file builder.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::RecordBuilder< RecordT, StorageT >::BuildHeader (Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Functor member called by Controller::SaveDatabase() during processing. -

    - -

    -Implements Barry::Builder. -

    -Definition at line 128 of file builder.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::RecordBuilder< RecordT, StorageT >::BuildFields (Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to build the record field data. -

    -Store the raw data in data, using offset to know where to write. Be sure to update offset, and be sure to adjust the size of the data packet (possibly with Data::ReleaseBuffer()). -

    -Implements Barry::Builder. -

    -Definition at line 133 of file builder.h. -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordBuilder-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordBuilder-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordBuilder-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordBuilder-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::RecordBuilder< RecordT, StorageT > Member List

    This is the complete list of members for Barry::RecordBuilder< RecordT, StorageT >, including all inherited members.

    - - - - - - - - - - -
    Builder()Barry::Builder [inline]
    BuildFields(Data &data, size_t &offset)Barry::RecordBuilder< RecordT, StorageT > [inline, virtual]
    BuildHeader(Data &data, size_t &offset)Barry::RecordBuilder< RecordT, StorageT > [inline, virtual]
    GetRecType() constBarry::RecordBuilder< RecordT, StorageT > [inline, virtual]
    GetUniqueId() constBarry::RecordBuilder< RecordT, StorageT > [inline, virtual]
    RecordBuilder(StorageT &storage)Barry::RecordBuilder< RecordT, StorageT > [inline]
    RecordBuilder(StorageT *storage)Barry::RecordBuilder< RecordT, StorageT > [inline]
    Retrieve(unsigned int databaseId)Barry::RecordBuilder< RecordT, StorageT > [inline, virtual]
    ~Builder()Barry::Builder [inline, virtual]
    ~RecordBuilder()Barry::RecordBuilder< RecordT, StorageT > [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordBuilder.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordBuilder.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordFetch.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordFetch.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordFetch.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordFetch.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: Barry::RecordFetch< RecordT > Class Template Reference - - - - - - - -

    Barry::RecordFetch< RecordT > Class Template Reference

    #include <builder.h> -

    -List of all members.


    Detailed Description

    -

    template<class RecordT>
    - class Barry::RecordFetch< RecordT >

    - -Generic record fetch class, to help with using records without builder classes. -

    - -

    -Definition at line 147 of file builder.h. - - - - - - -

    Public Member Functions

    RecordFetch (const RecordT &rec)
    -bool operator() (RecordT &rec, unsigned int dbId) const
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordFetch-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordFetch-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordFetch-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordFetch-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::RecordFetch< RecordT > Member List

    This is the complete list of members for Barry::RecordFetch< RecordT >, including all inherited members.

    - - -
    operator()(RecordT &rec, unsigned int dbId) constBarry::RecordFetch< RecordT > [inline]
    RecordFetch(const RecordT &rec)Barry::RecordFetch< RecordT > [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordParser.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordParser.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordParser.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordParser.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,317 +0,0 @@ - - -Barry: Barry::RecordParser< RecordT, StorageT > Class Template Reference - - - - - - - -

    Barry::RecordParser< RecordT, StorageT > Class Template Reference

    #include <parser.h> -

    -

    Inheritance diagram for Barry::RecordParser< RecordT, StorageT >: -

    - -Barry::Parser - -List of all members.

    Detailed Description

    -

    template<class RecordT, class StorageT>
    - class Barry::RecordParser< RecordT, StorageT >

    - -Template class for easy creation of specific parser objects. -

    -This template takes the following template arguments:

    -

      -
    • RecordT: One of the record parser classes in record.h
    • StorageT: A custom storage functor class. An object of this type will be called as a function with parsed Record as an argument. This happens on the fly as the data is retrieved from the device over USB, so it should not block forever.
    -

    -Example LoadDatabase() call:

    -

    -    struct StoreContact
    -    {
    -        std::vector<Contact> &array;
    -        StoreContact(std::vector<Contact> &a) : array(a) {}
    -        void operator() (const Contact &c)
    -        {
    -            array.push_back(c);
    -        }
    -    };

    -

        Controller con(probeResult);
    -    con.OpenMode(Controller::Desktop);
    -    std::vector<Contact> contactList;
    -    StoreContact storage(contactList);
    -    RecordParser<Contact, StoreContact> parser(storage);
    -    con.LoadDatabase(con.GetDBID("Address Book"), parser);
    -    
    -

    - -

    -Definition at line 111 of file parser.h. - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

     RecordParser (StorageT &storage)
     Constructor that references an externally managed storage object.
     RecordParser (StorageT *storage)
     Constructor that references a locally managed storage object.
    ~RecordParser ()
    virtual void Clear ()
     Reset and prepare for a new raw data packet.
    virtual void SetIds (uint8_t RecType, uint32_t UniqueId)
     Stores the IDs.
    virtual void ParseHeader (const Data &data, size_t &offset)
     Called to parse the header portion of the raw data packet.
    virtual void ParseFields (const Data &data, size_t &offset)
     Called to parse sub fields in the raw data packet.
    virtual void Store ()
     Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.
    -


    Constructor & Destructor Documentation

    - -
    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - -
    Barry::RecordParser< RecordT, StorageT >::RecordParser (StorageT &  storage  )  [inline]
    -
    -
    - -

    -Constructor that references an externally managed storage object. -

    - -

    -Definition at line 119 of file parser.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - -
    Barry::RecordParser< RecordT, StorageT >::RecordParser (StorageT *  storage  )  [inline]
    -
    -
    - -

    -Constructor that references a locally managed storage object. -

    -The pointer passed in will be stored, and freed when this class is destroyed. It is safe to call this constructor with a 'new'ly created storage object. -

    -Definition at line 126 of file parser.h. -

    -

    -


    Member Function Documentation

    - -
    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - -
    virtual void Barry::RecordParser< RecordT, StorageT >::Clear (  )  [inline, virtual]
    -
    -
    - -

    -Reset and prepare for a new raw data packet. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 135 of file parser.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::RecordParser< RecordT, StorageT >::SetIds (uint8_t  RecType,
    uint32_t  UniqueId 
    ) [inline, virtual]
    -
    -
    - -

    -Stores the IDs. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 140 of file parser.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::RecordParser< RecordT, StorageT >::ParseHeader (const Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse the header portion of the raw data packet. -

    -data contains the entire packet, and offset contains the location at which to start parsing. -

    -Reimplemented from Barry::Parser. -

    -Definition at line 145 of file parser.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - - - - - - - - - - - -
    virtual void Barry::RecordParser< RecordT, StorageT >::ParseFields (const Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse sub fields in the raw data packet. -

    -The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing. -

    -Reimplemented from Barry::Parser. -

    -Definition at line 150 of file parser.h. -

    -

    - -

    -
    -
    -template<class RecordT, class StorageT>
    - - - - - - - - -
    virtual void Barry::RecordParser< RecordT, StorageT >::Store (  )  [inline, virtual]
    -
    -
    - -

    -Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 155 of file parser.h. -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordParser-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordParser-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordParser-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordParser-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::RecordParser< RecordT, StorageT > Member List

    This is the complete list of members for Barry::RecordParser< RecordT, StorageT >, including all inherited members.

    - - - - - - - - - - -
    Clear()Barry::RecordParser< RecordT, StorageT > [inline, virtual]
    ParseFields(const Data &data, size_t &offset)Barry::RecordParser< RecordT, StorageT > [inline, virtual]
    ParseHeader(const Data &data, size_t &offset)Barry::RecordParser< RecordT, StorageT > [inline, virtual]
    Parser()Barry::Parser [inline]
    RecordParser(StorageT &storage)Barry::RecordParser< RecordT, StorageT > [inline]
    RecordParser(StorageT *storage)Barry::RecordParser< RecordT, StorageT > [inline]
    SetIds(uint8_t RecType, uint32_t UniqueId)Barry::RecordParser< RecordT, StorageT > [inline, virtual]
    Store()Barry::RecordParser< RecordT, StorageT > [inline, virtual]
    ~Parser()Barry::Parser [inline, virtual]
    ~RecordParser()Barry::RecordParser< RecordT, StorageT > [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordParser.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordParser.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordStateTable.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordStateTable.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordStateTable.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordStateTable.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ - - -Barry: Barry::RecordStateTable Class Reference - - - - - - - -

    Barry::RecordStateTable Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 96 of file record.h. - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef RecordStateTableState State
    -typedef unsigned int IndexType
    -typedef std::map< IndexType,
    - State
    StateMapType

    Public Member Functions

    RecordStateTable ()
    ~RecordStateTable ()
    -void Parse (const Data &data)
    -void Clear ()
    -bool GetIndex (uint32_t RecordId, IndexType *pFoundIndex=0) const
    -uint32_t MakeNewRecordId () const
    -void Dump (std::ostream &os) const

    Public Attributes

    -StateMapType StateMap
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordStateTable-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordStateTable-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1RecordStateTable-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1RecordStateTable-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::RecordStateTable Member List

    This is the complete list of members for Barry::RecordStateTable, including all inherited members.

    - - - - - - - - - - - -
    Clear()Barry::RecordStateTable
    Dump(std::ostream &os) constBarry::RecordStateTable
    GetIndex(uint32_t RecordId, IndexType *pFoundIndex=0) constBarry::RecordStateTable
    IndexType typedefBarry::RecordStateTable
    MakeNewRecordId() constBarry::RecordStateTable
    Parse(const Data &data)Barry::RecordStateTable
    RecordStateTable()Barry::RecordStateTable
    State typedefBarry::RecordStateTable
    StateMapBarry::RecordStateTable
    StateMapType typedefBarry::RecordStateTable
    ~RecordStateTable()Barry::RecordStateTable


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SavedMessage.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SavedMessage.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SavedMessage.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SavedMessage.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ - - -Barry: Barry::SavedMessage Class Reference - - - - - - - -

    Barry::SavedMessage Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 45 of file r_saved_message.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  MessagePriorityType
    enum  MessageSensitivityType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    SavedMessage ()
    ~SavedMessage ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    -void BuildFields (Data &data, size_t &offset) const
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const SavedMessage &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -EmailAddress From
    -EmailAddress To
    -EmailAddress Cc
    -EmailAddress Bcc
    -EmailAddress Sender
    -EmailAddress ReplyTo
    -std::string Subject
    -std::string Body
    -std::string Attachment
    -uint32_t MessageRecordId
    -uint32_t MessageReplyTo
    -time_t MessageDateSent
    -time_t MessageDateReceived
    -bool MessageTruncated
    -bool MessageRead
    -bool MessageReply
    -bool MessageSaved
    -bool MessageSavedDeleted
    -MessagePriorityType MessagePriority
    -MessageSensitivityType MessageSensitivity
    -std::vector< UnknownFieldUnknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SavedMessage-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SavedMessage-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SavedMessage-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SavedMessage-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::SavedMessage Member List

    This is the complete list of members for Barry::SavedMessage, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttachmentBarry::SavedMessage
    BccBarry::SavedMessage
    BodyBarry::SavedMessage
    BuildFields(Data &data, size_t &offset) constBarry::SavedMessage
    BuildHeader(Data &data, size_t &offset) constBarry::SavedMessage
    CcBarry::SavedMessage
    Clear()Barry::SavedMessage
    Dump(std::ostream &os) constBarry::SavedMessage
    FromBarry::SavedMessage
    GetDBName()Barry::SavedMessage [inline, static]
    GetDefaultRecType()Barry::SavedMessage [inline, static]
    GetRecType() constBarry::SavedMessage [inline]
    GetUniqueId() constBarry::SavedMessage [inline]
    MessageDateReceivedBarry::SavedMessage
    MessageDateSentBarry::SavedMessage
    MessagePriorityBarry::SavedMessage
    MessagePriorityType enum nameBarry::SavedMessage
    MessageReadBarry::SavedMessage
    MessageRecordIdBarry::SavedMessage
    MessageReplyBarry::SavedMessage
    MessageReplyToBarry::SavedMessage
    MessageSavedBarry::SavedMessage
    MessageSavedDeletedBarry::SavedMessage
    MessageSensitivityBarry::SavedMessage
    MessageSensitivityType enum nameBarry::SavedMessage
    MessageTruncatedBarry::SavedMessage
    operator<(const SavedMessage &other) constBarry::SavedMessage [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::SavedMessage
    ParseFields(const Data &data, size_t &offset)Barry::SavedMessage
    ParseHeader(const Data &data, size_t &offset)Barry::SavedMessage
    RecordIdBarry::SavedMessage
    RecTypeBarry::SavedMessage
    ReplyToBarry::SavedMessage
    SavedMessage()Barry::SavedMessage
    SenderBarry::SavedMessage
    SetIds(uint8_t Type, uint32_t Id)Barry::SavedMessage [inline]
    SubjectBarry::SavedMessage
    ToBarry::SavedMessage
    UnknownsBarry::SavedMessage
    ~SavedMessage()Barry::SavedMessage


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1scoped__lock.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1scoped__lock.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1scoped__lock.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1scoped__lock.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::scoped_lock Class Reference - - - - - - - -

    Barry::scoped_lock Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 29 of file scoped_lock.h. - - - - - - - - -

    Public Member Functions

    scoped_lock (pthread_mutex_t &mutex)
    ~scoped_lock ()
    -void unlock ()
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1scoped__lock-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1scoped__lock-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1scoped__lock-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1scoped__lock-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::scoped_lock Member List

    This is the complete list of members for Barry::scoped_lock, including all inherited members.

    - - - -
    scoped_lock(pthread_mutex_t &mutex)Barry::scoped_lock [inline]
    unlock()Barry::scoped_lock [inline]
    ~scoped_lock()Barry::scoped_lock [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ - - -Barry: Barry::ServiceBookConfig Class Reference - - - - - - - -

    Barry::ServiceBookConfig Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 47 of file r_servicebook.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    ServiceBookConfig ()
    ~ServiceBookConfig ()
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    void BuildFields (Data &data, size_t &offset) const
     Build fields part of record.
    -void Clear ()
    -void Dump (std::ostream &os) const

    Public Attributes

    -uint8_t Format
    -UnknownsType Unknowns
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::ServiceBookConfig::BuildFields (Data data,
    size_t &  offset 
    ) const
    -
    -
    - -

    -Build fields part of record. -

    - -

    -Definition at line 170 of file r_servicebook.cc. -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBookConfig-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ServiceBookConfig Member List

    This is the complete list of members for Barry::ServiceBookConfig, including all inherited members.

    - - - - - - - - - - - - -
    BuildFields(Data &data, size_t &offset) constBarry::ServiceBookConfig
    BuildHeader(Data &data, size_t &offset) constBarry::ServiceBookConfig
    Clear()Barry::ServiceBookConfig
    Dump(std::ostream &os) constBarry::ServiceBookConfig
    FormatBarry::ServiceBookConfig
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::ServiceBookConfig
    ParseFields(const Data &data, size_t &offset)Barry::ServiceBookConfig
    ParseHeader(const Data &data, size_t &offset)Barry::ServiceBookConfig
    ServiceBookConfig()Barry::ServiceBookConfig
    UnknownsBarry::ServiceBookConfig
    UnknownsType typedefBarry::ServiceBookConfig
    ~ServiceBookConfig()Barry::ServiceBookConfig


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBook.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBook.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBook.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBook.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ - - -Barry: Barry::ServiceBook Class Reference - - - - - - - -

    Barry::ServiceBook Class Reference
    - -[RecordParserClasses] -

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 81 of file r_servicebook.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    ServiceBook ()
    ~ServiceBook ()
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void BuildHeader (Data &data, size_t &offset) const
    void BuildFields (Data &data, size_t &offset) const
     Build fields part of record.
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const ServiceBook &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -std::string Name
    -std::string HiddenName
    -std::string Description
    -std::string DSID
    -std::string BesDomain
    -std::string UniqueId
    -std::string ContentId
    -ServiceBookConfig Config
    -UnknownsType Unknowns
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::ServiceBook::BuildFields (Data data,
    size_t &  offset 
    ) const
    -
    -
    - -

    -Build fields part of record. -

    - -

    -Definition at line 348 of file r_servicebook.cc. -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBook-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBook-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ServiceBook-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ServiceBook-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ServiceBook Member List

    This is the complete list of members for Barry::ServiceBook, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    BesDomainBarry::ServiceBook
    BuildFields(Data &data, size_t &offset) constBarry::ServiceBook
    BuildHeader(Data &data, size_t &offset) constBarry::ServiceBook
    Clear()Barry::ServiceBook
    ConfigBarry::ServiceBook
    ContentIdBarry::ServiceBook
    DescriptionBarry::ServiceBook
    DSIDBarry::ServiceBook
    Dump(std::ostream &os) constBarry::ServiceBook
    GetDBName()Barry::ServiceBook [inline, static]
    GetDefaultRecType()Barry::ServiceBook [inline, static]
    GetRecType() constBarry::ServiceBook [inline]
    GetUniqueId() constBarry::ServiceBook [inline]
    HiddenNameBarry::ServiceBook
    NameBarry::ServiceBook
    operator<(const ServiceBook &other) constBarry::ServiceBook [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::ServiceBook
    ParseFields(const Data &data, size_t &offset)Barry::ServiceBook
    ParseHeader(const Data &data, size_t &offset)Barry::ServiceBook
    RecordIdBarry::ServiceBook
    RecTypeBarry::ServiceBook
    ServiceBook()Barry::ServiceBook
    SetIds(uint8_t Type, uint32_t Id)Barry::ServiceBook [inline]
    UniqueIdBarry::ServiceBook
    UnknownsBarry::ServiceBook
    UnknownsType typedefBarry::ServiceBook
    ~ServiceBook()Barry::ServiceBook


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Socket.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Socket.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Socket.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Socket.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ - - -Barry: Barry::Socket Class Reference - - - - - - - -

    Barry::Socket Class Reference

    #include <socket.h> -

    -List of all members.


    Detailed Description

    -Encapsulates a "logical socket" in the Blackberry USB protocol. -

    -By default, provides raw send/receive access, as well as packet writing on socket 0, which is always open.

    -There are Open and Close members to open data sockets which are used to transfer data to and from the device.

    -The destructor will close any non-0 open sockets automatically.

    -Requires an active Usb::Device object to work on. -

    - -

    -Definition at line 119 of file socket.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    ~Socket ()
    -uint16_t GetSocket () const
    -uint8_t GetCloseFlag () const
    -void Close ()
    void Send (Data &send, int timeout=-1)
     Sends 'send' data to device, no receive.
    void Send (Data &send, Data &receive, int timeout=-1)
     Sends 'send' data to device, and waits for response.
    -void Send (Barry::Packet &packet, int timeout=-1)
    -void Receive (Data &receive, int timeout=-1)
    -void Packet (Data &send, Data &receive, int timeout=-1)
    -void Packet (Barry::Packet &packet, int timeout=-1)
    -void NextRecord (Data &receive)
    -void RegisterInterest (SocketRoutingQueue::SocketDataHandler handler, void *context)
    -void UnregisterInterest ()

    Protected Member Functions

    -void CheckSequence (const Data &seq)
    -void ForceClosed ()
    Socket (SocketZero &zero, uint16_t socket, uint8_t closeFlag)

    Friends

    -class SocketZero
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::Socket::Send (Data send,
    int  timeout = -1 
    )
    -
    -
    - -

    -Sends 'send' data to device, no receive. -

    -

    Returns:
    void
    -
    Exceptions:
    - - -
    Usb::Error on underlying bus errors.
    -
    - -

    -Definition at line 633 of file socket.cc. -

    -References Barry::Data::GetBuffer(), Barry::Data::GetSize(), htobs, MAKE_PACKETPTR_BUF, Barry::SocketZero::RawSend(), and SB_PACKET_HEADER_SIZE. -

    -Referenced by Packet(), and Send(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void Barry::Socket::Send (Data send,
    Data receive,
    int  timeout = -1 
    )
    -
    -
    - -

    -Sends 'send' data to device, and waits for response. -

    -

    Returns:
    void
    -
    Exceptions:
    - - -
    Usb::Error on underlying bus errors.
    -
    - -

    -Definition at line 652 of file socket.cc. -

    -References Receive(), and Send(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Socket-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Socket-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Socket-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Socket-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Socket Member List

    This is the complete list of members for Barry::Socket, including all inherited members.

    - - - - - - - - - - - - - - - - - -
    CheckSequence(const Data &seq)Barry::Socket [protected]
    Close()Barry::Socket
    ForceClosed()Barry::Socket [protected]
    GetCloseFlag() constBarry::Socket [inline]
    GetSocket() constBarry::Socket [inline]
    NextRecord(Data &receive)Barry::Socket
    Packet(Data &send, Data &receive, int timeout=-1)Barry::Socket
    Packet(Barry::Packet &packet, int timeout=-1)Barry::Socket
    Receive(Data &receive, int timeout=-1)Barry::Socket
    RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, void *context)Barry::Socket
    Send(Data &send, int timeout=-1)Barry::Socket
    Send(Data &send, Data &receive, int timeout=-1)Barry::Socket
    Send(Barry::Packet &packet, int timeout=-1)Barry::Socket
    Socket(SocketZero &zero, uint16_t socket, uint8_t closeFlag)Barry::Socket [protected]
    SocketZero classBarry::Socket [friend]
    UnregisterInterest()Barry::Socket
    ~Socket()Barry::Socket


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,457 +0,0 @@ - - -Barry: Barry::SocketRoutingQueue Class Reference - - - - - - - -

    Barry::SocketRoutingQueue Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 39 of file router.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef void(*) SocketDataHandler (void *ctx, Data *)
    -typedef std::tr1::shared_ptr<
    - QueueEntry
    QueueEntryPtr
    -typedef uint16_t SocketId
    -typedef std::map< SocketId,
    - QueueEntryPtr
    SocketQueueMap

    Public Member Functions

    SocketRoutingQueue (int prealloc_buffer_count=4)
    ~SocketRoutingQueue ()
    -void SetUsbDevice (Usb::Device *dev, int writeEp, int readEp)
    -void ClearUsbDevice ()
    -bool UsbDeviceReady ()
    -Usb::DeviceGetUsbDevice ()
    void AllocateBuffers (int count)
     This class starts out with no buffers, and will grow one buffer at a time if needed.
    bool DefaultRead (Data &receive, int timeout=-1)
     Returns the data for the next unregistered socket.
    DataHandle DefaultRead (int timeout=-1)
     This version does not perform a copy.
    void RegisterInterest (SocketId socket, SocketDataHandler handler=0, void *context=0)
     Register an interest in data from a certain socket.
    void UnregisterInterest (SocketId socket)
     Unregisters interest in data from the given socket, and discards any existing data in its interest queue.
    bool SocketRead (SocketId socket, Data &receive, int timeout=-1)
     Reads data from the interested socket cache.
    DataHandle SocketRead (SocketId socket, int timeout=-1)
     Copying is not performed with this function.
    -bool IsAvailable (SocketId socket) const
    bool DoRead (std::string &msg, int timeout=-1)
     Called by the application's "read thread" to read the next usb packet and route it to the correct queue.
    -void SpinoffSimpleReadThread ()

    Protected Member Functions

    void ReturnBuffer (Data *buf)
     Provides a method of returning a buffer to the free queue after processing.

    Static Protected Member Functions

    static void * SimpleReadThread (void *userptr)
     Convenience thread to handle USB read activity.

    Friends

    -class DataHandle

    Classes

    struct  QueueEntry
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    void Barry::SocketRoutingQueue::ReturnBuffer (Data buf  )  [protected]
    -
    -
    - -

    -Provides a method of returning a buffer to the free queue after processing. -

    -The DataHandle class calls this automatically from its destructor. -

    -Definition at line 69 of file router.cc. -

    -References Barry::DataQueue::push(). -

    -

    - -

    -
    - - - - - - - - - -
    void * Barry::SocketRoutingQueue::SimpleReadThread (void *  userptr  )  [static, protected]
    -
    -
    - -

    -Convenience thread to handle USB read activity. -

    - -

    -Definition at line 80 of file router.cc. -

    -References DoRead(), and m_continue_reading. -

    -Referenced by SpinoffSimpleReadThread(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::SocketRoutingQueue::AllocateBuffers (int  count  ) 
    -
    -
    - -

    -This class starts out with no buffers, and will grow one buffer at a time if needed. -

    -Call this to allocate count buffers all at once and place them on the free queue. After calling this function, at least count buffers will exist in the free queue. If there are already count buffers, none will be added. -

    -Definition at line 136 of file router.cc. -

    -References Barry::DataQueue::push(), and Barry::DataQueue::size(). -

    -Referenced by SocketRoutingQueue(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    bool Barry::SocketRoutingQueue::DefaultRead (Data receive,
    int  timeout = -1 
    )
    -
    -
    - -

    -Returns the data for the next unregistered socket. -

    -Blocks until timeout or data is available. Returns false (or null pointer) on timeout and no data. With the return version of the function, there is no copying performed.

    -This version performs a copy. -

    -Definition at line 157 of file router.cc. -

    -References Barry::DataHandle::get(). -

    -

    - -

    -
    - - - - - - - - - -
    DataHandle Barry::SocketRoutingQueue::DefaultRead (int  timeout = -1  ) 
    -
    -
    - -

    -This version does not perform a copy. -

    - -

    -Definition at line 171 of file router.cc. -

    -References DataHandle, and Barry::DataQueue::wait_pop(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void Barry::SocketRoutingQueue::RegisterInterest (SocketId  socket,
    SocketDataHandler  handler = 0,
    void *  context = 0 
    )
    -
    -
    - -

    -Register an interest in data from a certain socket. -

    -To read from that socket, use the SocketRead() function from then on.

    -Any non-registered socket goes in the default queue and must be read by DefaultRead()

    -If not null, handler is called when new data is read. It will be called in the same thread instance that DoRead() is called from. Handler is passed the DataQueue Data pointer, and so no copying is done. Once the handler returns, the data is considered processed and not added to the interested queue, but instead returned to m_free.

    -Throws std::logic_error if already registered. -

    -Definition at line 196 of file router.cc. -

    -Referenced by Barry::Socket::RegisterInterest(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::SocketRoutingQueue::UnregisterInterest (SocketId  socket  ) 
    -
    -
    - -

    -Unregisters interest in data from the given socket, and discards any existing data in its interest queue. -

    -Any new incoming data for this socket will be placed in the default queue. -

    -Definition at line 218 of file router.cc. -

    -References Barry::DataQueue::append_from(). -

    -Referenced by Barry::Socket::UnregisterInterest(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool Barry::SocketRoutingQueue::SocketRead (SocketId  socket,
    Data receive,
    int  timeout = -1 
    )
    -
    -
    - -

    -Reads data from the interested socket cache. -

    -Can only read from sockets that have been previously registered.

    -Blocks until timeout or data is available.

    -Returns false (or null pointer) on timeout and no data. With the return version of the function, there is no copying performed.

    -Throws std::logic_error if a socket was requested that was not previously registered.

    -Copying is performed with this function. -

    -Definition at line 254 of file router.cc. -

    -References Barry::DataHandle::get(). -

    -Referenced by Barry::Socket::Receive(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    DataHandle Barry::SocketRoutingQueue::SocketRead (SocketId  socket,
    int  timeout = -1 
    )
    -
    -
    - -

    -Copying is not performed with this function. -

    -Throws std::logic_error if a socket was requested that was not previously registered. -

    -Definition at line 271 of file router.cc. -

    -References DataHandle, Barry::DataQueue::m_queue, and Barry::DataQueue::wait_pop(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    bool Barry::SocketRoutingQueue::DoRead (std::string &  msg,
    int  timeout = -1 
    )
    -
    -
    - -

    -Called by the application's "read thread" to read the next usb packet and route it to the correct queue. -

    -Returns after every read, even if a handler is associated with a queue. Note: this function is safe to call before SetUsbDevice() is called... it just doesn't do anything if there is no usb device to work with.

    -Timeout is in milliseconds.

    -Returns false in the case of USB errors and puts the error message in msg. -

    -Definition at line 336 of file router.cc. -

    -References btohs, Usb::Device::BulkRead(), DataHandle, Barry::DataHandle::get(), Barry::Data::GetSize(), MAKE_PACKET, Barry::DataQueue::pop(), Barry::DataQueue::push(), Barry::DataHandle::release(), and Barry::scoped_lock::unlock(). -

    -Referenced by SimpleReadThread(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketRoutingQueue-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::SocketRoutingQueue Member List

    This is the complete list of members for Barry::SocketRoutingQueue, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - -
    AllocateBuffers(int count)Barry::SocketRoutingQueue
    ClearUsbDevice()Barry::SocketRoutingQueue
    DataHandle classBarry::SocketRoutingQueue [friend]
    DefaultRead(Data &receive, int timeout=-1)Barry::SocketRoutingQueue
    DefaultRead(int timeout=-1)Barry::SocketRoutingQueue
    DoRead(std::string &msg, int timeout=-1)Barry::SocketRoutingQueue
    GetUsbDevice()Barry::SocketRoutingQueue [inline]
    IsAvailable(SocketId socket) constBarry::SocketRoutingQueue
    QueueEntryPtr typedefBarry::SocketRoutingQueue
    RegisterInterest(SocketId socket, SocketDataHandler handler=0, void *context=0)Barry::SocketRoutingQueue
    ReturnBuffer(Data *buf)Barry::SocketRoutingQueue [protected]
    SetUsbDevice(Usb::Device *dev, int writeEp, int readEp)Barry::SocketRoutingQueue
    SimpleReadThread(void *userptr)Barry::SocketRoutingQueue [protected, static]
    SocketDataHandler typedefBarry::SocketRoutingQueue
    SocketId typedefBarry::SocketRoutingQueue
    SocketQueueMap typedefBarry::SocketRoutingQueue
    SocketRead(SocketId socket, Data &receive, int timeout=-1)Barry::SocketRoutingQueue
    SocketRead(SocketId socket, int timeout=-1)Barry::SocketRoutingQueue
    SocketRoutingQueue(int prealloc_buffer_count=4)Barry::SocketRoutingQueue
    SpinoffSimpleReadThread()Barry::SocketRoutingQueue
    UnregisterInterest(SocketId socket)Barry::SocketRoutingQueue
    UsbDeviceReady()Barry::SocketRoutingQueue
    ~SocketRoutingQueue()Barry::SocketRoutingQueue


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketZero.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketZero.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketZero.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketZero.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,193 +0,0 @@ - - -Barry: Barry::SocketZero Class Reference - - - - - - - -

    Barry::SocketZero Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 44 of file socket.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    SocketZero (SocketRoutingQueue &queue, int writeEndpoint, uint8_t zeroSocketSequenceStart=0)
    SocketZero (Usb::Device &dev, int writeEndpoint, int readEndpoint, uint8_t zeroSocketSequenceStart=0)
    ~SocketZero ()
    -uint8_t GetZeroSocketSequence () const
    -void SetRoutingQueue (SocketRoutingQueue &queue)
    -void UnlinkRoutingQueue ()
    -void Send (Data &send, int timeout=-1)
    -void Send (Data &send, Data &receive, int timeout=-1)
    -void Send (Barry::Packet &packet, int timeout=-1)
    SocketHandle Open (uint16_t socket, const char *password=0)
     Open a logical socket on the device.
    void Close (Socket &socket)
     Closes a non-default socket (i.e.

    Protected Member Functions

    bool SequencePacket (const Data &data)
     Returns true if this is a sequence packet that should be ignored.

    Friends

    -class Socket
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - -
    bool Barry::SocketZero::SequencePacket (const Data data  )  [protected]
    -
    -
    - -

    -Returns true if this is a sequence packet that should be ignored. -

    -This function is used in SocketZero::RawReceive() in order to determine whether to keep reading or not. By default, this function checks whether the packet is a sequence packet or not, and returns true if so. Also, if it is a sequence packet, it checks the validity of the sequence number.

    -If sequence packets become important in the future, this function could be changed to call a user-defined callback, in order to handle these things out of band. -

    -Definition at line 340 of file socket.cc. -

    -References Barry::Data::GetSize(), IS_COMMAND, MIN_PACKET_SIZE, and SB_COMMAND_SEQUENCE_HANDSHAKE. -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    SocketHandle Barry::SocketZero::Open (uint16_t  socket,
    const char *  password = 0 
    )
    -
    -
    - -

    -Open a logical socket on the device. -

    -Both the socket number and the flag are based on the response to the SELECT_MODE command. See Controller::SelectMode() for more info on this.

    -The packet sequence is normal for most socket operations.

    -

      -
    • Down: command packet with OPEN_SOCKET
    • Up: optional sequence handshake packet
    • Up: command response, which repeats the socket and flag data as confirmation
    -

    -

    Exceptions:
    - - - -
    Barry::Error Thrown on protocol error.
    Barry::BadPassword Thrown on invalid password, or not enough retries left on device.
    -
    - -

    -Definition at line 420 of file socket.cc. -

    -References BARRY_MIN_PASSWORD_TRIES, BARRY_MIN_PASSWORD_TRIES_ASC, Barry::ZeroPacket::ChallengeSeed(), Barry::Packet::Command(), GetZeroSocketSequence(), Barry::ZeroPacket::RemainingTries(), SB_COMMAND_OPENED_SOCKET, SB_COMMAND_PASSWORD_CHALLENGE, SB_COMMAND_PASSWORD_FAILED, Socket, Barry::ZeroPacket::SocketResponse(), and Barry::ZeroPacket::SocketSequence(). -

    -Referenced by Barry::Mode::Serial::Open(), and Barry::Mode::Desktop::RetryPassword(). -

    -

    - -

    -
    - - - - - - - - - -
    void Barry::SocketZero::Close (Socket socket  ) 
    -
    -
    - -

    -Closes a non-default socket (i.e. -

    -non-zero socket number)

    -The packet sequence is just like Open(), except the command is CLOSE_SOCKET.

    -

    Exceptions:
    - - -
    Barry::Error 
    -
    - -

    -Definition at line 507 of file socket.cc. -

    -References btohs, Barry::Protocol::CheckSize(), Barry::Protocol::Packet::command, Barry::Socket::ForceClosed(), Barry::Socket::GetCloseFlag(), Barry::Socket::GetSocket(), htobs, IS_COMMAND, MAKE_PACKET, SB_COMMAND_CLOSE_SOCKET, SB_COMMAND_CLOSED_SOCKET, SB_COMMAND_SEQUENCE_HANDSHAKE, SB_SOCKET_PACKET_HEADER_SIZE, Send(), Barry::Protocol::Packet::size, Barry::Protocol::Packet::PacketData::socket, Barry::Protocol::Packet::socket, and Barry::Protocol::Packet::u. -

    -Referenced by Barry::Socket::Close(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketZero-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketZero-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1SocketZero-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1SocketZero-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::SocketZero Member List

    This is the complete list of members for Barry::SocketZero, including all inherited members.

    - - - - - - - - - - - - - -
    Close(Socket &socket)Barry::SocketZero
    GetZeroSocketSequence() constBarry::SocketZero [inline]
    Open(uint16_t socket, const char *password=0)Barry::SocketZero
    Send(Data &send, int timeout=-1)Barry::SocketZero
    Send(Data &send, Data &receive, int timeout=-1)Barry::SocketZero
    Send(Barry::Packet &packet, int timeout=-1)Barry::SocketZero
    SequencePacket(const Data &data)Barry::SocketZero [protected]
    SetRoutingQueue(SocketRoutingQueue &queue)Barry::SocketZero
    Socket classBarry::SocketZero [friend]
    SocketZero(SocketRoutingQueue &queue, int writeEndpoint, uint8_t zeroSocketSequenceStart=0)Barry::SocketZero [explicit]
    SocketZero(Usb::Device &dev, int writeEndpoint, int readEndpoint, uint8_t zeroSocketSequenceStart=0)Barry::SocketZero
    UnlinkRoutingQueue()Barry::SocketZero
    ~SocketZero()Barry::SocketZero


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Task.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Task.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Task.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Task.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ - - -Barry: Barry::Task Class Reference - - - - - - - -

    Barry::Task Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 34 of file r_task.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    enum  AlarmFlagType
    enum  RecurringCodeType
    enum  PriorityFlagType
    enum  StatusFlagType
    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    Task ()
    ~Task ()
    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    -void ParseRecurrenceData (const void *data)
    -void BuildRecurrenceData (void *data)
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Task &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -uint8_t TaskType
    -std::string Summary
    -std::string Notes
    -std::string Categories
    -std::string UID
    -time_t StartTime
    -time_t DueTime
    -time_t AlarmTime
    -int TimeZoneCode
    -AlarmFlagType AlarmType
    -unsigned short Interval
    -RecurringCodeType RecurringType
    -time_t RecurringEndTime
    -unsigned short DayOfWeek
    -unsigned short WeekOfMonth
    -unsigned short DayOfMonth
    -unsigned short MonthOfYear
    -unsigned char WeekDays
    -int ClassType
    -PriorityFlagType PriorityFlag
    -StatusFlagType StatusFlag
    -bool Recurring
    -bool Perpetual
    -bool DueDateFlag
    -UnknownsType Unknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Task-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Task-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Task-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Task-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Task Member List

    This is the complete list of members for Barry::Task, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AlarmFlagType enum nameBarry::Task
    AlarmTimeBarry::Task
    AlarmTypeBarry::Task
    BuildRecurrenceData(void *data)Barry::Task
    CategoriesBarry::Task
    ClassTypeBarry::Task
    Clear()Barry::Task
    DayOfMonthBarry::Task
    DayOfWeekBarry::Task
    DueDateFlagBarry::Task
    DueTimeBarry::Task
    Dump(std::ostream &os) constBarry::Task
    GetDBName()Barry::Task [inline, static]
    GetDefaultRecType()Barry::Task [inline, static]
    GetRecType() constBarry::Task [inline]
    GetUniqueId() constBarry::Task [inline]
    IntervalBarry::Task
    MonthOfYearBarry::Task
    NotesBarry::Task
    operator<(const Task &other) constBarry::Task [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Task
    ParseFields(const Data &data, size_t &offset)Barry::Task
    ParseHeader(const Data &data, size_t &offset)Barry::Task
    ParseRecurrenceData(const void *data)Barry::Task
    PerpetualBarry::Task
    PriorityFlagBarry::Task
    PriorityFlagType enum nameBarry::Task
    RecordIdBarry::Task
    RecTypeBarry::Task
    RecurringBarry::Task
    RecurringCodeType enum nameBarry::Task
    RecurringEndTimeBarry::Task
    RecurringTypeBarry::Task
    SetIds(uint8_t Type, uint32_t Id)Barry::Task [inline]
    StartTimeBarry::Task
    StatusFlagBarry::Task
    StatusFlagType enum nameBarry::Task
    SummaryBarry::Task
    Task()Barry::Task
    TaskTypeBarry::Task
    TimeZoneCodeBarry::Task
    UIDBarry::Task
    UnknownsBarry::Task
    UnknownsType typedefBarry::Task
    WeekDaysBarry::Task
    WeekOfMonthBarry::Task
    ~Task()Barry::Task


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Timezone.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Timezone.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Timezone.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Timezone.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ - - -Barry: Barry::Timezone Class Reference - - - - - - - -

    Barry::Timezone Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 35 of file r_timezone.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::vector< UnknownFieldUnknownsType

    Public Member Functions

    Timezone ()
    -virtual ~Timezone ()
    -const unsigned char * ParseField (const unsigned char *begin, const unsigned char *end)
    -uint8_t GetRecType () const
    -uint32_t GetUniqueId () const
    -void SetIds (uint8_t Type, uint32_t Id)
    -void ParseHeader (const Data &data, size_t &offset)
    -void ParseFields (const Data &data, size_t &offset)
    -void Clear ()
    -void Dump (std::ostream &os) const
    -bool operator< (const Timezone &other) const

    Static Public Member Functions

    -static const char * GetDBName ()
    -static uint8_t GetDefaultRecType ()

    Public Attributes

    -uint8_t RecType
    -uint32_t RecordId
    -uint8_t TZType
    -uint32_t DSTOffset
    -int32_t Index
    -int32_t Offset
    -int32_t OffsetFraction
    -uint32_t StartMonth
    -uint32_t EndMonth
    -bool Left
    -bool UseDST
    -std::string TimeZoneName
    -UnknownsType Unknowns
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1Timezone-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Timezone-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1Timezone-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1Timezone-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Timezone Member List

    This is the complete list of members for Barry::Timezone, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Clear()Barry::Timezone
    DSTOffsetBarry::Timezone
    Dump(std::ostream &os) constBarry::Timezone
    EndMonthBarry::Timezone
    GetDBName()Barry::Timezone [inline, static]
    GetDefaultRecType()Barry::Timezone [inline, static]
    GetRecType() constBarry::Timezone [inline]
    GetUniqueId() constBarry::Timezone [inline]
    IndexBarry::Timezone
    LeftBarry::Timezone
    OffsetBarry::Timezone
    OffsetFractionBarry::Timezone
    operator<(const Timezone &other) constBarry::Timezone [inline]
    ParseField(const unsigned char *begin, const unsigned char *end)Barry::Timezone
    ParseFields(const Data &data, size_t &offset)Barry::Timezone
    ParseHeader(const Data &data, size_t &offset)Barry::Timezone
    RecordIdBarry::Timezone
    RecTypeBarry::Timezone
    SetIds(uint8_t Type, uint32_t Id)Barry::Timezone [inline]
    StartMonthBarry::Timezone
    Timezone()Barry::Timezone
    TimeZoneNameBarry::Timezone
    TZTypeBarry::Timezone
    UnknownsBarry::Timezone
    UnknownsType typedefBarry::Timezone
    UseDSTBarry::Timezone
    ~Timezone()Barry::Timezone [virtual]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ZeroPacket.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ZeroPacket.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ZeroPacket.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ZeroPacket.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ - - -Barry: Barry::ZeroPacket Class Reference - - - - - - - -

    Barry::ZeroPacket Class Reference

    #include <packet.h> -

    -

    Inheritance diagram for Barry::ZeroPacket: -

    - -Barry::Packet - -List of all members.

    Detailed Description

    -Provides an API for building and analyzing socket-0 protocol packets. -

    -This class relies on 2 external objects: a send and receive Data buffer.

    -Note that the receive buffer may be modified during a packet send, and this DBPacket class provides API helpers to analyze the results. -

    - -

    -Definition at line 75 of file packet.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    ZeroPacket (Data &send, Data &receive)
    ~ZeroPacket ()
    void GetAttribute (unsigned int object, unsigned int attribute)
     Builds a command packet for the initial socket-0 handshakes that fetch certain (some unknown) attributes.
    -unsigned int ObjectID () const
    -unsigned int AttributeID () const
    -uint32_t ChallengeSeed () const
    -unsigned int RemainingTries () const
    -unsigned int SocketResponse () const
    -unsigned char SocketSequence () const

    Friends

    -class Socket
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Barry::ZeroPacket::GetAttribute (unsigned int  object,
    unsigned int  attribute 
    )
    -
    -
    - -

    -Builds a command packet for the initial socket-0 handshakes that fetch certain (some unknown) attributes. -

    -The attributes appear to exist in an object/attribute sequence, so that's how we address them here. -

    -Definition at line 78 of file packet.cc. -

    -References ATTRIBUTE_FETCH_COMMAND_SIZE, Barry::Data::GetBuffer(), htobs, Barry::Packet::m_send, MAKE_PACKETPTR_BUF, Barry::Data::ReleaseBuffer(), SB_COMMAND_FETCH_ATTRIBUTE, and SB_SOCKET_PACKET_HEADER_SIZE. -

    -Referenced by Barry::Probe::ProbePair(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classBarry_1_1ZeroPacket-members.html barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ZeroPacket-members.html --- barry-0.14/doc/www/doxygen/html/classBarry_1_1ZeroPacket-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ZeroPacket-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ZeroPacket Member List

    This is the complete list of members for Barry::ZeroPacket, including all inherited members.

    - - - - - - - - - - - - - - - - - -
    AttributeID() constBarry::ZeroPacket
    ChallengeSeed() constBarry::ZeroPacket
    Command() constBarry::Packet
    GetAttribute(unsigned int object, unsigned int attribute)Barry::ZeroPacket
    GetReceive()Barry::Packet [inline, protected]
    GetSend()Barry::Packet [inline, protected]
    m_receiveBarry::Packet [protected]
    m_sendBarry::Packet [protected]
    ObjectID() constBarry::ZeroPacket
    Packet(Data &send, Data &receive)Barry::Packet [inline]
    RemainingTries() constBarry::ZeroPacket
    Socket classBarry::ZeroPacket [friend]
    SocketResponse() constBarry::ZeroPacket
    SocketSequence() constBarry::ZeroPacket
    ZeroPacket(Data &send, Data &receive)Barry::ZeroPacket
    ~Packet()Barry::Packet [inline, virtual]
    ~ZeroPacket()Barry::ZeroPacket


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classBarry_1_1ZeroPacket.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classBarry_1_1ZeroPacket.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classbase64__input.html barry-0.0.20110506/doc/www/doxygen/html/classbase64__input.html --- barry-0.14/doc/www/doxygen/html/classbase64__input.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classbase64__input.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - -Barry: base64_input Class Reference - - - - - - -

    base64_input Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 31 of file base64.cc. - - - - - - -

    Public Member Functions

    base64_input (const std::string &input)
    -int operator() ()
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classbase64__input-members.html barry-0.0.20110506/doc/www/doxygen/html/classbase64__input-members.html --- barry-0.14/doc/www/doxygen/html/classbase64__input-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classbase64__input-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    base64_input Member List

    This is the complete list of members for base64_input, including all inherited members.

    - - -
    base64_input(const std::string &input)base64_input [inline]
    operator()()base64_input [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classbase64__output.html barry-0.0.20110506/doc/www/doxygen/html/classbase64__output.html --- barry-0.14/doc/www/doxygen/html/classbase64__output.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classbase64__output.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - -Barry: base64_output Class Reference - - - - - - -

    base64_output Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 51 of file base64.cc. - - - - - - -

    Public Member Functions

    base64_output (std::string &output)
    -void operator() (int c)
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classbase64__output-members.html barry-0.0.20110506/doc/www/doxygen/html/classbase64__output-members.html --- barry-0.14/doc/www/doxygen/html/classbase64__output-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classbase64__output-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    base64_output Member List

    This is the complete list of members for base64_output, including all inherited members.

    - - -
    base64_output(std::string &output)base64_output [inline]
    operator()(int c)base64_output [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classChecksumParser.html barry-0.0.20110506/doc/www/doxygen/html/classChecksumParser.html --- barry-0.14/doc/www/doxygen/html/classChecksumParser.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classChecksumParser.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,188 +0,0 @@ - - -Barry: ChecksumParser Class Reference - - - - - - -

    ChecksumParser Class Reference

    Inheritance diagram for ChecksumParser: -

    - -Barry::Parser - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 54 of file brecsum.cc. - - - - - - - - - - - - - - - - -

    Public Member Functions

    ChecksumParser (bool IncludeIds)
    virtual void Clear ()
     Reset and prepare for a new raw data packet.
    virtual void SetIds (uint8_t RecType, uint32_t UniqueId)
     Stores the IDs.
    virtual void ParseFields (const Barry::Data &data, size_t &offset)
     Called to parse sub fields in the raw data packet.
    virtual void Store ()
     Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    virtual void ChecksumParser::Clear (  )  [inline, virtual]
    -
    -
    - -

    -Reset and prepare for a new raw data packet. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 64 of file brecsum.cc. -

    -References Barry::SHA1_Init(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void ChecksumParser::SetIds (uint8_t  RecType,
    uint32_t  UniqueId 
    ) [inline, virtual]
    -
    -
    - -

    -Stores the IDs. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 69 of file brecsum.cc. -

    -References Barry::SHA1_Update(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void ChecksumParser::ParseFields (const Barry::Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse sub fields in the raw data packet. -

    -The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing. -

    -Reimplemented from Barry::Parser. -

    -Definition at line 76 of file brecsum.cc. -

    -References Barry::Data::GetData(), Barry::Data::GetSize(), and Barry::SHA1_Update(). -

    -

    - -

    -
    - - - - - - - - -
    virtual void ChecksumParser::Store (  )  [inline, virtual]
    -
    -
    - -

    -Called at the very end of record parsing, and used to store the final packet somewhere, either in memory, disk, etc. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 83 of file brecsum.cc. -

    -References Barry::SHA1_Final(). -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classChecksumParser-members.html barry-0.0.20110506/doc/www/doxygen/html/classChecksumParser-members.html --- barry-0.14/doc/www/doxygen/html/classChecksumParser-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classChecksumParser-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - -Barry: Member List - - - - - - -

    ChecksumParser Member List

    This is the complete list of members for ChecksumParser, including all inherited members.

    - - - - - - - - -
    ChecksumParser(bool IncludeIds)ChecksumParser [inline, explicit]
    Clear()ChecksumParser [inline, virtual]
    ParseFields(const Barry::Data &data, size_t &offset)ChecksumParser [inline, virtual]
    ParseHeader(const Data &data, size_t &offset)Barry::Parser [inline, virtual]
    Parser()Barry::Parser [inline]
    SetIds(uint8_t RecType, uint32_t UniqueId)ChecksumParser [inline, virtual]
    Store()ChecksumParser [inline, virtual]
    ~Parser()Barry::Parser [inline, virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classChecksumParser.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classChecksumParser.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classContact2Ldif.html barry-0.0.20110506/doc/www/doxygen/html/classContact2Ldif.html --- barry-0.14/doc/www/doxygen/html/classContact2Ldif.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classContact2Ldif.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ - - -Barry: Contact2Ldif Class Reference - - - - - - -

    Contact2Ldif Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 102 of file btool.cc. - - - - - - - - - -

    Public Member Functions

    Contact2Ldif (Barry::ContactLdif &ldif)
    -void operator() (const Contact &rec)

    Public Attributes

    -Barry::ContactLdifldif
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classContact2Ldif-members.html barry-0.0.20110506/doc/www/doxygen/html/classContact2Ldif-members.html --- barry-0.14/doc/www/doxygen/html/classContact2Ldif-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classContact2Ldif-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Contact2Ldif Member List

    This is the complete list of members for Contact2Ldif, including all inherited members.

    - - - -
    Contact2Ldif(Barry::ContactLdif &ldif)Contact2Ldif [inline]
    ldifContact2Ldif
    operator()(const Contact &rec)Contact2Ldif [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classDataDumpParser.html barry-0.0.20110506/doc/www/doxygen/html/classDataDumpParser.html --- barry-0.14/doc/www/doxygen/html/classDataDumpParser.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classDataDumpParser.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ - - -Barry: DataDumpParser Class Reference - - - - - - -

    DataDumpParser Class Reference

    Inheritance diagram for DataDumpParser: -

    - -Barry::Parser - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 204 of file btool.cc. - - - - - - - - -

    Public Member Functions

    virtual void SetIds (uint8_t RecType, uint32_t UniqueId)
     Stores the IDs.
    virtual void ParseFields (const Barry::Data &data, size_t &offset)
     Called to parse sub fields in the raw data packet.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    virtual void DataDumpParser::SetIds (uint8_t  RecType,
    uint32_t  UniqueId 
    ) [inline, virtual]
    -
    -
    - -

    -Stores the IDs. -

    - -

    -Reimplemented from Barry::Parser. -

    -Definition at line 209 of file btool.cc. -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    virtual void DataDumpParser::ParseFields (const Barry::Data data,
    size_t &  offset 
    ) [inline, virtual]
    -
    -
    - -

    -Called to parse sub fields in the raw data packet. -

    -The same data is passed as was passed in ParseHeader, only the offset will be updated if it was advanced during the header parsing. -

    -Reimplemented from Barry::Parser. -

    -Definition at line 214 of file btool.cc. -

    -

    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classDataDumpParser-members.html barry-0.0.20110506/doc/www/doxygen/html/classDataDumpParser-members.html --- barry-0.14/doc/www/doxygen/html/classDataDumpParser-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classDataDumpParser-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - -Barry: Member List - - - - - - -

    DataDumpParser Member List

    This is the complete list of members for DataDumpParser, including all inherited members.

    - - - - - - - -
    Clear()Barry::Parser [inline, virtual]
    ParseFields(const Barry::Data &data, size_t &offset)DataDumpParser [inline, virtual]
    ParseHeader(const Data &data, size_t &offset)Barry::Parser [inline, virtual]
    Parser()Barry::Parser [inline]
    SetIds(uint8_t RecType, uint32_t UniqueId)DataDumpParser [inline, virtual]
    Store()Barry::Parser [inline, virtual]
    ~Parser()Barry::Parser [inline, virtual]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classDataDumpParser.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classDataDumpParser.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classes.html barry-0.0.20110506/doc/www/doxygen/html/classes.html --- barry-0.14/doc/www/doxygen/html/classes.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classes.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - -Barry: Alphabetical List - - - - - - -

    Barry Class Index

    A | B | C | D | E | F | G | I | L | M | O | P | R | S | T | U | Z

    - -
      A  
    -
    DBC_TaggedUpload (Barry::Protocol)   PackedField_10 (Barry::Protocol)   
    AttributeFetch (Barry::Protocol)   DBCommand (Barry::Protocol)   Packet (Barry)   
      B  
    -
    DBCommand::Parameters (Barry::Protocol)   Packet (Barry::Protocol)   
    BadData (Barry)   DBDBField (Barry::Protocol)   Packet::PacketData (Barry::Protocol)   
    BadPassword (Barry)   DBPacket (Barry)   Parser (Barry)   
    BadSize (Barry)   DBR_DBDBRecord (Barry::Protocol)   PasswordChallenge (Barry::Protocol)   
    base64_input   DBR_OldDBDBRecord (Barry::Protocol)   PasswordChallenge::Hash (Barry::Protocol)   
    base64_output   DBR_OldTaggedRecord (Barry::Protocol)   PINMessage (Barry)   
    Builder (Barry)   DBR_OldTaggedRecord::TaggedData (Barry::Protocol)   PostalAddress (Barry)   
      C  
    -
    DBResponse (Barry::Protocol)   PppFilter (Barry)   
    Calendar (Barry)   DBResponse::Parameters (Barry::Protocol)   Probe (Barry)   
    CalendarRecurrenceDataField (Barry::Protocol)   Desktop (Barry::Mode)   ProbeResult (Barry)   
    CalendarRecurrenceDataField::Additional (Barry::Protocol)   Device (Usb)   
      R  
    -
    CalendarRecurrenceDataField::Additional::Day (Barry::Protocol)   DeviceDiscovery (Usb)   RecordBuilder (Barry)   
    CalendarRecurrenceDataField::Additional::MonthByDate (Barry::Protocol)   Diff (Barry)   RecordFetch (Barry)   
    CalendarRecurrenceDataField::Additional::MonthByDay (Barry::Protocol)   
      E  
    -
    RecordParser (Barry)   
    CalendarRecurrenceDataField::Additional::Week (Barry::Protocol)   EmailAddress (Barry)   RecordStateTable (Barry)   
    CalendarRecurrenceDataField::Additional::YearByDate (Barry::Protocol)   EndpointDiscovery (Usb)   RecordStateTableField (Barry::Protocol)   
    CalendarRecurrenceDataField::Additional::YearByDay (Barry::Protocol)   EndpointPair (Usb)   RecordStateTableState (Barry)   
    ChecksumParser   ErrnoError (Barry)   
      S  
    -
    CommandTable (Barry)   Error (Usb)   SavedMessage (Barry)   
    CommandTableCommand (Barry)   Error (Barry)   scoped_lock (Barry)   
    CommandTableField (Barry::Protocol)   
      F  
    -
    SequenceCommand (Barry::Protocol)   
    CommonField (Barry::Protocol)   FieldLink (Barry)   Serial (Barry::Mode)   
    CommonField::CommonFieldData (Barry::Protocol)   Folder (Barry)   ServiceBook (Barry)   
    ConfigDesc (Usb)   
      G  
    -
    ServiceBookConfig (Barry)   
    ConfigDiscovery (Usb)   GroupLink (Barry::Protocol)   ServiceBookConfigField (Barry::Protocol)   
    Contact (Barry)   
      I  
    -
    SHA_CTX (Barry)   
    Contact2Ldif   Interface (Usb)   SizePacket (Barry::Protocol)   
    ContactGroupLink (Barry)   InterfaceDesc (Usb)   Socket (Barry)   
    ContactLdif (Barry)   InterfaceDiscovery (Usb)   SocketCommand (Barry::Protocol)   
    ContactLdif::AccessPair (Barry)   IpModem (Barry::Mode)   SocketCommand::PacketData (Barry::Protocol)   
    ContactLdif::LdifAttribute (Barry)   
      L  
    -
    SocketRoutingQueue (Barry)   
    ContactLdif::NameToFunc (Barry)   LogLock (Barry)   SocketRoutingQueue::QueueEntry (Barry)   
    Controller (Barry)   
      M  
    -
    SocketZero (Barry)   
      D  
    -
    Match (Usb)   StateTableCommand   
    Data (Barry)   Memo (Barry)   Store   
    DatabaseDatabase (Barry)   Message (Barry)   
      T  
    -
    DatabaseItem (Barry)   MessageAddress (Barry::Protocol)   Task (Barry)   
    DataDumpParser   MessageRecord (Barry::Protocol)   Timeout (Usb)   
    DataHandle (Barry)   Modem (Barry)   TimeZone (Barry)   
    DataQueue (Barry)   ModeSelect (Barry::Protocol)   Timezone (Barry)   
    Date (Barry)   ModeSelect::ResponseBlock (Barry::Protocol)   
      U  
    -
    DBAccess (Barry::Protocol)   
      O  
    -
    UnknownData (Barry)   
    DBAccess::DBData (Barry::Protocol)   OldDBDBField (Barry::Protocol)   UnknownField (Barry)   
    DBC_IndexedUpload (Barry::Protocol)   
      P  
    -
      Z  
    -
    DBC_Record (Barry::Protocol)   PackedField_02 (Barry::Protocol)   ZeroPacket (Barry)   
    DBC_RecordFlags (Barry::Protocol)   

    A | B | C | D | E | F | G | I | L | M | O | P | R | S | T | U | Z

    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - -Barry: Usb::ConfigDiscovery Class Reference - - - - - - - -

    Usb::ConfigDiscovery Class Reference

    Inheritance diagram for Usb::ConfigDiscovery: -

    - - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 226 of file usbwrap.h. - - - - - - - - - - - -

    Public Types

    -typedef std::map< unsigned
    -char, ConfigDesc
    base_type

    Public Member Functions

    ConfigDiscovery ()
    -bool Discover (Usb::DeviceIDType devid, int cfgcount)
    -bool IsValid () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::ConfigDiscovery Member List

    This is the complete list of members for Usb::ConfigDiscovery, including all inherited members.

    - - - - -
    base_type typedefUsb::ConfigDiscovery
    ConfigDiscovery()Usb::ConfigDiscovery [inline]
    Discover(Usb::DeviceIDType devid, int cfgcount)Usb::ConfigDiscovery
    IsValid() constUsb::ConfigDiscovery [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1ConfigDiscovery.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: Usb::DeviceDiscovery Class Reference - - - - - - - -

    Usb::DeviceDiscovery Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 244 of file usbwrap.h. - - - - - - - - - - - - - -

    Public Member Functions

    DeviceDiscovery (Usb::DeviceIDType devid)
    -bool Discover (Usb::DeviceIDType devid)
    -bool IsValid () const

    Public Attributes

    -usb_device_descriptor desc
    -ConfigDiscovery configs
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1DeviceDiscovery-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::DeviceDiscovery Member List

    This is the complete list of members for Usb::DeviceDiscovery, including all inherited members.

    - - - - - -
    configsUsb::DeviceDiscovery
    descUsb::DeviceDiscovery
    DeviceDiscovery(Usb::DeviceIDType devid)Usb::DeviceDiscovery
    Discover(Usb::DeviceIDType devid)Usb::DeviceDiscovery
    IsValid() constUsb::DeviceDiscovery [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Device.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Device.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Device.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Device.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ - - -Barry: Usb::Device Class Reference - - - - - - - -

    Usb::Device Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 95 of file usbwrap.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Device (Usb::DeviceIDType id, int timeout=USBWRAP_DEFAULT_TIMEOUT)
    ~Device ()
    -Usb::DeviceIDType GetID () const
    -Usb::DeviceHandleType GetHandle () const
    -int GetLastError () const
    -bool SetConfiguration (unsigned char cfg)
    -bool ClearHalt (int ep)
    -bool Reset ()
    -bool BulkRead (int ep, Barry::Data &data, int timeout=-1)
    -bool BulkWrite (int ep, const Barry::Data &data, int timeout=-1)
    -bool BulkWrite (int ep, const void *data, size_t size, int timeout=-1)
    -bool InterruptRead (int ep, Barry::Data &data, int timeout=-1)
    -bool InterruptWrite (int ep, const Barry::Data &data, int timeout=-1)
    void BulkDrain (int ep, int timeout=100)
     Reads anything available on the given endpoint, with a low timeout, in order to clear any pending reads.
    bool GetConfiguration (unsigned char &cfg)
     Uses the GET_CONFIGURATION control message to determine the currently selected USB configuration, returning it in the cfg argument.
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void Usb::Device::BulkDrain (int  ep,
    int  timeout = 100 
    )
    -
    -
    - -

    -Reads anything available on the given endpoint, with a low timeout, in order to clear any pending reads. -

    - -

    -Definition at line 312 of file usbwrap.cc. -

    -References BulkRead(). -

    -Referenced by Barry::Probe::ProbePair(). -

    -

    - -

    -
    - - - - - - - - - -
    bool Usb::Device::GetConfiguration (unsigned char &  cfg  ) 
    -
    -
    - -

    -Uses the GET_CONFIGURATION control message to determine the currently selected USB configuration, returning it in the cfg argument. -

    -If unsuccessful, returns false. -

    -Definition at line 329 of file usbwrap.cc. -

    -Referenced by Barry::Probe::ProbeDevice(). -

    -

    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Device-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Device-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Device-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Device-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::Device Member List

    This is the complete list of members for Usb::Device, including all inherited members.

    - - - - - - - - - - - - - - - -
    BulkDrain(int ep, int timeout=100)Usb::Device
    BulkRead(int ep, Barry::Data &data, int timeout=-1)Usb::Device
    BulkWrite(int ep, const Barry::Data &data, int timeout=-1)Usb::Device
    BulkWrite(int ep, const void *data, size_t size, int timeout=-1)Usb::Device
    ClearHalt(int ep)Usb::Device
    Device(Usb::DeviceIDType id, int timeout=USBWRAP_DEFAULT_TIMEOUT)Usb::Device
    GetConfiguration(unsigned char &cfg)Usb::Device
    GetHandle() constUsb::Device [inline]
    GetID() constUsb::Device [inline]
    GetLastError() constUsb::Device [inline]
    InterruptRead(int ep, Barry::Data &data, int timeout=-1)Usb::Device
    InterruptWrite(int ep, const Barry::Data &data, int timeout=-1)Usb::Device
    Reset()Usb::Device
    SetConfiguration(unsigned char cfg)Usb::Device
    ~Device()Usb::Device


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - -Barry: Usb::EndpointDiscovery Class Reference - - - - - - - -

    Usb::EndpointDiscovery Class Reference

    Inheritance diagram for Usb::EndpointDiscovery: -

    - - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 168 of file usbwrap.h. - - - - - - - - - - - - - - - - -

    Public Types

    -typedef std::map< unsigned
    -char, usb_endpoint_descriptor > 
    base_type
    -typedef std::vector< EndpointPairendpoint_array_type

    Public Member Functions

    EndpointDiscovery ()
    -bool IsValid () const
    -const endpoint_array_typeGetEndpointPairs () const

    Friends

    -class InterfaceDiscovery
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::EndpointDiscovery Member List

    This is the complete list of members for Usb::EndpointDiscovery, including all inherited members.

    - - - - - - -
    base_type typedefUsb::EndpointDiscovery
    endpoint_array_type typedefUsb::EndpointDiscovery
    EndpointDiscovery()Usb::EndpointDiscovery [inline]
    GetEndpointPairs() constUsb::EndpointDiscovery [inline]
    InterfaceDiscovery classUsb::EndpointDiscovery [friend]
    IsValid() constUsb::EndpointDiscovery [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1EndpointDiscovery.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Error.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Error.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Error.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Error.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: Usb::Error Class Reference - - - - - - - -

    Usb::Error Class Reference
    - -[Exceptions] -

    #include <usbwrap.h> -

    -

    Inheritance diagram for Usb::Error: -

    - -Barry::Error -Usb::Timeout - -List of all members.

    Detailed Description

    -Thrown on low level USB errors. -

    - -

    -Definition at line 44 of file usbwrap.h. - - - - - - - - -

    Public Member Functions

    Error (const std::string &str)
    Error (int libusb_errcode, const std::string &str)
    -int libusb_errcode () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Error-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Error-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Error-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Error-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::Error Member List

    This is the complete list of members for Usb::Error, including all inherited members.

    - - - -
    Error(const std::string &str)Usb::Error
    Error(int libusb_errcode, const std::string &str)Usb::Error
    libusb_errcode() constUsb::Error [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classUsb_1_1Error.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Error.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ - - -Barry: Usb::InterfaceDiscovery Class Reference - - - - - - - -

    Usb::InterfaceDiscovery Class Reference

    Inheritance diagram for Usb::InterfaceDiscovery: -

    - - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 199 of file usbwrap.h. - - - - - - - - - - - -

    Public Types

    -typedef std::map< int, InterfaceDescbase_type

    Public Member Functions

    InterfaceDiscovery ()
    -bool Discover (Usb::DeviceIDType devid, int cfgidx, int ifcount)
    -bool IsValid () const
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::InterfaceDiscovery Member List

    This is the complete list of members for Usb::InterfaceDiscovery, including all inherited members.

    - - - - -
    base_type typedefUsb::InterfaceDiscovery
    Discover(Usb::DeviceIDType devid, int cfgidx, int ifcount)Usb::InterfaceDiscovery
    InterfaceDiscovery()Usb::InterfaceDiscovery [inline]
    IsValid() constUsb::InterfaceDiscovery [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1InterfaceDiscovery.png differ diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Interface.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Interface.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Interface.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Interface.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Usb::Interface Class Reference - - - - - - - -

    Usb::Interface Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 144 of file usbwrap.h. - - - - - - -

    Public Member Functions

    Interface (Device &dev, int iface)
    ~Interface ()
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Interface-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Interface-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Interface-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Interface-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::Interface Member List

    This is the complete list of members for Usb::Interface, including all inherited members.

    - - -
    Interface(Device &dev, int iface)Usb::Interface
    ~Interface()Usb::Interface


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Match.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Match.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Match.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Match.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: Usb::Match Class Reference - - - - - - - -

    Usb::Match Class Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 71 of file usbwrap.h. - - - - - - - - - - - - - -

    Public Member Functions

    Match (int vendor, int product, const char *busname=0, const char *devname=0)
    ~Match ()
    -bool next_device (Usb::DeviceIDType *devid)

    Static Protected Member Functions

    -static bool ToNum (const char *str, long &num)
    -static bool NameCompare (const char *n1, const char *n2)
    -


    The documentation for this class was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Match-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Match-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Match-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Match-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::Match Member List

    This is the complete list of members for Usb::Match, including all inherited members.

    - - - - - -
    Match(int vendor, int product, const char *busname=0, const char *devname=0)Usb::Match
    NameCompare(const char *n1, const char *n2)Usb::Match [protected, static]
    next_device(Usb::DeviceIDType *devid)Usb::Match
    ToNum(const char *str, long &num)Usb::Match [protected, static]
    ~Match()Usb::Match


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Timeout.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Timeout.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Timeout.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Timeout.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Usb::Timeout Class Reference - - - - - - - -

    Usb::Timeout Class Reference
    - -[Exceptions] -

    Inheritance diagram for Usb::Timeout: -

    - -Usb::Error -Barry::Error - -List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 56 of file usbwrap.h. - - - - - - -

    Public Member Functions

    Timeout (const std::string &str)
    Timeout (int libusb_errcode, const std::string &str)
    -


    The documentation for this class was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/classUsb_1_1Timeout-members.html barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Timeout-members.html --- barry-0.14/doc/www/doxygen/html/classUsb_1_1Timeout-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Timeout-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::Timeout Member List

    This is the complete list of members for Usb::Timeout, including all inherited members.

    - - - - - -
    Error(const std::string &str)Usb::Error
    Error(int libusb_errcode, const std::string &str)Usb::Error
    libusb_errcode() constUsb::Error [inline]
    Timeout(const std::string &str)Usb::Timeout [inline]
    Timeout(int libusb_errcode, const std::string &str)Usb::Timeout [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/classUsb_1_1Timeout.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/classUsb_1_1Timeout.png differ diff -Nru barry-0.14/doc/www/doxygen/html/common_8cc.html barry-0.0.20110506/doc/www/doxygen/html/common_8cc.html --- barry-0.14/doc/www/doxygen/html/common_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/common_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: common.cc File Reference - - - - - - - -

    common.cc File Reference


    Detailed Description

    -General Barry interface routines. -

    - -

    -Definition in file common.cc. -

    -#include "common.h"
    -#include <usb.h>
    -#include <pthread.h>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    void Barry::Init (bool data_dump_mode, std::ostream *logStream)
     See also the LogLock class.

    Variables

    -bool Barry::__data_dump_mode__
    -std::ostream * Barry::LogStream = &std::cout
    -pthread_mutex_t Barry::LogStreamMutex
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/common_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/common_8cc-source.html --- barry-0.14/doc/www/doxygen/html/common_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/common_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ - - -Barry: common.cc Source File - - - - - - - -

    common.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       common.cc
    -00003 ///             General Barry interface routines
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "common.h"
    -00023 #include <usb.h>
    -00024 #include <pthread.h>
    -00025 #include "debug.h"
    -00026 
    -00027 namespace Barry {
    -00028 
    -00029 bool __data_dump_mode__;
    -00030 
    -00031 std::ostream *LogStream = &std::cout;
    -00032 pthread_mutex_t LogStreamMutex;
    -00033 
    -00034 
    -00035 //
    -00036 // Init
    -00037 //
    -00038 /// Barry library initializer.  Call this before anything else.
    -00039 /// This takes care of initializing the lower level libusb.
    -00040 ///
    -00041 /// \param[in]  data_dump_mode  If set to true, the protocol conversation
    -00042 ///                             will be sent to stdout via the C++ std::cout
    -00043 ///                             stream.
    -00044 /// \param[in]  LogStream       Pointer to std::ostream object to use for
    -00045 ///                             debug output and logging.  Defaults to
    -00046 ///                             std::cout.
    -00047 ///
    -00048 void Init(bool data_dump_mode, std::ostream *logStream)
    -00049 {
    -00050         if( data_dump_mode )
    -00051                 usb_set_debug(9);
    -00052         usb_init();
    -00053 
    -00054         __data_dump_mode__ = data_dump_mode;
    -00055         LogStream = logStream;
    -00056         pthread_mutex_init(&LogStreamMutex, NULL);
    -00057 }
    -00058 
    -00059 } // namespace Barry
    -00060 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/common_8h.html barry-0.0.20110506/doc/www/doxygen/html/common_8h.html --- barry-0.14/doc/www/doxygen/html/common_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/common_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ - - -Barry: common.h File Reference - - - - - - - -

    common.h File Reference


    Detailed Description

    -General header for the Barry library. -

    - -

    -Definition in file common.h. -

    -#include "dll.h"
    -#include <iostream>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define VENDOR_RIM   0x0fca
    -#define PRODUCT_RIM_BLACKBERRY   0x0001
    -#define PRODUCT_RIM_PEARL_DUAL   0x0004
    -#define PRODUCT_RIM_PEARL_8120   0x8004
    -#define PRODUCT_RIM_PEARL   0x0006
    -#define BLACKBERRY_CONFIGURATION   1
    -#define BLACKBERRY_DB_CLASS   0xff
    -#define BARRY_MIN_PASSWORD_TRIES   3
    -#define BARRY_MIN_PASSWORD_TRIES_ASC   "3"

    Functions

    void Barry::Init (bool data_dump_mode, std::ostream *logStream)
     See also the LogLock class.
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/common_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/common_8h-source.html --- barry-0.14/doc/www/doxygen/html/common_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/common_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ - - -Barry: common.h Source File - - - - - - - -

    common.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       common.h
    -00003 ///             General header for the Barry library
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_COMMON_H__
    -00023 #define __BARRY_COMMON_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <iostream>
    -00027 
    -00028 #define VENDOR_RIM              0x0fca
    -00029 #define PRODUCT_RIM_BLACKBERRY  0x0001
    -00030 #define PRODUCT_RIM_PEARL_DUAL  0x0004
    -00031 #define PRODUCT_RIM_PEARL_8120  0x8004
    -00032 #define PRODUCT_RIM_PEARL       0x0006
    -00033 
    -00034 #define BLACKBERRY_CONFIGURATION        1
    -00035 #define BLACKBERRY_DB_CLASS             0xff
    -00036 
    -00037 // minimum number of password tries remaining at which Barry gives up
    -00038 // for safety
    -00039 #define BARRY_MIN_PASSWORD_TRIES        3
    -00040 #define BARRY_MIN_PASSWORD_TRIES_ASC    "3"
    -00041 
    -00042 namespace Barry {
    -00043 
    -00044 /// See also the LogLock class.
    -00045 BXEXPORT void Init(bool data_dump_mode = false, std::ostream *logStream = &std::cout);
    -00046 
    -00047 } // namespace Barry
    -00048 
    -00049 #endif
    -00050 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/controller_8cc.html barry-0.0.20110506/doc/www/doxygen/html/controller_8cc.html --- barry-0.14/doc/www/doxygen/html/controller_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/controller_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: controller.cc File Reference - - - - - - - -

    controller.cc File Reference


    Detailed Description

    -High level Barry API class. -

    - -

    -Definition in file controller.cc. -

    -#include "controller.h"
    -#include "probe.h"
    -#include "common.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "endian.h"
    -#include <string.h>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/controller_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/controller_8cc-source.html --- barry-0.14/doc/www/doxygen/html/controller_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/controller_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ - - -Barry: controller.cc Source File - - - - - - - -

    controller.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       controller.cc
    -00003 ///             High level Barry API class
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "controller.h"
    -00023 #include "probe.h"
    -00024 #include "common.h"
    -00025 #include "protocol.h"
    -00026 #include "protostructs.h"
    -00027 #include "data.h"
    -00028 #include "endian.h"
    -00029 #include <string.h>
    -00030 
    -00031 #define __DEBUG_MODE__
    -00032 #include "debug.h"
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 //
    -00037 // Controller constructor
    -00038 //
    -00039 /// Constructor for the Controller class.  Requires a valid ProbeResult
    -00040 /// object to find the USB device to talk to.
    -00041 ///
    -00042 /// \param[in]  device          One of the ProbeResult objects from the
    -00043 ///                             Probe class.
    -00044 ///
    -00045 Controller::Controller(const ProbeResult &device)
    -00046         : m_result(device)
    -00047         , m_dev(device.m_dev)
    -00048         , m_iface(0)
    -00049         , m_pin(device.m_pin)
    -00050         , m_zero(m_dev, device.m_ep.write, device.m_ep.read, device.m_zeroSocketSequence)
    -00051         , m_queue(0)
    -00052 {
    -00053         dout("Controller: Using non-threaded sockets");
    -00054         SetupUsb(device);
    -00055 }
    -00056 
    -00057 //
    -00058 // Controller constructor
    -00059 //
    -00060 /// Constructor for the Controller class.  Requires a valid ProbeResult
    -00061 /// object to find the USB device to talk to.
    -00062 ///
    -00063 /// \param[in]  device          One of the ProbeResult objects from the
    -00064 ///                             Probe class.
    -00065 /// \param[in]  queue           Plugin router object for reading data
    -00066 ///                             from sockets.
    -00067 ///
    -00068 Controller::Controller(const ProbeResult &device, SocketRoutingQueue &queue)
    -00069         : m_result(device)
    -00070         , m_dev(device.m_dev)
    -00071         , m_iface(0)
    -00072         , m_pin(device.m_pin)
    -00073         , m_zero(queue, device.m_ep.write, device.m_zeroSocketSequence)
    -00074         , m_queue(&queue)
    -00075 {
    -00076         dout("Controller: Using threaded socket router");
    -00077 
    -00078         SetupUsb(device);
    -00079 
    -00080         // set the queue to use our device
    -00081         queue.SetUsbDevice(&m_dev, device.m_ep.write, device.m_ep.read);
    -00082 }
    -00083 
    -00084 void Controller::SetupUsb(const ProbeResult &device)
    -00085 {
    -00086         unsigned char cfg;
    -00087         if( !m_dev.GetConfiguration(cfg) )
    -00088                 throw Usb::Error(m_dev.GetLastError(),
    -00089                         "Controller: GetConfiguration failed");
    -00090 
    -00091         if( cfg != BLACKBERRY_CONFIGURATION ) {
    -00092                 if( !m_dev.SetConfiguration(BLACKBERRY_CONFIGURATION) )
    -00093                         throw Usb::Error(m_dev.GetLastError(),
    -00094                                 "Controller: SetConfiguration failed");
    -00095         }
    -00096 
    -00097         m_iface = new Usb::Interface(m_dev, device.m_interface);
    -00098 
    -00099         m_dev.ClearHalt(device.m_ep.read);
    -00100         m_dev.ClearHalt(device.m_ep.write);
    -00101 }
    -00102 
    -00103 Controller::~Controller()
    -00104 {
    -00105 //      // trap exceptions in the destructor
    -00106 //      try {
    -00107 //              // a non-default socket has been opened, close it
    -00108 //              m_socket.Close();
    -00109 //      }
    -00110 //      catch( std::runtime_error &re ) {
    -00111 //              // do nothing... log it?
    -00112 //              dout("Exception caught in ~Socket: " << re.what());
    -00113 //      }
    -00114 
    -00115         // detach the router from our device
    -00116         if( m_queue ) {
    -00117                 m_queue->ClearUsbDevice();
    -00118                 m_queue = 0;
    -00119         }
    -00120 
    -00121         // cleanup the interface
    -00122         delete m_iface;
    -00123 
    -00124         // this happens when for some reason the Desktop mode
    -00125         // is not fully opened, but the device has already recommended
    -00126         // a socket to open... in this case, reset the device
    -00127         // in the hopes that on next open, it will be in a
    -00128         // recognizable state.
    -00129         //
    -00130         // FIXME - this should not be necessary, and someday we
    -00131         // we should figure out how to handle the "already open"
    -00132         // response we get for the Desktop
    -00133         //
    -00134         // FIXME - halfOpen now seems to be handled in the Socket class...
    -00135         // perhaps move this there if needed
    -00136         //
    -00137 /*
    -00138         if( m_halfOpen ) {
    -00139                 dout("Controller object destroyed in halfopen state, resetting device");
    -00140                 m_dev.Reset();
    -00141         }
    -00142 */
    -00143 }
    -00144 
    -00145 ///////////////////////////////////////////////////////////////////////////////
    -00146 // protected members
    -00147 
    -00148 //
    -00149 // Tells device which mode is desired, and returns the suggested
    -00150 // socket ID to use for that mode.
    -00151 //
    -00152 uint16_t Controller::SelectMode(ModeType mode)
    -00153 {
    -00154         // select mode
    -00155         Protocol::Packet packet;
    -00156         packet.socket = 0;
    -00157         packet.size = htobs(SB_MODE_PACKET_COMMAND_SIZE);
    -00158         packet.command = SB_COMMAND_SELECT_MODE;
    -00159         packet.u.socket.socket = htobs(SB_MODE_REQUEST_SOCKET);
    -00160         packet.u.socket.sequence = 0; // updated by Socket::Send()
    -00161         memset(packet.u.socket.u.mode.name, 0, sizeof(packet.u.socket.u.mode.name));
    -00162 
    -00163         char *modeName = (char *) packet.u.socket.u.mode.name;
    -00164         switch( mode )
    -00165         {
    -00166         case Bypass:
    -00167                 strcpy(modeName, "RIM Bypass");
    -00168                 break;
    -00169 
    -00170         case Desktop:
    -00171                 strcpy(modeName, "RIM Desktop");
    -00172                 break;
    -00173 
    -00174         case JavaLoader:
    -00175                 strcpy(modeName, "RIM_JavaLoader");
    -00176                 break;
    -00177 
    -00178         case UsbSerData:
    -00179                 strcpy(modeName, "RIM_UsbSerData");
    -00180                 break;
    -00181 
    -00182         case UsbSerCtrl:
    -00183                 strcpy(modeName, "RIM_UsbSerCtrl");
    -00184                 break;
    -00185 
    -00186         default:
    -00187                 throw std::logic_error("Controller: Invalid mode in SelectMode");
    -00188                 break;
    -00189         }
    -00190 
    -00191         // send mode command before we open, as a default socket is socket 0
    -00192         Data command(&packet, btohs(packet.size));
    -00193         Data response;
    -00194 
    -00195         try {
    -00196                 m_zero.Send(command, response);
    -00197 
    -00198                 // get the data socket number
    -00199                 // indicates the socket number that
    -00200                 // should be used below in the Open() call
    -00201                 Protocol::CheckSize(response, SB_MODE_PACKET_RESPONSE_SIZE);
    -00202                 MAKE_PACKET(modepack, response);
    -00203                 if( modepack->command != SB_COMMAND_MODE_SELECTED ) {
    -00204                         eeout(command, response);
    -00205                         throw Error("Controller: mode not selected");
    -00206                 }
    -00207 
    -00208                 // return the socket that the device is expecting us to use
    -00209                 return btohs(modepack->u.socket.socket);
    -00210         }
    -00211         catch( Usb::Error & ) {
    -00212                 eout("Controller: error setting desktop mode");
    -00213                 eeout(command, response);
    -00214                 throw;
    -00215         }
    -00216 }
    -00217 
    -00218 
    -00219 ///////////////////////////////////////////////////////////////////////////////
    -00220 // public API
    -00221 
    -00222 
    -00223 } // namespace Barry
    -00224 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/controller_8h.html barry-0.0.20110506/doc/www/doxygen/html/controller_8h.html --- barry-0.14/doc/www/doxygen/html/controller_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/controller_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: controller.h File Reference - - - - - - - -

    controller.h File Reference


    Detailed Description

    -High level BlackBerry API class. -

    - -

    -Definition in file controller.h. -

    -#include "dll.h"
    -#include "usbwrap.h"
    -#include "socket.h"
    -#include "probe.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Classes

    class  Barry::Controller
     The main interface class. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/controller_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/controller_8h-source.html --- barry-0.14/doc/www/doxygen/html/controller_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/controller_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ - - -Barry: controller.h Source File - - - - - - - -

    controller.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       controller.h
    -00003 ///             High level BlackBerry API class
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_CONTROLLER_H__
    -00023 #define __BARRY_CONTROLLER_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "usbwrap.h"
    -00027 #include "socket.h"
    -00028 #include "probe.h"
    -00029 
    -00030 /// Project namespace, containing all related functions and classes.
    -00031 /// This is the only namespace applications should be concerned with,
    -00032 /// for now.
    -00033 namespace Barry {
    -00034 
    -00035 // forward declarations
    -00036 class SocketRoutingQueue;
    -00037 
    -00038 namespace Mode {
    -00039         class Desktop;
    -00040         class IpModem;
    -00041         class Serial;
    -00042 }
    -00043 
    -00044 //
    -00045 // Controller class
    -00046 //
    -00047 /// The main interface class.  This class coordinates the communication to
    -00048 /// a single handheld.  This class also owns the only Usb::Device object
    -00049 /// the handheld.  All other classes reference this one for the low level
    -00050 /// device object.  This class owns the only SocketZero object as well,
    -00051 /// which is the object that any SocketRoutingQueue is plugged into
    -00052 /// if constructed that way.
    -00053 ///
    -00054 /// To use this class, use the following steps:
    -00055 ///
    -00056 ///     - Probe the USB bus for matching devices with the Probe class
    -00057 ///     - Create an optional SocketRoutingQueue object and create a
    -00058 ///             read thread for it, or use its default read thread.
    -00059 ///     - Pass one of the probe results into the Controller constructor
    -00060 ///             to connect to the USB device.  Pass the routing queue
    -00061 ///             to the Controller constructor here too, if needed.
    -00062 ///     - Create the Mode object of your choice.  See m_desktop.h
    -00063 ///             and m_serial.h for these mode classes.  You pass
    -00064 ///             your controller object into these mode constructors
    -00065 ///             to create the mode.
    -00066 ///
    -00067 class BXEXPORT Controller
    -00068 {
    -00069         friend class Barry::Mode::Desktop;
    -00070         friend class Barry::Mode::IpModem;
    -00071         friend class Barry::Mode::Serial;
    -00072 
    -00073 public:
    -00074         /// Handheld mode type
    -00075         enum ModeType {
    -00076                 Unspecified,            //< default on start up (unused)
    -00077                 Bypass,                 //< unsupported, unknown
    -00078                 Desktop,                //< desktop mode required for database
    -00079                                         //< operation
    -00080                 JavaLoader,             //< unsupported
    -00081                 UsbSerData,             //< GPRS modem support over USB
    -00082                 UsbSerCtrl              //< internally used behind the scenes
    -00083         };
    -00084 
    -00085 private:
    -00086         ProbeResult m_result;
    -00087         Usb::Device m_dev;
    -00088         Usb::Interface *m_iface;
    -00089         uint32_t m_pin;
    -00090 
    -00091         SocketZero m_zero;
    -00092         SocketRoutingQueue *m_queue;    //< ptr to external object; no delete
    -00093 
    -00094 private:
    -00095         void SetupUsb(const ProbeResult &device);
    -00096 
    -00097 protected:
    -00098         uint16_t SelectMode(ModeType mode);     // returns mode socket
    -00099 
    -00100 public:
    -00101         explicit Controller(const ProbeResult &device);
    -00102         Controller(const ProbeResult &device, SocketRoutingQueue &queue);
    -00103         ~Controller();
    -00104 
    -00105         bool HasQueue() const { return m_queue; }
    -00106 
    -00107         const ProbeResult& GetProbeResult() const { return m_result; }
    -00108 };
    -00109 
    -00110 } // namespace Barry
    -00111 
    -00112 #endif
    -00113 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/data_8cc.html barry-0.0.20110506/doc/www/doxygen/html/data_8cc.html --- barry-0.14/doc/www/doxygen/html/data_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/data_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: data.cc File Reference - - - - - - - -

    data.cc File Reference


    Detailed Description

    -Classes to help manage pre-determined data files. -

    - -

    -Definition in file data.cc. -

    -#include "data.h"
    -#include <fstream>
    -#include <sstream>
    -#include <iomanip>
    -#include <string>
    -#include <stdexcept>
    -#include <string.h>
    -#include <stdlib.h>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    -bool Barry::IsHexData (const std::string &s)
    -istream & Barry::operator>> (istream &is, Data &data)
    -ostream & Barry::operator<< (ostream &os, const Data &data)
    -ostream & Barry::operator<< (ostream &os, const Diff &diff)
    -bool Barry::LoadDataArray (const string &filename, std::vector< Data > &array)
    -bool Barry::ReadDataArray (std::istream &is, std::vector< Data > &array)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/data_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/data_8cc-source.html --- barry-0.14/doc/www/doxygen/html/data_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/data_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,514 +0,0 @@ - - -Barry: data.cc Source File - - - - - - - -

    data.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       data.cc
    -00003 ///             Classes to help manage pre-determined data files.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "data.h"
    -00023 #include <fstream>
    -00024 #include <sstream>
    -00025 #include <iomanip>
    -00026 #include <string>
    -00027 #include <stdexcept>
    -00028 #include <string.h>
    -00029 #include <stdlib.h>
    -00030 
    -00031 //#define __DEBUG_MODE__
    -00032 #include "debug.h"
    -00033 
    -00034 
    -00035 using namespace std;
    -00036 
    -00037 
    -00038 namespace Barry {
    -00039 
    -00040 inline bool IsHexData(const std::string &s)
    -00041 {
    -00042         const char *str = s.c_str();
    -00043         for( int i = 0; i < 4 && *str; str++, i++ )
    -00044                 if( *str != ' ' )
    -00045                         return false;
    -00046 
    -00047         for( int i = 0; i < 8 && *str; str++, i++ ) {
    -00048                 const char *hexchars = "0123456789abcdef";
    -00049                 if( strchr(hexchars, *str) == NULL )
    -00050                         return false;
    -00051         }
    -00052 
    -00053         if( *str != ':' )
    -00054                 return false;
    -00055 
    -00056         return true;
    -00057 }
    -00058 
    -00059 
    -00060 
    -00061 ///////////////////////////////////////////////////////////////////////////////
    -00062 // Data class
    -00063 
    -00064 bool Data::bPrintAscii = true;
    -00065 
    -00066 Data::Data()
    -00067         : m_data(new unsigned char[0x4000]),
    -00068         m_bufsize(0x4000),
    -00069         m_datasize(0),
    -00070         m_endpoint(-1),
    -00071         m_externalData(0),
    -00072         m_external(false)
    -00073 {
    -00074         memset(m_data, 0, m_bufsize);
    -00075 }
    -00076 
    -00077 Data::Data(int endpoint, size_t startsize)
    -00078         : m_data(new unsigned char[startsize]),
    -00079         m_bufsize(startsize),
    -00080         m_datasize(0),
    -00081         m_endpoint(endpoint),
    -00082         m_externalData(0),
    -00083         m_external(false)
    -00084 {
    -00085         memset(m_data, 0, m_bufsize);
    -00086 }
    -00087 
    -00088 Data::Data(const void *ValidData, size_t size)
    -00089         : m_data(0),
    -00090         m_bufsize(0),
    -00091         m_datasize(size),
    -00092         m_endpoint(-1),
    -00093         m_externalData((const unsigned char*)ValidData),
    -00094         m_external(true)
    -00095 {
    -00096 }
    -00097 
    -00098 Data::Data(const Data &other)
    -00099         : m_data(other.m_bufsize ? new unsigned char[other.m_bufsize] : 0),
    -00100         m_bufsize(other.m_bufsize),
    -00101         m_datasize(other.m_datasize),
    -00102         m_endpoint(other.m_endpoint),
    -00103         m_externalData(other.m_externalData),
    -00104         m_external(other.m_external)
    -00105 {
    -00106         // copy over the raw data
    -00107         if( !m_external )
    -00108                 memcpy(m_data, other.m_data, other.m_bufsize);
    -00109 }
    -00110 
    -00111 Data::~Data()
    -00112 {
    -00113         delete [] m_data;
    -00114 }
    -00115 
    -00116 void Data::MakeSpace(size_t desiredsize)
    -00117 {
    -00118         if( m_bufsize < desiredsize ) {
    -00119                 desiredsize += 1024;    // get a proper chunk
    -00120                 unsigned char *newbuf = new unsigned char[desiredsize];
    -00121                 memcpy(newbuf, m_data, m_bufsize);
    -00122                 memset(newbuf + m_bufsize, 0, desiredsize - m_bufsize);
    -00123                 delete [] m_data;
    -00124                 m_data = newbuf;
    -00125                 m_bufsize = desiredsize;
    -00126         }
    -00127 }
    -00128 
    -00129 // perform the copy on write operation if needed
    -00130 void Data::CopyOnWrite(size_t desiredsize)
    -00131 {
    -00132         if( m_external ) {
    -00133                 // make room
    -00134                 MakeSpace(std::max(desiredsize, m_datasize));
    -00135 
    -00136                 // copy it over
    -00137                 memcpy(m_data, m_externalData, m_datasize);
    -00138 
    -00139                 // not external anymore
    -00140                 m_external = false;
    -00141         }
    -00142 }
    -00143 
    -00144 void Data::InputHexLine(istream &is)
    -00145 {
    -00146         unsigned int values[16];
    -00147         size_t index = 0;
    -00148 
    -00149         size_t address;
    -00150         is >> setbase(16) >> address;
    -00151         if( !is )
    -00152                 return;         // nothing to do
    -00153 
    -00154         is.ignore();            // eat the ':'
    -00155 
    -00156         while( is && index < 16 ) {
    -00157                 is >> setbase(16) >> values[index];
    -00158                 if( is )
    -00159                         index++;
    -00160         }
    -00161 
    -00162         dout("InputHexLine: read " << index << " bytes");
    -00163 
    -00164         CopyOnWrite(address + index);
    -00165         MakeSpace(address + index);     // make space for the new
    -00166         m_datasize = std::max(address + index, m_datasize);
    -00167         while( index-- )
    -00168                 m_data[address + index] = (unsigned char) values[index];
    -00169         return;
    -00170 }
    -00171 
    -00172 void Data::DumpHexLine(ostream &os, size_t index, size_t size) const
    -00173 {
    -00174         ios::fmtflags oldflags = os.setf(ios::right);
    -00175 
    -00176         // index
    -00177         os << "    ";
    -00178         os << setbase(16) << setfill('0') << setw(8)
    -00179            << index << ": ";
    -00180 
    -00181         // hex byte data
    -00182         for( size_t i = 0; i < size; i++ ) {
    -00183                 if( (index+i) < GetSize() ) {
    -00184                         os << setbase(16) << setfill('0')
    -00185                            << setw(2) << setprecision(2)
    -00186                            << (unsigned int) GetData()[index + i] << ' ';
    -00187                 }
    -00188                 else {
    -00189                         os << "   ";
    -00190                 }
    -00191         }
    -00192 
    -00193         // printable data
    -00194         if( bPrintAscii ) {
    -00195                 locale loc = os.getloc();
    -00196                 os << ' ';
    -00197                 for( size_t i = 0; i < size && (index+i) < GetSize(); i++ ) {
    -00198                         ostream::traits_type::char_type c = GetData()[index + i];
    -00199                         os << setbase(10) << (char) (isprint(c, loc) ? c : '.');
    -00200                 }
    -00201         }
    -00202 
    -00203         os << "\n";
    -00204         os.flags(oldflags);
    -00205 }
    -00206 
    -00207 void Data::DumpHex(ostream &os) const
    -00208 {
    -00209         for( size_t address = 0; address < GetSize(); address += 16 ) {
    -00210                 DumpHexLine(os, address, 16);
    -00211         }
    -00212 }
    -00213 
    -00214 unsigned char * Data::GetBuffer(size_t requiredsize)
    -00215 {
    -00216         CopyOnWrite(requiredsize);
    -00217         if( requiredsize > 0 )
    -00218                 MakeSpace(requiredsize);
    -00219         return m_data;
    -00220 }
    -00221 
    -00222 void Data::ReleaseBuffer(int datasize)
    -00223 {
    -00224         assert( datasize >= 0 || datasize == -1 );
    -00225         assert( datasize == -1 || (unsigned int)datasize <= m_bufsize );
    -00226         assert( !m_external );
    -00227 
    -00228         if( m_external )
    -00229                 return;
    -00230         if( datasize >= 0 && (unsigned int)datasize > m_bufsize ) {
    -00231                 dout("ReleaseBuffer called with datasize("
    -00232                         << std::dec << datasize << ") > m_bufsize("
    -00233                         << m_bufsize << ")");
    -00234                 return;
    -00235         }
    -00236 
    -00237         if( datasize >= 0 ) {
    -00238                 m_datasize = datasize;
    -00239         }
    -00240         else {
    -00241                 // search for last non-zero value in buffer
    -00242                 m_datasize = m_bufsize - 1;
    -00243                 while( m_datasize && m_data[m_datasize] == 0 )
    -00244                         --m_datasize;
    -00245         }
    -00246 }
    -00247 
    -00248 /// Append bytes of data based on str
    -00249 void Data::AppendHexString(const char *str)
    -00250 {
    -00251         CopyOnWrite(m_datasize + 512);
    -00252 
    -00253         std::istringstream iss(str);
    -00254         unsigned int byte;
    -00255         while( iss >> hex >> byte ) {
    -00256                 MakeSpace(m_datasize + 1);
    -00257                 m_data[m_datasize] = (unsigned char) byte;
    -00258                 m_datasize++;
    -00259         }
    -00260 }
    -00261 
    -00262 /// set buffer to 0 and remove all data
    -00263 void Data::Zap()
    -00264 {
    -00265         if( !m_external )
    -00266                 memset(m_data, 0, m_bufsize);
    -00267         m_datasize = 0;
    -00268 }
    -00269 
    -00270 Data & Data::operator=(const Data &other)
    -00271 {
    -00272         if( this == &other )
    -00273                 return *this;
    -00274 
    -00275         // don't remove our current buffer, only grow it if needed
    -00276         MakeSpace(other.m_bufsize);
    -00277         memcpy(m_data, other.m_data, other.m_bufsize);
    -00278 
    -00279         // then copy over the data state
    -00280         m_datasize = other.m_datasize;
    -00281         m_endpoint = other.m_endpoint;
    -00282         m_externalData = other.m_externalData;
    -00283         m_external = other.m_external;
    -00284         return *this;
    -00285 }
    -00286 
    -00287 istream& operator>> (istream &is, Data &data)
    -00288 {
    -00289         data.InputHexLine(is);
    -00290         return is;
    -00291 }
    -00292 
    -00293 ostream& operator<< (ostream &os, const Data &data)
    -00294 {
    -00295         data.DumpHex(os);
    -00296         return os;
    -00297 }
    -00298 
    -00299 
    -00300 ///////////////////////////////////////////////////////////////////////////////
    -00301 // Diff class
    -00302 
    -00303 Diff::Diff(const Data &old, const Data &new_)
    -00304         : m_old(old), m_new(new_)
    -00305 {
    -00306 }
    -00307 
    -00308 void Diff::Compare(ostream &os, size_t index, size_t size) const
    -00309 {
    -00310         size_t min = std::min(m_old.GetSize(), m_new.GetSize());
    -00311 
    -00312         // index
    -00313         os << ">   ";
    -00314         os << setbase(16) << setfill('0') << setw(8)
    -00315            << index << ": ";
    -00316 
    -00317         // diff data
    -00318         for( size_t i = 0; i < size; i++ ) {
    -00319                 size_t address = index + i;
    -00320 
    -00321                 // if data is available, print the diff
    -00322                 if( address < min ) {
    -00323                         if( m_old.GetData()[address] != m_new.GetData()[address] ) {
    -00324                                 // differ, print hex
    -00325                                 os << setbase(16) << setfill('0')
    -00326                                    << setw(2) << setprecision(2)
    -00327                                    << (unsigned int) m_new.GetData()[address] << ' ';
    -00328                         }
    -00329                         else {
    -00330                                 // same, just print spaces
    -00331                                 os << "   ";
    -00332                         }
    -00333                 }
    -00334                 else {
    -00335                         // one of the buffers is shorter...
    -00336                         if( address < m_new.GetSize() ) {
    -00337                                 // new still has data, print it
    -00338                                 os << setbase(16) << setfill('0')
    -00339                                    << setw(2) << setprecision(2)
    -00340                                    << (unsigned int) m_new.GetData()[address]
    -00341                                    << ' ';
    -00342                         }
    -00343                         else if( address < m_old.GetSize() ) {
    -00344                                 // new is out of data and old still has some
    -00345                                 os << "XX ";
    -00346                         }
    -00347                         else {
    -00348                                 // no more data, just print spaces
    -00349                                 os << "   ";
    -00350                         }
    -00351                 }
    -00352         }
    -00353 
    -00354         // printable data, just dump new
    -00355         if( Data::PrintAscii() ) {
    -00356                 os << ' ';
    -00357                 for( size_t i = 0; i < size && (index+i) < m_new.GetSize(); i++ ) {
    -00358                         int c = m_new.GetData()[index + i];
    -00359                         os << setbase(10) << (char) (isprint(c) ? c : '.');
    -00360                 }
    -00361         }
    -00362 
    -00363         os << "\n";
    -00364 }
    -00365 
    -00366 void Diff::Dump(std::ostream &os) const
    -00367 {
    -00368         if( m_old.GetSize() != m_new.GetSize() )
    -00369                 os << "sizes differ: "
    -00370                    << m_old.GetSize() << " != " << m_new.GetSize() << endl;
    -00371 
    -00372         size_t max = std::max(m_old.GetSize(), m_new.GetSize());
    -00373         for( size_t i = 0; i < max; i += 16 ) {
    -00374                 m_old.DumpHexLine(os, i, 16);
    -00375                 Compare(os, i, 16);
    -00376         }
    -00377 }
    -00378 
    -00379 ostream& operator<< (ostream &os, const Diff &diff)
    -00380 {
    -00381         diff.Dump(os);
    -00382         return os;
    -00383 }
    -00384 
    -00385 
    -00386 ///////////////////////////////////////////////////////////////////////////////
    -00387 // Utility functions
    -00388 
    -00389 static bool IsEndpointStart(const std::string &line, int &endpoint)
    -00390 {
    -00391         if( strncmp(line.c_str(), "sep: ", 5) == 0 ||
    -00392             strncmp(line.c_str(), "rep: ", 5) == 0 )
    -00393         {
    -00394                 endpoint = atoi(line.c_str() + 5);
    -00395                 return true;
    -00396         }
    -00397         return false;
    -00398 }
    -00399 
    -00400 bool LoadDataArray(const string &filename, std::vector<Data> &array)
    -00401 {
    -00402         ifstream in(filename.c_str());
    -00403         return ReadDataArray(in, array);
    -00404 }
    -00405 
    -00406 bool ReadDataArray(std::istream &is, std::vector<Data> &array)
    -00407 {
    -00408         if( !is )
    -00409                 return false;
    -00410 
    -00411         bool bInEndpoint = false;
    -00412         unsigned int nCurrent = 0;
    -00413         size_t nLargestSize = 0x100;
    -00414         while( is ) {
    -00415                 string line;
    -00416                 getline(is, line);
    -00417                 int endpoint;
    -00418                 if( bInEndpoint ) {
    -00419                         if( IsHexData(line) ) {
    -00420                                 istringstream sline(line);
    -00421                                 sline >> array[nCurrent];
    -00422                                 continue;
    -00423                         }
    -00424                         else {
    -00425                                 nLargestSize = std::max(nLargestSize,
    -00426                                         array[nCurrent].GetBufSize());
    -00427                                 bInEndpoint = false;
    -00428                         }
    -00429                 }
    -00430 
    -00431                 // check if this line starts a new endpoint
    -00432                 if( IsEndpointStart(line, endpoint) ) {
    -00433                         bInEndpoint = true;
    -00434                         Data chunk(endpoint, nLargestSize);
    -00435                         array.push_back(chunk);
    -00436                         nCurrent = array.size() - 1;
    -00437                 }
    -00438         }
    -00439         return true;
    -00440 }
    -00441 
    -00442 } // namespace Barry
    -00443 
    -00444 
    -00445 #ifdef __TEST_MODE__
    -00446 
    -00447 #include <iostream>
    -00448 #include <iomanip>
    -00449 #include "data.h"
    -00450 
    -00451 using namespace std;
    -00452 
    -00453 int main()
    -00454 {
    -00455         typedef std::vector<Data> DataVec;
    -00456         DataVec array;
    -00457         if( !LoadDataArray("data/parsed.log", array) ) {
    -00458                 cout << "Can't load file" << endl;
    -00459                 return 1;
    -00460         }
    -00461 
    -00462         DataVec::iterator i = array.begin();
    -00463         Data::PrintAscii(false);
    -00464         for( ; i != array.end(); i++ ) {
    -00465                 cout << "Endpoint: " << i->GetEndpoint() << endl;
    -00466                 cout << *i;
    -00467                 cout << "\n\n";
    -00468         }
    -00469 
    -00470 
    -00471         Data one, two;
    -00472         one.GetBuffer()[0] = 0x01;
    -00473         one.ReleaseBuffer(1);
    -00474         two.GetBuffer()[0] = 0x02;
    -00475         two.ReleaseBuffer(2);
    -00476 
    -00477         cout << Diff(one, two) << endl;
    -00478         cout << Diff(two, one) << endl;
    -00479 
    -00480         two.GetBuffer();
    -00481         two.ReleaseBuffer(32);
    -00482         cout << Diff(one, two) << endl;
    -00483 }
    -00484 
    -00485 #endif
    -00486 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/data_8h.html barry-0.0.20110506/doc/www/doxygen/html/data_8h.html --- barry-0.14/doc/www/doxygen/html/data_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/data_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ - - -Barry: data.h File Reference - - - - - - - -

    data.h File Reference


    Detailed Description

    -Class to deal with pre-saved data files. -

    - -

    -Definition in file data.h. -

    -#include "dll.h"
    -#include <iosfwd>
    -#include <vector>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Data
    class  Barry::Diff

    Functions

    -istream & Barry::operator>> (istream &is, Data &data)
    -ostream & Barry::operator<< (ostream &os, const Data &data)
    -ostream & Barry::operator<< (ostream &os, const Diff &diff)
    -bool Barry::LoadDataArray (const string &filename, std::vector< Data > &array)
    -bool Barry::ReadDataArray (std::istream &is, std::vector< Data > &array)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/data_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/data_8h-source.html --- barry-0.14/doc/www/doxygen/html/data_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/data_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ - - -Barry: data.h Source File - - - - - - - -

    data.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       data.h
    -00003 ///             Class to deal with pre-saved data files
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __SB_DATA_H__
    -00023 #define __SB_DATA_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <iosfwd>
    -00027 #include <vector>
    -00028 
    -00029 namespace Barry {
    -00030 
    -00031 class BXEXPORT Data
    -00032 {
    -00033         unsigned char *m_data;
    -00034         size_t m_bufsize;               //< size of m_data buffer allocated
    -00035         size_t m_datasize;              //< number of bytes of actual data
    -00036         int m_endpoint;
    -00037 
    -00038         // copy on write feature
    -00039         const unsigned char *m_externalData;
    -00040         bool m_external;
    -00041 
    -00042         // output format flags
    -00043         static bool bPrintAscii;
    -00044 
    -00045 protected:
    -00046         void MakeSpace(size_t desiredsize);
    -00047         void CopyOnWrite(size_t desiredsize);
    -00048 
    -00049 public:
    -00050         Data();
    -00051         explicit Data(int endpoint, size_t startsize = 0x4000);
    -00052         Data(const void *ValidData, size_t size);
    -00053         Data(const Data &other);
    -00054         ~Data();
    -00055 
    -00056         void InputHexLine(std::istream &is);
    -00057         void DumpHexLine(std::ostream &os, size_t index, size_t size) const;
    -00058         void DumpHex(std::ostream &os) const;
    -00059 
    -00060         int GetEndpoint() const { return m_endpoint; }
    -00061 
    -00062         const unsigned char * GetData() const { return m_external ? m_externalData : m_data; }
    -00063         size_t GetSize() const { return m_datasize; }
    -00064 
    -00065         unsigned char * GetBuffer(size_t requiredsize = 0);
    -00066         size_t GetBufSize() const { return m_bufsize; }
    -00067         void ReleaseBuffer(int datasize = -1);
    -00068 
    -00069         void AppendHexString(const char *str);
    -00070 
    -00071         void Zap();
    -00072 
    -00073         Data& operator=(const Data &other);
    -00074 
    -00075 
    -00076         // static functions
    -00077         static void PrintAscii(bool setting) { bPrintAscii = setting; }
    -00078         static bool PrintAscii() { return bPrintAscii; }
    -00079 };
    -00080 
    -00081 BXEXPORT std::istream& operator>> (std::istream &is, Data &data);
    -00082 BXEXPORT std::ostream& operator<< (std::ostream &os, const Data &data);
    -00083 
    -00084 
    -00085 class BXEXPORT Diff
    -00086 {
    -00087         const Data &m_old, &m_new;
    -00088 
    -00089         BXLOCAL void Compare(std::ostream &os, size_t index, size_t size) const;
    -00090 
    -00091 public:
    -00092         Diff(const Data &old, const Data &new_);
    -00093 
    -00094         void Dump(std::ostream &os) const;
    -00095 };
    -00096 
    -00097 BXEXPORT std::ostream& operator<< (std::ostream &os, const Diff &diff);
    -00098 
    -00099 
    -00100 // utility functions
    -00101 BXEXPORT bool LoadDataArray(const std::string &filename, std::vector<Data> &array);
    -00102 BXEXPORT bool ReadDataArray(std::istream &is, std::vector<Data> &array);
    -00103 
    -00104 } // namespace Barry
    -00105 
    -00106 #endif
    -00107 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dataqueue_8cc.html barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8cc.html --- barry-0.14/doc/www/doxygen/html/dataqueue_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - -Barry: dataqueue.cc File Reference - - - - - - - -

    dataqueue.cc File Reference


    Detailed Description

    -FIFO queue of Data objects. -

    - -

    -Definition in file dataqueue.cc. -

    -#include "dataqueue.h"
    -#include "scoped_lock.h"
    -#include "data.h"
    -#include <sys/time.h>
    -#include <time.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dataqueue_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8cc-source.html --- barry-0.14/doc/www/doxygen/html/dataqueue_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,305 +0,0 @@ - - -Barry: dataqueue.cc Source File - - - - - - - -

    dataqueue.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       dataqueue.cc
    -00003 ///             FIFO queue of Data objects
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "dataqueue.h"
    -00023 #include "scoped_lock.h"
    -00024 #include "data.h"
    -00025 #include <sys/time.h>
    -00026 #include <time.h>
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 //////////////////////////////////////////////////////////////////////////////
    -00031 // DataQueue class
    -00032 
    -00033 DataQueue::DataQueue()
    -00034 {
    -00035         pthread_mutex_init(&m_waitMutex, NULL);
    -00036         pthread_cond_init(&m_waitCond, NULL);
    -00037 
    -00038         pthread_mutex_init(&m_accessMutex, NULL);
    -00039 }
    -00040 
    -00041 DataQueue::~DataQueue()
    -00042 {
    -00043         scoped_lock lock(m_accessMutex);        // FIXME - is this sane?
    -00044 
    -00045         while( m_queue.size() ) {
    -00046                 delete m_queue.front();
    -00047                 m_queue.pop();
    -00048         }
    -00049 }
    -00050 
    -00051 //
    -00052 // push
    -00053 //
    -00054 /// Pushes data into the end of the queue.
    -00055 ///
    -00056 /// The queue owns this pointer as soon as the function is
    -00057 /// called.  In the case of an exception, it will be freed.
    -00058 /// Performs a thread broadcast once new data has been added.
    -00059 ///
    -00060 void DataQueue::push(Data *data)
    -00061 {
    -00062         try {
    -00063 
    -00064                 {
    -00065                         scoped_lock lock(m_accessMutex);
    -00066                         m_queue.push(data);
    -00067                 }
    -00068 
    -00069                 scoped_lock wait(m_waitMutex);
    -00070                 pthread_cond_broadcast(&m_waitCond);
    -00071 
    -00072         }
    -00073         catch(...) {
    -00074                 delete data;
    -00075                 throw;
    -00076         }
    -00077 }
    -00078 
    -00079 //
    -00080 // pop
    -00081 //
    -00082 /// Pops the next element off the front of the queue.
    -00083 ///
    -00084 /// Returns 0 if empty.
    -00085 /// The queue no longer owns this pointer upon return.
    -00086 ///
    -00087 Data* DataQueue::pop()
    -00088 {
    -00089         scoped_lock lock(m_accessMutex);
    -00090 
    -00091         if( m_queue.size() == 0 )
    -00092                 return 0;
    -00093 
    -00094         Data *ret = m_queue.front();
    -00095         m_queue.pop();
    -00096         return ret;
    -00097 }
    -00098 
    -00099 //
    -00100 // wait_pop
    -00101 //
    -00102 /// Pops the next element off the front of the queue, and
    -00103 /// waits until one exists if empty.  If still no data
    -00104 /// on timeout, returns null.
    -00105 /// (unlock the access mutex while waiting!)
    -00106 ///
    -00107 /// Timeout specified in milliseconds.  Default is wait forever.
    -00108 ///
    -00109 Data* DataQueue::wait_pop(int timeout)
    -00110 {
    -00111         Data *ret = 0;
    -00112 
    -00113         // check if something's there already
    -00114         {
    -00115                 scoped_lock access(m_accessMutex);
    -00116                 if( m_queue.size() ) {
    -00117                         ret = m_queue.front();
    -00118                         m_queue.pop();
    -00119                         return ret;
    -00120                 }
    -00121         }
    -00122 
    -00123         // nothing there, so wait...
    -00124 
    -00125         if( timeout == -1 ) {
    -00126                 // no timeout
    -00127                 int size = 0;
    -00128                 do {
    -00129                         {
    -00130                                 scoped_lock wait(m_waitMutex);
    -00131                                 pthread_cond_wait(&m_waitCond, &m_waitMutex);
    -00132                         }
    -00133 
    -00134                         // anything there?
    -00135                         scoped_lock access(m_accessMutex);
    -00136                         size = m_queue.size();
    -00137                         if( size != 0 ) {
    -00138                                 // already have the lock, return now
    -00139                                 ret = m_queue.front();
    -00140                                 m_queue.pop();
    -00141                                 return ret;
    -00142                         }
    -00143 
    -00144                 } while( size == 0 );
    -00145         }
    -00146         else {
    -00147                 // timeout in conditional wait
    -00148                 struct timeval now;
    -00149                 struct timespec to;
    -00150 
    -00151                 gettimeofday(&now, NULL);
    -00152                 to.tv_sec = now.tv_sec + timeout / 1000;
    -00153                 to.tv_nsec = (now.tv_usec + timeout % 1000 * 1000) * 1000;
    -00154 
    -00155                 scoped_lock wait(m_waitMutex);
    -00156                 pthread_cond_timedwait(&m_waitCond, &m_waitMutex, &to);
    -00157         }
    -00158 
    -00159         scoped_lock access(m_accessMutex);
    -00160         if( m_queue.size() == 0 )
    -00161                 return 0;
    -00162 
    -00163         ret = m_queue.front();
    -00164         m_queue.pop();
    -00165         return ret;
    -00166 }
    -00167 
    -00168 //
    -00169 // append_from
    -00170 //
    -00171 /// Pops all data from other and appends it to this.
    -00172 ///
    -00173 /// After calling this function, other will be empty, and
    -00174 /// this will contain all its data.
    -00175 ///
    -00176 /// In the case of an exception, any uncopied data will
    -00177 /// remain in other.
    -00178 ///
    -00179 /// This is a locking optimization, so all copying can happen
    -00180 /// inside one lock, instead of locking for each copy.
    -00181 ///
    -00182 void DataQueue::append_from(DataQueue &other)
    -00183 {
    -00184         scoped_lock us(m_accessMutex);
    -00185         scoped_lock them(other.m_accessMutex);
    -00186 
    -00187         while( other.m_queue.size() ) {
    -00188                 m_queue.push( other.m_queue.front() );
    -00189 
    -00190                 // only pop after the copy, since in the
    -00191                 // case of an exception we want to leave other intact
    -00192                 other.m_queue.pop();
    -00193         }
    -00194 }
    -00195 
    -00196 //
    -00197 // empty
    -00198 //
    -00199 /// Returns true if the queue is empty.
    -00200 ///
    -00201 bool DataQueue::empty() const
    -00202 {
    -00203         scoped_lock access(m_accessMutex);
    -00204         return m_queue.size() == 0;
    -00205 }
    -00206 
    -00207 //
    -00208 // size
    -00209 //
    -00210 /// Returns number of items in the queue.
    -00211 ///
    -00212 size_t DataQueue::size() const
    -00213 {
    -00214         scoped_lock access(m_accessMutex);
    -00215         return m_queue.size();
    -00216 }
    -00217 
    -00218 } // namespace Barry
    -00219 
    -00220 
    -00221 #ifdef __DQ_TEST_MODE__
    -00222 
    -00223 #include <iostream>
    -00224 
    -00225 using namespace std;
    -00226 using namespace Barry;
    -00227 
    -00228 void *WriteThread(void *userdata)
    -00229 {
    -00230         DataQueue *dq = (DataQueue*) userdata;
    -00231 
    -00232         dq->push( new Data );
    -00233         dq->push( new Data );
    -00234         sleep(5);
    -00235         dq->push( new Data );
    -00236 
    -00237         return 0;
    -00238 }
    -00239 
    -00240 void *ReadThread(void *userdata)
    -00241 {
    -00242         DataQueue *dq = (DataQueue*) userdata;
    -00243 
    -00244         sleep(1);
    -00245         if( Data *d = dq->pop() ) {
    -00246                 cout << "Received via pop: " << d << endl;
    -00247                 delete d;
    -00248         }
    -00249         else {
    -00250                 cout << "No data in the queue yet." << endl;
    -00251         }
    -00252 
    -00253         while( Data *d = dq->wait_pop(5010) ) {
    -00254                 cout << "Received: " << d << endl;
    -00255                 delete d;
    -00256         }
    -00257         return 0;
    -00258 }
    -00259 
    -00260 int main()
    -00261 {
    -00262         DataQueue from;
    -00263         from.push( new Data );
    -00264 
    -00265         DataQueue dq;
    -00266         dq.append_from(from);
    -00267 
    -00268         pthread_t t1, t2;
    -00269         pthread_create(&t1, NULL, &ReadThread, &dq);
    -00270         pthread_create(&t2, NULL, &WriteThread, &dq);
    -00271 
    -00272         pthread_join(t2, NULL);
    -00273         pthread_join(t1, NULL);
    -00274 }
    -00275 
    -00276 #endif
    -00277 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dataqueue_8h.html barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8h.html --- barry-0.14/doc/www/doxygen/html/dataqueue_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ - - -Barry: dataqueue.h File Reference - - - - - - - -

    dataqueue.h File Reference


    Detailed Description

    -FIFO queue of Data objects. -

    - -

    -Definition in file dataqueue.h. -

    -#include <queue>
    -#include <pthread.h>
    - -

    -Go to the source code of this file. - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::DataQueue
     This class provides a thread aware fifo queue for Data objects, providing memory management for all Data object pointers it contains. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dataqueue_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8h-source.html --- barry-0.14/doc/www/doxygen/html/dataqueue_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dataqueue_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - -Barry: dataqueue.h Source File - - - - - - - -

    dataqueue.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       dataqueue.h
    -00003 ///             FIFO queue of Data objects
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_DATAQUEUE_H__
    -00023 #define __BARRY_DATAQUEUE_H__
    -00024 
    -00025 #include <queue>
    -00026 #include <pthread.h>
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 class Data;
    -00031 
    -00032 //
    -00033 // DataQueue class
    -00034 //
    -00035 /// This class provides a thread aware fifo queue for Data objects,
    -00036 /// providing memory management for all Data object pointers it contains.
    -00037 ///
    -00038 /// It uses similar member names as std::queue<>, for consistency.
    -00039 ///
    -00040 class DataQueue
    -00041 {
    -00042         typedef std::queue<Data*>                       queue_type;
    -00043 
    -00044         pthread_mutex_t m_waitMutex;
    -00045         pthread_cond_t m_waitCond;
    -00046 
    -00047         mutable pthread_mutex_t m_accessMutex;  // locked for each access of m_queue
    -00048 
    -00049         queue_type m_queue;
    -00050 
    -00051 public:
    -00052         DataQueue();
    -00053         ~DataQueue();           // frees all data in the queue
    -00054 
    -00055         // Pushes data into the end of the queue.
    -00056         // The queue owns this pointer as soon as the function is
    -00057         // called.  In the case of an exception, it will be freed.
    -00058         // Performs a thread broadcast once new data has been added.
    -00059         void push(Data *data);
    -00060 
    -00061         // Pops the next element off the front of the queue.
    -00062         // Returns 0 if empty.
    -00063         // The queue no longer owns this pointer upon return.
    -00064         Data* pop();
    -00065 
    -00066         // Pops the next element off the front of the queue, and
    -00067         // waits until one exists if empty.  If still no data
    -00068         // on timeout, returns null.
    -00069         // Timeout specified in milliseconds.  Default is wait forever.
    -00070         Data* wait_pop(int timeout = -1);
    -00071 
    -00072         // Pops all data from other and appends it to this.
    -00073         // After calling this function, other will be empty, and
    -00074         // this will contain all its data.
    -00075         // In the case of an exception, any uncopied data will
    -00076         // remain in other.
    -00077         void append_from(DataQueue &other);
    -00078 
    -00079         bool empty() const;     // return true if empty
    -00080         size_t size() const;
    -00081 };
    -00082 
    -00083 } // namespace Barry
    -00084 
    -00085 #endif
    -00086 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/debug_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/debug_8h-source.html --- barry-0.14/doc/www/doxygen/html/debug_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/debug_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ - - -Barry: debug.h Source File - - - - - - - -

    debug.h

    00001 /*
    -00002     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00003 
    -00004     This program is free software; you can redistribute it and/or modify
    -00005     it under the terms of the GNU General Public License as published by
    -00006     the Free Software Foundation; either version 2 of the License, or
    -00007     (at your option) any later version.
    -00008 
    -00009     This program is distributed in the hope that it will be useful,
    -00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00012 
    -00013     See the GNU General Public License in the COPYING file at the
    -00014     root directory of this project for more details.
    -00015 */
    -00016 
    -00017 #include <iostream>             // debugging only
    -00018 #include <iomanip>
    -00019 #include "common.h"
    -00020 #include "log.h"
    -00021 
    -00022 #ifndef __BARRY_DEBUG_H__       // only protect the non-macro portion, in order
    -00023 #define __BARRY_DEBUG_H__       // to allow re-inclusion of debug.h with
    -00024                                 // different __DEBUG_MODE__ settings
    -00025 
    -00026 namespace Barry {
    -00027 extern bool __data_dump_mode__;
    -00028 extern std::ostream *LogStream;
    -00029 }
    -00030 
    -00031 #endif // __BARRY_DEBUG_H__
    -00032 
    -00033 // data dump output - controlled by command line -v switch
    -00034 #define ddout(x)        if(Barry::__data_dump_mode__) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; }
    -00035 
    -00036 #ifdef __DEBUG_MODE__
    -00037         // debugging on
    -00038         #undef dout
    -00039         #undef eout
    -00040 
    -00041         // low level debug output
    -00042         #define dout(x)         if(Barry::__data_dump_mode__) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; }
    -00043 //      #define dout(x)
    -00044 
    -00045         // exception output
    -00046         #define eout(x)         { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; }
    -00047 
    -00048         // easy exception output
    -00049         #define eeout(c, r)     { Barry::LogLock lock; (*Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; }
    -00050 
    -00051         // handle assert()
    -00052         #undef NDEBUG
    -00053 #else
    -00054 
    -00055         // debugging off
    -00056         #undef dout
    -00057         #undef eout
    -00058 
    -00059         #define dout(x)
    -00060         #define eout(x)         { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; }
    -00061         #define eeout(c, r)     { Barry::LogLock lock; (*Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; }
    -00062 
    -00063         // handle assert() as well
    -00064         #define NDEBUG
    -00065 #endif
    -00066 
    -00067 #include <assert.h>
    -00068 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dir_ae818e64ea3dc686ac96c0f260a1301d.html barry-0.0.20110506/doc/www/doxygen/html/dir_ae818e64ea3dc686ac96c0f260a1301d.html --- barry-0.14/doc/www/doxygen/html/dir_ae818e64ea3dc686ac96c0f260a1301d.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dir_ae818e64ea3dc686ac96c0f260a1301d.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - -Barry: tools/ Directory Reference - - - - - - -

    tools Directory Reference

    -

    - - - - - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -


    Files

    file  bcharge.cc [code]
     Talk to the Blackberry just enough to change the Max Power to 500mA.
    file  bidentify.cc [code]
     Tool for probing identifying Blackberry devices.
    file  bktrans.cc [code]
    file  brecsum.cc [code]
     Generate SHA1 sums of raw Blackberry database records.
    file  breset.cc [code]
     Attempt to reset all connected Blackberry devices via software.
    file  bs11nread.cc [code]
     Reads an boost serialization file and dumps to stdout.
    file  btool.cc [code]
     Barry library tester.
    file  btranslate.cc [code]
    file  pppob.cc [code]
     In the same vein as pppoe, used with pppd to create a pty tunnel and GPRS modem link.
    file  upldif.cc [code]
     LDIF contact uploader.
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dir_edc0f428e3eefcfdce9c25befd901c57.html barry-0.0.20110506/doc/www/doxygen/html/dir_edc0f428e3eefcfdce9c25befd901c57.html --- barry-0.14/doc/www/doxygen/html/dir_edc0f428e3eefcfdce9c25befd901c57.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dir_edc0f428e3eefcfdce9c25befd901c57.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,411 +0,0 @@ - - -Barry: src/ Directory Reference - - - - - - -

    src Directory Reference

    -

    - - - - - - - -

    -

    - - - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - - - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -

    - - - -

    -


    Files

    file  barry.h [code]
     Main header file for applications.
    file  base64.cc [code]
    file  base64.h [code]
    file  builder.h [code]
     Virtual protocol packet builder wrapper.
    file  cbarry.h [code]
     Main header file for Barry C API - incomplete.
    file  common.cc [code]
     General Barry interface routines.
    file  common.h [code]
     General header for the Barry library.
    file  controller.cc [code]
     High level Barry API class.
    file  controller.h [code]
     High level BlackBerry API class.
    file  data.cc [code]
     Classes to help manage pre-determined data files.
    file  data.h [code]
     Class to deal with pre-saved data files.
    file  dataqueue.cc [code]
     FIFO queue of Data objects.
    file  dataqueue.h [code]
     FIFO queue of Data objects.
    file  debug.h [code]
    file  dll.h [code]
     Macros for handling DLL/library API visibility.
    file  endian.h [code]
     Endian conversion macros.
    file  error.cc [code]
     Common exception classes for the Barry library.
    file  error.h [code]
     Common exception classes for the Barry library.
    file  ldif.cc [code]
     Routines for reading and writing LDAP LDIF data.
    file  ldif.h [code]
     Routines for reading and writing LDAP LDIF data.
    file  log.cc [code]
     General Barry interface routines.
    file  log.h [code]
     General header for the Barry library.
    file  m_desktop.cc [code]
     Mode class for the Desktop mode.
    file  m_desktop.h [code]
     Mode class for the Desktop mode.
    file  m_desktoptmpl.h [code]
     Ease of use templates for the Desktop mode class.
    file  m_ipmodem.cc [code]
     Mode class for GPRS modem mode (using endpoints on modern devices).
    file  m_ipmodem.h [code]
     Mode class for GPRS modem mode (using endpoints on modern devices).
    file  m_serial.cc [code]
     Mode class for serial / GPRS modem mode.
    file  m_serial.h [code]
     Mode class for serial / GPRS modem mode.
    file  modem.h [code]
     Modem API base class for the various serial/modem modes available on the Blackberry.
    file  packet.cc [code]
     Low level protocol packet builder class.
    file  packet.h [code]
     Low level protocol packet builder class.
    file  parser.cc [code]
     Virtual parser functor class.
    file  parser.h [code]
     Virtual parser wrapper.
    file  pppfilter.cc [code]
     Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle.
    file  pppfilter.h [code]
     Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle.
    file  probe.cc [code]
     USB Blackberry detection routines.
    file  probe.h [code]
     USB Blackberry detection routines.
    file  protocol.cc [code]
     USB Blackberry bulk protocol API.
    file  protocol.h [code]
     USB Blackberry bulk protocol API constants.
    file  protostructs.h [code]
     USB Blackberry bulk protocol API.
    file  r_calendar.cc [code]
     Blackberry database record parser class for calendar records.
    file  r_calendar.h [code]
     Blackberry database record parser class for calndar records.
    file  r_contact.cc [code]
     Blackberry database record parser class for contact records.
    file  r_contact.h [code]
     Blackberry database record parser class for contact records.
    file  r_folder.cc [code]
     Record parsing class for the folders database.
    file  r_folder.h [code]
     Record parsing class for the Folder database.
    file  r_memo.cc [code]
     Record parsing class for the memo database.
    file  r_memo.h [code]
     Record parsing class for the memo database.
    file  r_message.cc [code]
     Blackberry database record parser class for email records.
    file  r_message.h [code]
     Blackberry database record parser class for email records.
    file  r_pin_message.cc [code]
     Blackberry database record parser class for pin message records.
    file  r_pin_message.h [code]
     Blackberry database record parser class for pin message records.
    file  r_saved_message.cc [code]
     Blackberry database record parser class for saved email message records.
    file  r_saved_message.h [code]
    file  r_servicebook.cc [code]
     Blackberry database record parser class for Service Book records.
    file  r_servicebook.h [code]
     Blackberry database record parser class for the Service Book record.
    file  r_task.cc [code]
     Record parsing class for the task database.
    file  r_task.h [code]
     Record parsing class for the task database.
    file  r_timezone.cc [code]
     Record parsing class for the timezone database.
    file  r_timezone.h [code]
     Record parsing class for the timezone database.
    file  record-internal.h [code]
     Support functions, types, and templates for the general record parsing classes in r_*.h files.
    file  record.cc [code]
     Blackberry database record classes.
    file  record.h [code]
     Blackberry database record classes.
    file  router.cc [code]
     Support classes for the pluggable socket routing system.
    file  router.h [code]
     Support classes for the pluggable socket routing system.
    file  s11n-boost.h [code]
     Non-intrusive versions of serialization functions for the record classes.
    file  scoped_lock.h [code]
     Simple scope class for dealing with pthread mutex locking.
    file  sha1.cc [code]
    file  sha1.h [code]
    file  socket.cc [code]
     Class wrapper to encapsulate the Blackberry USB logical socket.
    file  socket.h [code]
     Class wrapper to encapsulate the Blackberry USB logical socket.
    file  strnlen.c [code]
     Implementation of strnlen() call, for systems that don't have GNU.
    file  strnlen.h [code]
     Header for strnlen() call, for systems that don't have GNU.
    file  time.cc [code]
     Conversion between time_t and cenmin_t and back.
    file  time.h [code]
     Time related conversion routines.
    file  usbwrap.cc [code]
     USB API wrapper.
    file  usbwrap.h [code]
     USB API wrapper.
    file  version.cc [code]
     Provide access to library version information.
    file  version.h [code]
     Provide access to library version information.
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dirs.html barry-0.0.20110506/doc/www/doxygen/html/dirs.html --- barry-0.14/doc/www/doxygen/html/dirs.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dirs.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ - - -Barry: Directory Hierarchy - - - - - -

    Barry Directories

    This directory hierarchy is sorted roughly, but not completely, alphabetically: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dll_8h.html barry-0.0.20110506/doc/www/doxygen/html/dll_8h.html --- barry-0.14/doc/www/doxygen/html/dll_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dll_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: dll.h File Reference - - - - - - - -

    dll.h File Reference


    Detailed Description

    -Macros for handling DLL/library API visibility. -

    -Based on documentation at: http://gcc.gnu.org/wiki/Visibility -

    -Definition in file dll.h. -

    - -

    -Go to the source code of this file. - - - - - - -

    Defines

    -#define BXEXPORT
    -#define BXLOCAL
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/dll_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/dll_8h-source.html --- barry-0.14/doc/www/doxygen/html/dll_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/dll_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - - -Barry: dll.h Source File - - - - - - - -

    dll.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       dll.h
    -00003 ///             Macros for handling DLL/library API visibility
    -00004 ///
    -00005 /// Based on documentation at: http://gcc.gnu.org/wiki/Visibility
    -00006 ///
    -00007 
    -00008 /*
    -00009     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #ifndef __BARRY_DLL_H__
    -00025 #define __BARRY_DLL_H__
    -00026 
    -00027 //
    -00028 //
    -00029 // Every non-templated class that is meant to be used by an application
    -00030 // must be declared as:
    -00031 //
    -00032 //         class BXEXPORT ClassName {};
    -00033 //
    -00034 // Every private (not protected or public) member function of an exported
    -00035 // class can be declared as:
    -00036 //
    -00037 //      private:
    -00038 //         BXLOCAL void HelperFunc();
    -00039 //
    -00040 // Every non-templated function that is meant to be used by an application
    -00041 // must be declared as:
    -00042 //
    -00043 //      BXEXPORT int GetAmount();
    -00044 //      BXEXPORT std::ostream& operator<< (std::ostream& os, const Obj &obj);
    -00045 //
    -00046 //
    -00047 // Everything else will be hidden, as per the build system's configuration.
    -00048 //
    -00049 //
    -00050 
    -00051 #if __BARRY_HAVE_GCCVISIBILITY__
    -00052 
    -00053 #define BXEXPORT __attribute__ ((visibility("default")))
    -00054 #define BXLOCAL __attribute__ ((visibility("hidden")))
    -00055 
    -00056 #else
    -00057 
    -00058 #define BXEXPORT
    -00059 #define BXLOCAL
    -00060 
    -00061 #endif
    -00062 
    -00063 #endif
    -00064 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/doxygen.css barry-0.0.20110506/doc/www/doxygen/html/doxygen.css --- barry-0.14/doc/www/doxygen/html/doxygen.css 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/doxygen.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,358 +0,0 @@ -BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -BODY,TD { - font-size: 90%; -} -H1 { - text-align: center; - font-size: 160%; -} -H2 { - font-size: 120%; -} -H3 { - font-size: 100%; -} -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.nav { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.navtab { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -TD.navtab { - font-size: 70%; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - border: 1px double #9295C2; -} -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} -A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} -A.codeRef:link { font-weight: normal; color: #0000FF} -A.codeRef:visited { font-weight: normal; color: #0000FF} -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -.fragment { - font-family: monospace, fixed; - font-size: 95%; -} -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } - -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #e8eef2; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #e8eef2; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdescLeft { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplParams { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - color: #606060; - background-color: #FAFAFA; - font-size: 80%; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -TD.tiny { font-size: 75%; -} -a { - color: #1A41A8; -} -a:visited { - color: #2A3798; -} -.dirtab { padding: 4px; - border-collapse: collapse; - border: 1px solid #84b0c7; -} -TH.dirtab { background: #e8eef2; - font-weight: bold; -} -HR { height: 1px; - border: none; - border-top: 1px solid black; -} - -/* Style for detailed member documentation */ -.memtemplate { - font-size: 80%; - color: #606060; - font-weight: normal; -} -.memnav { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -.memitem { - padding: 4px; - background-color: #eef3f5; - border-width: 1px; - border-style: solid; - border-color: #dedeee; - -moz-border-radius: 8px 8px 8px 8px; -} -.memname { - white-space: nowrap; - font-weight: bold; -} -.memdoc{ - padding-left: 10px; -} -.memproto { - background-color: #d5e1e8; - width: 100%; - border-width: 1px; - border-style: solid; - border-color: #84b0c7; - font-weight: bold; - -moz-border-radius: 8px 8px 8px 8px; -} -.paramkey { - text-align: right; -} -.paramtype { - white-space: nowrap; -} -.paramname { - color: #602020; - font-style: italic; - white-space: nowrap; -} -/* End Styling for detailed member documentation */ - -/* for the tree view */ -.ftvtree { - font-family: sans-serif; - margin:0.5em; -} -.directory { font-size: 9pt; font-weight: bold; } -.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } -.directory > h3 { margin-top: 0; } -.directory p { margin: 0px; white-space: nowrap; } -.directory div { display: none; margin: 0px; } -.directory img { vertical-align: -30%; } Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/doxygen.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/doxygen.png differ diff -Nru barry-0.14/doc/www/doxygen/html/endian_8h.html barry-0.0.20110506/doc/www/doxygen/html/endian_8h.html --- barry-0.14/doc/www/doxygen/html/endian_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/endian_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: endian.h File Reference - - - - - - - -

    endian.h File Reference


    Detailed Description

    -Endian conversion macros. -

    - -

    -Definition in file endian.h. -

    -#include "config.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - -

    Defines

    -#define btohs(x)   x
    -#define btohl(x)   x
    -#define btohll(x)   x
    -#define htobs(x)   x
    -#define htobl(x)   x
    -#define htobll(x)   x
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/endian_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/endian_8h-source.html --- barry-0.14/doc/www/doxygen/html/endian_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/endian_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ - - -Barry: endian.h Source File - - - - - - - -

    endian.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       endian.h
    -00003 ///             Endian conversion macros
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_ENDIAN_H__
    -00023 #define __BARRY_ENDIAN_H__
    -00024 
    -00025 // The Blackberry is little endian in its USB data.  Fortunately,
    -00026 // this makes conversion easy on the x86...
    -00027 #include "config.h"
    -00028 
    -00029 #ifndef WORDS_BIGENDIAN
    -00030 #define btohs(x) x                      // for uint16_t
    -00031 #define btohl(x) x                      // for uint32_t
    -00032 #define btohll(x) x                     // for uint64_t
    -00033 #define htobs(x) x                      // for uint16_t
    -00034 #define htobl(x) x                      // for uint32_t
    -00035 #define htobll(x) x                     // for uint64_t
    -00036 #else
    -00037 
    -00038 //#include <byteswap.h>
    -00039 
    -00040 // The following is a byteswap.h replacement, for systems like Mac OS X.
    -00041 // It was taken from a patch to the GPL software cowpatty, patch
    -00042 // by user gm2net.
    -00043 // http://www.netstumbler.org/showpost.php?s=79764fd1526e4653d5cb4432225da6ee&p=190494&postcount=29
    -00044 
    -00045 //#warning "byteswap.h is an unportable GNU extension!  Don't use!"
    -00046 
    -00047 static inline unsigned short bswap_16(unsigned short x) {
    -00048   return (x>>8) | (x<<8);
    -00049 }
    -00050 
    -00051 static inline unsigned int bswap_32(unsigned int x) {
    -00052   return (bswap_16(x&0xffff)<<16) | (bswap_16(x>>16));
    -00053 }
    -00054 
    -00055 static inline unsigned long long bswap_64(unsigned long long x) {
    -00056   return (((unsigned long long)bswap_32(x&0xffffffffull))<<32) | (bswap_32(x>>32));
    -00057 }
    -00058 
    -00059 #define btohs(x) bswap_16(x)            // for uint16_t
    -00060 #define btohl(x) bswap_32(x)            // for uint32_t
    -00061 #define btohll(x) bswap_64(x)           // for uint64_t
    -00062 #define htobs(x) bswap_16(x)            // for uint16_t
    -00063 #define htobl(x) bswap_32(x)            // for uint32_t
    -00064 #define htobll(x) bswap_64(x)           // for uint64_t
    -00065 #endif
    -00066 
    -00067 #endif
    -00068 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/error_8cc.html barry-0.0.20110506/doc/www/doxygen/html/error_8cc.html --- barry-0.14/doc/www/doxygen/html/error_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/error_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - -Barry: error.cc File Reference - - - - - - - -

    error.cc File Reference


    Detailed Description

    -Common exception classes for the Barry library. -

    - -

    -Definition in file error.cc. -

    -#include "error.h"
    -#include <sstream>
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/error_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/error_8cc-source.html --- barry-0.14/doc/www/doxygen/html/error_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/error_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - -Barry: error.cc Source File - - - - - - - -

    error.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       error.cc
    -00003 ///             Common exception classes for the Barry library
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "error.h"
    -00023 #include <sstream>
    -00024 #include <string.h>
    -00025 
    -00026 using namespace std;
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 std::string BadSize::GetMsg(unsigned int p, unsigned int d, unsigned int r)
    -00031 {
    -00032         std::ostringstream oss;
    -00033         oss << "Bad packet size. Packet: " << p
    -00034             << ". DataSize(): " << d
    -00035             << ". Required size: " << r;
    -00036         return oss.str();
    -00037 }
    -00038 
    -00039 std::string ErrnoError::GetMsg(const std::string &msg, int err)
    -00040 {
    -00041         std::ostringstream oss;
    -00042         oss << msg << ": (errno " << err << ") " << strerror(err);
    -00043         return oss.str();
    -00044 }
    -00045 
    -00046 } // namespace Barry
    -00047 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/error_8h.html barry-0.0.20110506/doc/www/doxygen/html/error_8h.html --- barry-0.14/doc/www/doxygen/html/error_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/error_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: error.h File Reference - - - - - - - -

    error.h File Reference


    Detailed Description

    -Common exception classes for the Barry library. -

    - -

    -Definition in file error.h. -

    -#include "dll.h"
    -#include <stdexcept>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Error
     The base class for any future derived exceptions. More...
    class  Barry::BadPassword
     A bad or unknown password when talking to the device. More...
    class  Barry::BadData
     Thrown by record classes if their data is invalid and cannot be uploaded to the Blackberry. More...
    class  Barry::BadSize
     Unexpected packet size, or not enough data. More...
    class  Barry::ErrnoError
     System error that provides an errno error code. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/error_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/error_8h-source.html --- barry-0.14/doc/www/doxygen/html/error_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/error_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ - - -Barry: error.h Source File - - - - - - - -

    error.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       error.h
    -00003 ///             Common exception classes for the Barry library
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_ERROR_H__
    -00023 #define __BARRY_ERROR_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <stdexcept>
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 /// \addtogroup exceptions
    -00031 /// @{
    -00032 
    -00033 //
    -00034 // Error class
    -00035 //
    -00036 /// The base class for any future derived exceptions.
    -00037 /// Can be thrown on any protocol error.
    -00038 ///
    -00039 class BXEXPORT Error : public std::runtime_error
    -00040 {
    -00041 public:
    -00042         Error(const std::string &str) : std::runtime_error(str) {}
    -00043 };
    -00044 
    -00045 
    -00046 //
    -00047 // BadPassword
    -00048 //
    -00049 /// A bad or unknown password when talking to the device.
    -00050 /// Can be thrown in the following instances:
    -00051 ///
    -00052 ///     - no password provided and the device requests one
    -00053 ///     - device rejected the available password
    -00054 ///     - too few remaining tries left... Barry will refuse to keep
    -00055 ///             trying passwords if there are fewer than
    -00056 ///             BARRY_MIN_PASSWORD_TRIES tries remaining.  In this case,
    -00057 ///             out_of_tries() will return true.
    -00058 ///             
    -00059 ///
    -00060 class BXEXPORT BadPassword : public Barry::Error
    -00061 {
    -00062         int m_remaining_tries;
    -00063         bool m_out_of_tries;
    -00064 
    -00065 public:
    -00066         BadPassword(const std::string &str, int remaining_tries,
    -00067                 bool out_of_tries)
    -00068                 : Barry::Error(str),
    -00069                 m_remaining_tries(remaining_tries),
    -00070                 m_out_of_tries(out_of_tries)
    -00071                 {}
    -00072         int remaining_tries() const { return m_remaining_tries; }
    -00073         bool out_of_tries() const { return m_out_of_tries; }
    -00074 };
    -00075 
    -00076 //
    -00077 // BadData
    -00078 //
    -00079 /// Thrown by record classes if their data is invalid and cannot be
    -00080 /// uploaded to the Blackberry.
    -00081 ///
    -00082 class BXEXPORT BadData : public Barry::Error
    -00083 {
    -00084 public:
    -00085         BadData(const std::string &str)
    -00086                 : Barry::Error(str)
    -00087                 {}
    -00088 };
    -00089 
    -00090 //
    -00091 // BadSize
    -00092 //
    -00093 /// Unexpected packet size, or not enough data.
    -00094 ///
    -00095 class BXEXPORT BadSize : public Barry::Error
    -00096 {
    -00097         unsigned int m_packet_size,
    -00098                 m_data_buf_size,
    -00099                 m_required_size;
    -00100 
    -00101         BXLOCAL static std::string GetMsg(unsigned int p, unsigned int d, unsigned int r);
    -00102 
    -00103 public:
    -00104         BadSize(unsigned int packet_size,
    -00105                 unsigned int data_buf_size,
    -00106                 unsigned int required_size)
    -00107                 : Barry::Error(GetMsg(packet_size, data_buf_size, required_size)),
    -00108                 m_packet_size(packet_size),
    -00109                 m_data_buf_size(data_buf_size),
    -00110                 m_required_size(required_size)
    -00111                 {}
    -00112         unsigned int packet_size() const { return m_packet_size; }
    -00113         unsigned int data_buf_size() const { return m_data_buf_size; }
    -00114         unsigned int required_size() const { return m_required_size; }
    -00115 };
    -00116 
    -00117 //
    -00118 // ErrnoError
    -00119 //
    -00120 /// System error that provides an errno error code.
    -00121 ///
    -00122 class ErrnoError : public Barry::Error
    -00123 {
    -00124         int m_errno;
    -00125 
    -00126         static std::string GetMsg(const std::string &msg, int err);
    -00127 
    -00128 public:
    -00129         ErrnoError(const std::string &msg, int err)
    -00130                 : Barry::Error(GetMsg(msg, err))
    -00131                 , m_errno(err)
    -00132                 {}
    -00133 
    -00134         int error_code() const { return m_errno; }
    -00135 };
    -00136 
    -00137 /// @}
    -00138 
    -00139 } // namespace Barry
    -00140 
    -00141 #endif
    -00142 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/files.html barry-0.0.20110506/doc/www/doxygen/html/files.html --- barry-0.14/doc/www/doxygen/html/files.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/files.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ - - -Barry: File Index - - - - - - -

    Barry File List

    Here is a list of all documented files with brief descriptions: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    barry.h [code]Main header file for applications
    base64.cc [code]
    base64.h [code]
    bcharge.cc [code]Talk to the Blackberry just enough to change the Max Power to 500mA
    bidentify.cc [code]Tool for probing identifying Blackberry devices
    bktrans.cc [code]
    brecsum.cc [code]Generate SHA1 sums of raw Blackberry database records
    breset.cc [code]Attempt to reset all connected Blackberry devices via software
    bs11nread.cc [code]Reads an boost serialization file and dumps to stdout
    btool.cc [code]Barry library tester
    btranslate.cc [code]
    builder.h [code]Virtual protocol packet builder wrapper
    cbarry.h [code]Main header file for Barry C API - incomplete
    common.cc [code]General Barry interface routines
    common.h [code]General header for the Barry library
    controller.cc [code]High level Barry API class
    controller.h [code]High level BlackBerry API class
    data.cc [code]Classes to help manage pre-determined data files
    data.h [code]Class to deal with pre-saved data files
    dataqueue.cc [code]FIFO queue of Data objects
    dataqueue.h [code]FIFO queue of Data objects
    debug.h [code]
    dll.h [code]Macros for handling DLL/library API visibility
    endian.h [code]Endian conversion macros
    error.cc [code]Common exception classes for the Barry library
    error.h [code]Common exception classes for the Barry library
    ldif.cc [code]Routines for reading and writing LDAP LDIF data
    ldif.h [code]Routines for reading and writing LDAP LDIF data
    log.cc [code]General Barry interface routines
    log.h [code]General header for the Barry library
    m_desktop.cc [code]Mode class for the Desktop mode
    m_desktop.h [code]Mode class for the Desktop mode
    m_desktoptmpl.h [code]Ease of use templates for the Desktop mode class
    m_ipmodem.cc [code]Mode class for GPRS modem mode (using endpoints on modern devices)
    m_ipmodem.h [code]Mode class for GPRS modem mode (using endpoints on modern devices)
    m_serial.cc [code]Mode class for serial / GPRS modem mode
    m_serial.h [code]Mode class for serial / GPRS modem mode
    modem.h [code]Modem API base class for the various serial/modem modes available on the Blackberry
    packet.cc [code]Low level protocol packet builder class
    packet.h [code]Low level protocol packet builder class
    parser.cc [code]Virtual parser functor class
    parser.h [code]Virtual parser wrapper
    pppfilter.cc [code]Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle
    pppfilter.h [code]Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle
    pppob.cc [code]In the same vein as pppoe, used with pppd to create a pty tunnel and GPRS modem link
    probe.cc [code]USB Blackberry detection routines
    probe.h [code]USB Blackberry detection routines
    protocol.cc [code]USB Blackberry bulk protocol API
    protocol.h [code]USB Blackberry bulk protocol API constants
    protostructs.h [code]USB Blackberry bulk protocol API
    r_calendar.cc [code]Blackberry database record parser class for calendar records
    r_calendar.h [code]Blackberry database record parser class for calndar records
    r_contact.cc [code]Blackberry database record parser class for contact records
    r_contact.h [code]Blackberry database record parser class for contact records
    r_folder.cc [code]Record parsing class for the folders database
    r_folder.h [code]Record parsing class for the Folder database
    r_memo.cc [code]Record parsing class for the memo database
    r_memo.h [code]Record parsing class for the memo database
    r_message.cc [code]Blackberry database record parser class for email records
    r_message.h [code]Blackberry database record parser class for email records
    r_pin_message.cc [code]Blackberry database record parser class for pin message records
    r_pin_message.h [code]Blackberry database record parser class for pin message records
    r_saved_message.cc [code]Blackberry database record parser class for saved email message records
    r_saved_message.h [code]
    r_servicebook.cc [code]Blackberry database record parser class for Service Book records
    r_servicebook.h [code]Blackberry database record parser class for the Service Book record
    r_task.cc [code]Record parsing class for the task database
    r_task.h [code]Record parsing class for the task database
    r_timezone.cc [code]Record parsing class for the timezone database
    r_timezone.h [code]Record parsing class for the timezone database
    record-internal.h [code]Support functions, types, and templates for the general record parsing classes in r_*.h files
    record.cc [code]Blackberry database record classes
    record.h [code]Blackberry database record classes
    router.cc [code]Support classes for the pluggable socket routing system
    router.h [code]Support classes for the pluggable socket routing system
    s11n-boost.h [code]Non-intrusive versions of serialization functions for the record classes
    scoped_lock.h [code]Simple scope class for dealing with pthread mutex locking
    sha1.cc [code]
    sha1.h [code]
    socket.cc [code]Class wrapper to encapsulate the Blackberry USB logical socket
    socket.h [code]Class wrapper to encapsulate the Blackberry USB logical socket
    strnlen.c [code]Implementation of strnlen() call, for systems that don't have GNU
    strnlen.h [code]Header for strnlen() call, for systems that don't have GNU
    time.cc [code]Conversion between time_t and cenmin_t and back
    time.h [code]Time related conversion routines
    upldif.cc [code]LDIF contact uploader
    usbwrap.cc [code]USB API wrapper
    usbwrap.h [code]USB API wrapper
    version.cc [code]Provide access to library version information
    version.h [code]Provide access to library version information
    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x62.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x62.html --- barry-0.14/doc/www/doxygen/html/functions_0x62.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x62.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - b -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x63.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x63.html --- barry-0.14/doc/www/doxygen/html/functions_0x63.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x63.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - c -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x64.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x64.html --- barry-0.14/doc/www/doxygen/html/functions_0x64.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x64.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - d -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x65.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x65.html --- barry-0.14/doc/www/doxygen/html/functions_0x65.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x65.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - e -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x66.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x66.html --- barry-0.14/doc/www/doxygen/html/functions_0x66.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x66.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,174 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - f -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x67.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x67.html --- barry-0.14/doc/www/doxygen/html/functions_0x67.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x67.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - g -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x68.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x68.html --- barry-0.14/doc/www/doxygen/html/functions_0x68.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x68.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - h -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x69.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x69.html --- barry-0.14/doc/www/doxygen/html/functions_0x69.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x69.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - i -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x6a.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x6a.html --- barry-0.14/doc/www/doxygen/html/functions_0x6a.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x6a.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - j -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x6c.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x6c.html --- barry-0.14/doc/www/doxygen/html/functions_0x6c.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x6c.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - l -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x6d.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x6d.html --- barry-0.14/doc/www/doxygen/html/functions_0x6d.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x6d.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - m -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x6e.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x6e.html --- barry-0.14/doc/www/doxygen/html/functions_0x6e.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x6e.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - n -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x6f.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x6f.html --- barry-0.14/doc/www/doxygen/html/functions_0x6f.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x6f.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - o -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x70.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x70.html --- barry-0.14/doc/www/doxygen/html/functions_0x70.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x70.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - p -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x71.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x71.html --- barry-0.14/doc/www/doxygen/html/functions_0x71.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x71.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - q -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x72.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x72.html --- barry-0.14/doc/www/doxygen/html/functions_0x72.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x72.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - r -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x73.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x73.html --- barry-0.14/doc/www/doxygen/html/functions_0x73.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x73.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - s -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x74.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x74.html --- barry-0.14/doc/www/doxygen/html/functions_0x74.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x74.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - t -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x75.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x75.html --- barry-0.14/doc/www/doxygen/html/functions_0x75.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x75.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - u -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x77.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x77.html --- barry-0.14/doc/www/doxygen/html/functions_0x77.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x77.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - w -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x79.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x79.html --- barry-0.14/doc/www/doxygen/html/functions_0x79.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x79.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - y -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_0x7e.html barry-0.0.20110506/doc/www/doxygen/html/functions_0x7e.html --- barry-0.14/doc/www/doxygen/html/functions_0x7e.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_0x7e.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - ~ -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_enum.html barry-0.0.20110506/doc/www/doxygen/html/functions_enum.html --- barry-0.14/doc/www/doxygen/html/functions_enum.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_enum.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Class Members - Enumerations - - - - - - - -  -

    -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_func.html barry-0.0.20110506/doc/www/doxygen/html/functions_func.html --- barry-0.14/doc/www/doxygen/html/functions_func.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_func.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,377 +0,0 @@ - - -Barry: Class Members - Functions - - - - - - - -
    - -
    - -

    -  -

    -

    - a -

    -

    - b -

    -

    - c -

    -

    - d -

    -

    - e -

    -

    - g -

    -

    - h -

    -

    - i -

    -

    - l -

    -

    - o -

    -

    - p -

    -

    - q -

    -

    - r -

    -

    - s -

    -

    - t -

    -

    - u -

    -

    - ~ -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions.html barry-0.0.20110506/doc/www/doxygen/html/functions.html --- barry-0.14/doc/www/doxygen/html/functions.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented class members with links to the class documentation for each member: -

    -

    - a -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_rela.html barry-0.0.20110506/doc/www/doxygen/html/functions_rela.html --- barry-0.14/doc/www/doxygen/html/functions_rela.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_rela.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: Class Members - Related Functions - - - - - - - -  -

    -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_type.html barry-0.0.20110506/doc/www/doxygen/html/functions_type.html --- barry-0.14/doc/www/doxygen/html/functions_type.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_type.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ - - -Barry: Class Members - Typedefs - - - - - - - -
    - -
    - -

    -  -

    -

    - a -

    -

    - b -

    -

    - c -

    -

    - d -

    -

    - e -

    -

    - g -

    -

    - h -

    -

    - i -

    -

    - q -

    -

    - s -

    -

    - u -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x62.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x62.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x62.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x62.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - b -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x63.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x63.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x63.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x63.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - c -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x64.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x64.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x64.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x64.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - d -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x65.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x65.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x65.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x65.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - e -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x66.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x66.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x66.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x66.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - f -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x67.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x67.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x67.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x67.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - g -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x68.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x68.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x68.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x68.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - h -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x69.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x69.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x69.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x69.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - i -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x6a.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6a.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x6a.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6a.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - j -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x6c.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6c.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x6c.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6c.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - l -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x6d.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6d.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x6d.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6d.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - m -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x6e.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6e.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x6e.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6e.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - n -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x6f.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6f.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x6f.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x6f.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - o -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x70.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x70.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x70.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x70.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - p -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x72.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x72.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x72.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x72.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - r -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x73.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x73.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x73.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x73.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - s -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x74.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x74.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x74.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x74.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - t -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x75.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x75.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x75.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x75.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - u -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x77.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x77.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x77.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x77.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - w -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars_0x79.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x79.html --- barry-0.14/doc/www/doxygen/html/functions_vars_0x79.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars_0x79.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - y -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/functions_vars.html barry-0.0.20110506/doc/www/doxygen/html/functions_vars.html --- barry-0.14/doc/www/doxygen/html/functions_vars.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/functions_vars.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ - - -Barry: Class Members - Variables - - - - - - - -
    - -
    - -

    -  -

    -

    - a -

    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/globals_func.html barry-0.0.20110506/doc/www/doxygen/html/globals_func.html --- barry-0.14/doc/www/doxygen/html/globals_func.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/globals_func.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -  -

    -

    - b -

    -

    - c -

    -

    - d -

    -

    - f -

    -

    - g -

    -

    - i -

    -

    - l -

    -

    - m -

    -

    - o -

    -

    - p -

    -

    - r -

    -

    - s -

    -

    - t -

    -

    - u -

    -

    - v -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/globals.html barry-0.0.20110506/doc/www/doxygen/html/globals.html --- barry-0.14/doc/www/doxygen/html/globals.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/globals.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,290 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented file members with links to the documentation: -

    -

    - _ -

    -

    - b -

    -

    - c -

    -

    - d -

    -

    - f -

    -

    - g -

    -

    - i -

    -

    - l -

    -

    - m -

    -

    - o -

    -

    - p -

    -

    - r -

    -

    - s -

    -

    - t -

    -

    - u -

    -

    - v -

    -

    - z -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/globals_type.html barry-0.0.20110506/doc/www/doxygen/html/globals_type.html --- barry-0.14/doc/www/doxygen/html/globals_type.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/globals_type.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: Class Members - - - - - - - -  -

    -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/globals_vars.html barry-0.0.20110506/doc/www/doxygen/html/globals_vars.html --- barry-0.14/doc/www/doxygen/html/globals_vars.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/globals_vars.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - - -Barry: Class Members - - - - - - - -  -

    -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/group__exceptions.html barry-0.0.20110506/doc/www/doxygen/html/group__exceptions.html --- barry-0.14/doc/www/doxygen/html/group__exceptions.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/group__exceptions.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Exceptions - - - - - -

    Exceptions

    -

    - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Barry::Error
     The base class for any future derived exceptions. More...
    class  Barry::BadPassword
     A bad or unknown password when talking to the device. More...
    class  Barry::BadData
     Thrown by record classes if their data is invalid and cannot be uploaded to the Blackberry. More...
    class  Barry::BadSize
     Unexpected packet size, or not enough data. More...
    class  Barry::ErrnoError
     System error that provides an errno error code. More...
    class  Usb::Error
     Thrown on low level USB errors. More...
    class  Usb::Timeout
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/group__RecordParserClasses.html barry-0.0.20110506/doc/www/doxygen/html/group__RecordParserClasses.html --- barry-0.14/doc/www/doxygen/html/group__RecordParserClasses.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/group__RecordParserClasses.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - -Barry: RecordParserClasses - - - - - -

    RecordParserClasses


    Detailed Description

    -Parser and data storage classes. -

    -These classes take a Database Database record and convert them into C++ objects. Each of these classes are safe to be used in standard containers, and are meant to be used in conjunction with the RecordParser<> template when calling Controller::LoadDatabase(). -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Barry::Calendar
    class  Barry::Contact
    class  Barry::Message
    class  Barry::PINMessage
    class  Barry::SavedMessage
    class  Barry::ServiceBookConfig
    class  Barry::ServiceBook

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Calendar &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Contact &contact)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Message &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const PINMessage &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const SavedMessage &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const ServiceBookConfig &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const ServiceBook &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/hierarchy.html barry-0.0.20110506/doc/www/doxygen/html/hierarchy.html --- barry-0.14/doc/www/doxygen/html/hierarchy.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/hierarchy.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ - - -Barry: Hierarchical Index - - - - - - -

    Barry Class Hierarchy

    This inheritance list is sorted roughly, but not completely, alphabetically: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/index.html barry-0.0.20110506/doc/www/doxygen/html/index.html --- barry-0.14/doc/www/doxygen/html/index.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ - - -Barry: Barry Reference Manual - - - - - -

    Barry Reference Manual

    -

    -

    0.14

    -Getting Started

    -Welcome to the Barry reference manual. This entire manual was generated via Doxygen from comments in the code. You can view the code here as well, in the Files section.

    -The best place to get started at the moment is to examine the source code to the Barry command line tool: btool.cc

    -Major Classes

    -To get started with the API, see the Barry::Controller class.
    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/ldif_8cc.html barry-0.0.20110506/doc/www/doxygen/html/ldif_8cc.html --- barry-0.14/doc/www/doxygen/html/ldif_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/ldif_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: ldif.cc File Reference - - - - - - - -

    ldif.cc File Reference


    Detailed Description

    -Routines for reading and writing LDAP LDIF data. -

    - -

    -Definition in file ldif.cc. -

    -#include "ldif.h"
    -#include "record.h"
    -#include "base64.h"
    -#include <stdexcept>
    -#include <iostream>
    -#include <iomanip>
    -#include <string.h>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/ldif_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/ldif_8cc-source.html --- barry-0.14/doc/www/doxygen/html/ldif_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/ldif_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,852 +0,0 @@ - - -Barry: ldif.cc Source File - - - - - - - -

    ldif.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       ldif.cc
    -00003 ///             Routines for reading and writing LDAP LDIF data.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "ldif.h"
    -00023 #include "record.h"
    -00024 #include "base64.h"
    -00025 #include <stdexcept>
    -00026 #include <iostream>
    -00027 #include <iomanip>
    -00028 #include <string.h>
    -00029 
    -00030 #define __DEBUG_MODE__
    -00031 #include "debug.h"
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 const ContactLdif::NameToFunc ContactLdif::FieldMap[] = {
    -00036         { "Email", "Email address",
    -00037                 &ContactLdif::Email, &ContactLdif::SetEmail },
    -00038         { "Phone", "Phone number",
    -00039                 &ContactLdif::Phone, &ContactLdif::SetPhone },
    -00040         { "Fax", "Fax number",
    -00041                 &ContactLdif::Fax, &ContactLdif::SetFax },
    -00042         { "WorkPhone", "Work phone number",
    -00043                 &ContactLdif::WorkPhone, &ContactLdif::SetWorkPhone },
    -00044         { "HomePhone", "Home phone number",
    -00045                 &ContactLdif::HomePhone, &ContactLdif::SetHomePhone },
    -00046         { "MobilePhone", "Mobile phone number",
    -00047                 &ContactLdif::MobilePhone, &ContactLdif::SetMobilePhone },
    -00048         { "Pager", "Pager number",
    -00049                 &ContactLdif::Pager, &ContactLdif::SetPager },
    -00050         { "PIN", "PIN",
    -00051                 &ContactLdif::PIN, &ContactLdif::SetPIN },
    -00052         { "FirstName", "First name",
    -00053                 &ContactLdif::FirstName, &ContactLdif::SetFirstName },
    -00054         { "LastName", "Last name",
    -00055                 &ContactLdif::LastName, &ContactLdif::SetLastName },
    -00056         { "Company", "Company name",
    -00057                 &ContactLdif::Company, &ContactLdif::SetCompany },
    -00058         { "DefaultCommunicationsMethod", "Default communications method",
    -00059                 &ContactLdif::DefaultCommunicationsMethod, &ContactLdif::SetDefaultCommunicationsMethod },
    -00060         { "Address1", "Address, line 1",
    -00061                 &ContactLdif::Address1, &ContactLdif::SetAddress1 },
    -00062         { "Address2", "Address, line 2",
    -00063                 &ContactLdif::Address2, &ContactLdif::SetAddress2 },
    -00064         { "Address3", "Address, line 3",
    -00065                 &ContactLdif::Address3, &ContactLdif::SetAddress3 },
    -00066         { "City", "City",
    -00067                 &ContactLdif::City, &ContactLdif::SetCity },
    -00068         { "Province", "Province / State",
    -00069                 &ContactLdif::Province, &ContactLdif::SetProvince },
    -00070         { "PostalCode", "Postal / ZIP code",
    -00071                 &ContactLdif::PostalCode, &ContactLdif::SetPostalCode },
    -00072         { "Country", "Country",
    -00073                 &ContactLdif::Country, &ContactLdif::SetCountry },
    -00074         { "JobTitle", "Job Title",
    -00075                 &ContactLdif::JobTitle, &ContactLdif::SetJobTitle },
    -00076         { "PublicKey", "Public key",
    -00077                 &ContactLdif::PublicKey, &ContactLdif::SetPublicKey },
    -00078         { "Notes", "Notes",
    -00079                 &ContactLdif::Notes, &ContactLdif::SetNotes },
    -00080         { "PostalAddress", "Mailing address (includes address lines, city, province, country, and postal code)",
    -00081                 &ContactLdif::PostalAddress, &ContactLdif::SetPostalAddress },
    -00082         { "FullName", "First + Last names",
    -00083                 &ContactLdif::FullName, &ContactLdif::SetFullName },
    -00084         { "FQDN", "Fully qualified domain name",
    -00085                 &ContactLdif::FQDN, &ContactLdif::SetFQDN },
    -00086         { 0, 0, 0 }
    -00087 };
    -00088 
    -00089 
    -00090 bool ContactLdif::LdifAttribute::operator<(const LdifAttribute &other) const
    -00091 {
    -00092         // the dn attribute always comes first in LDIF output
    -00093         if( name == "dn" ) {
    -00094                 if( other.name == "dn" )
    -00095                         return false;   // both dn, so equal
    -00096                 return true;
    -00097         }
    -00098         else if( other.name == "dn" )
    -00099                 return false;
    -00100 
    -00101         return (order < other.order && name != other.name) ||
    -00102                 (order == other.order && name < other.name);
    -00103 }
    -00104 
    -00105 bool ContactLdif::LdifAttribute::operator==(const LdifAttribute &other) const
    -00106 {
    -00107         return name == other.name;
    -00108 }
    -00109 
    -00110 
    -00111 ///////////////////////////////////////////////////////////////////////////////
    -00112 // ContactLdif class
    -00113 
    -00114 ContactLdif::ContactLdif(const std::string &baseDN)
    -00115         : m_baseDN(baseDN)
    -00116 {
    -00117         // setup some sane defaults
    -00118         Map("mail", &ContactLdif::Email, &ContactLdif::SetEmail);
    -00119         Map("facsimileTelephoneNumber", &ContactLdif::Fax, &ContactLdif::SetFax);
    -00120         Map("telephoneNumber", &ContactLdif::WorkPhone, &ContactLdif::SetWorkPhone);
    -00121         Map("homePhone", &ContactLdif::HomePhone, &ContactLdif::SetHomePhone);
    -00122         Map("mobile", &ContactLdif::MobilePhone, &ContactLdif::SetMobilePhone);
    -00123         Map("pager", &ContactLdif::Pager, &ContactLdif::SetPager);
    -00124         Map("l", &ContactLdif::City, &ContactLdif::SetCity);
    -00125         Map("st", &ContactLdif::Province, &ContactLdif::SetProvince);
    -00126         Map("postalCode", &ContactLdif::PostalCode, &ContactLdif::SetPostalCode);
    -00127         Map("o", &ContactLdif::Company, &ContactLdif::SetCompany);
    -00128         Map("c", &ContactLdif::Country, &ContactLdif::SetCountry);
    -00129         SetObjectClass("c", "country");
    -00130 
    -00131         Map("title", &ContactLdif::JobTitle, &ContactLdif::SetJobTitle);
    -00132         Map("dn", &ContactLdif::FQDN, &ContactLdif::SetFQDN);
    -00133         Map("displayName", &ContactLdif::FullName, &ContactLdif::SetFullName);
    -00134         Map("cn", &ContactLdif::FullName, &ContactLdif::SetFullName);
    -00135         Map("sn", &ContactLdif::LastName, &ContactLdif::SetLastName);
    -00136         Map("givenName", &ContactLdif::FirstName, &ContactLdif::SetFirstName);
    -00137         Map("street", &ContactLdif::Address1, &ContactLdif::SetAddress1);
    -00138         Map("postalAddress", &ContactLdif::PostalAddress, &ContactLdif::SetPostalAddress);
    -00139         Map("note", &ContactLdif::Notes, &ContactLdif::SetNotes);
    -00140 
    -00141         // add heuristics hooks
    -00142         Hook("cn", &m_cn);
    -00143         Hook("displayName", &m_displayName);
    -00144         Hook("sn", &m_sn);
    -00145         Hook("givenName", &m_givenName);
    -00146 
    -00147         // set default DN attribute
    -00148         SetDNAttr("cn");
    -00149 }
    -00150 
    -00151 ContactLdif::~ContactLdif()
    -00152 {
    -00153 }
    -00154 
    -00155 void ContactLdif::DoWrite(Barry::Contact &con,
    -00156                           const std::string &attr,
    -00157                           const std::string &data)
    -00158 {
    -00159         // valid?
    -00160         if( attr.size() == 0 || data.size() == 0 )
    -00161                 return;
    -00162 
    -00163         // now have attr/data pair, check hooks:
    -00164         HookMapType::iterator hook = m_hookMap.find(attr);
    -00165         if( hook != m_hookMap.end() ) {
    -00166                 *(hook->second) = data;
    -00167         }
    -00168 
    -00169         // run according to map
    -00170         AccessMapType::iterator acc = m_map.find(attr);
    -00171         if( acc != m_map.end() ) {
    -00172                 (this->*(acc->second.write))(con, data);
    -00173         }
    -00174 }
    -00175 
    -00176 void ContactLdif::Hook(const std::string &ldifname, std::string *var)
    -00177 {
    -00178         m_hookMap[ldifname] = var;
    -00179 }
    -00180 
    -00181 const ContactLdif::NameToFunc*
    -00182 ContactLdif::GetField(const std::string &fieldname) const
    -00183 {
    -00184         for( const NameToFunc *n = FieldMap; n->name; n++ ) {
    -00185                 if( fieldname == n->name )
    -00186                         return n;
    -00187         }
    -00188         return 0;
    -00189 }
    -00190 
    -00191 std::string ContactLdif::GetFieldReadName(GetFunctionType read) const
    -00192 {
    -00193         for( const NameToFunc *n = FieldMap; n->name; n++ ) {
    -00194                 if( read == n->read )
    -00195                         return n->name;
    -00196         }
    -00197         return "<unknown>";
    -00198 }
    -00199 
    -00200 std::string ContactLdif::GetFieldWriteName(SetFunctionType write) const
    -00201 {
    -00202         for( const NameToFunc *n = FieldMap; n->name; n++ ) {
    -00203                 if( write == n->write )
    -00204                         return n->name;
    -00205         }
    -00206         return "<unknown>";
    -00207 }
    -00208 
    -00209 bool ContactLdif::Map(const LdifAttribute &ldifname,
    -00210                       const std::string &readField,
    -00211                       const std::string &writeField)
    -00212 {
    -00213         const NameToFunc *read = GetField(readField);
    -00214         const NameToFunc *write = GetField(writeField);
    -00215         if( !read || !write )
    -00216                 return false;
    -00217         Map(ldifname, read->read, write->write);
    -00218         return true;
    -00219 }
    -00220 
    -00221 void ContactLdif::Map(const LdifAttribute &ldifname,
    -00222                       GetFunctionType read,
    -00223                       SetFunctionType write)
    -00224 {
    -00225         m_map[ldifname] = AccessPair(read, write);
    -00226 }
    -00227 
    -00228 void ContactLdif::Unmap(const LdifAttribute &ldifname)
    -00229 {
    -00230         m_map.erase(ldifname);
    -00231 }
    -00232 
    -00233 //
    -00234 // SetDNAttr
    -00235 //
    -00236 /// Sets the LDIF attribute name to use when constructing the FQDN.
    -00237 /// The FQDN field will take this name, and combine it with the
    -00238 /// baseDN from the constructor to produce a FQDN for the record.
    -00239 ///
    -00240 bool ContactLdif::SetDNAttr(const LdifAttribute &name)
    -00241 {
    -00242         // try to find the attribute in the map
    -00243         AccessMapType::iterator i = m_map.find(name);
    -00244         if( i == m_map.end() )
    -00245                 return false;
    -00246 
    -00247         m_dnAttr = name;
    -00248         return true;
    -00249 }
    -00250 
    -00251 bool ContactLdif::SetObjectClass(const LdifAttribute &name,
    -00252                                  const std::string &objectClass)
    -00253 {
    -00254         AccessMapType::iterator i = m_map.find(name);
    -00255         if( i == m_map.end() )
    -00256                 return false;
    -00257 
    -00258         LdifAttribute key = i->first;
    -00259         AccessPair pair = i->second;
    -00260         m_map.erase(key);
    -00261         key.objectClass = objectClass;
    -00262         m_map[key] = pair;
    -00263         return true;
    -00264 }
    -00265 
    -00266 bool ContactLdif::SetObjectOrder(const LdifAttribute &name, int order)
    -00267 {
    -00268         AccessMapType::iterator i = m_map.find(name);
    -00269         if( i == m_map.end() )
    -00270                 return false;
    -00271 
    -00272         LdifAttribute key = i->first;
    -00273         AccessPair pair = i->second;
    -00274         m_map.erase(key);
    -00275         key.order = order;
    -00276         m_map[key] = pair;
    -00277         return true;
    -00278 }
    -00279 
    -00280 
    -00281 std::string ContactLdif::Email(const Barry::Contact &con) const
    -00282 {
    -00283         return con.GetEmail(m_emailIndex++);
    -00284 }
    -00285 
    -00286 std::string ContactLdif::Phone(const Barry::Contact &con) const
    -00287 {
    -00288         return con.Phone;
    -00289 }
    -00290 
    -00291 std::string ContactLdif::Fax(const Barry::Contact &con) const
    -00292 {
    -00293         return con.Fax;
    -00294 }
    -00295 
    -00296 std::string ContactLdif::WorkPhone(const Barry::Contact &con) const
    -00297 {
    -00298         return con.WorkPhone;
    -00299 }
    -00300 
    -00301 std::string ContactLdif::HomePhone(const Barry::Contact &con) const
    -00302 {
    -00303         return con.HomePhone;
    -00304 }
    -00305 
    -00306 std::string ContactLdif::MobilePhone(const Barry::Contact &con) const
    -00307 {
    -00308         return con.MobilePhone;
    -00309 }
    -00310 
    -00311 std::string ContactLdif::Pager(const Barry::Contact &con) const
    -00312 {
    -00313         return con.Pager;
    -00314 }
    -00315 
    -00316 std::string ContactLdif::PIN(const Barry::Contact &con) const
    -00317 {
    -00318         return con.PIN;
    -00319 }
    -00320 
    -00321 std::string ContactLdif::FirstName(const Barry::Contact &con) const
    -00322 {
    -00323         return con.FirstName;
    -00324 }
    -00325 
    -00326 std::string ContactLdif::LastName(const Barry::Contact &con) const
    -00327 {
    -00328         return con.LastName;
    -00329 }
    -00330 
    -00331 std::string ContactLdif::Company(const Barry::Contact &con) const
    -00332 {
    -00333         return con.Company;
    -00334 }
    -00335 
    -00336 std::string ContactLdif::DefaultCommunicationsMethod(const Barry::Contact &con) const
    -00337 {
    -00338         return con.DefaultCommunicationsMethod;
    -00339 }
    -00340 
    -00341 std::string ContactLdif::Address1(const Barry::Contact &con) const
    -00342 {
    -00343         return con.WorkAddress.Address1;
    -00344 }
    -00345 
    -00346 std::string ContactLdif::Address2(const Barry::Contact &con) const
    -00347 {
    -00348         return con.WorkAddress.Address2;
    -00349 }
    -00350 
    -00351 std::string ContactLdif::Address3(const Barry::Contact &con) const
    -00352 {
    -00353         return con.WorkAddress.Address3;
    -00354 }
    -00355 
    -00356 std::string ContactLdif::City(const Barry::Contact &con) const
    -00357 {
    -00358         return con.WorkAddress.City;
    -00359 }
    -00360 
    -00361 std::string ContactLdif::Province(const Barry::Contact &con) const
    -00362 {
    -00363         return con.WorkAddress.Province;
    -00364 }
    -00365 
    -00366 std::string ContactLdif::PostalCode(const Barry::Contact &con) const
    -00367 {
    -00368         return con.WorkAddress.PostalCode;
    -00369 }
    -00370 
    -00371 std::string ContactLdif::Country(const Barry::Contact &con) const
    -00372 {
    -00373         return con.WorkAddress.Country;
    -00374 }
    -00375 
    -00376 std::string ContactLdif::JobTitle(const Barry::Contact &con) const
    -00377 {
    -00378         return con.JobTitle;
    -00379 }
    -00380 
    -00381 std::string ContactLdif::PublicKey(const Barry::Contact &con) const
    -00382 {
    -00383         return con.PublicKey;
    -00384 }
    -00385 
    -00386 std::string ContactLdif::Notes(const Barry::Contact &con) const
    -00387 {
    -00388         return con.Notes;
    -00389 }
    -00390 
    -00391 std::string ContactLdif::PostalAddress(const Barry::Contact &con) const
    -00392 {
    -00393         return con.WorkAddress.GetLabel();
    -00394 }
    -00395 
    -00396 std::string ContactLdif::FullName(const Barry::Contact &con) const
    -00397 {
    -00398         return con.GetFullName();
    -00399 }
    -00400 
    -00401 std::string ContactLdif::FQDN(const Barry::Contact &con) const
    -00402 {
    -00403         std::string FQDN = m_dnAttr.name;
    -00404         FQDN += "=";
    -00405 
    -00406         AccessMapType::const_iterator i = m_map.find(m_dnAttr);
    -00407         if( i != m_map.end() ) {
    -00408                 FQDN += (this->*(i->second.read))(con);
    -00409         }
    -00410         else {
    -00411                 FQDN += "unknown";
    -00412         }
    -00413 
    -00414         FQDN += ",";
    -00415         FQDN += m_baseDN;
    -00416         return FQDN;
    -00417 }
    -00418 
    -00419 bool ContactLdif::IsArrayFunc(GetFunctionType getf) const
    -00420 {
    -00421         // Currently, only the Email getter has array data
    -00422         if( getf == &ContactLdif::Email )
    -00423                 return true;
    -00424         return false;
    -00425 }
    -00426 
    -00427 void ContactLdif::ClearArrayState() const
    -00428 {
    -00429         m_emailIndex = 0;
    -00430 }
    -00431 
    -00432 void ContactLdif::SetEmail(Barry::Contact &con, const std::string &val) const
    -00433 {
    -00434         con.EmailAddresses.push_back(val);
    -00435 }
    -00436 
    -00437 void ContactLdif::SetPhone(Barry::Contact &con, const std::string &val) const
    -00438 {
    -00439         con.Phone = val;
    -00440 }
    -00441 
    -00442 void ContactLdif::SetFax(Barry::Contact &con, const std::string &val) const
    -00443 {
    -00444         con.Fax = val;
    -00445 }
    -00446 
    -00447 void ContactLdif::SetWorkPhone(Barry::Contact &con, const std::string &val) const
    -00448 {
    -00449         con.WorkPhone = val;
    -00450 }
    -00451 
    -00452 void ContactLdif::SetHomePhone(Barry::Contact &con, const std::string &val) const
    -00453 {
    -00454         con.HomePhone = val;
    -00455 }
    -00456 
    -00457 void ContactLdif::SetMobilePhone(Barry::Contact &con, const std::string &val) const
    -00458 {
    -00459         con.MobilePhone = val;
    -00460 }
    -00461 
    -00462 void ContactLdif::SetPager(Barry::Contact &con, const std::string &val) const
    -00463 {
    -00464         con.Pager = val;
    -00465 }
    -00466 
    -00467 void ContactLdif::SetPIN(Barry::Contact &con, const std::string &val) const
    -00468 {
    -00469         con.PIN = val;
    -00470 }
    -00471 
    -00472 void ContactLdif::SetFirstName(Barry::Contact &con, const std::string &val) const
    -00473 {
    -00474         con.FirstName = val;
    -00475 }
    -00476 
    -00477 void ContactLdif::SetLastName(Barry::Contact &con, const std::string &val) const
    -00478 {
    -00479         con.LastName = val;
    -00480 }
    -00481 
    -00482 void ContactLdif::SetCompany(Barry::Contact &con, const std::string &val) const
    -00483 {
    -00484         con.Company = val;
    -00485 }
    -00486 
    -00487 void ContactLdif::SetDefaultCommunicationsMethod(Barry::Contact &con, const std::string &val) const
    -00488 {
    -00489         con.DefaultCommunicationsMethod = val;
    -00490 }
    -00491 
    -00492 void ContactLdif::SetAddress1(Barry::Contact &con, const std::string &val) const
    -00493 {
    -00494         con.WorkAddress.Address1 = val;
    -00495 }
    -00496 
    -00497 void ContactLdif::SetAddress2(Barry::Contact &con, const std::string &val) const
    -00498 {
    -00499         con.WorkAddress.Address2 = val;
    -00500 }
    -00501 
    -00502 void ContactLdif::SetAddress3(Barry::Contact &con, const std::string &val) const
    -00503 {
    -00504         con.WorkAddress.Address3 = val;
    -00505 }
    -00506 
    -00507 void ContactLdif::SetCity(Barry::Contact &con, const std::string &val) const
    -00508 {
    -00509         con.WorkAddress.City = val;
    -00510 }
    -00511 
    -00512 void ContactLdif::SetProvince(Barry::Contact &con, const std::string &val) const
    -00513 {
    -00514         con.WorkAddress.Province = val;
    -00515 }
    -00516 
    -00517 void ContactLdif::SetPostalCode(Barry::Contact &con, const std::string &val) const
    -00518 {
    -00519         con.WorkAddress.PostalCode = val;
    -00520 }
    -00521 
    -00522 void ContactLdif::SetCountry(Barry::Contact &con, const std::string &val) const
    -00523 {
    -00524         con.WorkAddress.Country = val;
    -00525 }
    -00526 
    -00527 void ContactLdif::SetJobTitle(Barry::Contact &con, const std::string &val) const
    -00528 {
    -00529         con.JobTitle = val;
    -00530 }
    -00531 
    -00532 void ContactLdif::SetPublicKey(Barry::Contact &con, const std::string &val) const
    -00533 {
    -00534         con.PublicKey = val;
    -00535 }
    -00536 
    -00537 void ContactLdif::SetNotes(Barry::Contact &con, const std::string &val) const
    -00538 {
    -00539         con.Notes = val;
    -00540 }
    -00541 
    -00542 void ContactLdif::SetPostalAddress(Barry::Contact &con, const std::string &val) const
    -00543 {
    -00544         // fixme;
    -00545 //      throw std::runtime_error("SetPostalAddress() not implemented");
    -00546 //      std::cout << "SetPostalAddress() not implemented: " << val << std::endl;
    -00547 }
    -00548 
    -00549 void ContactLdif::SetFullName(Barry::Contact &con, const std::string &val) const
    -00550 {
    -00551         std::string first, last;
    -00552         Contact::SplitName(val, first, last);
    -00553         con.FirstName = first;
    -00554         con.LastName = last;
    -00555 }
    -00556 
    -00557 void ContactLdif::SetFQDN(Barry::Contact &con, const std::string &val) const
    -00558 {
    -00559         throw std::runtime_error("not implemented");
    -00560 }
    -00561 
    -00562 
    -00563 void ContactLdif::ClearHeuristics()
    -00564 {
    -00565         m_cn.clear();
    -00566         m_displayName.clear();
    -00567         m_sn.clear();
    -00568         m_givenName.clear();
    -00569 }
    -00570 
    -00571 bool ContactLdif::RunHeuristics(Barry::Contact &con)
    -00572 {
    -00573         // start fresh
    -00574         con.LastName.clear();
    -00575         con.FirstName.clear();
    -00576 
    -00577         // find the best match for name... prefer sn/givenName if available
    -00578         if( m_sn.size() ) {
    -00579                 con.LastName = m_sn;
    -00580         }
    -00581         if( m_givenName.size() ) {
    -00582                 con.FirstName = m_givenName;
    -00583         }
    -00584 
    -00585         if( !con.LastName.size() || !con.FirstName.size() ) {
    -00586                 std::string first, last;
    -00587 
    -00588                 // still don't have a complete name, check cn first
    -00589                 if( m_cn.size() ) {
    -00590                         Contact::SplitName(m_cn, first, last);
    -00591                         if( !con.LastName.size() && last.size() )
    -00592                                 con.LastName = last;
    -00593                         if( !con.FirstName.size() && first.size() )
    -00594                                 con.FirstName = first;
    -00595                 }
    -00596 
    -00597                 // displayName is last chance
    -00598                 if( m_displayName.size() ) {
    -00599                         Contact::SplitName(m_displayName, first, last);
    -00600                         if( !con.LastName.size() && last.size() )
    -00601                                 con.LastName = last;
    -00602                         if( !con.FirstName.size() && first.size() )
    -00603                                 con.FirstName = first;
    -00604                 }
    -00605         }
    -00606 
    -00607         return con.LastName.size() && con.FirstName.size();
    -00608 }
    -00609 
    -00610 
    -00611 //
    -00612 // DumpLdif
    -00613 //
    -00614 /// Output contact data to os in LDAP LDIF format.
    -00615 ///
    -00616 void ContactLdif::DumpLdif(std::ostream &os,
    -00617                        const Barry::Contact &con) const
    -00618 {
    -00619         // start fresh
    -00620         ClearArrayState();
    -00621 
    -00622         // setup stream state
    -00623         std::ios::fmtflags oldflags = os.setf(std::ios::left);
    -00624         char fill = os.fill(' ');
    -00625 
    -00626         if( FirstName(con).size() == 0 && LastName(con).size() == 0 )
    -00627                 return;                 // nothing to do
    -00628 
    -00629         os << "# Contact 0x" << std::hex << con.GetID() << ", "
    -00630                 << FullName(con) << "\n";
    -00631 
    -00632         // cycle through the map
    -00633         for(    AccessMapType::const_iterator b = m_map.begin();
    -00634                 b != m_map.end();
    -00635                 ++b )
    -00636         {
    -00637                 // print only fields with data
    -00638                 std::string field;
    -00639 
    -00640                 do {
    -00641                         field = (this->*(b->second.read))(con);
    -00642                         if( field.size() ) {
    -00643                                 os << b->first.name << MakeLdifData(field) << "\n";
    -00644                                 if( b->first.objectClass.size() )
    -00645                                         os << "objectClass: " << b->first.objectClass << "\n";
    -00646                         }
    -00647                 } while( IsArrayFunc(b->second.read) && field.size() );
    -00648         }
    -00649 
    -00650         os << "objectClass: inetOrgPerson\n";
    -00651 
    -00652         // last line must be empty
    -00653         os << "\n";
    -00654 
    -00655         // cleanup the stream
    -00656         os.flags(oldflags);
    -00657         os.fill(fill);
    -00658 }
    -00659 
    -00660 bool ContactLdif::ReadLdif(std::istream &is, Barry::Contact &con)
    -00661 {
    -00662         std::string line;
    -00663 
    -00664         // start fresh
    -00665         con.Clear();
    -00666         ClearHeuristics();
    -00667 
    -00668         // search for beginning dn: line
    -00669         bool found = false;
    -00670         while( std::getline(is, line) ) {
    -00671                 if( strncmp(line.c_str(), "dn: ", 4) == 0 ) {
    -00672                         found = true;
    -00673                         break;
    -00674                 }
    -00675         }
    -00676         if( !found )
    -00677                 return false;
    -00678 
    -00679         // storage for various name styles
    -00680         std::string coded, decode, attr, data;
    -00681         bool b64field = false;
    -00682 
    -00683         // read ldif lines until empty line is found
    -00684         while( getline(is, line) && line.size() ) {
    -00685 
    -00686                 if( b64field ) {
    -00687                         // processing a base64 encoded field
    -00688                         if( line[0] == ' ' ) {
    -00689                                 coded += "\n";
    -00690                                 coded += line;
    -00691                                 continue;
    -00692                         }
    -00693                         else {
    -00694                                 // end of base64 block... ignore errors,
    -00695                                 // and attempt to save everything decodable...
    -00696                                 // the LDAP server sometimes returns incomplete
    -00697                                 // base64 encoding, but otherwise the data is fine
    -00698                                 base64_decode(coded, decode);
    -00699                                 DoWrite(con, attr, decode);
    -00700                                 coded.clear();
    -00701                                 b64field = false;
    -00702                         }
    -00703                         // fall through to process new line
    -00704                 }
    -00705 
    -00706 
    -00707                 // split into attribute / data
    -00708                 std::string::size_type delim = line.find(':'), dstart;
    -00709                 if( delim == std::string::npos )
    -00710                         continue;
    -00711 
    -00712                 attr.assign(line, 0, delim);
    -00713                 dstart = delim + 1;
    -00714                 while( line[dstart] == ' ' || line[dstart] == ':' )
    -00715                         dstart++;
    -00716                 data = line.substr(dstart);
    -00717 
    -00718                 // is this data base64 encoded?
    -00719                 if( line[delim + 1] == ':' ) {
    -00720                         coded = data;
    -00721                         b64field = true;
    -00722                         continue;
    -00723                 }
    -00724 
    -00725                 DoWrite(con, attr, data);
    -00726         }
    -00727 
    -00728         if( b64field ) {
    -00729                 // clean up base64 decoding... ignore errors, see above comment
    -00730                 base64_decode(coded, decode);
    -00731                 DoWrite(con, attr, decode);
    -00732                 coded.clear();
    -00733                 b64field = false;
    -00734         }
    -00735 
    -00736         return RunHeuristics(con);
    -00737 }
    -00738 
    -00739 void ContactLdif::DumpMap(std::ostream &os) const
    -00740 {
    -00741         std::ios::fmtflags oldflags = os.setf(std::ios::left);
    -00742         char fill = os.fill(' ');
    -00743 
    -00744         os << "ContactLdif Mapping:\n";
    -00745 
    -00746         // cycle through the map
    -00747         for(    AccessMapType::const_iterator b = m_map.begin();
    -00748                 b != m_map.end();
    -00749                 ++b )
    -00750         {
    -00751                 os << "   " << std::left << std::setw(20) << b->first.name
    -00752                    << "->  " << GetFieldReadName(b->second.read)
    -00753                    << " / " << GetFieldWriteName(b->second.write) << "\n";
    -00754 
    -00755                 // find read/write names
    -00756 
    -00757                 if( b->first.objectClass.size() ) {
    -00758                         os << "   " << std::setw(20) << " "
    -00759                            << "objectClass: " << b->first.objectClass << "\n";
    -00760                 }
    -00761         }
    -00762 
    -00763         os << "   >>> DN attribute: " << m_dnAttr.name << "\n";
    -00764 
    -00765         // cleanup the stream
    -00766         os.flags(oldflags);
    -00767         os.fill(fill);
    -00768 }
    -00769 
    -00770 std::string ContactLdif::MakeLdifData(const std::string &str)
    -00771 {
    -00772         std::string data = ":";
    -00773 
    -00774         if( NeedsEncoding(str) ) {
    -00775                 std::string b64;
    -00776                 base64_encode(str, b64);
    -00777 
    -00778                 data += ": ";
    -00779                 data += b64;
    -00780         }
    -00781         else {
    -00782                 data += " ";
    -00783                 data += str;
    -00784         }
    -00785 
    -00786         return data;
    -00787 }
    -00788 
    -00789 //
    -00790 // RFC 2849
    -00791 //
    -00792 // Must not contain:
    -00793 //      0x00 (NUL), 0x0a (LF), 0x0d (CR), or anything greater than 0x7f
    -00794 //
    -00795 // First char must meet above criteria, plus must not be:
    -00796 //      0x20 (SPACE), 0x3a (colon), 0x3c ('<')
    -00797 //
    -00798 bool ContactLdif::NeedsEncoding(const std::string &str)
    -00799 {
    -00800         for( std::string::size_type i = 0; i < str.size(); i++ ) {
    -00801                 unsigned char c = str[i];
    -00802 
    -00803                 switch( c )
    -00804                 {
    -00805                 case 0x00:
    -00806                 case 0x0a:
    -00807                 case 0x0d:
    -00808                         return true;
    -00809 
    -00810                 case 0x20:
    -00811                 case 0x3a:
    -00812                 case 0x3c:
    -00813                         if( i == 0 )
    -00814                                 return true;
    -00815                 }
    -00816 
    -00817                 if( c > 0x7f )
    -00818                         return true;
    -00819         }
    -00820         return false;
    -00821 }
    -00822 
    -00823 } // namespace Barry
    -00824 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/ldif_8h.html barry-0.0.20110506/doc/www/doxygen/html/ldif_8h.html --- barry-0.14/doc/www/doxygen/html/ldif_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/ldif_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: ldif.h File Reference - - - - - - - -

    ldif.h File Reference


    Detailed Description

    -Routines for reading and writing LDAP LDIF data. -

    - -

    -Definition in file ldif.h. -

    -#include "dll.h"
    -#include <string>
    -#include <map>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::ContactLdif
     Class for generating LDIF output based on a Barry::Contact record object. More...
    struct  Barry::ContactLdif::NameToFunc
     Used to create a List of supported Barry field names, including calculated names, such as full postal address. More...
    struct  Barry::ContactLdif::LdifAttribute
    struct  Barry::ContactLdif::AccessPair

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const ContactLdif &ldif)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/ldif_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/ldif_8h-source.html --- barry-0.14/doc/www/doxygen/html/ldif_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/ldif_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ - - -Barry: ldif.h Source File - - - - - - - -

    ldif.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       ldif.h
    -00003 ///             Routines for reading and writing LDAP LDIF data.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_LDIF_H__
    -00023 #define __BARRY_LDIF_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <string>
    -00027 #include <map>
    -00028 
    -00029 // forward declarations
    -00030 namespace Barry {
    -00031         class Contact;
    -00032 }
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 //
    -00037 // ContactLdif
    -00038 //
    -00039 /// Class for generating LDIF output based on a Barry::Contact record object.
    -00040 /// This class supports LDIF attribute mapping, and a heuristics mechanism
    -00041 /// for parsing LDIF fields that may not have consistent data.
    -00042 ///
    -00043 /// To use this class, create an instance of it, then call DumpLdif(), passing
    -00044 /// the Contact record object to base the work on.  Output will be written
    -00045 /// to the stream you provide.  ReadLdif() goes in the other direction.
    -00046 ///
    -00047 /// To override LDIF attribute mapping, call Map() or Unmap() as appropriate.
    -00048 ///
    -00049 /// To get a list of supported Barry::Contact field names, call GetFieldNames().
    -00050 /// This function returns a pointer to an array of ContactLdif::NameToFunc
    -00051 /// structures, ending with NameToFunc::name as null.  You can cycle through the
    -00052 /// array with code like this:
    -00053 ///
    -00054 /// <pre>
    -00055 ///     for( ContactLdif::NameToFunc *n = o.GetFieldNames(); n->name; n++ ) {
    -00056 ///             ...
    -00057 ///     }
    -00058 /// </pre>
    -00059 ///
    -00060 /// Note that all Get/Set functions used in attribute mapping are virtual,
    -00061 /// and can be overridden by a derived class.  This includes the heuristics
    -00062 /// functions, which are called by DumpLdif().
    -00063 ///
    -00064 class BXEXPORT ContactLdif
    -00065 {
    -00066 public:
    -00067         typedef std::string (ContactLdif::*GetFunctionType)(const Barry::Contact&) const;
    -00068         typedef void (ContactLdif::*SetFunctionType)(Barry::Contact&, const std::string &) const;
    -00069 
    -00070         /// Used to create a List of supported Barry field names, including
    -00071         /// calculated names, such as full postal address.
    -00072         struct NameToFunc
    -00073         {
    -00074                 const char *name;
    -00075                 const char *description;
    -00076                 GetFunctionType read;
    -00077                 SetFunctionType write;
    -00078         };
    -00079 
    -00080         struct LdifAttribute
    -00081         {
    -00082                 std::string name;
    -00083                 std::string objectClass;
    -00084                 int order;
    -00085 
    -00086                 LdifAttribute() : order(0) {}
    -00087                 LdifAttribute(const char *name, const std::string &oc = "")
    -00088                         : name(name), objectClass(oc), order(0)
    -00089                         {}
    -00090                 LdifAttribute(const std::string &name, const std::string &oc = "")
    -00091                         : name(name), objectClass(oc), order(0)
    -00092                         {}
    -00093 
    -00094                 bool operator<(const LdifAttribute &other) const;
    -00095                 bool operator==(const LdifAttribute &other) const;
    -00096         };
    -00097 
    -00098         struct AccessPair
    -00099         {
    -00100                 GetFunctionType read;
    -00101                 SetFunctionType write;
    -00102 
    -00103                 AccessPair() : read(0), write(0) {}
    -00104                 AccessPair(GetFunctionType r, SetFunctionType w)
    -00105                         : read(r), write(w)
    -00106                         {}
    -00107         };
    -00108 
    -00109         typedef std::map<LdifAttribute, AccessPair>   AccessMapType;
    -00110         typedef std::map<std::string, std::string*>   HookMapType;
    -00111 
    -00112 protected:
    -00113         static const NameToFunc FieldMap[];
    -00114         AccessMapType m_map;
    -00115         std::string m_baseDN;
    -00116         HookMapType m_hookMap;
    -00117         LdifAttribute m_dnAttr;
    -00118 
    -00119         void DoWrite(Barry::Contact &con, const std::string &attr,
    -00120                 const std::string &data);
    -00121 
    -00122         // Array getter state
    -00123         mutable unsigned int m_emailIndex;
    -00124 
    -00125         // name heuristics
    -00126         std::string m_cn, m_displayName, m_sn, m_givenName;
    -00127 
    -00128         // heuristics hooking - saves each found value in the variable
    -00129         // pointed at by var
    -00130         void Hook(const std::string &ldifname, std::string *var);
    -00131 
    -00132 public:
    -00133         explicit ContactLdif(const std::string &baseDN);
    -00134         virtual ~ContactLdif();
    -00135 
    -00136         const NameToFunc* GetFieldNames() const { return FieldMap; }
    -00137         const NameToFunc* GetField(const std::string &fieldname) const;
    -00138         std::string GetFieldReadName(GetFunctionType read) const;
    -00139         std::string GetFieldWriteName(SetFunctionType write) const;
    -00140 
    -00141         bool Map(const LdifAttribute &ldifname, const std::string &readField,
    -00142                 const std::string &writeField);
    -00143         void Map(const LdifAttribute &ldifname, GetFunctionType read,
    -00144                 SetFunctionType write);
    -00145         void Unmap(const LdifAttribute &ldifname);
    -00146 
    -00147         void SetBaseDN(const std::string &baseDN) { m_baseDN = baseDN; }
    -00148         bool SetDNAttr(const LdifAttribute &name);
    -00149         bool SetObjectClass(const LdifAttribute &name, const std::string &objectClass);
    -00150         bool SetObjectOrder(const LdifAttribute &name, int order);
    -00151 
    -00152         //
    -00153         // Access functions
    -00154         //
    -00155 
    -00156         virtual std::string Email(const Barry::Contact &con) const;
    -00157         virtual std::string Phone(const Barry::Contact &con) const;
    -00158         virtual std::string Fax(const Barry::Contact &con) const;
    -00159         virtual std::string WorkPhone(const Barry::Contact &con) const;
    -00160         virtual std::string HomePhone(const Barry::Contact &con) const;
    -00161         virtual std::string MobilePhone(const Barry::Contact &con) const;
    -00162         virtual std::string Pager(const Barry::Contact &con) const;
    -00163         virtual std::string PIN(const Barry::Contact &con) const;
    -00164         virtual std::string FirstName(const Barry::Contact &con) const;
    -00165         virtual std::string LastName(const Barry::Contact &con) const;
    -00166         virtual std::string Company(const Barry::Contact &con) const;
    -00167         virtual std::string DefaultCommunicationsMethod(const Barry::Contact &con) const;
    -00168         virtual std::string Address1(const Barry::Contact &con) const;
    -00169         virtual std::string Address2(const Barry::Contact &con) const;
    -00170         virtual std::string Address3(const Barry::Contact &con) const;
    -00171         virtual std::string City(const Barry::Contact &con) const;
    -00172         virtual std::string Province(const Barry::Contact &con) const;
    -00173         virtual std::string PostalCode(const Barry::Contact &con) const;
    -00174         virtual std::string Country(const Barry::Contact &con) const;
    -00175         virtual std::string JobTitle(const Barry::Contact &con) const;
    -00176         virtual std::string PublicKey(const Barry::Contact &con) const;
    -00177         virtual std::string Notes(const Barry::Contact &con) const;
    -00178         // calculated values...
    -00179         virtual std::string PostalAddress(const Barry::Contact &con) const;
    -00180         virtual std::string FullName(const Barry::Contact &con) const;
    -00181         virtual std::string FQDN(const Barry::Contact &con) const;
    -00182 
    -00183         //
    -00184         // Array modifier functions for above Access functions
    -00185         //
    -00186 
    -00187         virtual bool IsArrayFunc(GetFunctionType getf) const;
    -00188         void ClearArrayState() const;
    -00189 
    -00190         //
    -00191         // Write functions
    -00192         //
    -00193 
    -00194         virtual void SetEmail(Barry::Contact &con, const std::string &val) const;
    -00195         virtual void SetPhone(Barry::Contact &con, const std::string &val) const;
    -00196         virtual void SetFax(Barry::Contact &con, const std::string &val) const;
    -00197         virtual void SetWorkPhone(Barry::Contact &con, const std::string &val) const;
    -00198         virtual void SetHomePhone(Barry::Contact &con, const std::string &val) const;
    -00199         virtual void SetMobilePhone(Barry::Contact &con, const std::string &val) const;
    -00200         virtual void SetPager(Barry::Contact &con, const std::string &val) const;
    -00201         virtual void SetPIN(Barry::Contact &con, const std::string &val) const;
    -00202         virtual void SetFirstName(Barry::Contact &con, const std::string &val) const;
    -00203         virtual void SetLastName(Barry::Contact &con, const std::string &val) const;
    -00204         virtual void SetCompany(Barry::Contact &con, const std::string &val) const;
    -00205         virtual void SetDefaultCommunicationsMethod(Barry::Contact &con, const std::string &val) const;
    -00206         virtual void SetAddress1(Barry::Contact &con, const std::string &val) const;
    -00207         virtual void SetAddress2(Barry::Contact &con, const std::string &val) const;
    -00208         virtual void SetAddress3(Barry::Contact &con, const std::string &val) const;
    -00209         virtual void SetCity(Barry::Contact &con, const std::string &val) const;
    -00210         virtual void SetProvince(Barry::Contact &con, const std::string &val) const;
    -00211         virtual void SetPostalCode(Barry::Contact &con, const std::string &val) const;
    -00212         virtual void SetCountry(Barry::Contact &con, const std::string &val) const;
    -00213         virtual void SetJobTitle(Barry::Contact &con, const std::string &val) const;
    -00214         virtual void SetPublicKey(Barry::Contact &con, const std::string &val) const;
    -00215         virtual void SetNotes(Barry::Contact &con, const std::string &val) const;
    -00216         virtual void SetPostalAddress(Barry::Contact &con, const std::string &val) const;
    -00217         virtual void SetFullName(Barry::Contact &con, const std::string &val) const;
    -00218         virtual void SetFQDN(Barry::Contact &con, const std::string &val) const;
    -00219 
    -00220 
    -00221         //
    -00222         // Name heuristics
    -00223         //
    -00224 
    -00225         virtual void ClearHeuristics();
    -00226         virtual bool RunHeuristics(Barry::Contact &con);
    -00227 
    -00228         //
    -00229         // Operations
    -00230         //
    -00231 
    -00232         void DumpLdif(std::ostream &os, const Barry::Contact &contact) const;
    -00233         bool ReadLdif(std::istream &is, Barry::Contact &contact);
    -00234                                                         // returns true on success
    -00235         void DumpMap(std::ostream &os) const;
    -00236 
    -00237 
    -00238         static std::string MakeLdifData(const std::string &str);
    -00239         static bool NeedsEncoding(const std::string &str);
    -00240 };
    -00241 
    -00242 BXEXPORT inline std::ostream& operator<< (std::ostream &os, const ContactLdif &ldif) {
    -00243         ldif.DumpMap(os);
    -00244         return os;
    -00245 }
    -00246 
    -00247 } // namespace Barry
    -00248 
    -00249 #endif
    -00250 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/log_8cc.html barry-0.0.20110506/doc/www/doxygen/html/log_8cc.html --- barry-0.14/doc/www/doxygen/html/log_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/log_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - -Barry: log.cc File Reference - - - - - - - -

    log.cc File Reference


    Detailed Description

    -General Barry interface routines. -

    - -

    -Definition in file log.cc. -

    -#include "log.h"
    -#include <pthread.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    -bool Barry::LogVerbose ()
    -std::ostream * Barry::GetLogStream ()

    Variables

    -bool Barry::__data_dump_mode__
    -std::ostream * Barry::LogStream
    -pthread_mutex_t Barry::LogStreamMutex
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/log_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/log_8cc-source.html --- barry-0.14/doc/www/doxygen/html/log_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/log_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ - - -Barry: log.cc Source File - - - - - - - -

    log.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       log.cc
    -00003 ///             General Barry interface routines
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "log.h"
    -00023 #include <pthread.h>
    -00024 
    -00025 namespace Barry {
    -00026 
    -00027 extern bool __data_dump_mode__;
    -00028 extern std::ostream *LogStream;
    -00029 extern pthread_mutex_t LogStreamMutex;
    -00030 
    -00031 LogLock::LogLock()
    -00032 {
    -00033         while( pthread_mutex_lock(&LogStreamMutex) != 0 )
    -00034                 ;
    -00035 }
    -00036 
    -00037 LogLock::~LogLock()
    -00038 {
    -00039         pthread_mutex_unlock(&LogStreamMutex);
    -00040 }
    -00041 
    -00042 
    -00043 bool LogVerbose()
    -00044 {
    -00045         return __data_dump_mode__;
    -00046 }
    -00047 
    -00048 std::ostream* GetLogStream()
    -00049 {
    -00050         return LogStream;
    -00051 }
    -00052 
    -00053 } // namespace Barry
    -00054 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/log_8h.html barry-0.0.20110506/doc/www/doxygen/html/log_8h.html --- barry-0.14/doc/www/doxygen/html/log_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/log_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ - - -Barry: log.h File Reference - - - - - - - -

    log.h File Reference


    Detailed Description

    -General header for the Barry library. -

    - -

    -Definition in file log.h. -

    -#include "dll.h"
    -#include <iomanip>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::LogLock
     RAII locking class used to protect the logStream passed into Barry::Init() (common.h). More...

    Defines

    -#define barrylog(x)   { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; }
    -#define barryverbose(x)   if(Barry::LogVerbose()) { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; }

    Functions

    -bool Barry::LogVerbose ()
    -std::ostream * Barry::GetLogStream ()
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/log_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/log_8h-source.html --- barry-0.14/doc/www/doxygen/html/log_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/log_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ - - -Barry: log.h Source File - - - - - - - -

    log.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       log.h
    -00003 ///             General header for the Barry library
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_LOG_H__
    -00023 #define __BARRY_LOG_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <iomanip>
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 //
    -00031 // LogLock
    -00032 //
    -00033 /// RAII locking class used to protect the logStream passed into
    -00034 /// Barry::Init() (common.h).  If the application uses the same stream for
    -00035 /// its own logging, it should use this lock class, or use the macros
    -00036 /// in log.h.
    -00037 ///
    -00038 class BXEXPORT LogLock
    -00039 {
    -00040 public:
    -00041         LogLock();
    -00042         ~LogLock();
    -00043 };
    -00044 
    -00045 BXEXPORT bool LogVerbose();
    -00046 BXEXPORT std::ostream* GetLogStream();
    -00047 
    -00048 } // namespace Barry
    -00049 
    -00050 #define barrylog(x)     { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; }
    -00051 
    -00052 // controlled by command line -v switch
    -00053 #define barryverbose(x) if(Barry::LogVerbose()) { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; }
    -00054 
    -00055 #endif // __BARRY_LOG_H__
    -00056 
    -

    Generated on Wed Sep 24 21:27:31 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktop_8cc.html barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8cc.html --- barry-0.14/doc/www/doxygen/html/m__desktop_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: m_desktop.cc File Reference - - - - - - - -

    m_desktop.cc File Reference


    Detailed Description

    -Mode class for the Desktop mode. -

    - -

    -Definition in file m_desktop.cc. -

    -#include "m_desktop.h"
    -#include "data.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "packet.h"
    -#include "endian.h"
    -#include "error.h"
    -#include "usbwrap.h"
    -#include "controller.h"
    -#include <stdexcept>
    -#include <sstream>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktop_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8cc-source.html --- barry-0.14/doc/www/doxygen/html/m__desktop_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,552 +0,0 @@ - - -Barry: m_desktop.cc Source File - - - - - - - -

    m_desktop.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_desktop.cc
    -00003 ///             Mode class for the Desktop mode
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "m_desktop.h"
    -00023 #include "data.h"
    -00024 #include "protocol.h"
    -00025 #include "protostructs.h"
    -00026 #include "packet.h"
    -00027 #include "endian.h"
    -00028 #include "error.h"
    -00029 #include "usbwrap.h"
    -00030 #include "controller.h"
    -00031 #include <stdexcept>
    -00032 #include <sstream>
    -00033 
    -00034 #include "debug.h"
    -00035 
    -00036 namespace Barry { namespace Mode {
    -00037 
    -00038 
    -00039 ///////////////////////////////////////////////////////////////////////////////
    -00040 // Desktop Mode class
    -00041 
    -00042 Desktop::Desktop(Controller &con)
    -00043         : m_con(con)
    -00044         , m_ModeSocket(0)
    -00045 {
    -00046 }
    -00047 
    -00048 Desktop::~Desktop()
    -00049 {
    -00050 }
    -00051 
    -00052 ///////////////////////////////////////////////////////////////////////////////
    -00053 // protected members
    -00054 
    -00055 void Desktop::LoadCommandTable()
    -00056 {
    -00057         char rawCommand[] = { 6, 0, 0x0a, 0, 0x40, 0, 0, 1, 0, 0 };
    -00058         *((uint16_t*) rawCommand) = htobs(m_socket->GetSocket());
    -00059 
    -00060         Data command(rawCommand, sizeof(rawCommand));
    -00061         Data response;
    -00062 
    -00063         try {
    -00064                 m_socket->Packet(command, response);
    -00065 
    -00066                 MAKE_PACKET(rpack, response);
    -00067                 while( rpack->command != SB_COMMAND_DB_DONE ) {
    -00068                         m_socket->NextRecord(response);
    -00069 
    -00070                         rpack = (const Protocol::Packet *) response.GetData();
    -00071                         if( rpack->command == SB_COMMAND_DB_DATA && btohs(rpack->size) > 10 ) {
    -00072                                 // second packet is generally large, and contains
    -00073                                 // the command table
    -00074                                 m_commandTable.Clear();
    -00075                                 m_commandTable.Parse(response, 6);
    -00076                         }
    -00077                 }
    -00078 
    -00079                 ddout(m_commandTable);
    -00080 
    -00081         }
    -00082         catch( Usb::Error & ) {
    -00083                 eout("Desktop: error getting command table");
    -00084                 eeout(command, response);
    -00085                 throw;
    -00086         }
    -00087 }
    -00088 
    -00089 void Desktop::LoadDBDB()
    -00090 {
    -00091         Data command, response;
    -00092         DBPacket packet(*this, command, response);
    -00093         packet.GetDBDB();
    -00094 
    -00095         m_socket->Packet(packet);
    -00096 
    -00097         while( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00098                 if( packet.Command() == SB_COMMAND_DB_DATA ) {
    -00099                         m_dbdb.Clear();
    -00100                         m_dbdb.Parse(response);
    -00101                 }
    -00102 
    -00103                 // advance!
    -00104                 m_socket->NextRecord(response);
    -00105         }
    -00106 }
    -00107 
    -00108 
    -00109 
    -00110 ///////////////////////////////////////////////////////////////////////////////
    -00111 // public API
    -00112 
    -00113 //
    -00114 // Open
    -00115 //
    -00116 /// Select device mode.  This is required before using any other mode-based
    -00117 /// operations, such as GetDBDB() and LoadDatabase().
    -00118 ///
    -00119 /// This function opens a socket to the device for communicating in Desktop
    -00120 /// mode.  If the device requires it, specify the password with a const char*
    -00121 /// string in password.  The password will not be stored in memory
    -00122 /// inside this class, only a hash will be generated from it.  After
    -00123 /// using the hash, the hash memory will be set to 0.  The application
    -00124 /// is responsible for safely handling the raw password data.
    -00125 ///
    -00126 /// You can retry the password by catching Barry::BadPassword and
    -00127 /// calling RetryPassword() with the new password.
    -00128 ///
    -00129 /// \exception  Barry::Error
    -00130 ///             Thrown on protocol error.
    -00131 ///
    -00132 /// \exception  std::logic_error()
    -00133 ///             Thrown if unsupported mode is requested, or if socket
    -00134 ///             already open.
    -00135 ///
    -00136 /// \exception  Barry::BadPassword
    -00137 ///             Thrown when password is invalid or if not enough retries
    -00138 ///             left in the device.
    -00139 ///
    -00140 void Desktop::Open(const char *password)
    -00141 {
    -00142         if( m_ModeSocket ) {
    -00143                 m_socket->Close();
    -00144                 m_socket.reset();
    -00145                 m_ModeSocket = 0;
    -00146         }
    -00147 
    -00148         m_ModeSocket = m_con.SelectMode(Controller::Desktop);
    -00149         RetryPassword(password);
    -00150 }
    -00151 
    -00152 //
    -00153 // RetryPassword
    -00154 //
    -00155 /// Retry a failed password attempt from the first call to Open().
    -00156 /// Only call this function in response to Barry::BadPassword exceptions
    -00157 /// that are thrown from Open().
    -00158 ///
    -00159 /// \exception  Barry::Error
    -00160 ///             Thrown on protocol error.
    -00161 ///
    -00162 /// \exception  std::logic_error()
    -00163 ///             Thrown if in unsupported mode, or if socket already open.
    -00164 ///
    -00165 /// \exception  Barry::BadPassword
    -00166 ///             Thrown when password is invalid or if not enough retries
    -00167 ///             left in the device.
    -00168 ///
    -00169 void Desktop::RetryPassword(const char *password)
    -00170 {
    -00171         if( m_socket.get() != 0 )
    -00172                 throw std::logic_error("Socket alreay open in RetryPassword");
    -00173 
    -00174         m_socket = m_con.m_zero.Open(m_ModeSocket, password);
    -00175 
    -00176         // get command table and database database
    -00177         LoadCommandTable();
    -00178         LoadDBDB();
    -00179 }
    -00180 
    -00181 //
    -00182 // GetDBID
    -00183 //
    -00184 /// Get numeric database ID by name.
    -00185 ///
    -00186 /// \param[in]  name            Name of database, which matches one of the
    -00187 ///                             names listed in GetDBDB()
    -00188 ///
    -00189 /// \exception  Barry::Error
    -00190 ///             Thrown if name not found.
    -00191 ///
    -00192 unsigned int Desktop::GetDBID(const std::string &name) const
    -00193 {
    -00194         unsigned int ID = 0;
    -00195         // FIXME - this needs a better error handler...
    -00196         if( !m_dbdb.GetDBNumber(name, ID) ) {
    -00197                 throw Error("Desktop: database name not found: " + name);
    -00198         }
    -00199         return ID;
    -00200 }
    -00201 
    -00202 //
    -00203 // GetDBCommand
    -00204 //
    -00205 /// Get database command from command table.  Must call Open()
    -00206 /// before this.
    -00207 ///
    -00208 unsigned int Desktop::GetDBCommand(CommandType ct)
    -00209 {
    -00210         unsigned int cmd = 0;
    -00211         const char *cmdName = "Unknown";
    -00212 
    -00213         switch( ct )
    -00214         {
    -00215         case DatabaseAccess:
    -00216                 cmdName = "Database Access";
    -00217                 cmd = m_commandTable.GetCommand(cmdName);
    -00218                 break;
    -00219         default:
    -00220                 throw std::logic_error("Desktop: unknown command type");
    -00221         }
    -00222 
    -00223         if( cmd == 0 ) {
    -00224                 std::ostringstream oss;
    -00225                 oss << "Desktop: unable to get command code: " << cmdName;
    -00226                 throw Error(oss.str());
    -00227         }
    -00228 
    -00229         return cmd;
    -00230 }
    -00231 
    -00232 //
    -00233 // GetRecordStateTable
    -00234 //
    -00235 /// Retrieve the record state table from the handheld device, using the given
    -00236 /// database ID.  Results will be stored in result, which will be cleared
    -00237 /// before adding.
    -00238 ///
    -00239 void Desktop::GetRecordStateTable(unsigned int dbId, RecordStateTable &result)
    -00240 {
    -00241         dout("Database ID: " << dbId);
    -00242 
    -00243         // start fresh
    -00244         result.Clear();
    -00245 
    -00246         Data command, response;
    -00247         DBPacket packet(*this, command, response);
    -00248         packet.GetRecordStateTable(dbId);
    -00249 
    -00250         m_socket->Packet(packet);
    -00251         result.Parse(response);
    -00252 
    -00253         // flush the command sequence
    -00254         while( packet.Command() != SB_COMMAND_DB_DONE )
    -00255                 m_socket->NextRecord(response);
    -00256 }
    -00257 
    -00258 //
    -00259 // AddRecord
    -00260 //
    -00261 /// Adds a record to the specified database.  RecordId is
    -00262 /// retrieved from build, and duplicate IDs are allowed by the device
    -00263 /// (i.e. you can have two records with the same ID) 
    -00264 /// but *not* recommended!
    -00265 //
    -00266 void Desktop::AddRecord(unsigned int dbId, Builder &build)
    -00267 {
    -00268         dout("Database ID: " << dbId);
    -00269 
    -00270         Data command, response;
    -00271         DBPacket packet(*this, command, response);
    -00272 
    -00273         if( packet.SetRecord(dbId, build) ) {
    -00274 
    -00275                 std::ostringstream oss;
    -00276 
    -00277                 m_socket->Packet(packet);
    -00278 
    -00279                 // successful packet transfer, so check the network return code
    -00280                 if( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00281                         oss << "Desktop: device responded with unexpected packet command code: "
    -00282                             << "0x" << std::hex << packet.Command();
    -00283                         throw Error(oss.str());
    -00284                 }
    -00285 
    -00286                 if( packet.ReturnCode() != 0 ) {
    -00287                         oss << "Desktop: device responded with error code (command: "
    -00288                             << packet.Command() << ", code: "
    -00289                             << packet.ReturnCode() << ")";
    -00290                         throw Error(oss.str());
    -00291                 }
    -00292         }
    -00293 }
    -00294 
    -00295 //
    -00296 // GetRecord
    -00297 //
    -00298 /// Retrieves a specific record from the specified database.
    -00299 /// The stateTableIndex comes from the GetRecordStateTable()
    -00300 /// function.  GetRecord() does not clear the dirty flag.
    -00301 ///
    -00302 void Desktop::GetRecord(unsigned int dbId,
    -00303                            unsigned int stateTableIndex,
    -00304                            Parser &parser)
    -00305 {
    -00306         dout("Database ID: " << dbId);
    -00307 
    -00308         Data command, response;
    -00309         DBPacket packet(*this, command, response);
    -00310         packet.GetRecordByIndex(dbId, stateTableIndex);
    -00311 
    -00312         m_socket->Packet(packet);
    -00313 
    -00314         // perform copious packet checks
    -00315         if( response.GetSize() < SB_PACKET_RESPONSE_HEADER_SIZE ) {
    -00316                 eeout(command, response);
    -00317 
    -00318                 std::ostringstream oss;
    -00319                 oss << "Desktop: invalid response packet size of "
    -00320                     << std::dec << response.GetSize();
    -00321                 eout(oss.str());
    -00322                 throw Error(oss.str());
    -00323         }
    -00324         if( packet.Command() != SB_COMMAND_DB_DATA ) {
    -00325                 eeout(command, response);
    -00326 
    -00327                 std::ostringstream oss;
    -00328                 oss << "Desktop: unexpected command of 0x"
    -00329                     << std::setbase(16) << packet.Command()
    -00330                     << " instead of expected 0x"
    -00331                     << std::setbase(16) << (unsigned int)SB_COMMAND_DB_DATA;
    -00332                 eout(oss.str());
    -00333                 throw Error(oss.str());
    -00334         }
    -00335 
    -00336         // grab that data
    -00337         packet.Parse(parser);
    -00338 
    -00339         // flush the command sequence
    -00340         while( packet.Command() != SB_COMMAND_DB_DONE )
    -00341                 m_socket->NextRecord(response);
    -00342 }
    -00343 
    -00344 //
    -00345 // SetRecord
    -00346 //
    -00347 /// Overwrites a specific record in the device as identified by the
    -00348 /// stateTableIndex.
    -00349 ///
    -00350 void Desktop::SetRecord(unsigned int dbId, unsigned int stateTableIndex,
    -00351                            Builder &build)
    -00352 {
    -00353         dout("Database ID: " << dbId << " Index: " << stateTableIndex);
    -00354 
    -00355         Data command, response;
    -00356         DBPacket packet(*this, command, response);
    -00357 
    -00358         // loop until builder object has no more data
    -00359         if( !packet.SetRecordByIndex(dbId, stateTableIndex, build) ) {
    -00360                 throw std::logic_error("Desktop: no data available in SetRecord");
    -00361         }
    -00362 
    -00363         m_socket->Packet(packet);
    -00364 
    -00365         std::ostringstream oss;
    -00366 
    -00367         // successful packet transfer, so check the network return code
    -00368         if( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00369                 oss << "Desktop: device responded with unexpected packet command code: "
    -00370                     << "0x" << std::hex << packet.Command();
    -00371                 throw Error(oss.str());
    -00372         }
    -00373 
    -00374         if( packet.ReturnCode() != 0 ) {
    -00375                 oss << "Desktop: device responded with error code (command: "
    -00376                     << packet.Command() << ", code: "
    -00377                     << packet.ReturnCode() << ")";
    -00378                 throw Error(oss.str());
    -00379         }
    -00380 }
    -00381 
    -00382 //
    -00383 // ClearDirty
    -00384 //
    -00385 /// Clears the dirty flag on the specified record in the specified database.
    -00386 ///
    -00387 void Desktop::ClearDirty(unsigned int dbId, unsigned int stateTableIndex)
    -00388 {
    -00389         dout("Database ID: " << dbId);
    -00390 
    -00391         Data command, response;
    -00392         DBPacket packet(*this, command, response);
    -00393         packet.SetRecordFlags(dbId, stateTableIndex, 0);
    -00394 
    -00395         m_socket->Packet(packet);
    -00396 
    -00397         // flush the command sequence
    -00398         while( packet.Command() != SB_COMMAND_DB_DONE )
    -00399                 m_socket->NextRecord(response);
    -00400 }
    -00401 
    -00402 //
    -00403 // DeleteRecord
    -00404 //
    -00405 /// Deletes the specified record in the specified database.
    -00406 ///
    -00407 void Desktop::DeleteRecord(unsigned int dbId, unsigned int stateTableIndex)
    -00408 {
    -00409         dout("Database ID: " << dbId);
    -00410 
    -00411         Data command, response;
    -00412         DBPacket packet(*this, command, response);
    -00413         packet.DeleteRecordByIndex(dbId, stateTableIndex);
    -00414 
    -00415         m_socket->Packet(packet);
    -00416 
    -00417         // flush the command sequence
    -00418         while( packet.Command() != SB_COMMAND_DB_DONE )
    -00419                 m_socket->NextRecord(response);
    -00420 }
    -00421 
    -00422 //
    -00423 // LoadDatabase
    -00424 //
    -00425 /// Retrieve a database from the handheld device, using the given parser
    -00426 /// to parse the resulting data, and optionally store it.
    -00427 ///
    -00428 /// See the RecordParser<> template to create a parser object.  The
    -00429 /// RecordParser<> template allows custom storage based on the type of
    -00430 /// database record retrieved.  The database ID and the parser Record
    -00431 /// type must match.
    -00432 ///
    -00433 /// \param[in]  dbId            Database Database ID - use GetDBID()
    -00434 /// \param[out] parser          Parser object which parses the resulting
    -00435 ///                             protocol data, and optionally stores it in
    -00436 ///                             a custom fashion.  See the RecordParser<>
    -00437 ///                             template.
    -00438 ///
    -00439 /// \exception  Barry::Error
    -00440 ///             Thrown on protocol error.
    -00441 ///
    -00442 /// \exception  std::logic_error
    -00443 ///             Thrown if not in Desktop mode.
    -00444 ///
    -00445 void Desktop::LoadDatabase(unsigned int dbId, Parser &parser)
    -00446 {
    -00447         dout("Database ID: " << dbId);
    -00448 
    -00449         Data command, response;
    -00450         DBPacket packet(*this, command, response);
    -00451         packet.GetRecords(dbId);
    -00452 
    -00453         m_socket->Packet(packet);
    -00454 
    -00455         while( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00456                 if( packet.Command() == SB_COMMAND_DB_DATA ) {
    -00457                         // this size is the old header size, since using
    -00458                         // old command above
    -00459                         packet.Parse(parser);
    -00460                 }
    -00461 
    -00462                 // advance!
    -00463                 m_socket->NextRecord(response);
    -00464         }
    -00465 }
    -00466 
    -00467 void Desktop::SaveDatabase(unsigned int dbId, Builder &builder)
    -00468 {
    -00469         dout("Database ID: " << dbId);
    -00470 
    -00471         // Protocol note: so far in testing, this CLEAR_DATABASE operation is
    -00472         //                required, since every record sent via SET_RECORD
    -00473         //                is treated like a hypothetical "ADD_RECORD" (perhaps
    -00474         //                SET_RECORD should be renamed)... I don't know if
    -00475         //                there is a real SET_RECORD... all I know is from
    -00476         //                the Windows USB captures, which uses this same
    -00477         //                technique.
    -00478         Data command, response;
    -00479         DBPacket packet(*this, command, response);
    -00480         packet.ClearDatabase(dbId);
    -00481 
    -00482         // wait up to a minute here for old, slower devices with lots of data
    -00483         m_socket->Packet(packet, 60000);
    -00484         if( packet.ReturnCode() != 0 ) {
    -00485                 std::ostringstream oss;
    -00486                 oss << "Desktop: could not clear database: (command: "
    -00487                     << "0x" << std::hex << packet.Command() << ", code: "
    -00488                     << "0x" << std::hex << packet.ReturnCode() << ")";
    -00489                 throw Error(oss.str());
    -00490         }
    -00491 
    -00492         // check response to clear command was successful
    -00493         if( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00494                 eeout(command, response);
    -00495                 throw Error("Desktop: error clearing database, bad response");
    -00496         }
    -00497 
    -00498         // loop until builder object has no more data
    -00499         bool first = true;
    -00500         while( packet.SetRecord(dbId, builder) ) {
    -00501                 dout("Database ID: " << dbId);
    -00502 
    -00503                 m_socket->Packet(packet, first ? 60000 : -1);
    -00504                 first = false;
    -00505 
    -00506                 std::ostringstream oss;
    -00507                 // successful packet transfer, so check the network return code
    -00508                 if( packet.Command() != SB_COMMAND_DB_DONE ) {
    -00509                         oss << "Desktop: device responded with unexpected packet command code: "
    -00510                             << "0x" << std::hex << packet.Command();
    -00511                         throw Error(oss.str());
    -00512                 }
    -00513 
    -00514                 if( packet.ReturnCode() != 0 ) {
    -00515                         oss << "Desktop: device responded with error code (command: "
    -00516                             << packet.Command() << ", code: "
    -00517                             << packet.ReturnCode() << ")";
    -00518                         throw Error(oss.str());
    -00519                 }
    -00520         }
    -00521 }
    -00522 
    -00523 }} // namespace Barry::Mode
    -00524 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktop_8h.html barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8h.html --- barry-0.14/doc/www/doxygen/html/m__desktop_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: m_desktop.h File Reference - - - - - - - -

    m_desktop.h File Reference


    Detailed Description

    -Mode class for the Desktop mode. -

    - -

    -Definition in file m_desktop.h. -

    -#include "dll.h"
    -#include "socket.h"
    -#include "record.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Classes

    class  Barry::Mode::Desktop
     The main interface class to the device databases. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktop_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8h-source.html --- barry-0.14/doc/www/doxygen/html/m__desktop_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktop_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,150 +0,0 @@ - - -Barry: m_desktop.h Source File - - - - - - - -

    m_desktop.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_desktop.h
    -00003 ///             Mode class for the Desktop mode
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_M_DESKTOP_H__
    -00023 #define __BARRY_M_DESKTOP_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "socket.h"
    -00027 #include "record.h"
    -00028 
    -00029 namespace Barry {
    -00030 
    -00031 // forward declarations
    -00032 class Parser;
    -00033 class Builder;
    -00034 class Controller;
    -00035 
    -00036 namespace Mode {
    -00037 
    -00038 //
    -00039 // Desktop class
    -00040 //
    -00041 /// The main interface class to the device databases.
    -00042 ///
    -00043 /// To use this class, use the following steps:
    -00044 ///
    -00045 ///     - Create a Controller object (see Controller class for more details)
    -00046 ///     - Create this Mode::Desktop object, passing in the Controller
    -00047 ///             object during construction
    -00048 ///     - Call Open() to open database socket and finish constructing.
    -00049 ///     - Call GetDBDB() to get the device's database database
    -00050 ///     - Call GetDBID() to get a database ID by name
    -00051 ///     - Call LoadDatabase() to retrieve and store a database
    -00052 ///
    -00053 class BXEXPORT Desktop
    -00054 {
    -00055 public:
    -00056         enum CommandType { Unknown, DatabaseAccess };
    -00057 
    -00058 private:
    -00059         Controller &m_con;
    -00060 
    -00061         SocketHandle m_socket;
    -00062 
    -00063         CommandTable m_commandTable;
    -00064         DatabaseDatabase m_dbdb;
    -00065 
    -00066         uint16_t m_ModeSocket;                  // socket recommended by device
    -00067                                                 // when mode was selected
    -00068 
    -00069 protected:
    -00070         void LoadCommandTable();
    -00071         void LoadDBDB();
    -00072 
    -00073 public:
    -00074         Desktop(Controller &con);
    -00075         ~Desktop();
    -00076 
    -00077         //////////////////////////////////
    -00078         // primary operations - required before anything else
    -00079 
    -00080         void Open(const char *password = 0);
    -00081         void RetryPassword(const char *password);
    -00082 
    -00083         //////////////////////////////////
    -00084         // meta access
    -00085 
    -00086         /// Returns DatabaseDatabase object for this connection.
    -00087         /// Must call Open() first, which loads the DBDB.
    -00088         const DatabaseDatabase& GetDBDB() const { return m_dbdb; }
    -00089         unsigned int GetDBID(const std::string &name) const;
    -00090         unsigned int GetDBCommand(CommandType ct);
    -00091 
    -00092         //////////////////////////////////
    -00093         // Desktop mode - database specific
    -00094 
    -00095         // dirty flag related functions, for sync operations
    -00096         void GetRecordStateTable(unsigned int dbId, RecordStateTable &result);
    -00097         void AddRecord(unsigned int dbId, Builder &build); // RecordId is
    -00098                 // retrieved from build, and duplicate IDs are allowed,
    -00099                 // but *not* recommended!
    -00100         void GetRecord(unsigned int dbId, unsigned int stateTableIndex, Parser &parser);
    -00101         void SetRecord(unsigned int dbId, unsigned int stateTableIndex, Builder &build);
    -00102         void ClearDirty(unsigned int dbId, unsigned int stateTableIndex);
    -00103         void DeleteRecord(unsigned int dbId, unsigned int stateTableIndex);
    -00104 
    -00105         // pure load/save operations
    -00106         void LoadDatabase(unsigned int dbId, Parser &parser);
    -00107         void SaveDatabase(unsigned int dbId, Builder &builder);
    -00108 
    -00109         template <class RecordT, class StorageT> void LoadDatabaseByType(StorageT &store);
    -00110         template <class RecordT, class StorageT> void SaveDatabaseByType(StorageT &store);
    -00111 
    -00112         template <class StorageT> void LoadDatabaseByName(const std::string &name, StorageT &store);
    -00113         template <class StorageT> void SaveDatabaseByName(const std::string &name, StorageT &store);
    -00114 
    -00115         template <class RecordT> void AddRecordByType(uint32_t recordId, const RecordT &rec);
    -00116 
    -00117 };
    -00118 
    -00119 }} // namespace Barry::Mode
    -00120 
    -00121 #endif
    -00122 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktoptmpl_8h.html barry-0.0.20110506/doc/www/doxygen/html/m__desktoptmpl_8h.html --- barry-0.14/doc/www/doxygen/html/m__desktoptmpl_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktoptmpl_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ - - -Barry: m_desktoptmpl.h File Reference - - - - - - - -

    m_desktoptmpl.h File Reference


    Detailed Description

    -Ease of use templates for the Desktop mode class. -

    - -

    -Definition in file m_desktoptmpl.h. -

    -#include "dll.h"
    -#include "m_desktop.h"
    -#include "parser.h"
    -#include "builder.h"
    - -

    -Go to the source code of this file. - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__desktoptmpl_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/m__desktoptmpl_8h-source.html --- barry-0.14/doc/www/doxygen/html/m__desktoptmpl_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__desktoptmpl_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ - - -Barry: m_desktoptmpl.h Source File - - - - - - - -

    m_desktoptmpl.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_desktoptmpl.h
    -00003 ///             Ease of use templates for the Desktop mode class
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_M_DESKTOPTMPL_H__
    -00023 #define __BARRY_M_DESKTOPTMPL_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "m_desktop.h"
    -00027 #include "parser.h"
    -00028 #include "builder.h"
    -00029 
    -00030 namespace Barry { namespace Mode {
    -00031 
    -00032 BXEXPORT void LoadDatabase(unsigned int dbId, Parser &parser);
    -00033 BXEXPORT void SaveDatabase(unsigned int dbId, Builder &builder);
    -00034 
    -00035 template <class RecordT, class StorageT>
    -00036 void Desktop::LoadDatabaseByType(StorageT &store)
    -00037 {
    -00038         unsigned int dbId = this->GetDBID( RecordT::GetDBName() );
    -00039         Barry::RecordParser<RecordT, StorageT> parser(store);
    -00040         this->LoadDatabase(dbId, parser);
    -00041 }
    -00042 
    -00043 template <class RecordT, class StorageT>
    -00044 void Desktop::SaveDatabaseByType(StorageT &store)
    -00045 {
    -00046         unsigned int dbId = this->GetDBID( RecordT::GetDBName() );
    -00047         Barry::RecordBuilder<RecordT, StorageT> build(store);
    -00048         SaveDatabase(dbId, build);
    -00049 }
    -00050 
    -00051 template <class StorageT>
    -00052 void Desktop::LoadDatabaseByName(const std::string &name, StorageT &store)
    -00053 {
    -00054         if( name == Contact::GetDBName() )
    -00055                 LoadDatabaseByType<Contact>(store);
    -00056         else if( name == Message::GetDBName() )
    -00057                 LoadDatabaseByType<Message>(store);
    -00058         else if( name == Calendar::GetDBName() )
    -00059                 LoadDatabaseByType<Calendar>(store);
    -00060         else
    -00061                 throw Error("Unknown database name in LoadDatabaseByName: " + name);
    -00062 }
    -00063 
    -00064 template <class StorageT>
    -00065 void Desktop::SaveDatabaseByName(const std::string &name, StorageT &store)
    -00066 {
    -00067         if( name == Contact::GetDBName() )
    -00068                 SaveDatabaseByType<Contact>(store);
    -00069         else if( name == Message::GetDBName() )
    -00070                 SaveDatabaseByType<Message>(store);
    -00071         else if( name == Calendar::GetDBName() )
    -00072                 SaveDatabaseByType<Calendar>(store);
    -00073         else
    -00074                 throw Error("Unknown database name in SaveDatabaseByName: " + name);
    -00075 }
    -00076 
    -00077 template <class RecordT>
    -00078 void Desktop::AddRecordByType(uint32_t recordId, const RecordT &rec)
    -00079 {
    -00080         unsigned int dbId = this->GetDBID( RecordT::GetDBName() );
    -00081         // FIXME - I know this is a convenience template, but it still
    -00082         // hurts making a temporary copy just to set the record ID...
    -00083         // create a better API for this.
    -00084         RecordT r = rec;
    -00085         r.SetIds(RecordT::GetDefaultRecType(), recordId);
    -00086         Barry::RecordFetch<RecordT> fetch(r);
    -00087         Barry::RecordBuilder<RecordT, Barry::RecordFetch<RecordT> > build(fetch);
    -00088         this->AddRecord(dbId, build);
    -00089 }
    -00090 
    -00091 
    -00092 }} // namespace Barry::Mode
    -00093 
    -00094 #endif
    -00095 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__ipmodem_8cc.html barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8cc.html --- barry-0.14/doc/www/doxygen/html/m__ipmodem_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ - - -Barry: m_ipmodem.cc File Reference - - - - - - - -

    m_ipmodem.cc File Reference


    Detailed Description

    -Mode class for GPRS modem mode (using endpoints on modern devices). -

    - -

    -Definition in file m_ipmodem.cc. -

    -#include "m_ipmodem.h"
    -#include "controller.h"
    -#include "data.h"
    -#include "debug.h"
    -#include <sstream>
    -#include <string.h>
    -#include "sha1.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Variables

    -const char Barry::Mode::special_flag [] = { 0x78, 0x56, 0x34, 0x12 }
    -const char Barry::Mode::start [] = { 0x01, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -const char Barry::Mode::pw_start [] = { 0x01, 0, 0, 0, 1, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -const char Barry::Mode::stop [] = { 0x01, 0, 0, 0, 0, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__ipmodem_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8cc-source.html --- barry-0.14/doc/www/doxygen/html/m__ipmodem_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ - - -Barry: m_ipmodem.cc Source File - - - - - - - -

    m_ipmodem.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_ipmodem.cc
    -00003 ///             Mode class for GPRS modem mode (using endpoints on
    -00004 ///             modern devices)
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "m_ipmodem.h"
    -00024 #include "controller.h"
    -00025 #include "data.h"
    -00026 #include "debug.h"
    -00027 #include <sstream>
    -00028 #include <string.h>
    -00029 #include "sha1.h"
    -00030 
    -00031 namespace Barry { namespace Mode {
    -00032 
    -00033 const char special_flag[] = { 0x78, 0x56, 0x34, 0x12 }; // 0x12345678
    -00034 const char start[]        = { 0x01, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 };
    -00035 const char pw_start[]     = { 0x01, 0, 0, 0, 1, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 };
    -00036 const char stop[]         = { 0x01, 0, 0, 0, 0, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 };
    -00037 
    -00038 //////////////////////////////////////////////////////////////////////////////
    -00039 // Mode::IpModem class
    -00040 
    -00041 IpModem::IpModem(Controller &con,
    -00042                 DeviceDataCallback callback,
    -00043                 void *callback_context)
    -00044         : m_con(con)
    -00045         , m_dev(con.m_dev)
    -00046         , m_continue_reading(false)
    -00047         , m_callback(callback)
    -00048         , m_callback_context(callback_context)
    -00049 {
    -00050         memset(m_session_key, 0, sizeof(m_session_key));
    -00051 }
    -00052 
    -00053 IpModem::~IpModem()
    -00054 {
    -00055         try {
    -00056                 Close();
    -00057         } catch( std::exception &e ) {
    -00058                 dout("Exception caught in IpModem destructor, ignoring: "
    -00059                         << e.what());
    -00060         }
    -00061 }
    -00062 
    -00063 bool IpModem::SendPassword(const char *password)
    -00064 {
    -00065         if( !password || strlen(password) == 0  ) {
    -00066                 throw BadPassword("No password provided.", 0, false);
    -00067         }
    -00068 
    -00069         int read_ep  = m_con.GetProbeResult().m_epModem.read;
    -00070         int write_ep = m_con.GetProbeResult().m_epModem.write;
    -00071         Data data;
    -00072 
    -00073         m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start));
    -00074         m_dev.BulkRead(read_ep, data);
    -00075         ddout("IPModem read packet.\n" << data);
    -00076 
    -00077         // Need to add checks for other packet types.
    -00078         // check for 02 00 00 00 SS SS SS SS RR 00 00 00 0a 00 00 00 PP PP PP PP PP 00 00 00 78 56 34 12
    -00079         if( data.GetSize() >= 9 && data.GetData()[0] == 0x02  &&
    -00080             memcmp(data.GetData() + data.GetSize() - 4, special_flag, sizeof(special_flag))== 0 ) {
    -00081                 // Got a password request packet
    -00082                 ddout("IPModem password request packet:\n" << data);
    -00083 
    -00084                 // Check how many retries are left
    -00085                 if( data.GetData()[8] < BARRY_MIN_PASSWORD_TRIES ) {
    -00086                         throw BadPassword("Fewer than " BARRY_MIN_PASSWORD_TRIES_ASC " password tries remaining in device. Refusing to proceed, to avoid device zapping itself.  Use a Windows client, or re-cradle the device.",
    -00087                                 data.GetData()[8],
    -00088                                 true);
    -00089                 }
    -00090 
    -00091                 // Build the password hash
    -00092                 unsigned char pwdigest[SHA_DIGEST_LENGTH];
    -00093                 unsigned char prefixedhash[SHA_DIGEST_LENGTH + 4];
    -00094                 unsigned char pw_response[SHA_DIGEST_LENGTH + 8];
    -00095                 unsigned char seed[4];
    -00096 
    -00097                 // first, hash the password by itself
    -00098                 SHA1((unsigned char *) password, strlen(password), pwdigest);
    -00099 
    -00100                 // prefix the resulting hash with the provided seed
    -00101                 memcpy(&seed[0], data.GetData() + 4, sizeof(uint32_t));
    -00102                 memcpy(&prefixedhash[0], &seed, sizeof(uint32_t));
    -00103                 memcpy(&prefixedhash[4], pwdigest, SHA_DIGEST_LENGTH);
    -00104 
    -00105                 // hash again
    -00106                 SHA1((unsigned char *) prefixedhash, SHA_DIGEST_LENGTH + 4, pwdigest);
    -00107 
    -00108                 // Build the response packet
    -00109                 const char pw_rsphdr[]  = { 0x03, 0x00, 0x00, 0x00 };
    -00110                 memcpy(&pw_response[0], pw_rsphdr, sizeof(pw_rsphdr));
    -00111                 memcpy(&pw_response[4], pwdigest, SHA_DIGEST_LENGTH);
    -00112                 memcpy(&pw_response[24], special_flag, sizeof(special_flag));
    -00113 
    -00114                 // Send the password response packet
    -00115                 m_dev.BulkWrite(write_ep, pw_response, sizeof(pw_response));
    -00116                 m_dev.BulkRead(read_ep, data);
    -00117                 ddout("IPModem read password response.\n" << data);
    -00118 
    -00119                 // check response 04 00 00 00 .......
    -00120                 // On the 8703e the seed is incremented, retries are reset to 10 when the password is accepted.
    -00121                 // if( data.GetData()[0] == 0x04  && data.GetData()[8] == 0x0a ) {
    -00122                 if( data.GetSize() >= 9 && data.GetData()[0] == 0x04 ) {
    -00123                         if( memcmp(data.GetData() + 4, seed, sizeof(seed)) == 0 ) {
    -00124                                 ddout("IPModem invalid password.\n" << data);
    -00125                                 throw BadPassword("Password rejected by device.", data.GetData()[8], false);
    -00126                         }
    -00127                         ddout("IPModem password accepted.\n");
    -00128                         // send "start"? packet
    -00129                         m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start));
    -00130 
    -00131                         // send packet with the last 8 bytes of the password hash (session_key?)
    -00132                         //unsigned char pw_response[SHA_DIGEST_LENGTH + 8];
    -00133                         unsigned char pw_rsphdr[] = { 0x00, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0xc2, 1, 0 };
    -00134                         memcpy(&m_session_key[0], pwdigest + 12, sizeof(m_session_key));
    -00135                         memcpy(&pw_response[0], pw_rsphdr, sizeof(pw_rsphdr));
    -00136                         memcpy(&pw_response[16], pwdigest + 12, 8);
    -00137                         //memcpy(&pw_response[16], m_session_key, 8);
    -00138                         memcpy(&pw_response[24], special_flag, sizeof(special_flag));
    -00139                         m_dev.BulkWrite(write_ep, pw_response, sizeof(pw_response));
    -00140 
    -00141                         // blank password hashes as we don't need these anymore
    -00142                         memset(pwdigest, 0, sizeof(pwdigest));
    -00143                         memset(prefixedhash, 0, sizeof(prefixedhash));
    -00144 
    -00145                         // The modem should be ready to accept AT commands
    -00146                         return true;
    -00147                 }
    -00148 
    -00149                 // Unknown packet
    -00150                 ddout("IPModem Error unknown packet.\n" << data);
    -00151         }
    -00152         return false;
    -00153 }
    -00154 
    -00155 //////////////////////////////////////////////////////////////////////////////
    -00156 // protected API / static functions
    -00157 
    -00158 void *IpModem::DataReadThread(void *userptr)
    -00159 {
    -00160         IpModem *ipmodem = (IpModem*) userptr;
    -00161 
    -00162         int read_ep = ipmodem->m_con.GetProbeResult().m_epModem.read;
    -00163         Data data;
    -00164 
    -00165         while( ipmodem->m_continue_reading ) {
    -00166 
    -00167                 try {
    -00168 
    -00169                         ipmodem->m_dev.BulkRead(read_ep, data, 5000);
    -00170 
    -00171                         // is it a special code?
    -00172                         if( data.GetSize() > 4 &&
    -00173                             memcmp(data.GetData() + data.GetSize() - 4, special_flag, sizeof(special_flag)) == 0 ) {
    -00174                                 // log, then drop it on the floor for now
    -00175                                 ddout("IPModem special packet:\n" << data);
    -00176                                 continue;
    -00177                         }
    -00178 
    -00179                         // call callback if available
    -00180                         if( ipmodem->m_callback ) {
    -00181                                 (*ipmodem->m_callback)(ipmodem->m_callback_context,
    -00182                                         data.GetData(),
    -00183                                         data.GetSize());
    -00184                         }
    -00185 //                      else {
    -00186 //                              // append data to readCache
    -00187 //                              FIXME;
    -00188 //                      }
    -00189 
    -00190                 }
    -00191                 catch( Usb::Timeout &to ) {
    -00192                         // do nothing on timeouts
    -00193                         ddout("Timeout in DataReadThread!");
    -00194                 }
    -00195                 catch( std::exception &e ) {
    -00196                         eout("Exception in IpModem::DataReadThread: " << e.what());
    -00197                 }
    -00198         }
    -00199 
    -00200         return 0;
    -00201 }
    -00202 
    -00203 //////////////////////////////////////////////////////////////////////////////
    -00204 // public API
    -00205 
    -00206 void IpModem::Open(const char *password)
    -00207 {
    -00208         int read_ep  = m_con.GetProbeResult().m_epModem.read;
    -00209         int write_ep = m_con.GetProbeResult().m_epModem.write;
    -00210         Data data;
    -00211         // check that we have endpoints for the modem
    -00212         const Usb::EndpointPair &pair = m_con.GetProbeResult().m_epModem;
    -00213         if( !pair.IsComplete() ) {
    -00214                 std::ostringstream oss;
    -00215                 oss << "IP Modem not supported by this device: "
    -00216                         << "read: " << std::hex << (unsigned int) pair.read
    -00217                         << " write: " << std::hex << (unsigned int) pair.write
    -00218                         << " type: " << std::hex << (unsigned int) pair.type;
    -00219                 eout(oss.str());
    -00220                 throw Barry::Error(oss.str());
    -00221         }
    -00222 
    -00223         // clear halt when starting out
    -00224         m_dev.ClearHalt(pair.read);
    -00225         m_dev.ClearHalt(pair.write);
    -00226 
    -00227         if( !password || strlen(password) == 0 ) {
    -00228                 Data block(start, sizeof(start));
    -00229                 Write(block);
    -00230         }
    -00231         else {
    -00232                 if( !SendPassword(password) ) {
    -00233                         throw Barry::Error("IpModem:: Error sending password.");
    -00234                 }
    -00235         }
    -00236 
    -00237         // see if the modem will respond to commands
    -00238         const char modem_command[] = { "AT\r" };
    -00239         m_dev.BulkWrite(write_ep, modem_command, strlen(modem_command));
    -00240         m_dev.BulkRead(read_ep, data);
    -00241         ddout("IPModem:: AT command response.\n" << data);
    -00242         if( data.GetSize() >= 1 ) {
    -00243                 switch(data.GetData()[0])
    -00244                 {
    -00245                 case 0x02:      // password seed received
    -00246                         throw BadPassword("This device requested a password.",
    -00247                                 data.GetSize() >= 9 ? data.GetData()[8] : 0, false);
    -00248 
    -00249                 case 0x04:      // command accepted
    -00250                         break;
    -00251 
    -00252                 case 0x07:      // device is password protected?
    -00253                         throw BadPassword("This device requires a password.", 0, false);
    -00254 
    -00255                 default:        // ???
    -00256                         ddout("IPModem:: unknown AT command response.\n");
    -00257                         break;
    -00258                 }
    -00259         }
    -00260 
    -00261         // spawn read thread
    -00262         m_continue_reading = true;
    -00263         int ret = pthread_create(&m_modem_read_thread, NULL, &IpModem::DataReadThread, this);
    -00264         if( ret ) {
    -00265                 m_continue_reading = false;
    -00266                 throw Barry::ErrnoError("IpModem:: Error creating USB read thread.", ret);
    -00267         }
    -00268 }
    -00269 
    -00270 void IpModem::Write(const Data &data, int timeout)
    -00271 {
    -00272         if( data.GetSize() == 0 )
    -00273                 return; // nothing to do
    -00274 
    -00275         // according to Rick Scott the m_filter is not needed with the ip modem
    -00276         // but with the 8320 with Rogers, it doesn't seem to connect without it
    -00277         // If this is a performance problem, perhaps make this a runtime
    -00278         // option.
    -00279         m_dev.BulkWrite(m_con.GetProbeResult().m_epModem.write,
    -00280                 m_filter.Write(data), timeout);
    -00281 }
    -00282 
    -00283 void IpModem::Close()
    -00284 {
    -00285         // This is the terminate connection sequence
    -00286         // that resets the modem so we can re-connect
    -00287         // without unpluging the USB cable or reseting
    -00288         // the whole device.
    -00289         // This works on a BB 8703e a with password. other BB's??
    -00290         unsigned char end[28];
    -00291         int read_ep  = m_con.GetProbeResult().m_epModem.read;
    -00292         int write_ep = m_con.GetProbeResult().m_epModem.write;
    -00293         Data data;
    -00294 
    -00295         //0 0 0 0 b0 0 0 0 0 0 0 0 0 c2 1 0 + session_key + special_flag
    -00296         ddout("IpModem:: Closing connection.");
    -00297         memset(end, 0, sizeof(end));
    -00298         end[4]  = 0xb0;
    -00299         end[13] = 0xc2;
    -00300         end[14] = 0x01;
    -00301         memcpy(&end[16], m_session_key,  sizeof(m_session_key));
    -00302         memcpy(&end[24], special_flag, sizeof(special_flag));
    -00303         m_dev.BulkWrite(write_ep, end, sizeof(end));
    -00304 
    -00305         //0 0 0 0 20 0 0 0 3 0 0 0 0 c2 1 0 + session_key + special_flag
    -00306         memset(end, 0, sizeof(end));
    -00307         end[4]  = 0x20;
    -00308         end[8]  = 0x03;
    -00309         end[13] = 0xc2;
    -00310         end[14] = 0x01;
    -00311         memcpy(&end[16], m_session_key,  sizeof(m_session_key));
    -00312         memcpy(&end[24], special_flag, sizeof(special_flag));
    -00313         m_dev.BulkWrite(write_ep, end, sizeof(end));
    -00314 
    -00315         //0 0 0 0 30 0 0 0 0 0 0 0 0 c2 1 0 + session_key + special_flag
    -00316         // The session_key is set to 0x0's when there is no password.
    -00317         memset(end, 0, sizeof(end));
    -00318         end[4]  = 0x30;
    -00319         end[13] = 0xc2;
    -00320         end[14] = 0x01;
    -00321         memcpy(&end[16], m_session_key,  sizeof(m_session_key));
    -00322         memcpy(&end[24], special_flag, sizeof(special_flag));
    -00323         m_dev.BulkWrite(write_ep, end, sizeof(end));
    -00324         m_dev.BulkWrite(write_ep, stop, sizeof(stop));
    -00325         try {
    -00326                 m_dev.BulkRead(read_ep, data, 5000);
    -00327                 ddout("IPModem:: Close read packet:\n" << data);
    -00328         }
    -00329         catch( Usb::Timeout &to ) {
    -00330                 // do nothing on timeouts
    -00331                 ddout("IPModem:: Close Read Timeout");
    -00332         }
    -00333         // stop the read thread
    -00334         if( m_continue_reading ) {
    -00335                 m_continue_reading = false;
    -00336                 pthread_join(m_modem_read_thread, NULL);
    -00337         }
    -00338         ddout("IPmodem:: Closed!");
    -00339 
    -00340 }
    -00341 
    -00342 }} // namespace Barry::Mode
    -00343 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__ipmodem_8h.html barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8h.html --- barry-0.14/doc/www/doxygen/html/m__ipmodem_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: m_ipmodem.h File Reference - - - - - - - -

    m_ipmodem.h File Reference


    Detailed Description

    -Mode class for GPRS modem mode (using endpoints on modern devices). -

    - -

    -Definition in file m_ipmodem.h. -

    -#include "dll.h"
    -#include "modem.h"
    -#include "usbwrap.h"
    -#include "data.h"
    -#include "pppfilter.h"
    -#include <pthread.h>
    - -

    -Go to the source code of this file. - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Classes

    class  Barry::Mode::IpModem
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__ipmodem_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8h-source.html --- barry-0.14/doc/www/doxygen/html/m__ipmodem_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__ipmodem_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - -Barry: m_ipmodem.h Source File - - - - - - - -

    m_ipmodem.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_ipmodem.h
    -00003 ///             Mode class for GPRS modem mode (using endpoints on
    -00004 ///             modern devices)
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_M_IPMODEM_H__
    -00024 #define __BARRY_M_IPMODEM_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "modem.h"
    -00028 #include "usbwrap.h"
    -00029 #include "data.h"
    -00030 #include "pppfilter.h"
    -00031 #include <pthread.h>
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 // forward declarations
    -00036 class Controller;
    -00037 
    -00038 namespace Mode {
    -00039 
    -00040 class BXEXPORT IpModem : public Modem
    -00041 {
    -00042 public:
    -00043         typedef void (*DeviceDataCallback)(void *context, const unsigned char *data, int len);
    -00044 
    -00045 private:
    -00046         Controller &m_con;
    -00047         Usb::Device &m_dev;
    -00048 
    -00049         PppFilter m_filter;                     // used for 0x7e handling
    -00050 
    -00051         // thread data
    -00052         volatile bool m_continue_reading;
    -00053         pthread_t m_modem_read_thread;
    -00054 
    -00055         // external callbacks
    -00056         DeviceDataCallback m_callback;
    -00057         void *m_callback_context;
    -00058 
    -00059         unsigned char m_session_key[8];         // = { 0x00, 0, 0, 0, 0, 0, 0, 0 };
    -00060 
    -00061 private:
    -00062         BXLOCAL bool SendPassword(const char *password = 0);
    -00063 
    -00064 protected:
    -00065         static void *DataReadThread(void *userptr);
    -00066 
    -00067 public:
    -00068         IpModem(Controller &con, DeviceDataCallback callback, void *callback_context);
    -00069         ~IpModem();
    -00070 
    -00071         //////////////////////////////////
    -00072         // general operations
    -00073         void Open(const char *password = 0);
    -00074         void Close();
    -00075 
    -00076         //////////////////////////////////
    -00077         // UsbSerData mode - modem specific
    -00078 
    -00079 //      void Read(Data &data, int timeout); // can be called from separate thread
    -00080         void Write(const Data &data, int timeout = -1);
    -00081 };
    -00082 
    -00083 }} // namespace Barry::Mode
    -00084 
    -00085 #endif
    -00086 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/modem_8h.html barry-0.0.20110506/doc/www/doxygen/html/modem_8h.html --- barry-0.14/doc/www/doxygen/html/modem_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/modem_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: modem.h File Reference - - - - - - - -

    modem.h File Reference


    Detailed Description

    -Modem API base class for the various serial/modem modes available on the Blackberry. -

    - -

    -Definition in file modem.h. -

    -#include "dll.h"
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Modem
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/modem_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/modem_8h-source.html --- barry-0.14/doc/www/doxygen/html/modem_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/modem_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - -Barry: modem.h Source File - - - - - - - -

    modem.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       modem.h
    -00003 ///             Modem API base class for the various serial/modem
    -00004 ///             modes available on the Blackberry.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_MODEM_H__
    -00024 #define __BARRY_MODEM_H__
    -00025 
    -00026 #include "dll.h"
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 class Data;
    -00031 
    -00032 class BXEXPORT Modem
    -00033 {
    -00034 public:
    -00035         virtual ~Modem() {}
    -00036 
    -00037         virtual void Open(const char *password = 0) = 0;
    -00038         virtual void Close() = 0;
    -00039         virtual void Write(const Data &data, int timeout = -1) = 0;
    -00040 };
    -00041 
    -00042 }
    -00043 
    -00044 #endif
    -00045 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/modules.html barry-0.0.20110506/doc/www/doxygen/html/modules.html --- barry-0.14/doc/www/doxygen/html/modules.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/modules.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ - - -Barry: Module Index - - - - - -

    Barry Modules

    Here is a list of all modules: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__serial_8cc.html barry-0.0.20110506/doc/www/doxygen/html/m__serial_8cc.html --- barry-0.14/doc/www/doxygen/html/m__serial_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__serial_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: m_serial.cc File Reference - - - - - - - -

    m_serial.cc File Reference


    Detailed Description

    -Mode class for serial / GPRS modem mode. -

    - -

    -Definition in file m_serial.cc. -

    -#include "m_serial.h"
    -#include "controller.h"
    -#include "protostructs.h"
    -#include "endian.h"
    -#include "debug.h"
    -#include <stdexcept>
    - -

    -Go to the source code of this file. - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__serial_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/m__serial_8cc-source.html --- barry-0.14/doc/www/doxygen/html/m__serial_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__serial_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ - - -Barry: m_serial.cc Source File - - - - - - - -

    m_serial.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_serial.cc
    -00003 ///             Mode class for serial / GPRS modem mode
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "m_serial.h"
    -00023 #include "controller.h"
    -00024 #include "protostructs.h"
    -00025 #include "endian.h"
    -00026 #include "debug.h"
    -00027 #include <stdexcept>
    -00028 
    -00029 namespace Barry { namespace Mode {
    -00030 
    -00031 //////////////////////////////////////////////////////////////////////////////
    -00032 // Mode::Serial class
    -00033 
    -00034 Serial::Serial( Controller &con,
    -00035                 DeviceDataCallback callback,
    -00036                 void *callback_context)
    -00037         : m_con(con)
    -00038         , m_ModeSocket(0)
    -00039         , m_CtrlSocket(0)
    -00040         , m_callback(callback)
    -00041         , m_callback_context(callback_context)
    -00042 {
    -00043         if( !m_con.HasQueue() )
    -00044                 throw std::logic_error("A SocketRoutingQueue is required in the Controller class when using Mode::Serial.");
    -00045 }
    -00046 
    -00047 Serial::~Serial()
    -00048 {
    -00049 }
    -00050 
    -00051 
    -00052 //////////////////////////////////////////////////////////////////////////////
    -00053 // protected API / static functions
    -00054 
    -00055 void Serial::DataCallback(void *context, Data *data)
    -00056 {
    -00057         ddout("Serial::DataCallback called");
    -00058 
    -00059         Serial *ser = (Serial*) context;
    -00060 
    -00061         if( data->GetSize() <= 4 )
    -00062                 return; // nothing to do
    -00063 
    -00064         // call callback if available
    -00065         if( ser->m_callback ) {
    -00066                 (*ser->m_callback)(ser->m_callback_context,
    -00067                         data->GetData() + 4,
    -00068                         data->GetSize() - 4);
    -00069         }
    -00070 //      else {
    -00071 //              // append data to readCache
    -00072 //              FIXME;
    -00073 //      }
    -00074 }
    -00075 
    -00076 void Serial::CtrlCallback(void *context, Data *data)
    -00077 {
    -00078 //      Serial *ser = (Serial*) context;
    -00079 
    -00080         // just dump to stdout, and do nothing
    -00081         ddout("CtrlCallback received:\n" << *data);
    -00082 }
    -00083 
    -00084 //////////////////////////////////////////////////////////////////////////////
    -00085 // public API
    -00086 
    -00087 void Serial::Open(const char *password)
    -00088 {
    -00089         if( m_ModeSocket ) {
    -00090                 m_data->Close();
    -00091                 m_data.reset();
    -00092                 m_ModeSocket = 0;
    -00093         }
    -00094 
    -00095         if( m_CtrlSocket ) {
    -00096                 m_ctrl->Close();
    -00097                 m_ctrl.reset();
    -00098                 m_CtrlSocket = 0;
    -00099         }
    -00100 
    -00101         m_ModeSocket = m_con.SelectMode(Controller::UsbSerData);
    -00102         m_data = m_con.m_zero.Open(m_ModeSocket, password);
    -00103 
    -00104         m_CtrlSocket = m_con.SelectMode(Controller::UsbSerCtrl);
    -00105         m_ctrl = m_con.m_zero.Open(m_CtrlSocket, password);
    -00106 
    -00107         // register callback for incoming data, for speed
    -00108         m_data->RegisterInterest(DataCallback, this);
    -00109         m_ctrl->RegisterInterest(CtrlCallback, this);
    -00110 
    -00111         const unsigned char start[] =
    -00112                 { 0, 0, 0x0a, 0, 0x01, 0x01, 0xc2, 0x00, 0x40, 0x00 };
    -00113         Data block(start, sizeof(start));
    -00114         m_ctrl->Send(block);
    -00115 }
    -00116 
    -00117 void Serial::Close()
    -00118 {
    -00119         ddout("Serial:: Closing connection.");
    -00120 }
    -00121 
    -00122 /*
    -00123 // FIXME - if this behaviour is truly common between modes, create
    -00124 // a common base class for this.
    -00125 void Serial::RetryPassword(const char *password)
    -00126 {
    -00127         if( m_data.get() || m_ctrl.get() )
    -00128                 throw std::logic_error("Socket already open in Serial::RetryPassword");
    -00129 
    -00130         m_data = m_con.m_zero.OpenDBSocket(m_ModeSocket, password);
    -00131         m_ctrl = m_con.m_zero.OpenDBSocket(m_CtrlSocket, password);
    -00132 
    -00133         // register callback for incoming data, for speed
    -00134         m_data->RegisterInterest(DataCallback, this);
    -00135 }
    -00136 */
    -00137 
    -00138 /*
    -00139 // can be called from separate thread
    -00140 void Serial::SerialRead(Data &data, int timeout)
    -00141 {
    -00142         m_socket.Receive(data, timeout);
    -00143 }
    -00144 */
    -00145 
    -00146 void Serial::Write(const Data &data, int timeout)
    -00147 {
    -00148         if( data.GetSize() <= 0 )
    -00149                 return; // nothing to do
    -00150 
    -00151         if( !m_data.get() )
    -00152                 throw std::logic_error("Must call Open() before Write() in Mode::Serial");
    -00153 
    -00154         // filter data for PPP, and prepend 4 bytes
    -00155         Data &filtered = m_filter.Write(data, 4);
    -00156 
    -00157         // setup header (only size needed, as socket will be set by socket class)
    -00158         unsigned char *buf = filtered.GetBuffer();
    -00159         MAKE_PACKETPTR_BUF(spack, buf);
    -00160         spack->size = htobs(filtered.GetSize());
    -00161 
    -00162         // send via appropriate socket
    -00163         m_data->Send(filtered, timeout);
    -00164 }
    -00165 
    -00166 }} // namespace Barry::Mode
    -00167 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__serial_8h.html barry-0.0.20110506/doc/www/doxygen/html/m__serial_8h.html --- barry-0.14/doc/www/doxygen/html/m__serial_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__serial_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: m_serial.h File Reference - - - - - - - -

    m_serial.h File Reference


    Detailed Description

    -Mode class for serial / GPRS modem mode. -

    - -

    -Definition in file m_serial.h. -

    -#include "dll.h"
    -#include "modem.h"
    -#include "socket.h"
    -#include "data.h"
    -#include "pppfilter.h"
    - -

    -Go to the source code of this file. - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Classes

    class  Barry::Mode::Serial
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/m__serial_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/m__serial_8h-source.html --- barry-0.14/doc/www/doxygen/html/m__serial_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/m__serial_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: m_serial.h Source File - - - - - - - -

    m_serial.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       m_serial.h
    -00003 ///             Mode class for serial / GPRS modem mode
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_M_SERIAL_H__
    -00023 #define __BARRY_M_SERIAL_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "modem.h"
    -00027 #include "socket.h"
    -00028 #include "data.h"
    -00029 #include "pppfilter.h"
    -00030 
    -00031 namespace Barry {
    -00032 
    -00033 // forward declarations
    -00034 class Controller;
    -00035 
    -00036 namespace Mode {
    -00037 
    -00038 class BXEXPORT Serial : public Modem
    -00039 {
    -00040 public:
    -00041         typedef void (*DeviceDataCallback)(void *context, const unsigned char *data, int len);
    -00042 
    -00043 private:
    -00044         Controller &m_con;
    -00045 
    -00046         SocketHandle m_data;
    -00047         SocketHandle m_ctrl;
    -00048 
    -00049         uint16_t m_ModeSocket;                  // socket recommended by device
    -00050                                                 // when mode was selected
    -00051         uint16_t m_CtrlSocket;
    -00052 
    -00053         // PPP filtering
    -00054         PppFilter m_filter;
    -00055 
    -00056         // UsbSerData cache
    -00057 //      Data m_readCache;
    -00058 
    -00059         // external callbacks
    -00060         DeviceDataCallback m_callback;
    -00061         void *m_callback_context;
    -00062 
    -00063 protected:
    -00064         static void DataCallback(void *context, Data *data);
    -00065         static void CtrlCallback(void *context, Data *data);
    -00066 
    -00067 public:
    -00068         Serial(Controller &con, DeviceDataCallback callback, void *callback_context);
    -00069         ~Serial();
    -00070 
    -00071         //////////////////////////////////
    -00072         // general operations
    -00073         void Open(const char *password = 0);    // FIXME password needed?  if not,
    -00074                                                 // then we can remove it from
    -00075                                                 // the Modem base class
    -00076         void Close();
    -00077         void RetryPassword(const char *password);
    -00078 
    -00079         //////////////////////////////////
    -00080         // UsbSerData mode - modem specific
    -00081 
    -00082 //      void Read(Data &data, int timeout); // can be called from separate thread
    -00083         void Write(const Data &data, int timeout = -1);
    -00084 };
    -00085 
    -00086 }} // namespace Barry::Mode
    -00087 
    -00088 #endif
    -00089 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceBarry_1_1Mode.html barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry_1_1Mode.html --- barry-0.14/doc/www/doxygen/html/namespaceBarry_1_1Mode.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry_1_1Mode.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::Mode Namespace Reference - - - - - - - -

    Barry::Mode Namespace Reference

    -

    - -

    - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Desktop
     The main interface class to the device databases. More...
    class  IpModem
    class  Serial

    Variables

    -const char special_flag [] = { 0x78, 0x56, 0x34, 0x12 }
    -const char start [] = { 0x01, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -const char pw_start [] = { 0x01, 0, 0, 0, 1, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -const char stop [] = { 0x01, 0, 0, 0, 0, 0, 0, 0, 0x78, 0x56, 0x34, 0x12 }
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceBarry_1_1Protocol.html barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry_1_1Protocol.html --- barry-0.14/doc/www/doxygen/html/namespaceBarry_1_1Protocol.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry_1_1Protocol.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,101 +0,0 @@ - - -Barry: Barry::Protocol Namespace Reference - - - - - - - -

    Barry::Protocol Namespace Reference

    -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    union  SizePacket
    struct  GroupLink
    struct  MessageAddress
    struct  CommonField
    struct  CommandTableField
    struct  OldDBDBField
    struct  DBDBField
    struct  RecordStateTableField
    struct  CalendarRecurrenceDataField
    struct  PackedField_02
    struct  PackedField_10
    struct  ServiceBookConfigField
    struct  DBC_Record
    struct  DBC_RecordFlags
    struct  DBC_TaggedUpload
    struct  DBC_IndexedUpload
    struct  PasswordChallenge
    struct  AttributeFetch
    struct  ModeSelect
    struct  SocketCommand
    struct  SequenceCommand
    struct  DBCommand
    struct  DBR_OldDBDBRecord
    struct  DBR_DBDBRecord
    struct  DBR_OldTaggedRecord
    struct  MessageRecord
    struct  DBResponse
    struct  DBAccess
    struct  Packet

    Functions

    -void CheckSize (const Data &packet, size_t requiredsize)
    -unsigned int GetSize (const Data &packet)
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceBarry.html barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry.html --- barry-0.14/doc/www/doxygen/html/namespaceBarry.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceBarry.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ - - -Barry: Barry Namespace Reference - - - - - - -

    Barry Namespace Reference


    Detailed Description

    -Project namespace, containing all related functions and classes. -

    -This is the only namespace applications should be concerned with, for now. -

    - -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Builder
     Base class for the builder functor hierarchy. More...
    class  RecordBuilder
     Template class for easy creation of specific protocol packet builder objects. More...
    class  RecordFetch
     Generic record fetch class, to help with using records without builder classes. More...
    class  Controller
     The main interface class. More...
    class  Data
    class  Diff
    class  DataQueue
     This class provides a thread aware fifo queue for Data objects, providing memory management for all Data object pointers it contains. More...
    class  Error
     The base class for any future derived exceptions. More...
    class  BadPassword
     A bad or unknown password when talking to the device. More...
    class  BadData
     Thrown by record classes if their data is invalid and cannot be uploaded to the Blackberry. More...
    class  BadSize
     Unexpected packet size, or not enough data. More...
    class  ErrnoError
     System error that provides an errno error code. More...
    class  ContactLdif
     Class for generating LDIF output based on a Barry::Contact record object. More...
    class  LogLock
     RAII locking class used to protect the logStream passed into Barry::Init() (common.h). More...
    class  Modem
    class  Packet
    class  ZeroPacket
     Provides an API for building and analyzing socket-0 protocol packets. More...
    class  DBPacket
     Provides an API for building and analyzing raw DB protocol packets. More...
    class  Parser
     Base class for the parser hierarchy. More...
    class  RecordParser
     Template class for easy creation of specific parser objects. More...
    class  PppFilter
    struct  ProbeResult
    class  Probe
    class  Calendar
    struct  ContactGroupLink
    class  Contact
    class  Folder
    class  Memo
    class  Message
    class  PINMessage
    class  SavedMessage
    class  ServiceBookConfig
    class  ServiceBook
    class  Task
    class  Timezone
    struct  FieldLink
    struct  CommandTableCommand
    class  CommandTable
    struct  RecordStateTableState
    class  RecordStateTable
    struct  DatabaseItem
    class  DatabaseDatabase
    struct  UnknownData
    struct  UnknownField
    struct  EmailAddress
    struct  PostalAddress
    struct  Date
    class  SocketRoutingQueue
    class  DataHandle
     std::auto_ptr like class that handles pointers to Data, but instead of freeing them completely, the Data objects are turned to the SocketRoutingQueue from whence they came. More...
    class  scoped_lock
    struct  SHA_CTX
    class  SocketZero
    class  Socket
     Encapsulates a "logical socket" in the Blackberry USB protocol. More...
    struct  TimeZone

    Namespaces

    namespace  Mode
    namespace  Protocol

    Typedefs

    -typedef std::vector< std::string > CategoryList
    -typedef std::auto_ptr< SocketSocketHandle
    -typedef long min1900_t

    Functions

    void Init (bool data_dump_mode, std::ostream *logStream)
     See also the LogLock class.
    -bool IsHexData (const std::string &s)
    -istream & operator>> (istream &is, Data &data)
    -ostream & operator<< (ostream &os, const Data &data)
    -ostream & operator<< (ostream &os, const Diff &diff)
    -bool LoadDataArray (const string &filename, std::vector< Data > &array)
    -bool ReadDataArray (std::istream &is, std::vector< Data > &array)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const ContactLdif &ldif)
    -bool LogVerbose ()
    -std::ostream * GetLogStream ()
    -std::ostream & operator<< (std::ostream &os, const ProbeResult &pr)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Calendar &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Contact &contact)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Folder &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Memo &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Message &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const PINMessage &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const SavedMessage &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const ServiceBookConfig &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const ServiceBook &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Task &msg)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const Timezone &msg)
    -template<class RecordT>
    const unsigned char * ParseCommonFields (RecordT &rec, const void *begin, const void *end)
    -template<class SizeT>
    SizeT ConvertHtoB (SizeT s)
    -void BuildField1900 (Data &data, size_t &size, uint8_t type, time_t t)
    -void BuildField (Data &data, size_t &size, uint8_t type, char c)
    -void BuildField (Data &data, size_t &size, uint8_t type, uint16_t value)
    -void BuildField (Data &data, size_t &size, uint8_t type, const std::string &str)
    -void BuildField (Data &data, size_t &size, uint8_t type, const void *buf, size_t bufsize)
    -void BuildField (Data &data, size_t &size, const Barry::UnknownField &field)
    -void BuildField (Data &data, size_t &size, uint8_t type, const Barry::Protocol::GroupLink &link)
    -std::string ParseFieldString (const Barry::Protocol::CommonField *field)
    -std::string ParseFieldString (const void *data, uint16_t maxlen)
    -std::ostream & operator<< (std::ostream &os, const std::vector< UnknownField > &unknowns)
    -std::ostream & operator<< (std::ostream &os, const EmailAddress &msga)
    -std::ostream & operator<< (std::ostream &os, const PostalAddress &post)
    -std::ostream & operator<< (std::ostream &os, const Date &date)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const CommandTable &command)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const RecordStateTable &rst)
    -BXEXPORT std::ostream & operator<< (std::ostream &os, const DatabaseDatabase &dbdb)
    -void SHA1 (const void *dataIn, int len, unsigned char *hashout)
    -void SHA1_Init (SHA_CTX *ctx)
    -void SHA1_Update (SHA_CTX *ctx, const void *_dataIn, int len)
    -void SHA1_Final (unsigned char hashout[20], SHA_CTX *ctx)
    -min1900_t time2min (time_t t)
    -time_t min2time (min1900_t m)
    const TimeZoneGetTimeZoneTable ()
     Returns a pointer to an array of TimeZone structs.
    const TimeZoneGetTimeZone (unsigned short Code)
     Searches the internal timezone code table for the given Code and returns a pointer to a TimeZone struct found.
    unsigned short GetTimeZoneCode (signed short HourOffset, signed short MinOffset)
     Searches the internal timezone table for the first matching Code.
    time_t DayToDate (unsigned short Day)
     This routine takes the day of the year and returns a time_t adjusted from the first of the year.
    time_t Message2Time (uint16_t r_date, uint16_t r_time)
     Localize the funky math used to convert a Blackberry message timestamp into a time_t.
    const char * Version (int &major, int &minor)
     Fills major and minor with integer version numbers, and returns a string containing human readable version information in English.

    Variables

    -bool __data_dump_mode__
    -std::ostream * LogStream = &std::cout
    -pthread_mutex_t LogStreamMutex
    -bool __data_dump_mode__
    -std::ostream * LogStream
    -bool __data_dump_mode__
    -std::ostream * LogStream
    -pthread_mutex_t LogStreamMutex
    -unsigned char Intro_Sends [][32]
    -unsigned char Intro_Receives [][32]
    -FieldLink< CalendarCalendarFieldLinks []
    -FieldLink< ContactContactFieldLinks []
    -FieldLink< FolderFolderFieldLinks []
    -FieldLink< MemoMemoFieldLinks []
    -FieldLink< MessageMessageFieldLinks []
    -FieldLink< PINMessagePINMessageFieldLinks []
    -FieldLink< SavedMessageSavedMessageFieldLinks []
    -FieldLink< ServiceBookConfigServiceBookConfigFieldLinks []
    -FieldLink< ServiceBookServiceBookFieldLinks []
    -FieldLink< TaskTaskFieldLinks []
    -FieldLink< TimezoneTimezoneFieldLinks []
    -TimeZone Zones []
    -


    Function Documentation

    - -
    -
    - - - - - - - - - -
    BXEXPORT time_t Barry::DayToDate (unsigned short  Day  ) 
    -
    -
    - -

    -This routine takes the day of the year and returns a time_t adjusted from the first of the year. -

    -FIXME This function assumes the year hasn't changed, but I don't have enough information to determine where the year is in this header info -

    -Definition at line 186 of file time.cc. -

    -Referenced by Message2Time(). -

    -

    - -

    -
    - - - - - - - - - -
    BXEXPORT const TimeZone * Barry::GetTimeZone (unsigned short  Code  ) 
    -
    -
    - -

    -Searches the internal timezone code table for the given Code and returns a pointer to a TimeZone struct found. -

    -If the code is not found, a pointer to a valid TimeZone struct is is still returned, but the struct's Code contains TIME_ZONE_CODE_ERR, and the name is "Unknown time zone." The unknown timezone is the same offset as GMT. -

    -Definition at line 149 of file time.cc. -

    -References Barry::TimeZone::Name, TIME_ZONE_CODE_ERR, and Zones. -

    -Referenced by Barry::Calendar::Dump(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    BXEXPORT unsigned short Barry::GetTimeZoneCode (signed short  HourOffset,
    signed short  MinOffset = 0 
    )
    -
    -
    - -

    -Searches the internal timezone table for the first matching Code. -

    -If no matching Code is found, TIME_ZONE_CODE_ERR is returned.

    -This function does not adjust for daylight saving time. -

    -Definition at line 168 of file time.cc. -

    -References Barry::TimeZone::Name, TIME_ZONE_CODE_ERR, and Zones. -

    -Referenced by Barry::Task::Clear(), and Barry::Calendar::Clear(). -

    -

    - -

    -
    - - - - - - - - -
    BXEXPORT const TimeZone * Barry::GetTimeZoneTable (  ) 
    -
    -
    - -

    -Returns a pointer to an array of TimeZone structs. -

    -The last struct contains 0 in all fields, and can be used as an "end of array" marker. -

    -Definition at line 134 of file time.cc. -

    -References Zones. -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    BXEXPORT void Barry::Init (bool  data_dump_mode = false,
    std::ostream *  logStream = &std::cout 
    )
    -
    -
    - -

    -See also the LogLock class. -

    -Call this before anything else. This takes care of initializing the lower level libusb.

    -

    Parameters:
    - - - -
    [in] data_dump_mode If set to true, the protocol conversation will be sent to stdout via the C++ std::cout stream.
    [in] LogStream Pointer to std::ostream object to use for debug output and logging. Defaults to std::cout.
    -
    - -

    -Definition at line 48 of file common.cc. -

    -References __data_dump_mode__, LogStream, and LogStreamMutex. -

    -Referenced by main(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    BXEXPORT time_t Barry::Message2Time (uint16_t  r_date,
    uint16_t  r_time 
    )
    -
    -
    - -

    -Localize the funky math used to convert a Blackberry message timestamp into a time_t. -

    -Both r_date and r_time are expected to be fed in from the Protocol::MessageRecord struct in raw form, without endian conversion. This function handles that. -

    -Definition at line 217 of file time.cc. -

    -References btohs, and DayToDate(). -

    -Referenced by Barry::SavedMessage::ParseHeader(), Barry::PINMessage::ParseHeader(), and Barry::Message::ParseHeader(). -

    -

    - -

    -
    - - - - - - - - - - - - - - - - - - -
    BXEXPORT const char * Barry::Version (int &  major,
    int &  minor 
    )
    -
    -
    - -

    -Fills major and minor with integer version numbers, and returns a string containing human readable version information in English. -

    - -

    -Definition at line 39 of file version.cc. -

    -References BARRY_VERSION_MAJOR, BARRY_VERSION_MINOR, and BARRY_VERSION_STRING. -

    -Referenced by Usage(). -

    -

    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceboost_1_1serialization.html barry-0.0.20110506/doc/www/doxygen/html/namespaceboost_1_1serialization.html --- barry-0.14/doc/www/doxygen/html/namespaceboost_1_1serialization.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceboost_1_1serialization.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - - -Barry: boost::serialization Namespace Reference - - - - - - - -

    boost::serialization Namespace Reference

    -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Functions

    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::UnknownField &uf, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Contact::GroupLink &g, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Contact &c, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::EmailAddress &a, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Message &m, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Calendar &c, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::ServiceBook &c, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Memo &m, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Task &t, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::PINMessage &p, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::SavedMessage &m, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Folder &f, const unsigned int ver)
    -template<class ArchiveT>
    void serialize (ArchiveT &ar, Barry::Timezone &t, const unsigned int ver)
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceboost.html barry-0.0.20110506/doc/www/doxygen/html/namespaceboost.html --- barry-0.14/doc/www/doxygen/html/namespaceboost.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceboost.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - -Barry: boost Namespace Reference - - - - - - -

    boost Namespace Reference

    -

    - -

    - - - - - -

    Namespaces

    namespace  serialization
    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespacemembers_func.html barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_func.html --- barry-0.14/doc/www/doxygen/html/namespacemembers_func.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_func.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -  -

    -

    - c -

    -

    - d -

    -

    - g -

    -

    - i -

    -

    - l -

      -
    • LoadDataArray() -: Barry -
    • LogVerbose() -: Barry -
    -

    - m -

    -

    - o -

    -

    - p -

      -
    • ParseCommonFields() -: Barry -
    -

    - r -

      -
    • ReadDataArray() -: Barry -
    -

    - s -

    -

    - t -

    -

    - v -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespacemembers.html barry-0.0.20110506/doc/www/doxygen/html/namespacemembers.html --- barry-0.14/doc/www/doxygen/html/namespacemembers.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespacemembers.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ - - -Barry: Class Members - - - - - - - -
    - -
    - -

    -Here is a list of all documented namespace members with links to the namespaces they belong to: -

    -

    - _ -

      -
    • __data_dump_mode__ -: Barry -
    -

    - c -

    -

    - d -

      -
    • DayToDate() -: Barry -
    • DeviceHandleType -: Usb -
    • DeviceIDType -: Usb -
    -

    - f -

      -
    • FolderFieldLinks -: Barry -
    -

    - g -

    -

    - i -

    -

    - l -

    -

    - m -

    -

    - o -

    -

    - p -

    -

    - r -

      -
    • ReadDataArray() -: Barry -
    -

    - s -

    -

    - t -

      -
    • TaskFieldLinks -: Barry -
    • time2min() -: Barry -
    • TimezoneFieldLinks -: Barry -
    -

    - v -

    -

    - z -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespacemembers_type.html barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_type.html --- barry-0.14/doc/www/doxygen/html/namespacemembers_type.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_type.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - -Barry: Class Members - - - - - - - -  -

    -

      -
    • CategoryList -: Barry -
    • DeviceHandleType -: Usb -
    • DeviceIDType -: Usb -
    • min1900_t -: Barry -
    • SocketHandle -: Barry -
    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespacemembers_vars.html barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_vars.html --- barry-0.14/doc/www/doxygen/html/namespacemembers_vars.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespacemembers_vars.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ - - -Barry: Class Members - - - - - - - -  -

    -

    -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaces.html barry-0.0.20110506/doc/www/doxygen/html/namespaces.html --- barry-0.14/doc/www/doxygen/html/namespaces.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaces.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Namespace Index - - - - - - -

    Barry Namespace List

    Here is a list of all documented namespaces with brief descriptions: - - - - - - -
    BarryProject namespace, containing all related functions and classes
    Barry::Mode
    Barry::Protocol
    boost
    boost::serialization
    UsbNamespace for the libusb-related wrapper classes
    -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/namespaceUsb.html barry-0.0.20110506/doc/www/doxygen/html/namespaceUsb.html --- barry-0.14/doc/www/doxygen/html/namespaceUsb.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/namespaceUsb.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ - - -Barry: Usb Namespace Reference - - - - - - -

    Usb Namespace Reference


    Detailed Description

    -Namespace for the libusb-related wrapper classes. -

    -This namespace may change in the future. -

    - -

    - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Classes

    class  Error
     Thrown on low level USB errors. More...
    class  Timeout
    class  Match
    class  Device
    class  Interface
    struct  EndpointPair
    class  EndpointDiscovery
    struct  InterfaceDesc
    class  InterfaceDiscovery
    struct  ConfigDesc
    class  ConfigDiscovery
    class  DeviceDiscovery

    Typedefs

    typedef usb_device * DeviceIDType
     Typedefs used by the wrapper class, in the hope to make it easier to switch from libusb stable to devel and back.
    -typedef usb_dev_handle * DeviceHandleType
    -


    Typedef Documentation

    - -
    -
    - - - - -
    typedef struct usb_device* Usb::DeviceIDType
    -
    -
    - -

    -Typedefs used by the wrapper class, in the hope to make it easier to switch from libusb stable to devel and back. -

    - -

    -Definition at line 68 of file usbwrap.h. -

    -

    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/packet_8cc.html barry-0.0.20110506/doc/www/doxygen/html/packet_8cc.html --- barry-0.14/doc/www/doxygen/html/packet_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/packet_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ - - -Barry: packet.cc File Reference - - - - - - - -

    packet.cc File Reference


    Detailed Description

    -Low level protocol packet builder class. -

    -Has knowledge of specific protocol commands in order to hide protocol details behind an API. -

    -Definition in file packet.cc. -

    -#include "packet.h"
    -#include "m_desktop.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "endian.h"
    -#include "parser.h"
    -#include "builder.h"
    -#include "error.h"
    -#include <string.h>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/packet_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/packet_8cc-source.html --- barry-0.14/doc/www/doxygen/html/packet_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/packet_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,516 +0,0 @@ - - -Barry: packet.cc Source File - - - - - - - -

    packet.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       packet.cc
    -00003 ///             Low level protocol packet builder class.
    -00004 ///             Has knowledge of specific protocol commands in order
    -00005 ///             to hide protocol details behind an API.
    -00006 ///
    -00007 
    -00008 /*
    -00009     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #include "packet.h"
    -00025 #include "m_desktop.h"
    -00026 #include "protocol.h"
    -00027 #include "protostructs.h"
    -00028 #include "data.h"
    -00029 #include "endian.h"
    -00030 #include "parser.h"
    -00031 #include "builder.h"
    -00032 #include "error.h"
    -00033 #include <string.h>
    -00034 
    -00035 #define __DEBUG_MODE__
    -00036 #include "debug.h"
    -00037 
    -00038 
    -00039 namespace Barry {
    -00040 
    -00041 //////////////////////////////////////////////////////////////////////////////
    -00042 // Packet base class
    -00043 
    -00044 //
    -00045 // Command
    -00046 //
    -00047 /// Returns the command value of the receive packet.  If receive isn't
    -00048 /// large enough, throws Error.
    -00049 ///
    -00050 unsigned int Packet::Command() const
    -00051 {
    -00052         Protocol::CheckSize(m_receive);
    -00053         MAKE_PACKET(rpack, m_receive);
    -00054         return rpack->command;
    -00055 }
    -00056 
    -00057 
    -00058 //////////////////////////////////////////////////////////////////////////////
    -00059 // ZeroPacket class
    -00060 
    -00061 ZeroPacket::ZeroPacket(Data &send, Data &receive)
    -00062         : Packet(send, receive)
    -00063 {
    -00064 }
    -00065 
    -00066 ZeroPacket::~ZeroPacket()
    -00067 {
    -00068 }
    -00069 
    -00070 //
    -00071 // GetAttribute
    -00072 //
    -00073 /// Builds a command packet for the initial socket-0 handshakes
    -00074 /// that fetch certain (some unknown) attributes.  The attributes
    -00075 /// appear to exist in an object/attribute sequence, so that's
    -00076 /// how we address them here.
    -00077 ///
    -00078 void ZeroPacket::GetAttribute(unsigned int object, unsigned int attribute)
    -00079 {
    -00080         size_t size = SB_SOCKET_PACKET_HEADER_SIZE + ATTRIBUTE_FETCH_COMMAND_SIZE;
    -00081         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size));
    -00082         Protocol::Packet &packet = *cpack;
    -00083 
    -00084         packet.socket = 0;
    -00085         packet.size = htobs(size);
    -00086         packet.command = SB_COMMAND_FETCH_ATTRIBUTE;
    -00087         packet.u.socket.socket = htobs(0x00ff); // default non-socket request
    -00088         packet.u.socket.sequence = 0;           // filled in by Socket class
    -00089         packet.u.socket.u.fetch.object = htobs(object);
    -00090         packet.u.socket.u.fetch.attribute = htobs(attribute);
    -00091 
    -00092         m_send.ReleaseBuffer(size);
    -00093 }
    -00094 
    -00095 unsigned int ZeroPacket::ObjectID() const
    -00096 {
    -00097         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE);
    -00098         MAKE_PACKET(rpack, m_receive);
    -00099         return btohs(rpack->u.socket.u.fetch.object);
    -00100 }
    -00101 
    -00102 unsigned int ZeroPacket::AttributeID() const
    -00103 {
    -00104         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE);
    -00105         MAKE_PACKET(rpack, m_receive);
    -00106         return btohs(rpack->u.socket.u.fetch.attribute);
    -00107 }
    -00108 
    -00109 uint32_t ZeroPacket::ChallengeSeed() const
    -00110 {
    -00111         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE +
    -00112                 PASSWORD_CHALLENGE_SEED_SIZE);
    -00113         MAKE_PACKET(rpack, m_receive);
    -00114         return btohl(rpack->u.socket.u.password.u.seed);
    -00115 }
    -00116 
    -00117 unsigned int ZeroPacket::RemainingTries() const
    -00118 {
    -00119         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE +
    -00120                 PASSWORD_CHALLENGE_HEADER_SIZE);
    -00121         MAKE_PACKET(rpack, m_receive);
    -00122         // this is a byte, so no byte swapping needed
    -00123         return rpack->u.socket.u.password.remaining_tries;
    -00124 }
    -00125 
    -00126 unsigned int ZeroPacket::SocketResponse() const
    -00127 {
    -00128         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE);
    -00129         MAKE_PACKET(rpack, m_receive);
    -00130         return btohs(rpack->u.socket.socket);
    -00131 }
    -00132 
    -00133 unsigned char ZeroPacket::SocketSequence() const
    -00134 {
    -00135         Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE);
    -00136         MAKE_PACKET(rpack, m_receive);
    -00137         return rpack->u.socket.sequence;        // sequence is a byte
    -00138 }
    -00139 
    -00140 
    -00141 
    -00142 //////////////////////////////////////////////////////////////////////////////
    -00143 // DBPacket class
    -00144 
    -00145 DBPacket::DBPacket(Mode::Desktop &con, Data &send, Data &receive)
    -00146         : Packet(send, receive)
    -00147         , m_con(con)
    -00148         , m_last_dbop(0)
    -00149 {
    -00150 }
    -00151 
    -00152 DBPacket::~DBPacket()
    -00153 {
    -00154 }
    -00155 
    -00156 //
    -00157 // ClearDatabase
    -00158 //
    -00159 /// Builds a command packet for the CLEAR_DATABASE command code, placing
    -00160 /// the data in the send buffer.
    -00161 ///
    -00162 void DBPacket::ClearDatabase(unsigned int dbId)
    -00163 {
    -00164         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9));
    -00165         Protocol::Packet &packet = *cpack;
    -00166 
    -00167         // socket class should override this for us
    -00168 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00169         packet.size = htobs(9);
    -00170         packet.command = SB_COMMAND_DB_DATA;
    -00171         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00172         packet.u.db.u.command.operation = SB_DBOP_CLEAR_DATABASE;
    -00173         packet.u.db.u.command.databaseId = htobs(dbId);
    -00174 
    -00175         m_send.ReleaseBuffer(9);
    -00176 
    -00177         m_last_dbop = SB_DBOP_CLEAR_DATABASE;
    -00178 }
    -00179 
    -00180 //
    -00181 // GetDBDB
    -00182 //
    -00183 /// Builds a command packet for the GET_DBDB command code, placing the
    -00184 /// data in m_send.
    -00185 ///
    -00186 void DBPacket::GetDBDB()
    -00187 {
    -00188         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(7));
    -00189         Protocol::Packet &packet = *cpack;
    -00190 
    -00191         // socket class should override this for us
    -00192 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00193         packet.size = htobs(7);
    -00194         packet.command = SB_COMMAND_DB_DATA;
    -00195         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00196 //      packet.u.db.u.command.operation = SB_DBOP_GET_DBDB;
    -00197         packet.u.db.u.command.operation = SB_DBOP_OLD_GET_DBDB;
    -00198 
    -00199         m_send.ReleaseBuffer(7);
    -00200 
    -00201         m_last_dbop = SB_DBOP_OLD_GET_DBDB;
    -00202 }
    -00203 
    -00204 //
    -00205 // GetRecordStateTable
    -00206 //
    -00207 /// Builds a command packet in the send buffer for the
    -00208 /// GET_RECORD_STATE_TABLE command.
    -00209 ///
    -00210 void DBPacket::GetRecordStateTable(unsigned int dbId)
    -00211 {
    -00212         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9));
    -00213         Protocol::Packet &packet = *cpack;
    -00214 
    -00215         // socket class should override this for us
    -00216 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00217         packet.size = htobs(9);
    -00218         packet.command = SB_COMMAND_DB_DATA;
    -00219         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00220         packet.u.db.u.command.operation = SB_DBOP_GET_RECORD_STATE_TABLE;
    -00221         packet.u.db.u.command.databaseId = htobs(dbId);
    -00222 
    -00223         m_send.ReleaseBuffer(9);
    -00224 
    -00225         m_last_dbop = SB_DBOP_GET_RECORD_STATE_TABLE;
    -00226 }
    -00227 
    -00228 //
    -00229 // SetRecordFlags
    -00230 //
    -00231 /// Builds a command packet in the send buffer for the SET_RECORD_FLAGS
    -00232 /// command code.
    -00233 ///
    -00234 /// FIXME - this API call is incomplete, since there are unknown flags
    -00235 ///         in the SetRecordFlags protocol packet.  Currently it is only
    -00236 ///         used to set all flags to zero.
    -00237 ///
    -00238 void DBPacket::SetRecordFlags(unsigned int dbId, unsigned int stateTableIndex,
    -00239                             uint8_t flag1)
    -00240 {
    -00241         size_t size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_RECORD_FLAGS_SIZE;
    -00242         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size));
    -00243         Protocol::Packet &packet = *cpack;
    -00244 
    -00245         // socket class should override this for us
    -00246 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00247         packet.size = htobs(size);
    -00248         packet.command = SB_COMMAND_DB_DATA;
    -00249         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00250         packet.u.db.u.command.operation = SB_DBOP_SET_RECORD_FLAGS;
    -00251         packet.u.db.u.command.databaseId = htobs(dbId);
    -00252         packet.u.db.u.command.u.flags.unknown = flag1;
    -00253         packet.u.db.u.command.u.flags.index = htobs(stateTableIndex);
    -00254         memset(packet.u.db.u.command.u.flags.unknown2, 0, sizeof(packet.u.db.u.command.u.flags.unknown2));
    -00255 
    -00256         m_send.ReleaseBuffer(size);
    -00257 
    -00258         m_last_dbop = SB_DBOP_SET_RECORD_FLAGS;
    -00259 }
    -00260 
    -00261 //
    -00262 // DeleteRecordByIndex
    -00263 //
    -00264 /// Builds a command packet in the send buffer for the DELETE_RECORD_BY_INDEX
    -00265 /// command code.
    -00266 ///
    -00267 void DBPacket::DeleteRecordByIndex(unsigned int dbId, unsigned int stateTableIndex)
    -00268 {
    -00269         size_t size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_RECORD_HEADER_SIZE;
    -00270         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size));
    -00271         Protocol::Packet &packet = *cpack;
    -00272 
    -00273         // socket class should override this for us
    -00274 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00275         packet.size = htobs(size);
    -00276         packet.command = SB_COMMAND_DB_DATA;
    -00277         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00278         packet.u.db.u.command.operation = SB_DBOP_DELETE_RECORD_BY_INDEX;
    -00279         packet.u.db.u.command.databaseId = htobs(dbId);
    -00280         packet.u.db.u.command.u.record.recordIndex = htobs(stateTableIndex);
    -00281 
    -00282         m_send.ReleaseBuffer(size);
    -00283 
    -00284         m_last_dbop = SB_DBOP_DELETE_RECORD_BY_INDEX;
    -00285 }
    -00286 
    -00287 //
    -00288 // GetRecordByIndex
    -00289 //
    -00290 /// Builds a command packet in the send buffer for the GET_RECORD_BY_INDEX
    -00291 /// command code.
    -00292 ///
    -00293 void DBPacket::GetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex)
    -00294 {
    -00295         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(11));
    -00296         Protocol::Packet &packet = *cpack;
    -00297 
    -00298         // socket class should override this for us
    -00299 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00300         packet.size = htobs(11);
    -00301         packet.command = SB_COMMAND_DB_DATA;
    -00302         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00303         packet.u.db.u.command.operation = SB_DBOP_GET_RECORD_BY_INDEX;
    -00304         packet.u.db.u.command.databaseId = htobs(dbId);
    -00305         packet.u.db.u.command.u.record.recordIndex = htobs(stateTableIndex);
    -00306 
    -00307         m_send.ReleaseBuffer(11);
    -00308 
    -00309         m_last_dbop = SB_DBOP_GET_RECORD_BY_INDEX;
    -00310 }
    -00311 
    -00312 //
    -00313 // SetRecordByIndex
    -00314 //
    -00315 /// Builds a command packet in the m_send buffer for the SET_RECORD_BY_INDEX
    -00316 /// command code.
    -00317 ///
    -00318 /// \return     bool
    -00319 ///             - true means success
    -00320 ///             - false means no data available from Builder object
    -00321 ///
    -00322 bool DBPacket::SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex,
    -00323                               Builder &build)
    -00324 {
    -00325         // get new data if available
    -00326         if( !build.Retrieve(dbId) )
    -00327                 return false;
    -00328 
    -00329         // build packet data
    -00330         size_t header_size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_INDEXED_UPLOAD_HEADER_SIZE;
    -00331         build.BuildFields(m_send, header_size);
    -00332         size_t total_size = m_send.GetSize();
    -00333 
    -00334         // fill in the header values
    -00335         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(total_size));
    -00336         Protocol::Packet &packet = *cpack;
    -00337 
    -00338         // socket class should override this for us
    -00339 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00340         packet.size = htobs(total_size);
    -00341         packet.command = SB_COMMAND_DB_DATA;
    -00342         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00343         packet.u.db.u.command.operation = SB_DBOP_SET_RECORD_BY_INDEX;
    -00344         packet.u.db.u.command.databaseId = htobs(dbId);
    -00345         packet.u.db.u.command.u.index_upload.unknown = 0;
    -00346         packet.u.db.u.command.u.index_upload.index = htobs(stateTableIndex);
    -00347 
    -00348         m_send.ReleaseBuffer(total_size);
    -00349 
    -00350         m_last_dbop = SB_DBOP_SET_RECORD_BY_INDEX;
    -00351         return true;
    -00352 }
    -00353 
    -00354 //
    -00355 // GetRecords
    -00356 //
    -00357 /// Builds a command packet in the send buffer for the GET_RECORDS
    -00358 /// command code.
    -00359 ///
    -00360 void DBPacket::GetRecords(unsigned int dbId)
    -00361 {
    -00362         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9));
    -00363         Protocol::Packet &packet = *cpack;
    -00364 
    -00365         // socket class should override this for us
    -00366 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00367         packet.size = htobs(9);
    -00368         packet.command = SB_COMMAND_DB_DATA;
    -00369         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00370         packet.u.db.u.command.operation = SB_DBOP_OLD_GET_RECORDS;
    -00371         packet.u.db.u.command.databaseId = htobs(dbId);
    -00372 
    -00373         m_send.ReleaseBuffer(9);
    -00374 
    -00375         m_last_dbop = SB_DBOP_OLD_GET_RECORDS;
    -00376 }
    -00377 
    -00378 //
    -00379 // SetRecord
    -00380 //
    -00381 /// Builds a command packet in the m_send buffer for the SET_RECORD command
    -00382 /// code.
    -00383 ///
    -00384 /// \return     bool
    -00385 ///             - true means success
    -00386 ///             - false means no data available from Builder object
    -00387 ///
    -00388 bool DBPacket::SetRecord(unsigned int dbId, Builder &build)
    -00389 {
    -00390         // get new data if available
    -00391         if( !build.Retrieve(dbId) )
    -00392                 return false;
    -00393 
    -00394         // build packet data
    -00395         size_t header_size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_TAGGED_UPLOAD_HEADER_SIZE;
    -00396         build.BuildHeader(m_send, header_size);
    -00397         build.BuildFields(m_send, header_size);
    -00398         size_t total_size = m_send.GetSize();
    -00399 
    -00400         // fill in the header values
    -00401         MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(total_size));
    -00402         Protocol::Packet &packet = *cpack;
    -00403 
    -00404         // socket class should override this for us
    -00405 //      packet.socket = htobs(m_con.m_socket->GetSocket());
    -00406         packet.size = htobs(total_size);
    -00407         packet.command = SB_COMMAND_DB_DATA;
    -00408         packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess);
    -00409         packet.u.db.u.command.operation = SB_DBOP_SET_RECORD;
    -00410         packet.u.db.u.command.databaseId = htobs(dbId);
    -00411         packet.u.db.u.command.u.tag_upload.rectype = build.GetRecType();
    -00412         packet.u.db.u.command.u.tag_upload.uniqueId = htobl(build.GetUniqueId());
    -00413         packet.u.db.u.command.u.tag_upload.unknown2 = 1;        // unknown observed value
    -00414 
    -00415         m_send.ReleaseBuffer(total_size);
    -00416 
    -00417         m_last_dbop = SB_DBOP_SET_RECORD;
    -00418         return true;
    -00419 }
    -00420 
    -00421 
    -00422 // throws FIXME if packet doesn't support it
    -00423 unsigned int DBPacket::ReturnCode() const
    -00424 {
    -00425         if( Command() == SB_COMMAND_DB_DONE ) {
    -00426                 Protocol::CheckSize(m_receive, SB_PACKET_DBACCESS_HEADER_SIZE + SB_DBACCESS_RETURN_CODE_SIZE);
    -00427                 MAKE_PACKET(rpack, m_receive);
    -00428                 return rpack->u.db.u.return_code;
    -00429         }
    -00430         else {
    -00431                 throw Error("Attempting to extract a return code from the wrong response packet type");
    -00432         }
    -00433 }
    -00434 
    -00435 //
    -00436 // DBOperation
    -00437 //
    -00438 /// Returns the database operation code from the receive packet, assuming
    -00439 /// that receive contains a response packet.  If receive isn't large
    -00440 /// enough, throws Error.
    -00441 ///
    -00442 unsigned int DBPacket::DBOperation() const
    -00443 {
    -00444         Protocol::CheckSize(m_receive, SB_PACKET_RESPONSE_HEADER_SIZE);
    -00445         MAKE_PACKET(rpack, m_receive);
    -00446         return rpack->u.db.u.response.operation;
    -00447 }
    -00448 
    -00449 //
    -00450 // Parse
    -00451 //
    -00452 /// Parses the data in the receive buffer, and attempts to be smart about it,
    -00453 /// using the last send command as guidance for what to expect in the
    -00454 /// response.
    -00455 ///
    -00456 /// \returns    bool    true - packet was recognized and parse was attempted
    -00457 ///                     false - packet was not recognized
    -00458 ///
    -00459 bool DBPacket::Parse(Parser &parser)
    -00460 {
    -00461         size_t offset = 0;
    -00462         MAKE_PACKET(rpack, m_receive);
    -00463 
    -00464         switch( m_last_dbop )
    -00465         {
    -00466         case SB_DBOP_OLD_GET_RECORDS:
    -00467         case SB_DBOP_GET_RECORD_BY_INDEX:
    -00468                 parser.Clear();
    -00469 
    -00470                 offset = SB_PACKET_RESPONSE_HEADER_SIZE + DBR_OLD_TAGGED_RECORD_HEADER_SIZE;
    -00471                 Protocol::CheckSize(m_receive, offset);
    -00472                 // FIXME - this may need adjustment for email records... they
    -00473                 // don't seem to have uniqueID's
    -00474                 parser.SetIds(rpack->u.db.u.response.u.tagged.rectype,
    -00475                         btohl(rpack->u.db.u.response.u.tagged.uniqueId));
    -00476 
    -00477                 parser.ParseHeader(m_receive, offset);
    -00478                 parser.ParseFields(m_receive, offset);
    -00479                 parser.Store();
    -00480                 return true;
    -00481 
    -00482         default:        // unknown command
    -00483                 return false;
    -00484         }
    -00485 }
    -00486 
    -00487 } // namespace Barry
    -00488 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/packet_8h.html barry-0.0.20110506/doc/www/doxygen/html/packet_8h.html --- barry-0.14/doc/www/doxygen/html/packet_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/packet_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: packet.h File Reference - - - - - - - -

    packet.h File Reference


    Detailed Description

    -Low level protocol packet builder class. -

    -Has knowledge of specific protocol commands in order to hide protocol details behind an API. -

    -Definition in file packet.h. -

    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Mode

    Classes

    class  Barry::Packet
    class  Barry::ZeroPacket
     Provides an API for building and analyzing socket-0 protocol packets. More...
    class  Barry::DBPacket
     Provides an API for building and analyzing raw DB protocol packets. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/packet_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/packet_8h-source.html --- barry-0.14/doc/www/doxygen/html/packet_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/packet_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,194 +0,0 @@ - - -Barry: packet.h Source File - - - - - - - -

    packet.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       packet.h
    -00003 ///             Low level protocol packet builder class.
    -00004 ///             Has knowledge of specific protocol commands in order
    -00005 ///             to hide protocol details behind an API.
    -00006 ///
    -00007 
    -00008 /*
    -00009     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #ifndef __BARRY_PACKET_H__
    -00025 #define __BARRY_PACKET_H__
    -00026 
    -00027 #include <stdint.h>
    -00028 
    -00029 namespace Barry { class Data; }
    -00030 
    -00031 namespace Barry {
    -00032 
    -00033 // forward declarations
    -00034 class Parser;
    -00035 class Builder;
    -00036 class SocketZero;
    -00037 class Socket;
    -00038 namespace Mode {
    -00039         class Desktop;
    -00040 }
    -00041 
    -00042 class Packet
    -00043 {
    -00044         friend class SocketZero;
    -00045         friend class Socket;
    -00046 
    -00047 protected:
    -00048         Data &m_send, &m_receive;
    -00049 
    -00050         Data& GetSend() { return m_send; }
    -00051         Data& GetReceive() { return m_receive; }
    -00052 
    -00053 public:
    -00054         Packet(Data &send, Data &receive)
    -00055                 : m_send(send), m_receive(receive)
    -00056                 {}
    -00057         virtual ~Packet() {}
    -00058 
    -00059         //////////////////////////////////
    -00060         // common response analysis
    -00061 
    -00062         unsigned int Command() const;   // throws Error if receive isn't big enough
    -00063 };
    -00064 
    -00065 //
    -00066 // ZeroPacket class
    -00067 //
    -00068 /// Provides an API for building and analyzing socket-0 protocol packets.
    -00069 /// This class relies on 2 external objects: a send and receive Data buffer.
    -00070 ///
    -00071 /// Note that the receive buffer may be modified
    -00072 /// during a packet send, and this DBPacket class provides API helpers
    -00073 /// to analyze the results.
    -00074 ///
    -00075 class ZeroPacket : public Packet
    -00076 {
    -00077         friend class Socket;
    -00078 
    -00079 public:
    -00080         ZeroPacket(Data &send, Data &receive);
    -00081         ~ZeroPacket();
    -00082 
    -00083         //////////////////////////////////
    -00084         // meta access
    -00085 
    -00086         //////////////////////////////////
    -00087         // packet building
    -00088 
    -00089         void GetAttribute(unsigned int object, unsigned int attribute);
    -00090 
    -00091 
    -00092         //////////////////////////////////
    -00093         // response analysis
    -00094 
    -00095         unsigned int ObjectID() const;
    -00096         unsigned int AttributeID() const;
    -00097         uint32_t ChallengeSeed() const;
    -00098         unsigned int RemainingTries() const;
    -00099         unsigned int SocketResponse() const;
    -00100         unsigned char SocketSequence() const;
    -00101 };
    -00102 
    -00103 
    -00104 //
    -00105 // DBPacket class
    -00106 //
    -00107 /// Provides an API for building and analyzing raw DB protocol packets.
    -00108 /// This class relies on 3 external objects: a Mode::Desktop object,
    -00109 /// a send Data buffer, and a receive data buffer.  Socket and
    -00110 /// connection details are retrieved on a readonly basis from the
    -00111 /// Mode::Desktop object, but both send and receive buffers can be
    -00112 /// modified.
    -00113 ///
    -00114 /// Note that the receive buffer may be modified
    -00115 /// during a packet send, and this DBPacket class provides API helpers
    -00116 /// to analyze the results.
    -00117 ///
    -00118 class DBPacket : public Packet
    -00119 {
    -00120         friend class Socket;
    -00121 
    -00122 private:
    -00123         Mode::Desktop &m_con;
    -00124         unsigned int m_last_dbop;       // last database operation
    -00125 
    -00126 protected:
    -00127 
    -00128 public:
    -00129         DBPacket(Mode::Desktop &con, Data &send, Data &receive);
    -00130         ~DBPacket();
    -00131 
    -00132         //////////////////////////////////
    -00133         // meta access
    -00134 
    -00135         //////////////////////////////////
    -00136         // packet building
    -00137 
    -00138         // commands that correspond to the DB operation
    -00139         // constants in protocol.h
    -00140         void ClearDatabase(unsigned int dbId);
    -00141         void GetDBDB();
    -00142         void GetRecordStateTable(unsigned int dbId);
    -00143         void SetRecordFlags(unsigned int dbId, unsigned int stateTableIndex, uint8_t flag1);
    -00144         void DeleteRecordByIndex(unsigned int dbId, unsigned int stateTableIndex);
    -00145         void GetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex);
    -00146         bool SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex, Builder &build);
    -00147         void GetRecords(unsigned int dbId);
    -00148         bool SetRecord(unsigned int dbId, Builder &build);
    -00149 
    -00150 
    -00151         //////////////////////////////////
    -00152         // response analysis
    -00153 
    -00154         // DB command response functions
    -00155         unsigned int ReturnCode() const;        // throws FIXME if packet doesn't support it
    -00156         unsigned int DBOperation() const; // throws Error on size trouble
    -00157 
    -00158         bool Parse(Parser &parser);     // switches based on last m_send command
    -00159 
    -00160         // response parsers
    -00161 };
    -00162 
    -00163 } // namespace Barry
    -00164 
    -00165 #endif
    -00166 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/parser_8cc.html barry-0.0.20110506/doc/www/doxygen/html/parser_8cc.html --- barry-0.14/doc/www/doxygen/html/parser_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/parser_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - - -Barry: parser.cc File Reference - - - - - - - -

    parser.cc File Reference


    Detailed Description

    -Virtual parser functor class. -

    -Also, all protocol-specific parser code goes in here. -

    -Definition in file parser.cc. -

    -#include "parser.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/parser_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/parser_8cc-source.html --- barry-0.14/doc/www/doxygen/html/parser_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/parser_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - -Barry: parser.cc Source File - - - - - - - -

    parser.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       parser.cc
    -00003 ///             Virtual parser functor class.  Also, all protocol-specific
    -00004 ///             parser code goes in here.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "parser.h"
    -00024 #include "protocol.h"
    -00025 #include "protostructs.h"
    -00026 
    -00027 namespace Barry {
    -00028 
    -00029 
    -00030 } // namespace Barry
    -00031 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/parser_8h.html barry-0.0.20110506/doc/www/doxygen/html/parser_8h.html --- barry-0.14/doc/www/doxygen/html/parser_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/parser_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: parser.h File Reference - - - - - - - -

    parser.h File Reference


    Detailed Description

    -Virtual parser wrapper. -

    - -

    -Definition in file parser.h. -

    -#include "dll.h"
    -#include "data.h"
    -#include "protocol.h"
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Parser
     Base class for the parser hierarchy. More...
    class  Barry::RecordParser< RecordT, StorageT >
     Template class for easy creation of specific parser objects. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/parser_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/parser_8h-source.html --- barry-0.14/doc/www/doxygen/html/parser_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/parser_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ - - -Barry: parser.h Source File - - - - - - - -

    parser.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       parser.h
    -00003 ///             Virtual parser wrapper
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_PARSER_H__
    -00023 #define __BARRY_PARSER_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "data.h"
    -00027 #include "protocol.h"
    -00028 #include <stdint.h>             // for uint32_t
    -00029 
    -00030 // forward declarations
    -00031 namespace Barry { class Data; }
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 // also acts as a null parser
    -00036 //
    -00037 // Parser class
    -00038 //
    -00039 /// Base class for the parser hierarchy.  If in debug mode, this
    -00040 /// class can be used as a null parser.  Call Init() and the protocol
    -00041 /// will be dumped to stdout and no parsing will be done.
    -00042 ///
    -00043 /// This class provides the interface that the Controller class uses
    -00044 /// to pass raw data it reads from the device.  The Controller, along
    -00045 /// with the Packet class, calls each of the virtual functions below
    -00046 /// in the same order.
    -00047 ///
    -00048 class BXEXPORT Parser
    -00049 {
    -00050 public:
    -00051         Parser() {}
    -00052         virtual ~Parser() {}
    -00053 
    -00054         /// Reset and prepare for a new raw data packet
    -00055         virtual void Clear() {}
    -00056 
    -00057         /// Stores the IDs
    -00058         virtual void SetIds(uint8_t RecType, uint32_t UniqueId) {}
    -00059 
    -00060         /// Called to parse the header portion of the raw data packet.
    -00061         /// data contains the entire packet, and offset contains the
    -00062         /// location at which to start parsing.
    -00063         virtual void ParseHeader(const Data &data, size_t &offset) {}
    -00064 
    -00065         /// Called to parse sub fields in the raw data packet.
    -00066         /// The same data is passed as was passed in ParseHeader,
    -00067         /// only the offset will be updated if it was advanced during
    -00068         /// the header parsing.
    -00069         virtual void ParseFields(const Data &data, size_t &offset) {}
    -00070 
    -00071         /// Called at the very end of record parsing, and used to
    -00072         /// store the final packet somewhere, either in memory, disk, etc.
    -00073         virtual void Store() {}
    -00074 };
    -00075 
    -00076 
    -00077 //
    -00078 // RecordParser template class
    -00079 //
    -00080 /// Template class for easy creation of specific parser objects.  This template
    -00081 /// takes the following template arguments:
    -00082 ///
    -00083 ///     - RecordT: One of the record parser classes in record.h
    -00084 ///     - StorageT: A custom storage functor class.  An object of this type
    -00085 ///             will be called as a function with parsed Record as an
    -00086 ///             argument.  This happens on the fly as the data is retrieved
    -00087 ///             from the device over USB, so it should not block forever.
    -00088 ///
    -00089 /// Example LoadDatabase() call:
    -00090 ///
    -00091 /// <pre>
    -00092 /// struct StoreContact
    -00093 /// {
    -00094 ///     std::vector<Contact> &amp;array;
    -00095 ///     StoreContact(std::vector<Contact> &amp;a) : array(a) {}
    -00096 ///     void operator() (const Contact &amp;c)
    -00097 ///     {
    -00098 ///         array.push_back(c);
    -00099 ///     }
    -00100 /// };
    -00101 ///
    -00102 /// Controller con(probeResult);
    -00103 /// con.OpenMode(Controller::Desktop);
    -00104 /// std::vector<Contact> contactList;
    -00105 /// StoreContact storage(contactList);
    -00106 /// RecordParser<Contact, StoreContact> parser(storage);
    -00107 /// con.LoadDatabase(con.GetDBID("Address Book"), parser);
    -00108 /// </pre>
    -00109 ///
    -00110 template <class RecordT, class StorageT>
    -00111 class RecordParser : public Parser
    -00112 {
    -00113         StorageT *m_store;
    -00114         bool m_owned;
    -00115         RecordT m_rec;
    -00116 
    -00117 public:
    -00118         /// Constructor that references an externally managed storage object.
    -00119         RecordParser(StorageT &storage)
    -00120                 : m_store(&storage), m_owned(false) {}
    -00121 
    -00122         /// Constructor that references a locally managed storage object.
    -00123         /// The pointer passed in will be stored, and freed when this class
    -00124         /// is destroyed.  It is safe to call this constructor with
    -00125         /// a 'new'ly created storage object.
    -00126         RecordParser(StorageT *storage)
    -00127                 : m_store(storage), m_owned(true) {}
    -00128 
    -00129         ~RecordParser()
    -00130         {
    -00131                 if( this->m_owned )
    -00132                         delete m_store;
    -00133         }
    -00134 
    -00135         virtual void Clear()
    -00136         {
    -00137                 m_rec = RecordT();
    -00138         }
    -00139 
    -00140         virtual void SetIds(uint8_t RecType, uint32_t UniqueId)
    -00141         {
    -00142                 m_rec.SetIds(RecType, UniqueId);
    -00143         }
    -00144 
    -00145         virtual void ParseHeader(const Data &data, size_t &offset)
    -00146         {
    -00147                 m_rec.ParseHeader(data, offset);
    -00148         }
    -00149 
    -00150         virtual void ParseFields(const Data &data, size_t &offset)
    -00151         {
    -00152                 m_rec.ParseFields(data, offset);
    -00153         }
    -00154 
    -00155         virtual void Store()
    -00156         {
    -00157                 (*m_store)(m_rec);
    -00158         }
    -00159 };
    -00160 
    -00161 } // namespace Barry
    -00162 
    -00163 #endif
    -00164 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppfilter_8cc.html barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8cc.html --- barry-0.14/doc/www/doxygen/html/pppfilter_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - -Barry: pppfilter.cc File Reference - - - - - - - -

    pppfilter.cc File Reference


    Detailed Description

    -Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle. -

    -This logic is based partly on XmBlackBerry's gprs_protocol_fix.c program. -

    -Definition in file pppfilter.cc. -

    -#include "pppfilter.h"
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppfilter_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8cc-source.html --- barry-0.14/doc/www/doxygen/html/pppfilter_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ - - -Barry: pppfilter.cc Source File - - - - - - - -

    pppfilter.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       pppfilter.cc
    -00003 ///             Data filter class, to morph PPP data into something that
    -00004 ///             the Blackberry / Rogers / ISP can handle.
    -00005 ///             This logic is based partly on XmBlackBerry's
    -00006 ///             gprs_protocol_fix.c program.
    -00007 ///
    -00008 
    -00009 /*
    -00010     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00011 
    -00012     This program is free software; you can redistribute it and/or modify
    -00013     it under the terms of the GNU General Public License as published by
    -00014     the Free Software Foundation; either version 2 of the License, or
    -00015     (at your option) any later version.
    -00016 
    -00017     This program is distributed in the hope that it will be useful,
    -00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00020 
    -00021     See the GNU General Public License in the COPYING file at the
    -00022     root directory of this project for more details.
    -00023 */
    -00024 
    -00025 #include "pppfilter.h"
    -00026 #include <string.h>
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 //////////////////////////////////////////////////////////////////////////////
    -00031 // PppFilter class
    -00032 
    -00033 PppFilter::PppFilter()
    -00034         : m_ppp_mode(false)
    -00035         , m_last(0x7e)
    -00036 {
    -00037 }
    -00038 
    -00039 //
    -00040 // Filter
    -00041 //
    -00042 /// Copy PPP data from src to dest, creating needed space in dest,
    -00043 /// and inserting missing 0x7e characters wherever they are detected.
    -00044 /// Starts writing at the start of the dest buffer + destoffset.
    -00045 ///
    -00046 void PppFilter::Filter(Data &dest, const Data &src, unsigned int destoffset)
    -00047 {
    -00048         const unsigned char *b = src.GetData(), *e = src.GetData() + src.GetSize();
    -00049         size_t needed = src.GetSize() / 2 * 3 + 4 + destoffset; // worst case
    -00050         unsigned char *buf = dest.GetBuffer(needed) + destoffset;
    -00051         unsigned char *put = buf;
    -00052 
    -00053         while( b != e ) {
    -00054                 // if last character was 0x7e, then next one must be,
    -00055                 // or else we insert it ourselves
    -00056                 if( m_last == 0x7e ) {
    -00057                         m_last = 0;
    -00058                         if( *b != 0x7e )
    -00059                                 *put++ = 0x7e;
    -00060                         else
    -00061                                 *put++ = *b++;
    -00062                 }
    -00063 
    -00064                 // copy all non-0x7e chars verbatim
    -00065                 while( b != e && *b != 0x7e ) {
    -00066                         *put++ = *b++;
    -00067                 }
    -00068 
    -00069                 if( b != e ) {  // if b!=e then *b == 0x7e and must keep going
    -00070                         *put++ = *b++;
    -00071                         m_last = 0x7e;
    -00072                 }
    -00073         }
    -00074 
    -00075         dest.ReleaseBuffer(put - buf + destoffset);
    -00076 }
    -00077 
    -00078 //
    -00079 // Write
    -00080 //
    -00081 /// If PPP mode has not been detected, just return the data buffer.
    -00082 /// If in PPP mode, then filter data into internal write buffer,
    -00083 /// inserting any missing 0x7e characters and return reference
    -00084 /// to internal write buffer.
    -00085 ///
    -00086 const Data& PppFilter::Write(const Data &data)
    -00087 {
    -00088         if( data.GetSize() == 0 )
    -00089                 return data;    // nothing to do
    -00090 
    -00091         const unsigned char *b = data.GetData();
    -00092 
    -00093         if( !m_ppp_mode ) {
    -00094                 if( *b == 0x7e ) {
    -00095                         m_ppp_mode = true;
    -00096                         // fall through
    -00097                 }
    -00098                 else {
    -00099                         // not in ppp mode yet, so just pass the buffer
    -00100                         // straight back to the caller
    -00101                         return data;
    -00102                 }
    -00103         }
    -00104 
    -00105         Filter(m_writeBuf, data, 0);
    -00106         return m_writeBuf;
    -00107 }
    -00108 
    -00109 //
    -00110 // Write (with prepend)
    -00111 //
    -00112 /// Same as Write(data), but makes sure that prepend bytes are available
    -00113 /// at the beginning of the returned buffer.
    -00114 /// If not in PPP mode, the extra bytes are still provided.
    -00115 ///
    -00116 Data& PppFilter::Write(const Data &data, unsigned int prepend)
    -00117 {
    -00118         const unsigned char *b = data.GetData(), *e = data.GetData() + data.GetSize();
    -00119 
    -00120         if( !m_ppp_mode ) {
    -00121                 if( b != e && *b == 0x7e ) {
    -00122                         m_ppp_mode = true;
    -00123                         // fall through
    -00124                 }
    -00125                 else {
    -00126                         // make space, copy, return
    -00127                         unsigned int size = data.GetSize() + prepend;
    -00128                         unsigned char *buf = m_writeBuf.GetBuffer(size);
    -00129                         memcpy(&buf[prepend], data.GetData(), data.GetSize());
    -00130                         m_writeBuf.ReleaseBuffer(size);
    -00131                         return m_writeBuf;
    -00132                 }
    -00133         }
    -00134 
    -00135         Filter(m_writeBuf, data, prepend);
    -00136         return m_writeBuf;
    -00137 }
    -00138 
    -00139 } // namespace Barry
    -00140 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppfilter_8h.html barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8h.html --- barry-0.14/doc/www/doxygen/html/pppfilter_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - -Barry: pppfilter.h File Reference - - - - - - - -

    pppfilter.h File Reference


    Detailed Description

    -Data filter class, to morph PPP data into something that the Blackberry / Rogers / ISP can handle. -

    -This logic is based partly on XmBlackBerry's gprs_protocol_fix.c program. -

    -Definition in file pppfilter.h. -

    -#include "dll.h"
    -#include "data.h"
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::PppFilter
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppfilter_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8h-source.html --- barry-0.14/doc/www/doxygen/html/pppfilter_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppfilter_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ - - -Barry: pppfilter.h Source File - - - - - - - -

    pppfilter.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       pppfilter.h
    -00003 ///             Data filter class, to morph PPP data into something that
    -00004 ///             the Blackberry / Rogers / ISP can handle.
    -00005 ///             This logic is based partly on XmBlackBerry's
    -00006 ///             gprs_protocol_fix.c program.
    -00007 ///
    -00008 
    -00009 /*
    -00010     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00011 
    -00012     This program is free software; you can redistribute it and/or modify
    -00013     it under the terms of the GNU General Public License as published by
    -00014     the Free Software Foundation; either version 2 of the License, or
    -00015     (at your option) any later version.
    -00016 
    -00017     This program is distributed in the hope that it will be useful,
    -00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00020 
    -00021     See the GNU General Public License in the COPYING file at the
    -00022     root directory of this project for more details.
    -00023 */
    -00024 
    -00025 #ifndef __BARRY_M_PPPFILTER_H__
    -00026 #define __BARRY_M_PPPFILTER_H__
    -00027 
    -00028 #include "dll.h"
    -00029 #include "data.h"
    -00030 
    -00031 namespace Barry {
    -00032 
    -00033 class BXEXPORT PppFilter
    -00034 {
    -00035 private:
    -00036         Data m_writeBuf;                        // used for 0x7e handling
    -00037 
    -00038         // write flags
    -00039         bool m_ppp_mode;
    -00040         unsigned char m_last;
    -00041 
    -00042         BXLOCAL const Data& GetBuffer() const;  // not implemented, since
    -00043                 // Write can return either m_writeBuf or data, and
    -00044                 // so this would be useless and unsafe
    -00045 
    -00046         BXLOCAL void Filter(Data &dest, const Data &src, unsigned int destoffset);
    -00047 
    -00048 public:
    -00049         PppFilter();
    -00050 
    -00051         bool PppMode() const { return m_ppp_mode; }
    -00052         const Data& Write(const Data &data);
    -00053         Data& Write(const Data &data, unsigned int prepend);
    -00054 };
    -00055 
    -00056 } // namespace Barry
    -00057 
    -00058 #endif
    -00059 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppob_8cc.html barry-0.0.20110506/doc/www/doxygen/html/pppob_8cc.html --- barry-0.14/doc/www/doxygen/html/pppob_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppob_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ - - -Barry: pppob.cc File Reference - - - - - - - -

    pppob.cc File Reference


    Detailed Description

    -In the same vein as pppoe, used with pppd to create a pty tunnel and GPRS modem link. -

    - -

    -Definition in file pppob.cc. -

    -#include <barry/barry.h>
    -#include <iomanip>
    -#include <iostream>
    -#include <fstream>
    -#include <vector>
    -#include <string>
    -#include <memory>
    -#include <getopt.h>
    -#include <sys/select.h>
    -#include <sys/time.h>
    -#include <sys/types.h>
    -#include <unistd.h>
    -#include <signal.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - -

    Functions

    -void Usage ()
    -void signal_handler (int signum)
    -void SerialDataCallback (void *context, const unsigned char *data, int len)
    -void ProcessStdin (Modem &modem)
    -int main (int argc, char *argv[])

    Variables

    -bool data_dump = false
    -volatile bool signal_end = false
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/pppob_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/pppob_8cc-source.html --- barry-0.14/doc/www/doxygen/html/pppob_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/pppob_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ - - -Barry: pppob.cc Source File - - - - - - - -

    pppob.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       pppob.cc
    -00003 ///             In the same vein as pppoe, used with pppd to create a
    -00004 ///             pty tunnel and GPRS modem link.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include <barry/barry.h>
    -00024 #include <iomanip>
    -00025 #include <iostream>
    -00026 #include <fstream>
    -00027 #include <vector>
    -00028 #include <string>
    -00029 #include <memory>
    -00030 #include <getopt.h>
    -00031 #include <sys/select.h>
    -00032 #include <sys/time.h>
    -00033 #include <sys/types.h>
    -00034 #include <unistd.h>
    -00035 #include <signal.h>
    -00036 
    -00037 
    -00038 using namespace std;
    -00039 using namespace Barry;
    -00040 
    -00041 bool data_dump = false;
    -00042 volatile bool signal_end = false;
    -00043 
    -00044 void Usage()
    -00045 {
    -00046    int major, minor;
    -00047    const char *Version = Barry::Version(major, minor);
    -00048 
    -00049    cerr
    -00050    << "pppob - PPP over Barry\n"
    -00051    << "        Copyright 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)\n"
    -00052    << "        Using: " << Version << "\n"
    -00053    << "\n"
    -00054    << "   -l file   Direct pppob log output to file (useful with -v)\n"
    -00055    << "   -p pin    PIN of device to talk with\n"
    -00056    << "             If only one device plugged in, this flag is optional\n"
    -00057    << "   -P pass   Simplistic method to specify device password\n"
    -00058    << "   -s        Use Serial mode instead of IpModem\n"
    -00059    << "   -v        Dump protocol data during operation (debugging only!)\n"
    -00060    << endl;
    -00061 }
    -00062 
    -00063 void signal_handler(int signum)
    -00064 {
    -00065         signal_end = true;
    -00066 }
    -00067 
    -00068 void SerialDataCallback(void *context, const unsigned char *data, int len)
    -00069 {
    -00070         if( len && data_dump )
    -00071                 barryverbose("ReadThread:\n" << Data(data, len));
    -00072 
    -00073         while( len ) {
    -00074                 int written = write(1, data, len);
    -00075                 if( written > 0 ) {
    -00076                         len -= written;
    -00077                         data += written;
    -00078                 }
    -00079                 else {
    -00080                         barryverbose("Error in write()");
    -00081                 }
    -00082         }
    -00083 }
    -00084 
    -00085 void ProcessStdin(Modem &modem)
    -00086 {
    -00087         // Read from stdin and write to USB, until
    -00088         // stdin is closed
    -00089         Data data;
    -00090         int bytes_read;
    -00091         fd_set rfds;
    -00092         struct timeval tv;
    -00093         int ret;
    -00094 
    -00095         // Handle interrupt signals from pppd
    -00096         signal_end = false;
    -00097         signal(SIGINT, &signal_handler);
    -00098         signal(SIGHUP, &signal_handler);
    -00099         signal(SIGTERM, &signal_handler);
    -00100 
    -00101         FD_ZERO(&rfds);
    -00102         while( signal_end == false ) {
    -00103                 // Need to use select() here, so that pppd doesn't
    -00104                 // hang when it tries to set the line discipline
    -00105                 // on our stdin.
    -00106 
    -00107                 FD_SET(0, &rfds);
    -00108                 tv.tv_sec = 30;
    -00109                 tv.tv_usec = 0;
    -00110 
    -00111                 ret = select(1, &rfds, NULL, NULL, &tv);
    -00112                 if( ret == -1 ) {
    -00113                         perror("select()");
    -00114                 }
    -00115                 else if( ret && FD_ISSET(0, &rfds) ) {
    -00116                         bytes_read = read(0, data.GetBuffer(), data.GetBufSize());
    -00117                         if( bytes_read == 0 )
    -00118                                 break;
    -00119 
    -00120                         if( bytes_read > 0 ) {
    -00121                                 data.ReleaseBuffer(bytes_read);
    -00122                                 modem.Write(data);
    -00123                         }
    -00124                 }
    -00125         }
    -00126 }
    -00127 
    -00128 int main(int argc, char *argv[])
    -00129 {
    -00130         cout.sync_with_stdio(true);     // leave this on, since libusb uses
    -00131                                         // stdio for debug messages
    -00132 
    -00133         try {
    -00134 
    -00135                 uint32_t pin = 0;
    -00136                 bool force_serial = false;
    -00137                 std::string logfile;
    -00138                 std::string password;
    -00139 
    -00140                 // process command line options
    -00141                 for(;;) {
    -00142                         int cmd = getopt(argc, argv, "l:p:P:sv");
    -00143                         if( cmd == -1 )
    -00144                                 break;
    -00145 
    -00146                         switch( cmd )
    -00147                         {
    -00148                         case 'l':       // Verbose log file
    -00149                                 logfile = optarg;
    -00150                                 break;
    -00151 
    -00152                         case 'p':       // Blackberry PIN
    -00153                                 pin = strtoul(optarg, NULL, 16);
    -00154                                 break;
    -00155 
    -00156                         case 'P':       // Device password
    -00157                                 password = optarg;
    -00158                                 break;
    -00159 
    -00160                         case 's':       // Use Serial mode
    -00161                                 force_serial = true;
    -00162                                 break;
    -00163 
    -00164                         case 'v':       // data dump on
    -00165                                 data_dump = true;
    -00166                                 break;
    -00167 
    -00168                         case 'h':       // help
    -00169                         default:
    -00170                                 Usage();
    -00171                                 return 0;
    -00172                         }
    -00173                 }
    -00174 
    -00175                 // Initialize the barry library.  Must be called before
    -00176                 // anything else.
    -00177                 // Log to stderr, since stdout is for data in this program.
    -00178                 std::auto_ptr<std::ofstream> log;
    -00179                 if( logfile.size() ) {
    -00180                         log.reset( new std::ofstream(logfile.c_str(), ios::app) );
    -00181                         Barry::Init(data_dump, log.get());
    -00182                 }
    -00183                 else {
    -00184                         Barry::Init(data_dump, &std::cerr);
    -00185                 }
    -00186 
    -00187                 // Probe the USB bus for Blackberry devices and display.
    -00188                 // If user has specified a PIN, search for it in the
    -00189                 // available device list here as well
    -00190                 Barry::Probe probe;
    -00191                 int activeDevice = probe.FindActive(pin);
    -00192                 if( activeDevice == -1 ) {
    -00193                         if( pin )
    -00194                                 cerr << "PIN " << setbase(16) << pin
    -00195                                         << " not found" << endl;
    -00196                         cerr << "No device selected" << endl;
    -00197                         return 1;
    -00198                 }
    -00199 
    -00200                 const ProbeResult &device = probe.Get(activeDevice);
    -00201 
    -00202                 if( !force_serial && device.HasIpModem() ) {
    -00203                         barryverbose("Using IpModem mode...");
    -00204 
    -00205                         // Create our controller object using our threaded router.
    -00206                         Controller con(probe.Get(activeDevice));
    -00207 
    -00208                         // Open serial mode... the callback handles reading from
    -00209                         // USB and writing to stdout
    -00210                         Mode::IpModem modem(con, SerialDataCallback, 0);
    -00211                         modem.Open(password.c_str());
    -00212 
    -00213                         ProcessStdin(modem);
    -00214                         modem.Close();  // graceful close so we can restart without unplugging
    -00215                 }
    -00216                 else {
    -00217                         barryverbose("Using Serial mode...");
    -00218 
    -00219                         // Create our socket router and start thread to handle
    -00220                         // the USB reading, instead of creating our own thread.
    -00221                         SocketRoutingQueue router;
    -00222                         router.SpinoffSimpleReadThread();
    -00223 
    -00224                         // Create our controller object using our threaded router.
    -00225                         Controller con(probe.Get(activeDevice), router);
    -00226 
    -00227                         // Open desktop mode... this handles the password side
    -00228                         // of things
    -00229                         Mode::Desktop desktop(con);
    -00230                         desktop.Open(password.c_str());
    -00231 
    -00232                         // Open serial connection
    -00233                         Mode::Serial modem(con, SerialDataCallback, 0);
    -00234                         modem.Open();
    -00235 
    -00236                         ProcessStdin(modem);
    -00237                 }
    -00238 
    -00239                 barryverbose("Exiting");
    -00240 
    -00241         }
    -00242         catch( std::exception &e ) {
    -00243                 cerr << "exception caught in main(): " << e.what() << endl;
    -00244                 return 1;
    -00245         }
    -00246 
    -00247         return 0;
    -00248 }
    -00249 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/probe_8cc.html barry-0.0.20110506/doc/www/doxygen/html/probe_8cc.html --- barry-0.14/doc/www/doxygen/html/probe_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/probe_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ - - -Barry: probe.cc File Reference - - - - - - - -

    probe.cc File Reference


    Detailed Description

    -USB Blackberry detection routines. -

    - -

    -Definition in file probe.cc. -

    -#include "common.h"
    -#include "probe.h"
    -#include "usbwrap.h"
    -#include "data.h"
    -#include "endian.h"
    -#include "error.h"
    -#include "debug.h"
    -#include "packet.h"
    -#include "socket.h"
    -#include "protocol.h"
    -#include "record-internal.h"
    -#include "strnlen.h"
    -#include <iomanip>
    -#include <errno.h>
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    -std::ostream & Barry::operator<< (std::ostream &os, const ProbeResult &pr)

    Variables

    -unsigned char Barry::Intro_Sends [][32]
    -unsigned char Barry::Intro_Receives [][32]
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/probe_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/probe_8cc-source.html --- barry-0.14/doc/www/doxygen/html/probe_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/probe_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,435 +0,0 @@ - - -Barry: probe.cc Source File - - - - - - - -

    probe.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       probe.cc
    -00003 ///             USB Blackberry detection routines
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "common.h"
    -00023 #include "probe.h"
    -00024 #include "usbwrap.h"
    -00025 #include "data.h"
    -00026 #include "endian.h"
    -00027 #include "error.h"
    -00028 #include "debug.h"
    -00029 #include "packet.h"
    -00030 #include "socket.h"
    -00031 #include "protocol.h"
    -00032 #include "record-internal.h"
    -00033 #include "strnlen.h"
    -00034 #include <iomanip>
    -00035 #include <errno.h>
    -00036 #include <string.h>
    -00037 
    -00038 using namespace Usb;
    -00039 
    -00040 namespace Barry {
    -00041 
    -00042 unsigned char Intro_Sends[][32] = {
    -00043         // packet #1
    -00044         { 0x00, 0x00, 0x10, 0x00, 0x01, 0xff, 0x00, 0x00,
    -00045           0xa8, 0x18, 0xda, 0x8d, 0x6c, 0x02, 0x00, 0x00 }
    -00046 };
    -00047 
    -00048 
    -00049 unsigned char Intro_Receives[][32] = {
    -00050         // response to packet #1
    -00051         { 0x00, 0x00, 0x10, 0x00, 0x02, 0xff, 0x00, 0x00,
    -00052           0xa8, 0x18, 0xda, 0x8d, 0x6c, 0x02, 0x00, 0x00 }
    -00053 };
    -00054 
    -00055 namespace {
    -00056 
    -00057         unsigned int GetSize(const unsigned char *packet)
    -00058         {
    -00059                 uint16_t size = *((uint16_t *)&packet[2]);
    -00060                 return btohs(size);
    -00061         }
    -00062 
    -00063         bool Intro(int IntroIndex, const EndpointPair &ep, Device &dev, Data &response)
    -00064         {
    -00065                 dev.BulkWrite(ep.write, Intro_Sends[IntroIndex],
    -00066                         GetSize(Intro_Sends[IntroIndex]));
    -00067                 try {
    -00068                         dev.BulkRead(ep.read, response, 500);
    -00069                 }
    -00070                 catch( Usb::Timeout &to ) {
    -00071                         ddout("BulkRead: " << to.what());
    -00072                         return false;
    -00073                 }
    -00074                 ddout("BulkRead (" << (unsigned int)ep.read << "):\n" << response);
    -00075                 return true;
    -00076         }
    -00077 
    -00078 } // anonymous namespace
    -00079 
    -00080 
    -00081 bool Probe::CheckSize(const Data &data, unsigned int required)
    -00082 {
    -00083         const unsigned char *pd = data.GetData();
    -00084 
    -00085         if( GetSize(pd) != (unsigned int) data.GetSize() ||
    -00086             data.GetSize() < required ||
    -00087             pd[4] != SB_COMMAND_FETCHED_ATTRIBUTE )
    -00088         {
    -00089                 dout("Probe: Parse data failure: GetSize(pd): " << GetSize(pd)
    -00090                         << ", data.GetSize(): " << data.GetSize()
    -00091                         << ", pd[4]: " << (unsigned int) pd[4]);
    -00092                 return false;
    -00093         }
    -00094 
    -00095         return true;
    -00096 }
    -00097 
    -00098 bool Probe::ParsePIN(const Data &data, uint32_t &pin)
    -00099 {
    -00100         // validate response data
    -00101         const unsigned char *pd = data.GetData();
    -00102 
    -00103         if( !CheckSize(data, 0x14) )
    -00104                 return false;
    -00105 
    -00106         // capture the PIN
    -00107         pin = btohl(*((uint32_t *) &pd[16]));
    -00108 
    -00109         return true;
    -00110 }
    -00111 
    -00112 bool Probe::ParseDesc(const Data &data, std::string &desc)
    -00113 {
    -00114         if( !CheckSize(data, 29) )
    -00115                 return false;
    -00116 
    -00117         // capture the description
    -00118         const char *d = (const char*) &data.GetData()[28];
    -00119         int maxlen = data.GetSize() - 28;
    -00120         desc.assign(d, strnlen(d, maxlen));
    -00121 
    -00122         return true;
    -00123 }
    -00124 
    -00125 Probe::Probe(const char *busname, const char *devname)
    -00126         : m_fail_count(0)
    -00127 {
    -00128         // let the programmer pass in "" as well as 0
    -00129         if( busname && !strlen(busname) )
    -00130                 busname = 0;
    -00131         if( devname && !strlen(devname) )
    -00132                 devname = 0;
    -00133 
    -00134         // Search for standard product ID first
    -00135         ProbeMatching(VENDOR_RIM, PRODUCT_RIM_BLACKBERRY, busname, devname);
    -00136 
    -00137         // Search for Pearl devices second
    -00138         //
    -00139         // productID 6 devices (PRODUCT_RIM_PEARL) do not expose
    -00140         // the USB class 255 interface we need, but only the
    -00141         // Mass Storage one.  Here we search for PRODUCT_RIM_PEARL_DUAL,
    -00142         // (ID 4) which has both enabled.
    -00143         ProbeMatching(VENDOR_RIM, PRODUCT_RIM_PEARL_DUAL, busname, devname);
    -00144         // And a special case, which behaves similar to the PEARL_DUAL,
    -00145         // but with a unique Product ID.
    -00146         ProbeMatching(VENDOR_RIM, PRODUCT_RIM_PEARL_8120, busname, devname);
    -00147 }
    -00148 
    -00149 void Probe::ProbeMatching(int vendor, int product,
    -00150                         const char *busname, const char *devname)
    -00151 {
    -00152         Usb::DeviceIDType devid;
    -00153 
    -00154         Match match(vendor, product, busname, devname);
    -00155         while( match.next_device(&devid) ) try {
    -00156                 ProbeDevice(devid);
    -00157         }
    -00158         catch( Usb::Error &e ) {
    -00159                 dout("Usb::Error exception caught: " << e.what());
    -00160                 if( e.libusb_errcode() == -EBUSY ) {
    -00161                         m_fail_count++;
    -00162                         m_fail_msgs.push_back(e.what());
    -00163                 }
    -00164                 else {
    -00165                         throw;
    -00166                 }
    -00167         }
    -00168 }
    -00169 
    -00170 void Probe::ProbeDevice(Usb::DeviceIDType devid)
    -00171 {
    -00172         // skip if we can't properly discover device config
    -00173         DeviceDiscovery discover(devid);
    -00174         ConfigDesc &config = discover.configs[BLACKBERRY_CONFIGURATION];
    -00175 
    -00176         // search for interface class
    -00177         InterfaceDiscovery::base_type::iterator idi = config.interfaces.begin();
    -00178         for( ; idi != config.interfaces.end(); idi++ ) {
    -00179                 if( idi->second.desc.bInterfaceClass == BLACKBERRY_DB_CLASS )
    -00180                         break;
    -00181         }
    -00182         if( idi == config.interfaces.end() ) {
    -00183                 dout("Probe: Interface with BLACKBERRY_DB_CLASS ("
    -00184                         << BLACKBERRY_DB_CLASS << ") not found.");
    -00185                 return; // not found
    -00186         }
    -00187 
    -00188         unsigned char InterfaceNumber = idi->second.desc.bInterfaceNumber;
    -00189         dout("Probe: using InterfaceNumber: " << (unsigned int) InterfaceNumber);
    -00190 
    -00191         // check endpoint validity
    -00192         EndpointDiscovery &ed = config.interfaces[InterfaceNumber].endpoints;
    -00193         if( !ed.IsValid() || ed.GetEndpointPairs().size() == 0 ) {
    -00194                 dout("Probe: endpoint invalid.   ed.IsValud() == "
    -00195                         << (ed.IsValid() ? "true" : "false")
    -00196                         << ", ed.GetEndpointPairs().size() == "
    -00197                         << ed.GetEndpointPairs().size());
    -00198                 return;
    -00199         }
    -00200 
    -00201         ProbeResult result;
    -00202         result.m_dev = devid;
    -00203         result.m_interface = InterfaceNumber;
    -00204         result.m_zeroSocketSequence = 0;
    -00205 
    -00206         // open device
    -00207         Device dev(devid);
    -00208 //      dev.Reset();
    -00209 //      sleep(5);
    -00210 
    -00211         //  make sure we're talking to the right config
    -00212         unsigned char cfg;
    -00213         if( !dev.GetConfiguration(cfg) )
    -00214                 throw Usb::Error(dev.GetLastError(),
    -00215                         "Probe: GetConfiguration failed");
    -00216         if( cfg != BLACKBERRY_CONFIGURATION ) {
    -00217                 if( !dev.SetConfiguration(BLACKBERRY_CONFIGURATION) )
    -00218                         throw Usb::Error(dev.GetLastError(),
    -00219                                 "Probe: SetConfiguration failed");
    -00220         }
    -00221 
    -00222         // open interface
    -00223         Interface iface(dev, InterfaceNumber);
    -00224 
    -00225         // find the first bulk read/write endpoint pair that answers
    -00226         // to our probe commands
    -00227         // Start with second pair, since evidence indicates the later pairs
    -00228         // are the ones we need.
    -00229         size_t i;
    -00230         for(i = ed.GetEndpointPairs().size() > 1 ? 1 : 0;
    -00231             i < ed.GetEndpointPairs().size();
    -00232             i++ )
    -00233         {
    -00234                 const EndpointPair &ep = ed.GetEndpointPairs()[i];
    -00235                 if( ep.type == USB_ENDPOINT_TYPE_BULK ) {
    -00236 
    -00237                         uint32_t pin;
    -00238                         uint8_t zeroSocketSequence;
    -00239                         std::string desc;
    -00240                         if( ProbePair(dev, ep, pin, desc, zeroSocketSequence) ) {
    -00241                                 result.m_ep = ep;
    -00242                                 result.m_pin = pin;
    -00243                                 result.m_description = desc;
    -00244                                 result.m_zeroSocketSequence = zeroSocketSequence;
    -00245                                 break;
    -00246                         }
    -00247                 }
    -00248                 else {
    -00249                         dout("Probe: Skipping non-bulk endpoint pair (offset: "
    -00250                                 << i-1 << ") ");
    -00251                 }
    -00252         }
    -00253 
    -00254         // check for ip modem endpoints
    -00255         i++;
    -00256         if( i < ed.GetEndpointPairs().size() ) {
    -00257                 const EndpointPair &ep = ed.GetEndpointPairs()[i];
    -00258                 if( ProbeModem(dev, ep) ) {
    -00259                         result.m_epModem = ep;
    -00260                 }
    -00261         }
    -00262 
    -00263         // add to list
    -00264         if( result.m_ep.IsComplete() ) {
    -00265                 m_results.push_back(result);
    -00266                 ddout("Using ReadEndpoint: " << (unsigned int)result.m_ep.read);
    -00267                 ddout("      WriteEndpoint: " << (unsigned int)result.m_ep.write);
    -00268         }
    -00269         else {
    -00270                 ddout("Unable to discover endpoint pair for one device.");
    -00271         }
    -00272 }
    -00273 
    -00274 bool Probe::ProbePair(Usb::Device &dev,
    -00275                         const Usb::EndpointPair &ep,
    -00276                         uint32_t &pin,
    -00277                         std::string &desc,
    -00278                         uint8_t &zeroSocketSequence)
    -00279 {
    -00280         dev.ClearHalt(ep.read);
    -00281         dev.ClearHalt(ep.write);
    -00282 
    -00283         Data data;
    -00284         dev.BulkDrain(ep.read);
    -00285         if( !Intro(0, ep, dev, data) ) {
    -00286                 dout("Probe: Intro(0) failed");
    -00287                 return false;
    -00288         }
    -00289 
    -00290         SocketZero socket(dev, ep.write, ep.read);
    -00291 
    -00292         Data send, receive;
    -00293         ZeroPacket packet(send, receive);
    -00294 
    -00295         // unknown attribute: 0x14 / 0x01
    -00296         packet.GetAttribute(SB_OBJECT_INITIAL_UNKNOWN,
    -00297                 SB_ATTR_INITIAL_UNKNOWN);
    -00298         socket.Send(packet);
    -00299 
    -00300         // fetch PIN
    -00301         packet.GetAttribute(SB_OBJECT_PROFILE, SB_ATTR_PROFILE_PIN);
    -00302         socket.Send(packet);
    -00303         if( packet.ObjectID() != SB_OBJECT_PROFILE ||
    -00304             packet.AttributeID() != SB_ATTR_PROFILE_PIN ||
    -00305             !ParsePIN(receive, pin) )
    -00306         {
    -00307                 dout("Probe: unable to fetch PIN");
    -00308                 return false;
    -00309         }
    -00310 
    -00311         // fetch Description
    -00312         packet.GetAttribute(SB_OBJECT_PROFILE, SB_ATTR_PROFILE_DESC);
    -00313         socket.Send(packet);
    -00314         // response ObjectID does not match request... :-/
    -00315         if( // packet.ObjectID() != SB_OBJECT_PROFILE ||
    -00316             packet.AttributeID() != SB_ATTR_PROFILE_DESC ||
    -00317             !ParseDesc(receive, desc) )
    -00318         {
    -00319                 dout("Probe: unable to fetch description");
    -00320         }
    -00321 
    -00322         // more unknowns:
    -00323         for( uint16_t attr = 5; attr < 9; attr++ ) {
    -00324                 packet.GetAttribute(SB_OBJECT_SOCKET_UNKNOWN, attr);
    -00325                 socket.Send(packet);
    -00326                 // FIXME parse these responses, if they turn
    -00327                 // out to be important
    -00328         }
    -00329 
    -00330         // all info obtained!
    -00331         zeroSocketSequence = socket.GetZeroSocketSequence();
    -00332         return true;
    -00333 }
    -00334 
    -00335 bool Probe::ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep)
    -00336 {
    -00337         //
    -00338         // This check is not needed for all devices.  Some devices,
    -00339         // like the 8700 have both the RIM_UsbSerData mode and IpModem mode.
    -00340         //
    -00341         // If this function is called, then we have extra endpoints,
    -00342         // so might as well try them.
    -00343         //
    -00344         // FIXME - someday, we might wish to confirm that the endpoints
    -00345         // work as a modem, and return true/false based on that test.
    -00346         //
    -00347         return true;
    -00348 
    -00349 
    -00350 // Thanks to Rick Scott (XmBlackBerry:bb_usb.c) for reverse engineering this
    -00351 //      int num_read;
    -00352 //      char data[255];
    -00353 //      int local_errno;
    -00354 //
    -00355 //      num_read = usb_control_msg(dev.GetHandle(),
    -00356 //              /* bmRequestType */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
    -00357 //              /* bRequest */ 0xa5,
    -00358 //              /* wValue */ 0,
    -00359 //              /* wIndex */ 1,
    -00360 //              /* data */ data,
    -00361 //              /* wLength */ sizeof(data),
    -00362 //              /* timeout */ 2000);
    -00363 //      local_errno = errno;
    -00364 //      if( num_read > 1 ) {
    -00365 //              if( data[0] == 0x02 ) {
    -00366 //                      return true;
    -00367 //              }
    -00368 //      }
    -00369 //      return false;
    -00370 }
    -00371 
    -00372 int Probe::FindActive(uint32_t pin) const
    -00373 {
    -00374         for( int i = 0; i < GetCount(); i++ ) {
    -00375                 if( Get(i).m_pin == pin )
    -00376                         return i;
    -00377         }
    -00378         if( pin == 0 ) {
    -00379                 // can we default to a single device?
    -00380                 if( GetCount() == 1 )
    -00381                         return 0;       // yes!
    -00382         }
    -00383 
    -00384         // PIN not found
    -00385         return -1;
    -00386 }
    -00387 
    -00388 void ProbeResult::DumpAll(std::ostream &os) const
    -00389 {
    -00390         os << *this
    -00391            << ", Interface: 0x" << std::hex << (unsigned int) m_interface
    -00392            << ", Endpoints: (read: 0x" << std::hex << (unsigned int) m_ep.read
    -00393                 << ", write: 0x" << std::hex << (unsigned int) m_ep.write
    -00394                 << ", type: 0x" << std::hex << (unsigned int) m_ep.type
    -00395            << ", ZeroSocketSequence: 0x" << std::hex << (unsigned int) m_zeroSocketSequence;
    -00396 }
    -00397 
    -00398 std::ostream& operator<< (std::ostream &os, const ProbeResult &pr)
    -00399 {
    -00400         os << "Device ID: " << pr.m_dev
    -00401            << std::hex << ". PIN: " << pr.m_pin
    -00402            << ", Description: " << pr.m_description;
    -00403         return os;
    -00404 }
    -00405 
    -00406 } // namespace Barry
    -00407 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/probe_8h.html barry-0.0.20110506/doc/www/doxygen/html/probe_8h.html --- barry-0.14/doc/www/doxygen/html/probe_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/probe_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: probe.h File Reference - - - - - - - -

    probe.h File Reference


    Detailed Description

    -USB Blackberry detection routines. -

    - -

    -Definition in file probe.h. -

    -#include "dll.h"
    -#include "usbwrap.h"
    -#include <vector>
    -#include <iosfwd>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    struct  Barry::ProbeResult
    class  Barry::Probe

    Functions

    -std::ostream & Barry::operator<< (std::ostream &os, const ProbeResult &pr)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/probe_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/probe_8h-source.html --- barry-0.14/doc/www/doxygen/html/probe_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/probe_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: probe.h Source File - - - - - - - -

    probe.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       probe.h
    -00003 ///             USB Blackberry detection routines
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_PROBE_H__
    -00023 #define __BARRY_PROBE_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "usbwrap.h"
    -00027 #include <vector>
    -00028 #include <iosfwd>
    -00029 #include <stdint.h>
    -00030 
    -00031 namespace Barry {
    -00032 
    -00033 struct BXEXPORT ProbeResult
    -00034 {
    -00035         Usb::DeviceIDType m_dev;
    -00036         unsigned char m_interface;
    -00037         uint32_t m_pin;
    -00038         Usb::EndpointPair m_ep;
    -00039         Usb::EndpointPair m_epModem;
    -00040         uint8_t m_zeroSocketSequence;
    -00041         std::string m_description;
    -00042 
    -00043         ProbeResult()
    -00044                 : m_dev(0), m_interface(0), m_pin(0), m_zeroSocketSequence(0)
    -00045                 {}
    -00046         void DumpAll(std::ostream &os) const;
    -00047         bool HasIpModem() const { return m_epModem.IsComplete(); }
    -00048 };
    -00049 
    -00050 BXEXPORT std::ostream& operator<< (std::ostream &os, const ProbeResult &pr);
    -00051 
    -00052 
    -00053 class BXEXPORT Probe
    -00054 {
    -00055         std::vector<ProbeResult> m_results;
    -00056 
    -00057         std::vector<std::string> m_fail_msgs;
    -00058         int m_fail_count;
    -00059 
    -00060         BXLOCAL bool CheckSize(const Data &data, unsigned int required);
    -00061         BXLOCAL bool ParsePIN(const Data &data, uint32_t &pin);
    -00062         BXLOCAL bool ParseDesc(const Data &data, std::string &desc);
    -00063 
    -00064 protected:
    -00065         void ProbeMatching(int vendor, int product,
    -00066                 const char *busname, const char *devname);
    -00067         void ProbeDevice(Usb::DeviceIDType devid);
    -00068         bool ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep,
    -00069                 uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequence);
    -00070         bool ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep);
    -00071 
    -00072 public:
    -00073         Probe(const char *busname = 0, const char *devname = 0);
    -00074 
    -00075         int GetCount() const { return m_results.size(); }
    -00076         int GetFailCount() const { return m_fail_count; }
    -00077 
    -00078         const std::string& GetFailMsg(int index) const { return m_fail_msgs[index]; }
    -00079         const ProbeResult& Get(int index) const { return m_results[index]; }
    -00080 
    -00081         int FindActive(uint32_t pin = 0) const; // returns -1 if pin not found
    -00082                                                 // or if no devices
    -00083 };
    -00084 
    -00085 
    -00086 } // namespace Barry
    -00087 
    -00088 #endif
    -00089 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protocol_8cc.html barry-0.0.20110506/doc/www/doxygen/html/protocol_8cc.html --- barry-0.14/doc/www/doxygen/html/protocol_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protocol_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - -Barry: protocol.cc File Reference - - - - - - - -

    protocol.cc File Reference


    Detailed Description

    -USB Blackberry bulk protocol API. -

    - -

    -Definition in file protocol.cc. -

    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "endian.h"
    -#include "error.h"
    -#include "debug.h"
    -#include <sstream>
    - -

    -Go to the source code of this file. - - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Protocol

    Functions

    -void Barry::Protocol::CheckSize (const Data &packet, size_t requiredsize)
    -unsigned int Barry::Protocol::GetSize (const Data &packet)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protocol_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/protocol_8cc-source.html --- barry-0.14/doc/www/doxygen/html/protocol_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protocol_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ - - -Barry: protocol.cc Source File - - - - - - - -

    protocol.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       protocol.cc
    -00003 ///             USB Blackberry bulk protocol API
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "protocol.h"
    -00023 #include "protostructs.h"
    -00024 #include "data.h"
    -00025 #include "endian.h"
    -00026 #include "error.h"
    -00027 #include "debug.h"
    -00028 
    -00029 #include <sstream>
    -00030 
    -00031 namespace Barry { namespace Protocol {
    -00032 
    -00033 void CheckSize(const Data &packet, size_t requiredsize)
    -00034 {
    -00035         const Packet *p = (const Packet *) packet.GetData();
    -00036 
    -00037         // when packets are larger than 0xFFFF bytes, packet->size is no
    -00038         // longer reliable, so we go with the Data class size
    -00039         if( (btohs(p->size) != packet.GetSize() && packet.GetSize() <= 0xFFFF) ||
    -00040             packet.GetSize() < requiredsize )
    -00041 
    -00042         {
    -00043                 BadSize bs(btohs(p->size), packet.GetSize(), requiredsize);
    -00044                 eout(bs.what());
    -00045                 eout(packet);
    -00046                 throw bs;
    -00047         }
    -00048 }
    -00049 
    -00050 unsigned int GetSize(const Data &packet)
    -00051 {
    -00052         CheckSize(packet, 4);
    -00053 
    -00054         // when packets are larger than 0xFFFF bytes, packet->size is no
    -00055         // longer reliable, so we go with the Data class size
    -00056         if( packet.GetSize() > 0xFFFF ) {
    -00057                 return packet.GetSize();
    -00058         }
    -00059         else {
    -00060                 const Packet *p = (const Packet *) packet.GetData();
    -00061                 return btohs(p->size);
    -00062         }
    -00063 }
    -00064 
    -00065 }} // namespace Barry::Protocol
    -00066 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protocol_8h.html barry-0.0.20110506/doc/www/doxygen/html/protocol_8h.html --- barry-0.14/doc/www/doxygen/html/protocol_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protocol_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ - - -Barry: protocol.h File Reference - - - - - - - -

    protocol.h File Reference


    Detailed Description

    -USB Blackberry bulk protocol API constants. -

    - -

    -Definition in file protocol.h. -

    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Defines

    -#define SB_COMMAND_FETCH_ATTRIBUTE   0x05
    -#define SB_COMMAND_FETCHED_ATTRIBUTE   0x06
    -#define SB_COMMAND_SELECT_MODE   0x07
    -#define SB_COMMAND_MODE_SELECTED   0x08
    -#define SB_COMMAND_OPEN_SOCKET   0x0a
    -#define SB_COMMAND_CLOSE_SOCKET   0x0b
    -#define SB_COMMAND_CLOSED_SOCKET   0x0c
    -#define SB_COMMAND_PASSWORD_CHALLENGE   0x0e
    -#define SB_COMMAND_PASSWORD   0x0f
    -#define SB_COMMAND_OPENED_SOCKET   0x10
    -#define SB_COMMAND_PASSWORD_FAILED   0x11
    -#define SB_COMMAND_SEQUENCE_HANDSHAKE   0x13
    -#define SB_COMMAND_DB_DATA   0x40
    -#define SB_COMMAND_DB_FRAGMENTED   0x60
    -#define SB_COMMAND_DB_DONE   0x41
    -#define SB_MODE_REQUEST_SOCKET   0x00ff
    -#define SB_OBJECT_INITIAL_UNKNOWN   0x14
    -#define SB_ATTR_INITIAL_UNKNOWN   0x01
    -#define SB_OBJECT_PROFILE   0x08
    -#define SB_ATTR_PROFILE_DESC   0x02
    -#define SB_ATTR_PROFILE_PIN   0x04
    -#define SB_OBJECT_SOCKET_UNKNOWN   0x04
    -#define SB_DBOP_SET_RECORD   0x41
    -#define SB_DBOP_CLEAR_DATABASE   0x43
    -#define SB_DBOP_GET_DBDB   0x4a
    -#define SB_DBOP_OLD_GET_DBDB   0x4c
    -#define SB_DBOP_GET_COUNT   0x4e
    -#define SB_DBOP_GET_RECORDS   0x4f
    -#define SB_DBOP_OLD_GET_RECORDS   0x42
    -#define SB_DBOP_OLD_GET_RECORDS_REPLY   0x44
    -#define SB_DBOP_GET_RECORD_STATE_TABLE   0x53
    -#define SB_DBOP_SET_RECORD_FLAGS   0x54
    -#define SB_DBOP_GET_RECORD_BY_INDEX   0x46
    -#define SB_DBOP_SET_RECORD_BY_INDEX   0x55
    -#define SB_DBOP_DELETE_RECORD_BY_INDEX   0x52
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protocol_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/protocol_8h-source.html --- barry-0.14/doc/www/doxygen/html/protocol_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protocol_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ - - -Barry: protocol.h Source File - - - - - - - -

    protocol.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       protocol.h
    -00003 ///             USB Blackberry bulk protocol API constants
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_PROTOCOL_H__
    -00023 #define __BARRY_PROTOCOL_H__
    -00024 
    -00025 // packet commands (Packet.command: has response codes too)
    -00026 #define SB_COMMAND_FETCH_ATTRIBUTE      0x05
    -00027 #define SB_COMMAND_FETCHED_ATTRIBUTE    0x06
    -00028 #define SB_COMMAND_SELECT_MODE          0x07
    -00029 #define SB_COMMAND_MODE_SELECTED        0x08
    -00030 #define SB_COMMAND_OPEN_SOCKET          0x0a
    -00031 #define SB_COMMAND_CLOSE_SOCKET         0x0b
    -00032 #define SB_COMMAND_CLOSED_SOCKET        0x0c
    -00033 #define SB_COMMAND_PASSWORD_CHALLENGE   0x0e
    -00034 #define SB_COMMAND_PASSWORD             0x0f
    -00035 #define SB_COMMAND_OPENED_SOCKET        0x10
    -00036 #define SB_COMMAND_PASSWORD_FAILED      0x11
    -00037 #define SB_COMMAND_SEQUENCE_HANDSHAKE   0x13
    -00038 #define SB_COMMAND_DB_DATA              0x40
    -00039 #define SB_COMMAND_DB_FRAGMENTED        0x60
    -00040 #define SB_COMMAND_DB_DONE              0x41
    -00041 
    -00042 
    -00043 // mode constants
    -00044 #define SB_MODE_REQUEST_SOCKET          0x00ff
    -00045 
    -00046 
    -00047 // object and attribute ID codes (for ZeroPacket::GetAttribute())
    -00048 // meanings for most of these are unknown
    -00049 #define SB_OBJECT_INITIAL_UNKNOWN               0x14
    -00050 #define         SB_ATTR_INITIAL_UNKNOWN         0x01
    -00051 #define SB_OBJECT_PROFILE                       0x08
    -00052 #define         SB_ATTR_PROFILE_DESC            0x02
    -00053 #define         SB_ATTR_PROFILE_PIN             0x04
    -00054 #define SB_OBJECT_SOCKET_UNKNOWN                0x04
    -00055 
    -00056 
    -00057 // param command parameters
    -00058 //#define SB_PARAM_DEFAULT              0xff
    -00059 
    -00060 
    -00061 // DB Operation Command
    -00062 #define SB_DBOP_SET_RECORD              0x41
    -00063 #define SB_DBOP_CLEAR_DATABASE          0x43
    -00064 #define SB_DBOP_GET_DBDB                0x4a
    -00065 #define SB_DBOP_OLD_GET_DBDB            0x4c
    -00066 #define SB_DBOP_GET_COUNT               0x4e
    -00067 #define SB_DBOP_GET_RECORDS             0x4f
    -00068 #define SB_DBOP_OLD_GET_RECORDS         0x42
    -00069 #define SB_DBOP_OLD_GET_RECORDS_REPLY   0x44
    -00070 
    -00071 #define SB_DBOP_GET_RECORD_STATE_TABLE  0x53    // replies with 0x60, 0x41
    -00072 #define SB_DBOP_SET_RECORD_FLAGS        0x54    // replies with 0x41
    -00073                                                 // used to clear dirty flag
    -00074 #define SB_DBOP_GET_RECORD_BY_INDEX     0x46    // replies with 0x44
    -00075         // John's device uses 0x50, with a reply of 0x4f (!)
    -00076         // Then uses 0x55 as usual
    -00077         // Delete uses 0x50/0x4f to check as well, then uses 0x52 as
    -00078         // usual to do the actual delete.
    -00079 #define SB_DBOP_SET_RECORD_BY_INDEX     0x55    // replies with 0x41
    -00080 #define SB_DBOP_DELETE_RECORD_BY_INDEX  0x52    // intellisync does a GET(0x46)
    -00081                                                 // first, probably to make sure
    -00082                                                 // it has the right data and
    -00083                                                 // record
    -00084 
    -00085 #endif
    -00086 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protostructs_8h.html barry-0.0.20110506/doc/www/doxygen/html/protostructs_8h.html --- barry-0.14/doc/www/doxygen/html/protostructs_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protostructs_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,327 +0,0 @@ - - -Barry: protostructs.h File Reference - - - - - - - -

    protostructs.h File Reference


    Detailed Description

    -USB Blackberry bulk protocol API. -

    -This is split out from protocol.h so that low level, packed structs can be compiled separately from the application. This prevents aliasing problems in the application, or using -fno-strict-aliasing, which the library only needs.

    -Do not include this in any Barry library header. This may only be included from .cc files, in order to hide aliasing concernes from the application. -

    -Definition in file protostructs.h. -

    -#include <stdint.h>
    -#include <sys/types.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Barry::Protocol

    Classes

    union  Barry::Protocol::SizePacket
    struct  Barry::Protocol::GroupLink
    struct  Barry::Protocol::MessageAddress
    struct  Barry::Protocol::CommonField
    union  Barry::Protocol::CommonField::CommonFieldData
    struct  Barry::Protocol::CommandTableField
    struct  Barry::Protocol::OldDBDBField
    struct  Barry::Protocol::DBDBField
    struct  Barry::Protocol::RecordStateTableField
    struct  Barry::Protocol::CalendarRecurrenceDataField
    union  Barry::Protocol::CalendarRecurrenceDataField::Additional
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::Day
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
    struct  Barry::Protocol::CalendarRecurrenceDataField::Additional::Week
    struct  Barry::Protocol::PackedField_02
    struct  Barry::Protocol::PackedField_10
    struct  Barry::Protocol::ServiceBookConfigField
    struct  Barry::Protocol::DBC_Record
    struct  Barry::Protocol::DBC_RecordFlags
    struct  Barry::Protocol::DBC_TaggedUpload
    struct  Barry::Protocol::DBC_IndexedUpload
    struct  Barry::Protocol::PasswordChallenge
    union  Barry::Protocol::PasswordChallenge::Hash
    struct  Barry::Protocol::AttributeFetch
    struct  Barry::Protocol::ModeSelect
    struct  Barry::Protocol::ModeSelect::ResponseBlock
    struct  Barry::Protocol::SocketCommand
    union  Barry::Protocol::SocketCommand::PacketData
    struct  Barry::Protocol::SequenceCommand
    struct  Barry::Protocol::DBCommand
    union  Barry::Protocol::DBCommand::Parameters
    struct  Barry::Protocol::DBR_OldDBDBRecord
    struct  Barry::Protocol::DBR_DBDBRecord
    struct  Barry::Protocol::DBR_OldTaggedRecord
    union  Barry::Protocol::DBR_OldTaggedRecord::TaggedData
    struct  Barry::Protocol::MessageRecord
    struct  Barry::Protocol::DBResponse
    union  Barry::Protocol::DBResponse::Parameters
    struct  Barry::Protocol::DBAccess
    union  Barry::Protocol::DBAccess::DBData
    struct  Barry::Protocol::Packet
    union  Barry::Protocol::Packet::PacketData

    Defines

    -#define COMMON_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::CommonField) - sizeof(Barry::Protocol::CommonField::CommonFieldData))
    -#define COMMON_FIELD_MIN1900_SIZE   (sizeof(int32_t))
    -#define COMMAND_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::CommandTableField) - 1)
    -#define OLD_DBDB_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::OldDBDBField) - 1)
    -#define DBDB_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::DBDBField) - 1)
    -#define BARRY_RSTF_DIRTY   0x01
    -#define CRDF_TYPE_DAY   0x01
    -#define CRDF_TYPE_MONTH_BY_DATE   0x03
    -#define CRDF_TYPE_MONTH_BY_DAY   0x04
    -#define CRDF_TYPE_YEAR_BY_DATE   0x05
    -#define CRDF_TYPE_YEAR_BY_DAY   0x06
    -#define CRDF_TYPE_WEEK   0x0c
    -#define CRDF_WD_SUN   0x01
    -#define CRDF_WD_MON   0x02
    -#define CRDF_WD_TUE   0x04
    -#define CRDF_WD_WED   0x08
    -#define CRDF_WD_THU   0x10
    -#define CRDF_WD_FRI   0x20
    -#define CRDF_WD_SAT   0x40
    -#define CALENDAR_RECURRENCE_DATA_FIELD_SIZE   sizeof(Barry::Protocol::CalendarRecurrenceDataField)
    -#define PACKED_FIELD_02_HEADER_SIZE   (sizeof(Barry::Protocol::PackedField_02) - 1)
    -#define PACKED_FIELD_10_HEADER_SIZE   (sizeof(Barry::Protocol::PackedField_10) - 1)
    -#define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE   (sizeof(Barry::Protocol::ServiceBookConfigField) - 1)
    -#define DBC_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_Record) - 1)
    -#define DBC_RECORD_FLAGS_SIZE   (sizeof(Barry::Protocol::DBC_RecordFlags))
    -#define DBC_TAGGED_UPLOAD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_TaggedUpload) - 1)
    -#define DBC_INDEXED_UPLOAD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_IndexedUpload) - 1)
    -#define PASSWORD_CHALLENGE_HEADER_SIZE   (sizeof(Barry::Protocol::PasswordChallenge) - sizeof(Barry::Protocol::PasswordChallenge::Hash))
    -#define PASSWORD_CHALLENGE_SEED_SIZE   (PASSWORD_CHALLENGE_HEADER_SIZE + sizeof(uint32_t))
    -#define PASSWORD_CHALLENGE_SIZE   (sizeof(Barry::Protocol::PasswordChallenge))
    -#define ATTRIBUTE_FETCH_COMMAND_SIZE   (sizeof(Barry::Protocol::AttributeFetch) - 1)
    -#define SOCKET_COMMAND_HEADER_SIZE   (sizeof(Barry::Protocol::SocketCommand) - sizeof(Barry::Protocol::SocketCommand::PacketData))
    -#define DB_COMMAND_HEADER_SIZE   (sizeof(Barry::Protocol::DBCommand) - sizeof(Barry::Protocol::DBCommand::Parameters))
    -#define OLD_DBDB_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_OldDBDBRecord) - sizeof(Barry::Protocol::OldDBDBField))
    -#define DBDB_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_DBDBRecord) - sizeof(Barry::Protocol::DBDBField))
    -#define DBR_OLD_TAGGED_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::DBR_OldTaggedRecord) - sizeof(Barry::Protocol::DBR_OldTaggedRecord::TaggedData))
    -#define MESSAGE_RECORD_HEADER_SIZE   (sizeof(Barry::Protocol::MessageRecord) - sizeof(Barry::Protocol::CommonField))
    -#define DB_RESPONSE_HEADER_SIZE   (sizeof(Barry::Protocol::DBResponse) - sizeof(Barry::Protocol::DBResponse::Parameters))
    -#define SB_DBACCESS_HEADER_SIZE   (sizeof(Barry::Protocol::DBAccess) - sizeof(Barry::Protocol::DBAccess::DBData))
    -#define SB_DBACCESS_RETURN_CODE_SIZE   (1)
    -#define SB_PACKET_HEADER_SIZE   (sizeof(Barry::Protocol::Packet) - sizeof(Barry::Protocol::Packet::PacketData))
    -#define MIN_PACKET_SIZE   6
    -#define MAX_PACKET_SIZE   0x400
    -#define SB_PACKET_DBACCESS_HEADER_SIZE   (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE)
    -#define SB_FRAG_HEADER_SIZE   SB_PACKET_DBACCESS_HEADER_SIZE
    -#define SB_PACKET_COMMAND_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + DB_COMMAND_HEADER_SIZE)
    -#define SB_PACKET_RESPONSE_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + DB_RESPONSE_HEADER_SIZE)
    -#define SB_PACKET_DBDB_HEADER_SIZE   (SB_PACKET_RESPONSE_HEADER_SIZE + DBDB_RECORD_HEADER_SIZE)
    -#define SB_PACKET_OLD_DBDB_HEADER_SIZE   (SB_PACKET_RESPONSE_HEADER_SIZE + OLD_DBDB_RECORD_HEADER_SIZE)
    -#define SB_PACKET_UPLOAD_HEADER_SIZE   (SB_PACKET_DBACCESS_HEADER_SIZE + UPLOAD_HEADER_SIZE)
    -#define SB_SEQUENCE_PACKET_SIZE   (SB_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::SequenceCommand))
    -#define SB_SOCKET_PACKET_HEADER_SIZE   (SB_PACKET_HEADER_SIZE + SOCKET_COMMAND_HEADER_SIZE)
    -#define SB_MODE_PACKET_COMMAND_SIZE   (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect) - sizeof(Barry::Protocol::ModeSelect::ResponseBlock))
    -#define SB_MODE_PACKET_RESPONSE_SIZE   (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect))
    -#define COMMAND(data)   (((const Barry::Protocol::Packet *)data.GetData())->command)
    -#define IS_COMMAND(data, cmd)   (COMMAND(data) == cmd)
    -#define MAKE_PACKET(var, data)   const Barry::Protocol::Packet *var = (const Barry::Protocol::Packet *) (data).GetData()
    -#define MAKE_PACKETPTR_BUF(var, ptr)   Barry::Protocol::Packet *var = (Barry::Protocol::Packet *)ptr
    -#define MAKE_RECORD(type, var, data, off)   type *var = (type *) ((data).GetData() + (off))
    -#define MAKE_RECORD_PTR(type, var, data, off)   type *var = (type *) ((data) + (off))

    Functions

    -void Barry::Protocol::CheckSize (const Data &packet, size_t requiredsize)
    -unsigned int Barry::Protocol::GetSize (const Data &packet)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/protostructs_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/protostructs_8h-source.html --- barry-0.14/doc/www/doxygen/html/protostructs_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/protostructs_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ - - -Barry: protostructs.h Source File - - - - - - - -

    protostructs.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       protostructs.h
    -00003 ///             USB Blackberry bulk protocol API.  This is split out from
    -00004 ///             protocol.h so that low level, packed structs can be
    -00005 ///             compiled separately from the application.  This prevents
    -00006 ///             aliasing problems in the application, or using
    -00007 ///             -fno-strict-aliasing, which the library only needs.
    -00008 ///
    -00009 ///             Do not include this in any Barry library header.
    -00010 ///             This may only be included from .cc files, in order
    -00011 ///             to hide aliasing concernes from the application.
    -00012 ///
    -00013 
    -00014 /*
    -00015     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00016 
    -00017     This program is free software; you can redistribute it and/or modify
    -00018     it under the terms of the GNU General Public License as published by
    -00019     the Free Software Foundation; either version 2 of the License, or
    -00020     (at your option) any later version.
    -00021 
    -00022     This program is distributed in the hope that it will be useful,
    -00023     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00024     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00025 
    -00026     See the GNU General Public License in the COPYING file at the
    -00027     root directory of this project for more details.
    -00028 */
    -00029 
    -00030 #ifndef __BARRY_PROTOSTRUCTS_H__
    -00031 #define __BARRY_PROTOSTRUCTS_H__
    -00032 
    -00033 #include <stdint.h>
    -00034 #include <sys/types.h>
    -00035 
    -00036 // forward declarations
    -00037 namespace Barry { class Data; }
    -00038 
    -00039 namespace Barry { namespace Protocol {
    -00040 
    -00041 ///////////////////////////////////////////////////////////////////////////////
    -00042 union SizePacket
    -00043 {
    -00044         uint16_t size;
    -00045         char buffer[4];
    -00046 } __attribute__ ((packed));
    -00047 
    -00048 
    -00049 ///////////////////////////////////////////////////////////////////////////////
    -00050 // Record sub-field structs
    -00051 
    -00052 struct GroupLink                                // used for Contacts records
    -00053 {
    -00054         uint32_t        uniqueId;
    -00055         uint16_t        unknown;
    -00056 } __attribute__ ((packed));
    -00057 
    -00058 struct MessageAddress                           // used for Message records
    -00059 {
    -00060         uint8_t         unknown[8];
    -00061         uint8_t         addr[1];        // 2 null terminated strings: first
    -00062                                         // contains full name, second contains
    -00063                                         // the email address
    -00064 } __attribute__ ((packed));
    -00065 
    -00066 
    -00067 
    -00068 ///////////////////////////////////////////////////////////////////////////////
    -00069 // Record Field Formats
    -00070 
    -00071 struct CommonField
    -00072 {
    -00073         uint16_t        size;                   // including null terminator
    -00074         uint8_t         type;
    -00075 
    -00076         union CommonFieldData
    -00077         {
    -00078 
    -00079                 GroupLink       link;
    -00080                 MessageAddress  addr;
    -00081                 uint32_t        uint32;
    -00082                 int32_t         min1900;
    -00083                 uint16_t        code;
    -00084                 uint8_t         raw[1];
    -00085                 int16_t         int16;
    -00086 
    -00087         } __attribute__ ((packed)) u;
    -00088 
    -00089 } __attribute__ ((packed));
    -00090 #define COMMON_FIELD_HEADER_SIZE        (sizeof(Barry::Protocol::CommonField) - sizeof(Barry::Protocol::CommonField::CommonFieldData))
    -00091 #define COMMON_FIELD_MIN1900_SIZE       (sizeof(int32_t))
    -00092 
    -00093 struct CommandTableField
    -00094 {
    -00095         uint8_t         size;           // no null terminator
    -00096         uint8_t         code;
    -00097         uint8_t         name[1];
    -00098 } __attribute__ ((packed));
    -00099 #define COMMAND_FIELD_HEADER_SIZE       (sizeof(Barry::Protocol::CommandTableField) - 1)
    -00100 
    -00101 struct OldDBDBField
    -00102 {
    -00103         uint16_t        dbNumber;
    -00104         uint8_t         unknown1;
    -00105         uint32_t        dbSize;                 // assumed from Cassis docs...
    -00106                                                 // always 0 in USB
    -00107         uint16_t        dbRecordCount;
    -00108         uint16_t        unknown2;
    -00109         uint16_t        nameSize;               // includes null terminator
    -00110         uint8_t         name[1];
    -00111 } __attribute__ ((packed));
    -00112 #define OLD_DBDB_FIELD_HEADER_SIZE      (sizeof(Barry::Protocol::OldDBDBField) - 1)
    -00113 
    -00114 struct DBDBField
    -00115 {
    -00116         uint16_t        dbNumber;
    -00117         uint8_t         unknown1;
    -00118         uint32_t        dbSize;                 // assumed from Cassis docs...
    -00119                                                 // always 0 in USB
    -00120         uint32_t        dbRecordCount;
    -00121         uint16_t        unknown2;
    -00122         uint16_t        nameSize;               // includes null terminator
    -00123         uint8_t         unknown3;
    -00124         uint8_t         name[1];                // followed by 2 zeros!
    -00125         uint16_t        unknown;                // this comes after the
    -00126                                                 // null terminated name, but
    -00127                                                 // is here for size calcs
    -00128 } __attribute__ ((packed));
    -00129 #define DBDB_FIELD_HEADER_SIZE  (sizeof(Barry::Protocol::DBDBField) - 1)
    -00130 
    -00131 struct RecordStateTableField
    -00132 {
    -00133         uint8_t         rectype;                // it is unknown exactly what
    -00134                                                 // this field does, but it
    -00135                                                 // shows up here and in the
    -00136                                                 // tagged record header, and
    -00137                                                 // for some of the records
    -00138                                                 // they must match when writing
    -00139         uint16_t        index;
    -00140         uint32_t        uniqueId;               // matches the uniqueId of say,
    -00141                                                 // address book records
    -00142         uint8_t         flags;                  // bit 0x01 is the dirty flag
    -00143                                                 // don't know if any other bits
    -00144                                                 // are used
    -00145 #define BARRY_RSTF_DIRTY        0x01
    -00146         uint8_t         unknown2[4];
    -00147 } __attribute__ ((packed));
    -00148 
    -00149 struct CalendarRecurrenceDataField  // as documented in the Cassis project spec
    -00150 {
    -00151         uint8_t         type;
    -00152 #define CRDF_TYPE_DAY           0x01
    -00153 #define CRDF_TYPE_MONTH_BY_DATE 0x03
    -00154 #define CRDF_TYPE_MONTH_BY_DAY  0x04
    -00155 #define CRDF_TYPE_YEAR_BY_DATE  0x05
    -00156 #define CRDF_TYPE_YEAR_BY_DAY   0x06
    -00157 #define CRDF_TYPE_WEEK          0x0c
    -00158 
    -00159         uint8_t         unknown;                // always 0x01
    -00160         uint16_t        interval;
    -00161         uint32_t        startTime;
    -00162         uint32_t        endTime;                // 0xFFFFFFFF for never
    -00163 
    -00164         union Additional
    -00165         {
    -00166                 // Note: blank fields should be set to 0
    -00167 
    -00168                 struct Day
    -00169                 {
    -00170                         uint8_t day[6];         // always zeros!
    -00171                 } __attribute__ ((packed)) day;
    -00172 
    -00173                 struct MonthByDate
    -00174                 {
    -00175                         uint8_t monthDay;       // day of month to recur on
    -00176                                                 // (1-31)
    -00177                         uint8_t blank[5];
    -00178                 } __attribute__ ((packed)) month_by_date;
    -00179 
    -00180                 struct MonthByDay
    -00181                 {
    -00182                         uint8_t weekDay;        // day of week to recur on (0-6)
    -00183                         uint8_t week;           // week of month to recur on
    -00184                                                 // (1 to 5, first week, second
    -00185                                                 // week, etc)
    -00186                         uint8_t blank[4];
    -00187                 } __attribute__ ((packed)) month_by_day;
    -00188 
    -00189                 struct YearByDate
    -00190                 {
    -00191                         uint8_t monthDay;       // day of month to recur on
    -00192                                                 // (1-31)
    -00193                         uint8_t blank;
    -00194                         uint8_t month;          // month to recur on (1-12)
    -00195                         uint8_t blank_[3];
    -00196                 } __attribute__ ((packed)) year_by_date;
    -00197 
    -00198                 struct YearByDay
    -00199                 {
    -00200                         uint8_t weekDay;        // day of week to recur on (0-6)
    -00201                         uint8_t week;           // week of month (1 to 5)
    -00202                         uint8_t month;          // (1-12)
    -00203                         uint8_t blank[3];
    -00204                 } __attribute__ ((packed)) year_by_day;
    -00205 
    -00206                 struct Week
    -00207                 {
    -00208                         uint8_t days;           // bitmask
    -00209                         #define CRDF_WD_SUN     0x01
    -00210                         #define CRDF_WD_MON     0x02
    -00211                         #define CRDF_WD_TUE     0x04
    -00212                         #define CRDF_WD_WED     0x08
    -00213                         #define CRDF_WD_THU     0x10
    -00214                         #define CRDF_WD_FRI     0x20
    -00215                         #define CRDF_WD_SAT     0x40
    -00216 
    -00217                         uint8_t blank[5];
    -00218                 } __attribute__ ((packed)) week;
    -00219 
    -00220         } __attribute__ ((packed)) u;
    -00221 
    -00222 } __attribute__ ((packed));
    -00223 #define CALENDAR_RECURRENCE_DATA_FIELD_SIZE     sizeof(Barry::Protocol::CalendarRecurrenceDataField)
    -00224 
    -00225 
    -00226 
    -00227 ///////////////////////////////////////////////////////////////////////////////
    -00228 // Packed field structures - odd format used with Service Book records
    -00229 
    -00230 struct PackedField_02
    -00231 {
    -00232         uint8_t         code;
    -00233         uint8_t         size;
    -00234         uint8_t         type;
    -00235         uint8_t         raw[1];
    -00236 } __attribute__ ((packed));
    -00237 #define PACKED_FIELD_02_HEADER_SIZE     (sizeof(Barry::Protocol::PackedField_02) - 1)
    -00238 
    -00239 struct PackedField_10
    -00240 {
    -00241         uint8_t         type;
    -00242         uint8_t         size;
    -00243         uint8_t         raw[1];
    -00244 } __attribute__ ((packed));
    -00245 #define PACKED_FIELD_10_HEADER_SIZE     (sizeof(Barry::Protocol::PackedField_10) - 1)
    -00246 
    -00247 
    -00248 
    -00249 
    -00250 ///////////////////////////////////////////////////////////////////////////////
    -00251 // Service Book field and record structures
    -00252 
    -00253 struct ServiceBookConfigField
    -00254 {
    -00255         uint8_t         format;
    -00256         uint8_t         fields[1];
    -00257 } __attribute__ ((packed));
    -00258 #define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::ServiceBookConfigField) - 1)
    -00259 
    -00260 
    -00261 ///////////////////////////////////////////////////////////////////////////////
    -00262 // DB Command Parameter structures
    -00263 
    -00264 struct DBC_Record
    -00265 {
    -00266         uint16_t        recordIndex;    // index comes from RecordStateTable
    -00267         uint8_t         data[1];
    -00268 } __attribute__ ((packed));
    -00269 #define DBC_RECORD_HEADER_SIZE          (sizeof(Barry::Protocol::DBC_Record) - 1)
    -00270 
    -00271 struct DBC_RecordFlags
    -00272 {
    -00273         uint8_t         unknown;
    -00274         uint16_t        index;
    -00275         uint8_t         unknown2[5];
    -00276 } __attribute__ ((packed));
    -00277 #define DBC_RECORD_FLAGS_SIZE           (sizeof(Barry::Protocol::DBC_RecordFlags))
    -00278 
    -00279 struct DBC_TaggedUpload
    -00280 {
    -00281         uint8_t         rectype;                // it is unknown exactly what
    -00282                                                 // this field does, but it
    -00283                                                 // shows up here and in the
    -00284                                                 // RecordStateTable, and
    -00285                                                 // for some of the records
    -00286                                                 // they must match when writing
    -00287         uint32_t        uniqueId;
    -00288         uint8_t         unknown2;
    -00289         uint8_t         data[1];
    -00290 } __attribute__ ((packed));
    -00291 #define DBC_TAGGED_UPLOAD_HEADER_SIZE   (sizeof(Barry::Protocol::DBC_TaggedUpload) - 1)
    -00292 
    -00293 struct DBC_IndexedUpload
    -00294 {
    -00295         uint8_t         unknown;        // observed: 00 or 05
    -00296         uint16_t        index;
    -00297         uint8_t         data[1];
    -00298 } __attribute__ ((packed));
    -00299 #define DBC_INDEXED_UPLOAD_HEADER_SIZE  (sizeof(Barry::Protocol::DBC_IndexedUpload) - 1)
    -00300 
    -00301 struct PasswordChallenge
    -00302 {
    -00303         uint8_t         remaining_tries;        // number of password attempts
    -00304                                                 // the device will accept before
    -00305                                                 // committing suicide...
    -00306                                                 // starts at 10 and counts down
    -00307                                                 // on each bad password
    -00308         uint8_t         unknown;                // observed as 0... probably just
    -00309                                                 // the top byte of a uint16
    -00310                                                 // remaining_tries, but I don't
    -00311                                                 // want to take that chance
    -00312         uint16_t        param;                  // seems to be a secondary command
    -00313                                                 // of some kind, observed as 0x14
    -00314                                                 // or 0x04, but purpose unknown
    -00315                                                 // possibly a send/receive flag
    -00316                                                 // bit (0x10/0x00)
    -00317         union Hash
    -00318         {
    -00319                 uint32_t        seed;
    -00320                 uint8_t         hash[20];
    -00321         } __attribute__ ((packed)) u;
    -00322 
    -00323 } __attribute__ ((packed));
    -00324 #define PASSWORD_CHALLENGE_HEADER_SIZE  (sizeof(Barry::Protocol::PasswordChallenge) - sizeof(Barry::Protocol::PasswordChallenge::Hash))
    -00325 #define PASSWORD_CHALLENGE_SEED_SIZE    (PASSWORD_CHALLENGE_HEADER_SIZE + sizeof(uint32_t))
    -00326 #define PASSWORD_CHALLENGE_SIZE         (sizeof(Barry::Protocol::PasswordChallenge))
    -00327 
    -00328 struct AttributeFetch
    -00329 {
    -00330         uint16_t        object;
    -00331         uint16_t        attribute;
    -00332         uint8_t         raw[1];                 // used only in response
    -00333 } __attribute__ ((packed));
    -00334 #define ATTRIBUTE_FETCH_COMMAND_SIZE    (sizeof(Barry::Protocol::AttributeFetch) - 1)
    -00335 
    -00336 struct ModeSelect
    -00337 {
    -00338         uint8_t         name[16];
    -00339         struct ResponseBlock
    -00340         {
    -00341                 uint8_t         unknown[20];
    -00342         } __attribute__ ((packed)) response;
    -00343 } __attribute__ ((packed));
    -00344 
    -00345 
    -00346 ///////////////////////////////////////////////////////////////////////////////
    -00347 // Protocol command structures
    -00348 
    -00349 struct SocketCommand
    -00350 {
    -00351         uint16_t        socket;
    -00352         uint8_t         sequence;               // incremented on each socket 0
    -00353                                                 // communication, replies return
    -00354                                                 // the same number from command
    -00355 
    -00356         union PacketData
    -00357         {
    -00358 
    -00359                 PasswordChallenge       password;
    -00360                 AttributeFetch          fetch;
    -00361                 ModeSelect              mode;
    -00362                 uint8_t                 raw[1];
    -00363 
    -00364         } __attribute__ ((packed)) u;
    -00365 } __attribute__ ((packed));
    -00366 #define SOCKET_COMMAND_HEADER_SIZE              (sizeof(Barry::Protocol::SocketCommand) - sizeof(Barry::Protocol::SocketCommand::PacketData))
    -00367 
    -00368 struct SequenceCommand
    -00369 {
    -00370         uint8_t         unknown1;
    -00371         uint8_t         unknown2;
    -00372         uint8_t         unknown3;
    -00373         uint32_t        sequenceId;
    -00374 } __attribute__ ((packed));
    -00375 
    -00376 struct DBCommand
    -00377 {
    -00378         uint8_t         operation;      // see below
    -00379         uint16_t        databaseId;     // value from the Database Database
    -00380 
    -00381         union Parameters
    -00382         {
    -00383 
    -00384                 DBC_Record              record;
    -00385                 DBC_RecordFlags         flags;
    -00386                 DBC_TaggedUpload        tag_upload;
    -00387                 DBC_IndexedUpload       index_upload;
    -00388                 uint8_t                 raw[1];
    -00389 
    -00390         } __attribute__ ((packed)) u;
    -00391 } __attribute__ ((packed));
    -00392 #define DB_COMMAND_HEADER_SIZE          (sizeof(Barry::Protocol::DBCommand) - sizeof(Barry::Protocol::DBCommand::Parameters))
    -00393 
    -00394 
    -00395 
    -00396 ///////////////////////////////////////////////////////////////////////////////
    -00397 // Protocol response parameter structures
    -00398 
    -00399 struct DBR_OldDBDBRecord
    -00400 {
    -00401         uint16_t        count;                  // number of fields in record
    -00402         OldDBDBField    field[1];
    -00403 } __attribute__ ((packed));
    -00404 #define OLD_DBDB_RECORD_HEADER_SIZE     (sizeof(Barry::Protocol::DBR_OldDBDBRecord) - sizeof(Barry::Protocol::OldDBDBField))
    -00405 
    -00406 struct DBR_DBDBRecord
    -00407 {
    -00408         uint16_t        count;
    -00409         uint8_t         unknown[3];
    -00410         DBDBField       field[1];
    -00411 } __attribute__ ((packed));
    -00412 #define DBDB_RECORD_HEADER_SIZE         (sizeof(Barry::Protocol::DBR_DBDBRecord) - sizeof(Barry::Protocol::DBDBField))
    -00413 
    -00414 // Records with a uniqueId.  This covers the following records:
    -00415 //
    -00416 //      Old Contact records
    -00417 //      Old Service Book records
    -00418 //      Old Calendar records
    -00419 //
    -00420 struct DBR_OldTaggedRecord
    -00421 {
    -00422         uint8_t         rectype;
    -00423         uint16_t        index;
    -00424         uint32_t        uniqueId;
    -00425         uint8_t         unknown2;
    -00426 
    -00427         union TaggedData
    -00428         {
    -00429                 CommonField     field[1];
    -00430         } __attribute__ ((packed)) u;
    -00431 } __attribute__ ((packed));
    -00432 #define DBR_OLD_TAGGED_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::DBR_OldTaggedRecord) - sizeof(Barry::Protocol::DBR_OldTaggedRecord::TaggedData))
    -00433 
    -00434 struct MessageRecord
    -00435 {
    -00436         uint8_t         field1;         // always 'j'
    -00437         uint32_t        field2;         // always 0x00000000
    -00438         uint32_t        flags;          // flags
    -00439         uint32_t        field4;         // normal email and pin recv this is 0x7ff
    -00440                                         // changes on sent and reply to 0x01ffffff
    -00441                                         // and 0x003fffff on pin send
    -00442         uint32_t        field5;         // always 0x00000000
    -00443         uint32_t        field6;         // always 0x00000000
    -00444         uint32_t        field7;         // always 0x00000000
    -00445         uint32_t        field8;         // always 0x00000000
    -00446         uint16_t        field9;         // always 0x0000
    -00447         
    -00448         uint16_t        dateReceived;   // the first two of these time fields are always the same
    -00449         uint16_t        timeReceived;   // 
    -00450         uint16_t        dateDuplicate;  // On mail sent from the BB all three fields are identical
    -00451         uint16_t        timeDuplicate;  // (time sent)
    -00452         uint16_t        dateSent;       
    -00453         uint16_t        timeSent;
    -00454         
    -00455         uint16_t        priority;       // priority field
    -00456         uint32_t        field14;        // always 0x00000000
    -00457         uint32_t        field15;        // always 0x00000000
    -00458         uint16_t        field16;        // always 0x0000
    -00459         uint32_t        field13;        // PIN reply 0x00000000 other time 0xffffffff or 0xfffffffe
    -00460         uint16_t        messageSize;    // Message size, 0x0000 if Reply or Saved, 0xffff if below ????
    -00461         uint32_t        field18;        // 0x0's and 0xF'x
    -00462         uint32_t        field19;        // 0x0's and 0xF's
    -00463         uint16_t        field20;        // always 0x0000
    -00464         uint16_t        field21;        // 0x01 unless PIN reply then 0x00
    -00465         uint32_t        inReplyTo;      // reply to message?
    -00466         uint32_t        field22;        // always 0x00000000
    -00467         uint16_t        field23;        // FIXME
    -00468         
    -00469         uint32_t        folderOne;      // these are the 'folders' the message is in
    -00470         uint32_t        folderTwo;      //
    -00471          
    -00472         uint16_t        replyMessageFlags;      // 0xfffe on recvd messages
    -00473                                         // 0x001b on reply
    -00474                                         // 0x0015 on send
    -00475                                         // 0x3 pin send
    -00476                                         // 0x2 on pin recv
    -00477         uint16_t        field27;        // set to 0x00000004 on PIN reply, 0x00000005 otherwise
    -00478         uint32_t        headerUID;      // yet another copy of the UID (RecId)  
    -00479         
    -00480         uint32_t        field29;        // always 0x00000000
    -00481         uint16_t        field30;        // always 0x0002
    -00482         uint16_t        field31;        // always 0x00000000
    -00483         uint16_t        field32;        // always 0x0004
    -00484         uint16_t        field34;        // always 0x0000
    -00485         uint8_t         field33;        // always 'd'
    -00486         uint32_t        timeBlock;      // FIXME
    -00487         CommonField     field[1];
    -00488 } __attribute__ ((packed));
    -00489 #define MESSAGE_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::MessageRecord) - sizeof(Barry::Protocol::CommonField))
    -00490 
    -00491 
    -00492 
    -00493 ///////////////////////////////////////////////////////////////////////////////
    -00494 // Protocol response structures
    -00495 
    -00496 struct DBResponse
    -00497 {
    -00498         uint8_t         operation;
    -00499 
    -00500         union Parameters
    -00501         {
    -00502 
    -00503                 DBR_OldTaggedRecord     tagged;
    -00504                 DBR_OldDBDBRecord       old_dbdb;
    -00505                 DBR_DBDBRecord          dbdb;
    -00506 
    -00507         } __attribute__ ((packed)) u;
    -00508 
    -00509 } __attribute__ ((packed));
    -00510 #define DB_RESPONSE_HEADER_SIZE         (sizeof(Barry::Protocol::DBResponse) - sizeof(Barry::Protocol::DBResponse::Parameters))
    -00511 
    -00512 
    -00513 
    -00514 ///////////////////////////////////////////////////////////////////////////////
    -00515 // Database access command structure
    -00516 
    -00517 // even fragmented packets have a tableCmd
    -00518 struct DBAccess
    -00519 {
    -00520         uint8_t         tableCmd;
    -00521 
    -00522         union DBData
    -00523         {
    -00524                 DBCommand               command;
    -00525                 DBResponse              response;
    -00526                 CommandTableField       table[1];
    -00527                 uint8_t                 return_code;
    -00528                 uint8_t                 fragment[1];
    -00529 
    -00530         } __attribute__ ((packed)) u;
    -00531 } __attribute__ ((packed));
    -00532 #define SB_DBACCESS_HEADER_SIZE                 (sizeof(Barry::Protocol::DBAccess) - sizeof(Barry::Protocol::DBAccess::DBData))
    -00533 #define SB_DBACCESS_RETURN_CODE_SIZE            (1)
    -00534 
    -00535 
    -00536 
    -00537 ///////////////////////////////////////////////////////////////////////////////
    -00538 // Main packet struct
    -00539 
    -00540 struct Packet
    -00541 {
    -00542         uint16_t        socket;         // socket ID... 0 exists by default
    -00543         uint16_t        size;           // total size of data packet
    -00544         uint8_t         command;
    -00545 
    -00546         union PacketData
    -00547         {
    -00548 
    -00549                 SocketCommand           socket;
    -00550                 SequenceCommand         sequence;
    -00551                 DBAccess                db;
    -00552                 uint8_t                 raw[1];
    -00553 
    -00554         } __attribute__ ((packed)) u;
    -00555 } __attribute__ ((packed));
    -00556 #define SB_PACKET_HEADER_SIZE                   (sizeof(Barry::Protocol::Packet) - sizeof(Barry::Protocol::Packet::PacketData))
    -00557 
    -00558 // minimum required sizes for various responses
    -00559 #define MIN_PACKET_SIZE         6
    -00560 
    -00561 
    -00562 // maximum sizes
    -00563 #define MAX_PACKET_SIZE         0x400   // anything beyond this needs to be
    -00564                                         // fragmented
    -00565 
    -00566 /////////////////////////////////////////////////////////////////////////////
    -00567 //
    -00568 // various useful sizes
    -00569 //
    -00570 
    -00571 #define SB_PACKET_DBACCESS_HEADER_SIZE          (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE)
    -00572 #define SB_FRAG_HEADER_SIZE                     SB_PACKET_DBACCESS_HEADER_SIZE
    -00573 
    -00574 #define SB_PACKET_COMMAND_HEADER_SIZE           (SB_PACKET_DBACCESS_HEADER_SIZE + DB_COMMAND_HEADER_SIZE)
    -00575 #define SB_PACKET_RESPONSE_HEADER_SIZE          (SB_PACKET_DBACCESS_HEADER_SIZE + DB_RESPONSE_HEADER_SIZE)
    -00576 
    -00577 #define SB_PACKET_DBDB_HEADER_SIZE              (SB_PACKET_RESPONSE_HEADER_SIZE + DBDB_RECORD_HEADER_SIZE)
    -00578 #define SB_PACKET_OLD_DBDB_HEADER_SIZE          (SB_PACKET_RESPONSE_HEADER_SIZE + OLD_DBDB_RECORD_HEADER_SIZE)
    -00579 
    -00580 #define SB_PACKET_UPLOAD_HEADER_SIZE            (SB_PACKET_DBACCESS_HEADER_SIZE + UPLOAD_HEADER_SIZE)
    -00581 
    -00582 #define SB_SEQUENCE_PACKET_SIZE                 (SB_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::SequenceCommand))
    -00583 #define SB_SOCKET_PACKET_HEADER_SIZE            (SB_PACKET_HEADER_SIZE + SOCKET_COMMAND_HEADER_SIZE)
    -00584 #define SB_MODE_PACKET_COMMAND_SIZE             (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect) - sizeof(Barry::Protocol::ModeSelect::ResponseBlock))
    -00585 #define SB_MODE_PACKET_RESPONSE_SIZE            (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect))
    -00586 
    -00587 
    -00588 // Macros
    -00589 #define COMMAND(data)                           (((const Barry::Protocol::Packet *)data.GetData())->command)
    -00590 #define IS_COMMAND(data, cmd)                   (COMMAND(data) == cmd)
    -00591 #define MAKE_PACKET(var, data)                  const Barry::Protocol::Packet *var = (const Barry::Protocol::Packet *) (data).GetData()
    -00592 #define MAKE_PACKETPTR_BUF(var, ptr)            Barry::Protocol::Packet *var = (Barry::Protocol::Packet *)ptr
    -00593 #define MAKE_RECORD(type,var,data,off)          type *var = (type *) ((data).GetData() + (off))
    -00594 #define MAKE_RECORD_PTR(type,var,data,off)      type *var = (type *) ((data) + (off))
    -00595 
    -00596 // fragmentation protocol
    -00597 // send DATA first, then keep sending DATA packets, FRAGMENTing
    -00598 // as required until finished, then send DONE.  Both sides behave
    -00599 // this way, so different sized data can be sent in both
    -00600 // directions
    -00601 //
    -00602 // the fragmented piece only has a the param header, and then continues
    -00603 // right on with the data
    -00604 
    -00605 
    -00606 
    -00607 // checks packet size and throws BError if not right
    -00608 void CheckSize(const Barry::Data &packet, size_t requiredsize = MIN_PACKET_SIZE);
    -00609 unsigned int GetSize(const Barry::Data &packet);
    -00610 
    -00611 }} // namespace Barry::Protocol
    -00612 
    -00613 #endif
    -00614 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__calendar_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8cc.html --- barry-0.14/doc/www/doxygen/html/r__calendar_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ - - -Barry: r_calendar.cc File Reference - - - - - - - -

    r_calendar.cc File Reference


    Detailed Description

    -Blackberry database record parser class for calendar records. -

    - -

    -Definition in file r_calendar.cc. -

    -#include "r_calendar.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <string.h>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define CALFC_APPT_TYPE_FLAG   0x01
    -#define CALFC_SUBJECT   0x02
    -#define CALFC_NOTES   0x03
    -#define CALFC_LOCATION   0x04
    -#define CALFC_NOTIFICATION_TIME   0x05
    -#define CALFC_START_TIME   0x06
    -#define CALFC_END_TIME   0x07
    -#define CALFC_RECURRENCE_DATA   0x0c
    -#define CALFC_VERSION_DATA   0x10
    -#define CALFC_NOTIFICATION_DATA   0x1a
    -#define CALFC_FREEBUSY_FLAG   0x1c
    -#define CALFC_TIMEZONE_CODE   0x1e
    -#define CALFC_CLASS_FLAG   0x28
    -#define CALFC_ALLDAYEVENT_FLAG   0xff
    -#define CALFC_END   0xffff

    Variables

    -FieldLink< Calendar > Barry::CalendarFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__calendar_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__calendar_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,557 +0,0 @@ - - -Barry: r_calendar.cc Source File - - - - - - - -

    r_calendar.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_calendar.cc
    -00003 ///             Blackberry database record parser class for calendar records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "r_calendar.h"
    -00023 #include "record-internal.h"
    -00024 #include "protocol.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "error.h"
    -00029 #include "endian.h"
    -00030 #include <ostream>
    -00031 #include <iomanip>
    -00032 #include <time.h>
    -00033 #include <string.h>
    -00034 #include <stdexcept>
    -00035 
    -00036 #define __DEBUG_MODE__
    -00037 #include "debug.h"
    -00038 
    -00039 using namespace std;
    -00040 using namespace Barry::Protocol;
    -00041 
    -00042 namespace Barry {
    -00043 
    -00044 
    -00045 ///////////////////////////////////////////////////////////////////////////////
    -00046 // Calendar class
    -00047 
    -00048 // calendar field codes
    -00049 #define CALFC_APPT_TYPE_FLAG            0x01
    -00050 #define CALFC_SUBJECT                   0x02
    -00051 #define CALFC_NOTES                     0x03
    -00052 #define CALFC_LOCATION                  0x04
    -00053 #define CALFC_NOTIFICATION_TIME         0x05
    -00054 #define CALFC_START_TIME                0x06
    -00055 #define CALFC_END_TIME                  0x07
    -00056 #define CALFC_RECURRENCE_DATA           0x0c
    -00057 #define CALFC_VERSION_DATA              0x10
    -00058 #define CALFC_NOTIFICATION_DATA         0x1a
    -00059 #define CALFC_FREEBUSY_FLAG             0x1c
    -00060 #define CALFC_TIMEZONE_CODE             0x1e    // only seems to show up if recurring
    -00061 #define CALFC_CLASS_FLAG                0x28    // private flag from outlook
    -00062 #define CALFC_ALLDAYEVENT_FLAG          0xff
    -00063 #define CALFC_END                       0xffff
    -00064 
    -00065 FieldLink<Calendar> CalendarFieldLinks[] = {
    -00066    { CALFC_SUBJECT,    "Subject",    0, 0,    &Calendar::Subject, 0, 0 },
    -00067    { CALFC_NOTES,      "Notes",      0, 0,    &Calendar::Notes, 0, 0 },
    -00068    { CALFC_LOCATION,   "Location",   0, 0,    &Calendar::Location, 0, 0 },
    -00069    { CALFC_NOTIFICATION_TIME,"Notification Time",0,0, 0, 0, &Calendar::NotificationTime },
    -00070    { CALFC_START_TIME, "Start Time", 0, 0,    0, 0, &Calendar::StartTime },
    -00071    { CALFC_END_TIME,   "End Time",   0, 0,    0, 0, &Calendar::EndTime },
    -00072    { CALFC_END,        "End of List",0, 0,    0, 0, 0 }
    -00073 };
    -00074 
    -00075 Calendar::Calendar()
    -00076 {
    -00077         Clear();
    -00078 }
    -00079 
    -00080 Calendar::~Calendar()
    -00081 {
    -00082 }
    -00083 
    -00084 const unsigned char* Calendar::ParseField(const unsigned char *begin,
    -00085                                           const unsigned char *end)
    -00086 {
    -00087         const CommonField *field = (const CommonField *) begin;
    -00088 
    -00089         // advance and check size
    -00090         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00091         if( begin > end )               // if begin==end, we are ok
    -00092                 return begin;
    -00093 
    -00094         if( !btohs(field->size) )       // if field has no size, something's up
    -00095                 return begin;
    -00096 
    -00097         // cycle through the type table
    -00098         for(    FieldLink<Calendar> *b = CalendarFieldLinks;
    -00099                 b->type != CALFC_END;
    -00100                 b++ )
    -00101         {
    -00102                 if( b->type == field->type ) {
    -00103                         if( b->strMember ) {
    -00104                                 std::string &s = this->*(b->strMember);
    -00105                                 s = ParseFieldString(field);
    -00106                                 return begin;   // done!
    -00107                         }
    -00108                         else if( b->timeMember && btohs(field->size) == 4 ) {
    -00109                                 time_t &t = this->*(b->timeMember);
    -00110                                 dout("min1900: " << field->u.min1900);
    -00111                                 t = min2time(field->u.min1900);
    -00112                                 return begin;
    -00113                         }
    -00114                 }
    -00115         }
    -00116 
    -00117         // handle special cases
    -00118         switch( field->type )
    -00119         {
    -00120         case CALFC_APPT_TYPE_FLAG:
    -00121                 switch( field->u.raw[0] )
    -00122                 {
    -00123                 case 'a':                       // regular non-recurring appointment
    -00124                         Recurring = false;
    -00125                         return begin;
    -00126 
    -00127                 case '*':                       // recurring appointment
    -00128                         Recurring = true;
    -00129                         return begin;
    -00130 
    -00131                 default:
    -00132                         throw Error("Calendar::ParseField: unknown appointment type");
    -00133                 }
    -00134                 break;
    -00135 
    -00136         case CALFC_ALLDAYEVENT_FLAG:
    -00137                 AllDayEvent = field->u.raw[0] == 1;
    -00138                 return begin;
    -00139 
    -00140         case CALFC_RECURRENCE_DATA:
    -00141                 if( btohs(field->size) >= CALENDAR_RECURRENCE_DATA_FIELD_SIZE ) {
    -00142                         // good data
    -00143                         ParseRecurrenceData(&field->u.raw[0]);
    -00144                 }
    -00145                 else {
    -00146                         // not enough data!
    -00147                         throw Error("Calendar::ParseField: not enough data in recurrence data field");
    -00148                 }
    -00149                 return begin;
    -00150 
    -00151         case CALFC_TIMEZONE_CODE:
    -00152                 if( btohs(field->size) == 2 ) {
    -00153                         // good data
    -00154                         TimeZoneCode = btohs(field->u.code);
    -00155                 }
    -00156                 else {
    -00157                         throw Error("Calendar::ParseField: not enough data in time zone code field");
    -00158                 }
    -00159                 return begin;
    -00160 
    -00161         case CALFC_FREEBUSY_FLAG:
    -00162                 FreeBusyFlag = (FreeBusyFlagType)field->u.raw[0];
    -00163                 if( FreeBusyFlag > OutOfOffice ) {
    -00164                         throw Error("Calendar::ParseField: FreeBusyFlag out of range" );
    -00165                 }
    -00166                 return begin;
    -00167 
    -00168         case CALFC_CLASS_FLAG:
    -00169                 ClassFlag = (ClassFlagType)field->u.raw[0];
    -00170                 if( ClassFlag > Private ) {
    -00171                         throw Error("Calendar::ParseField: ClassFlag out of range" );
    -00172                 }
    -00173                 return begin;
    -00174         }
    -00175 
    -00176         // if still not handled, add to the Unknowns list
    -00177         UnknownField uf;
    -00178         uf.type = field->type;
    -00179         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00180         Unknowns.push_back(uf);
    -00181 
    -00182         // return new pointer for next field
    -00183         return begin;
    -00184 }
    -00185 
    -00186 // this function assumes the size has already been checked
    -00187 void Calendar::ParseRecurrenceData(const void *data)
    -00188 {
    -00189         const CalendarRecurrenceDataField *rec =
    -00190                 (const CalendarRecurrenceDataField*) data;
    -00191 
    -00192         Interval = btohs(rec->interval);
    -00193         if( Interval < 1 )
    -00194                 Interval = 1;   // must always be >= 1
    -00195 
    -00196         if( rec->endTime == 0xffffffff ) {
    -00197                 Perpetual = true;
    -00198         }
    -00199         else {
    -00200                 RecurringEndTime = min2time(rec->endTime);
    -00201                 Perpetual = false;
    -00202         }
    -00203 
    -00204         switch( rec->type )
    -00205         {
    -00206         case CRDF_TYPE_DAY:
    -00207                 RecurringType = Day;
    -00208                 // no extra data
    -00209                 break;
    -00210 
    -00211         case CRDF_TYPE_MONTH_BY_DATE:
    -00212                 RecurringType = MonthByDate;
    -00213                 DayOfMonth = rec->u.month_by_date.monthDay;
    -00214                 break;
    -00215 
    -00216         case CRDF_TYPE_MONTH_BY_DAY:
    -00217                 RecurringType = MonthByDay;
    -00218                 DayOfWeek = rec->u.month_by_day.weekDay;
    -00219                 WeekOfMonth = rec->u.month_by_day.week;
    -00220                 break;
    -00221 
    -00222         case CRDF_TYPE_YEAR_BY_DATE:
    -00223                 RecurringType = YearByDate;
    -00224                 DayOfMonth = rec->u.year_by_date.monthDay;
    -00225                 MonthOfYear = rec->u.year_by_date.month;
    -00226                 break;
    -00227 
    -00228         case CRDF_TYPE_YEAR_BY_DAY:
    -00229                 RecurringType = YearByDay;
    -00230                 DayOfWeek = rec->u.year_by_day.weekDay;
    -00231                 WeekOfMonth = rec->u.year_by_day.week;
    -00232                 MonthOfYear = rec->u.year_by_day.month;
    -00233                 break;
    -00234 
    -00235         case CRDF_TYPE_WEEK:
    -00236                 RecurringType = Week;
    -00237 
    -00238                 // Note: this simple copy is only possible since
    -00239                 // the CAL_WD_* constants are the same as CRDF_WD_* constants.
    -00240                 // If this ever changes, this code will need to change.
    -00241                 WeekDays = rec->u.week.days;
    -00242                 break;
    -00243 
    -00244         default:
    -00245                 eout("Unknown recurrence data type: " << rec->type);
    -00246                 throw Error("Unknown recurrence data type");
    -00247         }
    -00248 }
    -00249 
    -00250 // this function assumes there is CALENDAR_RECURRENCE_DATA_FIELD_SIZE bytes
    -00251 // available in data
    -00252 void Calendar::BuildRecurrenceData(void *data) const
    -00253 {
    -00254         if( !Recurring )
    -00255                 throw Error("Calendar::BuildRecurrenceData: Attempting to build recurrence data on non-recurring record.");
    -00256 
    -00257         CalendarRecurrenceDataField *rec = (CalendarRecurrenceDataField*) data;
    -00258 
    -00259         // set all to zero
    -00260         memset(data, 0, CALENDAR_RECURRENCE_DATA_FIELD_SIZE);
    -00261 
    -00262         rec->interval = htobs(Interval);
    -00263         rec->startTime = time2min(StartTime);
    -00264         if( Perpetual )
    -00265                 rec->endTime = 0xffffffff;
    -00266         else
    -00267                 rec->endTime = time2min(RecurringEndTime);
    -00268 
    -00269         switch( RecurringType )
    -00270         {
    -00271         case Day:
    -00272                 rec->type = CRDF_TYPE_DAY;
    -00273                 // no extra data
    -00274                 break;
    -00275 
    -00276         case MonthByDate:
    -00277                 rec->type = CRDF_TYPE_MONTH_BY_DATE;
    -00278                 rec->u.month_by_date.monthDay = DayOfMonth;
    -00279                 break;
    -00280 
    -00281         case MonthByDay:
    -00282                 rec->type = CRDF_TYPE_MONTH_BY_DAY;
    -00283                 rec->u.month_by_day.weekDay = DayOfWeek;
    -00284                 rec->u.month_by_day.week = WeekOfMonth;
    -00285                 break;
    -00286 
    -00287         case YearByDate:
    -00288                 rec->type = CRDF_TYPE_YEAR_BY_DATE;
    -00289                 rec->u.year_by_date.monthDay = DayOfMonth;
    -00290                 rec->u.year_by_date.month = MonthOfYear;
    -00291                 break;
    -00292 
    -00293         case YearByDay:
    -00294                 rec->type = CRDF_TYPE_YEAR_BY_DAY;
    -00295                 rec->u.year_by_day.weekDay = DayOfWeek;
    -00296                 rec->u.year_by_day.week = WeekOfMonth;
    -00297                 rec->u.year_by_day.month = MonthOfYear;
    -00298                 break;
    -00299 
    -00300         case Week:
    -00301                 rec->type = CRDF_TYPE_WEEK;
    -00302 
    -00303                 // Note: this simple copy is only possible since
    -00304                 // the CAL_WD_* constants are the same as CRDF_WD_* constants.
    -00305                 // If this ever changes, this code will need to change.
    -00306                 rec->u.week.days = WeekDays;
    -00307                 break;
    -00308 
    -00309         default:
    -00310                 eout("Calendar::BuildRecurrenceData: "
    -00311                         "Unknown recurrence data type: " << rec->type);
    -00312                 throw Error("Calendar::BuildRecurrenceData: Unknown recurrence data type");
    -00313         }
    -00314 }
    -00315 
    -00316 void Calendar::ParseHeader(const Data &data, size_t &offset)
    -00317 {
    -00318         // no header in Calendar records
    -00319 }
    -00320 
    -00321 void Calendar::ParseFields(const Data &data, size_t &offset)
    -00322 {
    -00323         const unsigned char *finish = ParseCommonFields(*this,
    -00324                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00325         offset += finish - (data.GetData() + offset);
    -00326 }
    -00327 
    -00328 void Calendar::BuildHeader(Data &data, size_t &offset) const
    -00329 {
    -00330         // no header in Calendar records
    -00331 }
    -00332 
    -00333 //
    -00334 // Build
    -00335 //
    -00336 /// Build fields part of record.
    -00337 ///
    -00338 void Calendar::BuildFields(Data &data, size_t &offset) const
    -00339 {
    -00340         data.Zap();
    -00341 
    -00342         // output the type first
    -00343         BuildField(data, offset, CALFC_APPT_TYPE_FLAG, Recurring ? '*' : 'a');
    -00344 
    -00345         // output all day event flag only if set
    -00346         if( AllDayEvent )
    -00347                 BuildField(data, offset, CALFC_ALLDAYEVENT_FLAG, (char)1);
    -00348 
    -00349         // cycle through the type table
    -00350         for(    const FieldLink<Calendar> *b = CalendarFieldLinks;
    -00351                 b->type != CALFC_END;
    -00352                 b++ )
    -00353         {
    -00354                 if( b->strMember ) {
    -00355                         const std::string &s = this->*(b->strMember);
    -00356                         if( s.size() )
    -00357                                 BuildField(data, offset, b->type, s);
    -00358                 }
    -00359                 else if( b->timeMember ) {
    -00360                         time_t t = this->*(b->timeMember);
    -00361                         if( t > 0 )
    -00362                                 BuildField1900(data, offset, b->type, t);
    -00363                 }
    -00364         }
    -00365 
    -00366         // handle special cases
    -00367 
    -00368         if( Recurring ) {
    -00369                 CalendarRecurrenceDataField recur;
    -00370                 BuildRecurrenceData(&recur);
    -00371                 BuildField(data, offset, CALFC_RECURRENCE_DATA,
    -00372                         &recur, CALENDAR_RECURRENCE_DATA_FIELD_SIZE);
    -00373         }
    -00374 
    -00375         if( TimeZoneValid )
    -00376                 BuildField(data, offset, CALFC_TIMEZONE_CODE, TimeZoneCode);
    -00377 
    -00378         BuildField(data, offset, CALFC_FREEBUSY_FLAG, (char)FreeBusyFlag);
    -00379         BuildField(data, offset, CALFC_CLASS_FLAG, (char)ClassFlag);
    -00380 
    -00381         // and finally save unknowns
    -00382         UnknownsType::const_iterator
    -00383                 ub = Unknowns.begin(), ue = Unknowns.end();
    -00384         for( ; ub != ue; ub++ ) {
    -00385                 BuildField(data, offset, *ub);
    -00386         }
    -00387 
    -00388         data.ReleaseBuffer(offset);
    -00389 }
    -00390 
    -00391 void Calendar::Clear()
    -00392 {
    -00393         RecType = Calendar::GetDefaultRecType();
    -00394 
    -00395         AllDayEvent = false;
    -00396         Subject.clear();
    -00397         Notes.clear();
    -00398         Location.clear();
    -00399         NotificationTime = StartTime = EndTime = 0;
    -00400 
    -00401         FreeBusyFlag = Free;
    -00402         ClassFlag = Public;
    -00403 
    -00404         Recurring = false;
    -00405         RecurringType = Calendar::Week;
    -00406         Interval = 1;
    -00407         RecurringEndTime = 0;
    -00408         Perpetual = false;
    -00409         TimeZoneCode = GetTimeZoneCode(0, 0);   // default to GMT
    -00410         TimeZoneValid = false;
    -00411         DayOfWeek = WeekOfMonth = DayOfMonth = MonthOfYear = 0;
    -00412         WeekDays = 0;
    -00413 
    -00414         Unknowns.clear();
    -00415 }
    -00416 
    -00417 void Calendar::Dump(std::ostream &os) const
    -00418 {
    -00419         static const char *DayNames[] = { "Sun", "Mon", "Tue", "Wed",
    -00420                 "Thu", "Fri", "Sat" };
    -00421         static const char *MonthNames[] = { "Jan", "Feb", "Mar", "Apr",
    -00422                 "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
    -00423         static const char *ClassTypes[] = { "Public", "Confidential", "Private" };
    -00424         static const char *FreeBusy[] = { "Free", "Tentative", "Busy", "Out of Office" };
    -00425 
    -00426 // FIXME - need a "check all data" function that make sure that all
    -00427 // recurrence data is within range.  Then call that before using
    -00428 // the data, such as in Build and in Dump.
    -00429 
    -00430         os << "Calendar entry: 0x" << setbase(16) << RecordId
    -00431                 << " (" << (unsigned int)RecType << ")\n";
    -00432         os << "   All Day Event: " << (AllDayEvent ? "yes" : "no") << "\n";
    -00433         os << "   Class: " << ClassTypes[ClassFlag] << "\n";
    -00434         os << "   Free/Busy: " << FreeBusy[FreeBusyFlag] << "\n";
    -00435         if( TimeZoneValid )
    -00436                 os << "   Time Zone: " << GetTimeZone(TimeZoneCode)->Name << "\n";
    -00437 
    -00438         // cycle through the type table
    -00439         for(    const FieldLink<Calendar> *b = CalendarFieldLinks;
    -00440                 b->type != CALFC_END;
    -00441                 b++ )
    -00442         {
    -00443                 if( b->strMember ) {
    -00444                         const std::string &s = this->*(b->strMember);
    -00445                         if( s.size() )
    -00446                                 os << "   " << b->name << ": " << s << "\n";
    -00447                 }
    -00448                 else if( b->timeMember ) {
    -00449                         time_t t = this->*(b->timeMember);
    -00450                         if( t > 0 )
    -00451                                 os << "   " << b->name << ": " << ctime(&t);
    -00452                         else
    -00453                                 os << "   " << b->name << ": disabled\n";
    -00454                 }
    -00455         }
    -00456 
    -00457         // print recurrence data if available
    -00458         os << "   Recurring: " << (Recurring ? "yes" : "no") << "\n";
    -00459         if( Recurring ) {
    -00460                 switch( RecurringType )
    -00461                 {
    -00462                 case Day:
    -00463                         os << "      Every day.\n";
    -00464                         break;
    -00465 
    -00466                 case MonthByDate:
    -00467                         os << "      Every month on the "
    -00468                            << DayOfMonth
    -00469                            << (DayOfMonth == 1 ? "st" : "")
    -00470                            << (DayOfMonth == 2 ? "nd" : "")
    -00471                            << (DayOfMonth == 3 ? "rd" : "")
    -00472                            << (DayOfMonth > 3  ? "th" : "")
    -00473                            << "\n";
    -00474                         break;
    -00475 
    -00476                 case MonthByDay:
    -00477                         os << "      Every month on the "
    -00478                            << DayNames[DayOfWeek]
    -00479                            << " of week "
    -00480                            << WeekOfMonth
    -00481                            << "\n";
    -00482                         break;
    -00483 
    -00484                 case YearByDate:
    -00485                         os << "      Every year on "
    -00486                            << MonthNames[MonthOfYear-1]
    -00487                            << " " << DayOfMonth << "\n";
    -00488                         break;
    -00489 
    -00490                 case YearByDay:
    -00491                         os << "      Every year in " << MonthNames[MonthOfYear-1]
    -00492                            << " on "
    -00493                            << DayNames[DayOfWeek]
    -00494                            << " of week " << WeekOfMonth << "\n";
    -00495                         break;
    -00496 
    -00497                 case Week:
    -00498                         os << "      Every week on: ";
    -00499                         if( WeekDays & CAL_WD_SUN ) os << "Sun ";
    -00500                         if( WeekDays & CAL_WD_MON ) os << "Mon ";
    -00501                         if( WeekDays & CAL_WD_TUE ) os << "Tue ";
    -00502                         if( WeekDays & CAL_WD_WED ) os << "Wed ";
    -00503                         if( WeekDays & CAL_WD_THU ) os << "Thu ";
    -00504                         if( WeekDays & CAL_WD_FRI ) os << "Fri ";
    -00505                         if( WeekDays & CAL_WD_SAT ) os << "Sat ";
    -00506                         os << "\n";
    -00507                         break;
    -00508 
    -00509                 default:
    -00510                         os << "      Unknown recurrence type\n";
    -00511                         break;
    -00512                 }
    -00513 
    -00514                 os << "      Interval: " << Interval << "\n";
    -00515 
    -00516                 if( Perpetual )
    -00517                         os << "      Ends: never\n";
    -00518                 else
    -00519                         os << "      Ends: "
    -00520                            << ctime(&RecurringEndTime);
    -00521         }
    -00522 
    -00523         // print any unknowns
    -00524         os << Unknowns;
    -00525 }
    -00526 
    -00527 
    -00528 } // namespace Barry
    -00529 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__calendar_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8h.html --- barry-0.14/doc/www/doxygen/html/r__calendar_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ - - -Barry: r_calendar.h File Reference - - - - - - - -

    r_calendar.h File Reference


    Detailed Description

    -Blackberry database record parser class for calndar records. -

    - -

    -Definition in file r_calendar.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Calendar

    Defines

    -#define CAL_WD_SUN   0x01
    -#define CAL_WD_MON   0x02
    -#define CAL_WD_TUE   0x04
    -#define CAL_WD_WED   0x08
    -#define CAL_WD_THU   0x10
    -#define CAL_WD_FRI   0x20
    -#define CAL_WD_SAT   0x40

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Calendar &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__calendar_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__calendar_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__calendar_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ - - -Barry: r_calendar.h Source File - - - - - - - -

    r_calendar.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_calendar.h
    -00003 ///             Blackberry database record parser class for calndar records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_RECORD_CALENDAR_H__
    -00023 #define __BARRY_RECORD_CALENDAR_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "record.h"
    -00027 #include <iosfwd>
    -00028 #include <string>
    -00029 #include <vector>
    -00030 #include <map>
    -00031 #include <stdint.h>
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 //
    -00036 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00037 //        operators in the future.
    -00038 //
    -00039 
    -00040 
    -00041 
    -00042 /// \addtogroup RecordParserClasses
    -00043 /// @{
    -00044 
    -00045 class BXEXPORT Calendar
    -00046 {
    -00047 public:
    -00048         typedef std::vector<UnknownField>               UnknownsType;
    -00049 
    -00050         uint8_t RecType;
    -00051         uint32_t RecordId;
    -00052 
    -00053         // general data
    -00054         bool AllDayEvent;
    -00055         std::string Subject;
    -00056         std::string Notes;
    -00057         std::string Location;
    -00058         time_t NotificationTime;        // 0 means notification is off
    -00059         time_t StartTime;
    -00060         time_t EndTime;
    -00061 
    -00062         ///
    -00063         /// Free Busy Flag
    -00064         ///
    -00065         /// This lists the available settings found in the device.
    -00066         /// This list is based on information from MS Outlook 2007
    -00067         /// (Free ==0 and Busy == 2)
    -00068         /// This is FBTYPE in RFC2445 and is defined as
    -00069         /// FREE, BUSY, BUSY-UNAVAILABLE and BUSY-TENTATIVE
    -00070         ///
    -00071         enum FreeBusyFlagType {
    -00072                 Free = 0,
    -00073                 Tentative,
    -00074                 Busy,
    -00075                 OutOfOffice
    -00076         };
    -00077         FreeBusyFlagType FreeBusyFlag;
    -00078 
    -00079         ///
    -00080         /// Class Flag
    -00081         ///
    -00082         /// This is also called classification in Evolution and it
    -00083         ///  is the equivilant of public or private in outlook
    -00084         ///  Private is set to 0x2 in Outlook
    -00085         ///  RFC2445 CLASS is PUBLIC, PRIVATE, CONFIDENTIAL
    -00086         ///
    -00087         enum ClassFlagType {
    -00088                 Public = 0,
    -00089                 Confidential,
    -00090                 Private
    -00091         };
    -00092 
    -00093         ClassFlagType ClassFlag;
    -00094 
    -00095         ///
    -00096         /// Recurring data
    -00097         ///
    -00098         /// Note: interval can be used on all of these recurring types to
    -00099         ///       make it happen "every other time" or more, etc.
    -00100         ///
    -00101         enum RecurringCodeType {
    -00102                 Day = 1,                //< eg. every day
    -00103                                         //< set: nothing
    -00104                 MonthByDate = 3,        //< eg. every month on the 12th
    -00105                                         //< set: DayOfMonth
    -00106                 MonthByDay = 4,         //< eg. every month on 3rd Wed
    -00107                                         //< set: DayOfWeek and WeekOfMonth
    -00108                 YearByDate = 5,         //< eg. every year on March 5
    -00109                                         //< set: DayOfMonth and MonthOfYear
    -00110                 YearByDay = 6,          //< eg. every year on 3rd Wed of Jan
    -00111                                         //< set: DayOfWeek, WeekOfMonth, and
    -00112                                         //<      MonthOfYear
    -00113                 Week = 12               //< eg. every week on Mon and Fri
    -00114                                         //< set: WeekDays
    -00115         };
    -00116     
    -00117         
    -00118         
    -00119         bool Recurring;
    -00120         RecurringCodeType RecurringType;
    -00121         unsigned short Interval;        // must be >= 1
    -00122         time_t RecurringEndTime;        // only pertains if Recurring is true
    -00123                                         // sets the date and time when
    -00124                                         // recurrence of this appointment
    -00125                                         // should no longer occur
    -00126                                         // If a perpetual appointment, this
    -00127                                         // is 0xFFFFFFFF in the low level data
    -00128                                         // Instead, set the following flag.
    -00129         bool Perpetual;                 // if true, this will always recur
    -00130         unsigned short TimeZoneCode;    // the time zone originally used
    -00131                                         // for the recurrence data...
    -00132                                         // seems to have little use, but
    -00133                                         // set to your current time zone
    -00134                                         // as a good default
    -00135         bool TimeZoneValid;             // true if the record contained a
    -00136                                         // time zone code
    -00137 
    -00138         unsigned short                  // recurring details, depending on type
    -00139                 DayOfWeek,              // 0-6
    -00140                 WeekOfMonth,            // 1-5
    -00141                 DayOfMonth,             // 1-31
    -00142                 MonthOfYear;            // 1-12
    -00143         unsigned char WeekDays;         // bitmask, bit 0 = sunday
    -00144 
    -00145 // FIXME - put these somewhere usable by both C and C++
    -00146                 #define CAL_WD_SUN      0x01
    -00147                 #define CAL_WD_MON      0x02
    -00148                 #define CAL_WD_TUE      0x04
    -00149                 #define CAL_WD_WED      0x08
    -00150                 #define CAL_WD_THU      0x10
    -00151                 #define CAL_WD_FRI      0x20
    -00152                 #define CAL_WD_SAT      0x40
    -00153 
    -00154         // unknown
    -00155         UnknownsType Unknowns;
    -00156 
    -00157 public:
    -00158         const unsigned char* ParseField(const unsigned char *begin,
    -00159                 const unsigned char *end);
    -00160         void ParseRecurrenceData(const void *data);
    -00161         void BuildRecurrenceData(void *data) const;
    -00162 
    -00163 public:
    -00164         Calendar();
    -00165         ~Calendar();
    -00166 
    -00167         // Parser / Builder API (see parser.h / builder.h)
    -00168         uint8_t GetRecType() const { return RecType; }
    -00169         uint32_t GetUniqueId() const { return RecordId; }
    -00170         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00171         void ParseHeader(const Data &data, size_t &offset);
    -00172         void ParseFields(const Data &data, size_t &offset);
    -00173         void BuildHeader(Data &data, size_t &offset) const;
    -00174         void BuildFields(Data &data, size_t &offset) const;
    -00175 
    -00176         void Clear();
    -00177 
    -00178         void Dump(std::ostream &os) const;
    -00179 
    -00180         // sorting
    -00181         bool operator<(const Calendar &other) const { return StartTime < other.StartTime; }
    -00182 
    -00183         // database name
    -00184         static const char * GetDBName() { return "Calendar"; }
    -00185         static uint8_t GetDefaultRecType() { return 5; }        // or 0?
    -00186 };
    -00187 
    -00188 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Calendar &msg) {
    -00189         msg.Dump(os);
    -00190         return os;
    -00191 }
    -00192 
    -00193 /// @}
    -00194 
    -00195 } // namespace Barry
    -00196 
    -00197 #endif
    -00198 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__contact_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__contact_8cc.html --- barry-0.14/doc/www/doxygen/html/r__contact_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__contact_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ - - -Barry: r_contact.cc File Reference - - - - - - - -

    r_contact.cc File Reference


    Detailed Description

    -Blackberry database record parser class for contact records. -

    - -

    -Definition in file r_contact.cc. -

    -#include "r_contact.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define CFC_EMAIL   1
    -#define CFC_PHONE   2
    -#define CFC_FAX   3
    -#define CFC_WORK_PHONE   6
    -#define CFC_HOME_PHONE   7
    -#define CFC_MOBILE_PHONE   8
    -#define CFC_PAGER   9
    -#define CFC_PIN   10
    -#define CFC_RADIO   14
    -#define CFC_WORK_PHONE_2   16
    -#define CFC_HOME_PHONE_2   17
    -#define CFC_OTHER_PHONE   18
    -#define CFC_NAME   32
    -#define CFC_COMPANY   33
    -#define CFC_DEFAULT_COMM_METHOD   34
    -#define CFC_ADDRESS1   35
    -#define CFC_ADDRESS2   36
    -#define CFC_ADDRESS3   37
    -#define CFC_CITY   38
    -#define CFC_PROVINCE   39
    -#define CFC_POSTAL_CODE   40
    -#define CFC_COUNTRY   41
    -#define CFC_TITLE   42
    -#define CFC_PUBLIC_KEY   43
    -#define CFC_GROUP_FLAG   44
    -#define CFC_GROUP_LINK   52
    -#define CFC_URL   54
    -#define CFC_PREFIX   55
    -#define CFC_CATEGORY   59
    -#define CFC_HOME_ADDRESS1   61
    -#define CFC_HOME_ADDRESS2   62
    -#define CFC_HOME_ADDRESS3   63
    -#define CFC_NOTES   64
    -#define CFC_USER_DEFINED_1   65
    -#define CFC_USER_DEFINED_2   66
    -#define CFC_USER_DEFINED_3   67
    -#define CFC_USER_DEFINED_4   68
    -#define CFC_HOME_CITY   69
    -#define CFC_HOME_PROVINCE   70
    -#define CFC_HOME_POSTAL_CODE   71
    -#define CFC_HOME_COUNTRY   72
    -#define CFC_IMAGE   77
    -#define CFC_BIRTHDAY   82
    -#define CFC_ANNIVERSARY   83
    -#define CFC_INVALID_FIELD   255

    Variables

    -FieldLink< Contact > Barry::ContactFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__contact_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__contact_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__contact_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__contact_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,604 +0,0 @@ - - -Barry: r_contact.cc Source File - - - - - - - -

    r_contact.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_contact.cc
    -00003 ///             Blackberry database record parser class for contact records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "r_contact.h"
    -00023 #include "record-internal.h"
    -00024 #include "protocol.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "error.h"
    -00029 #include "endian.h"
    -00030 #include <ostream>
    -00031 #include <iomanip>
    -00032 #include <time.h>
    -00033 #include <stdexcept>
    -00034 
    -00035 #define __DEBUG_MODE__
    -00036 #include "debug.h"
    -00037 
    -00038 using namespace std;
    -00039 using namespace Barry::Protocol;
    -00040 
    -00041 namespace Barry {
    -00042 
    -00043 
    -00044 
    -00045 ///////////////////////////////////////////////////////////////////////////////
    -00046 // Contact class
    -00047 
    -00048 // Contact field codes
    -00049 #define CFC_EMAIL               1
    -00050 #define CFC_PHONE               2
    -00051 #define CFC_FAX                 3
    -00052 #define CFC_WORK_PHONE          6
    -00053 #define CFC_HOME_PHONE          7
    -00054 #define CFC_MOBILE_PHONE        8
    -00055 #define CFC_PAGER               9
    -00056 #define CFC_PIN                 10
    -00057 #define CFC_RADIO               14      // 0x0e
    -00058 #define CFC_WORK_PHONE_2        16      // 0x10
    -00059 #define CFC_HOME_PHONE_2        17      // 0x11
    -00060 #define CFC_OTHER_PHONE         18      // 0x12
    -00061 #define CFC_NAME                32      // 0x20 used twice, in first/last name order
    -00062 #define CFC_COMPANY             33
    -00063 #define CFC_DEFAULT_COMM_METHOD 34
    -00064 #define CFC_ADDRESS1            35
    -00065 #define CFC_ADDRESS2            36
    -00066 #define CFC_ADDRESS3            37
    -00067 #define CFC_CITY                38
    -00068 #define CFC_PROVINCE            39
    -00069 #define CFC_POSTAL_CODE         40
    -00070 #define CFC_COUNTRY             41
    -00071 #define CFC_TITLE               42      // 0x2a
    -00072 #define CFC_PUBLIC_KEY          43
    -00073 #define CFC_GROUP_FLAG          44
    -00074 #define CFC_GROUP_LINK          52
    -00075 #define CFC_URL                 54      // 0x36
    -00076 #define CFC_PREFIX              55      // 0x37
    -00077 #define CFC_CATEGORY            59      // 0x3B
    -00078 #define CFC_HOME_ADDRESS1       61      // 0x3D
    -00079 #define CFC_HOME_ADDRESS2       62      // 0x3E
    -00080   // If the address 3 isn't mapped then it appears
    -00081   // in the same field as address2 with a space
    -00082 #define CFC_HOME_ADDRESS3       63      // 0x3F
    -00083 #define CFC_NOTES               64      // 0x40
    -00084 #define CFC_USER_DEFINED_1      65      // 0x41
    -00085 #define CFC_USER_DEFINED_2      66      // 0x42
    -00086 #define CFC_USER_DEFINED_3      67      // 0x43
    -00087 #define CFC_USER_DEFINED_4      68      // 0x44
    -00088 #define CFC_HOME_CITY           69      // 0x45
    -00089 #define CFC_HOME_PROVINCE       70      // 0x46
    -00090 #define CFC_HOME_POSTAL_CODE    71      // 0x47
    -00091 #define CFC_HOME_COUNTRY        72      // 0x48
    -00092 #define CFC_IMAGE               77      // 0x4D
    -00093 #define CFC_BIRTHDAY            82      // 0x52
    -00094 #define CFC_ANNIVERSARY         83      // 0x53
    -00095 #define CFC_INVALID_FIELD       255
    -00096 
    -00097 // Contact code to field table
    -00098 FieldLink<Contact> ContactFieldLinks[] = {
    -00099    { CFC_PHONE,        "Phone",      0,0,                 &Contact::Phone, 0, 0 },
    -00100    { CFC_FAX,          "Fax",        "facsimileTelephoneNumber",0, &Contact::Fax, 0, 0 },
    -00101    { CFC_WORK_PHONE,   "WorkPhone",  "telephoneNumber",0, &Contact::WorkPhone, 0, 0 },
    -00102    { CFC_HOME_PHONE,   "HomePhone",  "homePhone",0,       &Contact::HomePhone, 0, 0 },
    -00103    { CFC_MOBILE_PHONE, "MobilePhone","mobile",0,          &Contact::MobilePhone, 0, 0 },
    -00104    { CFC_PAGER,        "Pager",      "pager",0,           &Contact::Pager, 0, 0 },
    -00105    { CFC_PIN,          "PIN",        0,0,                 &Contact::PIN, 0, 0 },
    -00106    { CFC_RADIO,        "Radio",      0,0,                 &Contact::Radio, 0, 0 },
    -00107    { CFC_WORK_PHONE_2, "WorkPhone2", 0,0,                 &Contact::WorkPhone2, 0, 0 },
    -00108    { CFC_HOME_PHONE_2, "HomePhone2", 0,0,                 &Contact::HomePhone2, 0, 0 },
    -00109    { CFC_OTHER_PHONE,  "OtherPhone", 0,0,                 &Contact::OtherPhone, 0, 0 },
    -00110    { CFC_COMPANY,      "Company",    "o",0,               &Contact::Company, 0, 0 },
    -00111    { CFC_DEFAULT_COMM_METHOD,"DefaultCommMethod",0,0,     &Contact::DefaultCommunicationsMethod, 0, 0 },
    -00112    { CFC_ADDRESS1,     "WorkAddress1",   0,0,             0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address1 },
    -00113    { CFC_ADDRESS2,     "WorkAddress2",   0,0,             0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address2 },
    -00114    { CFC_ADDRESS3,     "WorkAddress3",   0,0,             0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address3 },
    -00115    { CFC_CITY,         "WorkCity",       "l",0,           0, 0, 0, &Contact::WorkAddress, &PostalAddress::City },
    -00116    { CFC_PROVINCE,     "WorkProvince",   "st",0,          0, 0, 0, &Contact::WorkAddress, &PostalAddress::Province },
    -00117    { CFC_POSTAL_CODE,  "WorkPostalCode", "postalCode",0,  0, 0, 0, &Contact::WorkAddress, &PostalAddress::PostalCode },
    -00118    { CFC_COUNTRY,      "WorkCountry",    "c", "country",  0, 0, 0, &Contact::WorkAddress, &PostalAddress::Country },
    -00119    { CFC_TITLE,        "JobTitle",   "title",0,           &Contact::JobTitle, 0, 0 },
    -00120    { CFC_PUBLIC_KEY,   "PublicKey",  0,0,                 &Contact::PublicKey, 0, 0 },
    -00121    { CFC_URL,          "URL",        0,0,                 &Contact::URL, 0, 0 },
    -00122    { CFC_PREFIX,       "Prefix",     0,0,                 &Contact::Prefix, 0, 0 },
    -00123    { CFC_HOME_ADDRESS1,"HomeAddress1", 0,0,               0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address1, },
    -00124    { CFC_HOME_ADDRESS2,"HomeAddress2", 0,0,               0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address2, },
    -00125    { CFC_HOME_ADDRESS3,"HomeAddress3", 0,0,               0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address3, },
    -00126    { CFC_NOTES,        "Notes",      0,0,                 &Contact::Notes, 0, 0 },
    -00127    { CFC_USER_DEFINED_1, "UserDefined1", 0,0,             &Contact::UserDefined1, 0, 0 },
    -00128    { CFC_USER_DEFINED_2, "UserDefined2", 0,0,             &Contact::UserDefined2, 0, 0 },
    -00129    { CFC_USER_DEFINED_3, "UserDefined3", 0,0,             &Contact::UserDefined3, 0, 0 },
    -00130    { CFC_USER_DEFINED_4, "UserDefined4", 0,0,             &Contact::UserDefined4, 0, 0 },
    -00131    { CFC_HOME_CITY,    "HomeCity",   0,0,                 0, 0, 0, &Contact::HomeAddress, &PostalAddress::City, },
    -00132    { CFC_HOME_PROVINCE,"HomeProvince", 0,0,               0, 0, 0, &Contact::HomeAddress, &PostalAddress::Province, },
    -00133    { CFC_HOME_POSTAL_CODE, "HomePostalCode", 0,0,         0, 0, 0, &Contact::HomeAddress, &PostalAddress::PostalCode, },
    -00134    { CFC_HOME_COUNTRY, "HomeCountry",0,0,                 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Country, },
    -00135    { CFC_IMAGE,        "Image",      0,0,                 &Contact::Image, 0, 0 },
    -00136    { CFC_INVALID_FIELD,"EndOfList",  0, 0, 0 }
    -00137 };
    -00138 
    -00139 Contact::Contact()
    -00140         : RecType(Contact::GetDefaultRecType()),
    -00141         RecordId(0),
    -00142         m_FirstNameSeen(false)
    -00143 {
    -00144 }
    -00145 
    -00146 Contact::~Contact()
    -00147 {
    -00148 }
    -00149 
    -00150 const unsigned char* Contact::ParseField(const unsigned char *begin,
    -00151                                          const unsigned char *end)
    -00152 {
    -00153         const CommonField *field = (const CommonField *) begin;
    -00154 
    -00155         // advance and check size
    -00156         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00157         if( begin > end )               // if begin==end, we are ok
    -00158                 return begin;
    -00159 
    -00160         if( !btohs(field->size) )       // if field has no size, something's up
    -00161                 return begin;
    -00162 
    -00163         // cycle through the type table
    -00164         for(    FieldLink<Contact> *b = ContactFieldLinks;
    -00165                 b->type != CFC_INVALID_FIELD;
    -00166                 b++ )
    -00167         {
    -00168                 if( b->type == field->type ) {
    -00169                         if( b->strMember ) {
    -00170                                 std::string &s = this->*(b->strMember);
    -00171                                 s = ParseFieldString(field);
    -00172                                 return begin;   // done!
    -00173                         }
    -00174                         else if( b->postMember && b->postField ) {
    -00175                                 std::string &s = (this->*(b->postMember)).*(b->postField);
    -00176                                 s = ParseFieldString(field);
    -00177                                 return begin;
    -00178                         }
    -00179                         else {
    -00180                                 break;  // fall through to special handling
    -00181                         }
    -00182                 }
    -00183         }
    -00184 
    -00185         // if not found in the type table, check for special handling
    -00186         switch( field->type )
    -00187         {
    -00188         case CFC_EMAIL: {
    -00189                 EmailAddresses.push_back( ParseFieldString(field) );
    -00190                 }
    -00191                 return begin;
    -00192 
    -00193         case CFC_NAME: {
    -00194                 // can be used multiple times, for first/last names
    -00195                 std::string *name;
    -00196                 if( FirstName.size() || m_FirstNameSeen ) {
    -00197                         // first name already filled, use last name
    -00198                         name = &LastName;
    -00199                         m_FirstNameSeen = false;
    -00200                 }
    -00201                 else {
    -00202                         name = &FirstName;
    -00203                         m_FirstNameSeen = true;
    -00204                 }
    -00205 
    -00206                 *name = ParseFieldString(field);
    -00207                 }
    -00208                 return begin;
    -00209 
    -00210         case CFC_GROUP_LINK:
    -00211                 // just add the unique ID to the list
    -00212                 GroupLinks.push_back(
    -00213                         GroupLink(field->u.link.uniqueId,
    -00214                                 field->u.link.unknown));
    -00215                 return begin;
    -00216 
    -00217         case CFC_GROUP_FLAG:
    -00218                 // ignore the group flag... the presense of group link items
    -00219                 // behaves as the flag in this class
    -00220                 return begin;
    -00221 
    -00222         case CFC_CATEGORY: {
    -00223                 std::string catstring = ParseFieldString(field);
    -00224                 CategoryStr2List(catstring, Categories);
    -00225                 }
    -00226                 return begin;
    -00227 
    -00228         case CFC_BIRTHDAY: {
    -00229                 std::string bstring = ParseFieldString(field);
    -00230                 Birthday.FromBBString(bstring);
    -00231                 }
    -00232                 return begin;
    -00233 
    -00234         case CFC_ANNIVERSARY: {
    -00235                 std::string astring = ParseFieldString(field);
    -00236                 Anniversary.FromBBString(astring);
    -00237                 }
    -00238                 return begin;
    -00239         }
    -00240 
    -00241         // if still not handled, add to the Unknowns list
    -00242         UnknownField uf;
    -00243         uf.type = field->type;
    -00244         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00245         Unknowns.push_back(uf);
    -00246 
    -00247         // return new pointer for next field
    -00248         return begin;
    -00249 }
    -00250 
    -00251 void Contact::ParseHeader(const Data &data, size_t &offset)
    -00252 {
    -00253         // no header to parse in Contact records
    -00254 }
    -00255 
    -00256 // this is called by the RecordParser<> class, which checks size for us
    -00257 void Contact::ParseFields(const Data &data, size_t &offset)
    -00258 {
    -00259         const unsigned char *finish = ParseCommonFields(*this,
    -00260                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00261         offset += finish - (data.GetData() + offset);
    -00262 }
    -00263 
    -00264 void Contact::BuildHeader(Data &data, size_t &offset) const
    -00265 {
    -00266         // no header in Contact records
    -00267 }
    -00268 
    -00269 //
    -00270 // BuildFields
    -00271 //
    -00272 /// Build fields part of record
    -00273 ///
    -00274 void Contact::BuildFields(Data &data, size_t &offset) const
    -00275 {
    -00276         data.Zap();
    -00277 
    -00278         // Sanity check: the Blackberry requires at least a name or
    -00279         // a company name for each address record.
    -00280         if( !GetFullName().size() && !Company.size() )
    -00281                 throw BadData("Contact must have name or company name.");
    -00282 
    -00283         // check if this is a group link record, and if so, output
    -00284         // the group flag
    -00285         if( GroupLinks.size() )
    -00286                 BuildField(data, offset, CFC_GROUP_FLAG, 'G');
    -00287 
    -00288         // special fields not in type table
    -00289         if( FirstName.size() )
    -00290                 BuildField(data, offset, CFC_NAME, FirstName);
    -00291         if( LastName.size() ) {
    -00292                 if( !FirstName.size() ) {
    -00293                         // order matters with first/last name, and if
    -00294                         // last name exists, and first name doesn't,
    -00295                         // insert blank first name ahead of it
    -00296                         BuildField(data, offset, CFC_NAME, FirstName);
    -00297                 }
    -00298                 BuildField(data, offset, CFC_NAME, LastName);
    -00299         }
    -00300 
    -00301         // add all email addresses
    -00302         EmailList::const_iterator eai = EmailAddresses.begin();
    -00303         for( ; eai != EmailAddresses.end(); ++eai ) {
    -00304                 if( eai->size() ) {
    -00305                         BuildField(data, offset, CFC_EMAIL, *eai);
    -00306                 }
    -00307         }
    -00308 
    -00309         // cycle through the type table
    -00310         for(    FieldLink<Contact> *b = ContactFieldLinks;
    -00311                 b->type != CFC_INVALID_FIELD;
    -00312                 b++ )
    -00313         {
    -00314                 // print only fields with data
    -00315                 if( b->strMember ) {
    -00316                         const std::string &field = this->*(b->strMember);
    -00317                         if( field.size() ) {
    -00318                                 BuildField(data, offset, b->type, field);
    -00319                         }
    -00320                 }
    -00321                 else if( b->postMember && b->postField ) {
    -00322                         const std::string &field = (this->*(b->postMember)).*(b->postField);
    -00323                         if( field.size() ) {
    -00324                                 BuildField(data, offset, b->type, field);
    -00325                         }
    -00326                 }
    -00327         }
    -00328 
    -00329         // save any group links
    -00330         GroupLinksType::const_iterator
    -00331                 gb = GroupLinks.begin(), ge = GroupLinks.end();
    -00332         for( ; gb != ge; gb++ ) {
    -00333                 Barry::Protocol::GroupLink link;
    -00334                 link.uniqueId = htobl(gb->Link);
    -00335                 link.unknown = htobs(gb->Unknown);
    -00336                 BuildField(data, offset, CFC_GROUP_LINK, link);
    -00337         }
    -00338 
    -00339         // save categories
    -00340         if( Categories.size() ) {
    -00341                 string store;
    -00342                 CategoryList2Str(Categories, store);
    -00343                 BuildField(data, offset, CFC_CATEGORY, store);
    -00344         }
    -00345 
    -00346         // save Birthday and Anniversary
    -00347         if( Birthday.HasData() )
    -00348                 BuildField(data, offset, CFC_BIRTHDAY, Birthday.ToBBString());
    -00349         if( Anniversary.HasData() )
    -00350                 BuildField(data, offset, CFC_ANNIVERSARY, Anniversary.ToBBString());
    -00351 
    -00352         // and finally save unknowns
    -00353         UnknownsType::const_iterator
    -00354                 ub = Unknowns.begin(), ue = Unknowns.end();
    -00355         for( ; ub != ue; ub++ ) {
    -00356                 BuildField(data, offset, *ub);
    -00357         }
    -00358 
    -00359         data.ReleaseBuffer(offset);
    -00360 }
    -00361 
    -00362 void Contact::Clear()
    -00363 {
    -00364         RecType = Contact::GetDefaultRecType();
    -00365 
    -00366         EmailAddresses.clear();
    -00367         Phone.clear();
    -00368         Fax.clear();
    -00369         WorkPhone.clear();
    -00370         HomePhone.clear();
    -00371         MobilePhone.clear();
    -00372         Pager.clear();
    -00373         PIN.clear();
    -00374         Radio.clear();
    -00375         WorkPhone2.clear();
    -00376         HomePhone2.clear();
    -00377         OtherPhone.clear();
    -00378         FirstName.clear();
    -00379         LastName.clear();
    -00380         Company.clear();
    -00381         DefaultCommunicationsMethod.clear();
    -00382         JobTitle.clear();
    -00383         PublicKey.clear();
    -00384         URL.clear();
    -00385         Prefix.clear();
    -00386         Notes.clear();
    -00387         UserDefined1.clear();
    -00388         UserDefined2.clear();
    -00389         UserDefined3.clear();
    -00390         UserDefined4.clear();
    -00391         Image.clear();
    -00392 
    -00393         Birthday.Clear();
    -00394         Anniversary.Clear();
    -00395 
    -00396         WorkAddress.Clear();
    -00397         HomeAddress.Clear();
    -00398 
    -00399         Categories.clear();
    -00400 
    -00401         GroupLinks.clear();
    -00402         Unknowns.clear();
    -00403 
    -00404         m_FirstNameSeen = false;
    -00405 }
    -00406 
    -00407 //
    -00408 // GetFullName
    -00409 //
    -00410 /// Helper function that returns a formatted full name
    -00411 ///
    -00412 std::string Contact::GetFullName() const
    -00413 {
    -00414         std::string Full = FirstName;
    -00415         if( Full.size() && LastName.size() )
    -00416                 Full += " ";
    -00417         Full += LastName;
    -00418         return Full;
    -00419 }
    -00420 
    -00421 //
    -00422 // GetEmail
    -00423 //
    -00424 /// Helper function that always returns a valid string.  The string
    -00425 /// may be empty if there is no address at the specified index.
    -00426 ///
    -00427 const std::string& Contact::GetEmail(unsigned int index) const
    -00428 {
    -00429         static const std::string blank;
    -00430         if( index < EmailAddresses.size() )
    -00431                 return EmailAddresses[index];
    -00432         return blank;
    -00433 }
    -00434 
    -00435 void Contact::Dump(std::ostream &os) const
    -00436 {
    -00437         ios::fmtflags oldflags = os.setf(ios::left);
    -00438         char fill = os.fill(' ');
    -00439 
    -00440         os << "Contact: 0x" << setbase(16) << GetID()
    -00441                 << " (" << (unsigned int)RecType << ")\n";
    -00442 
    -00443         // special fields not in type table
    -00444         os << "    " << setw(20) << "FirstName";
    -00445         os << ": " << FirstName << "\n";
    -00446         os << "    " << setw(20) << "LastName";
    -00447         os << ": " << LastName << "\n";
    -00448 
    -00449         // cycle through email addresses
    -00450         EmailList::const_iterator eai = EmailAddresses.begin();
    -00451         for( ; eai != EmailAddresses.end(); ++eai ) {
    -00452                 if( eai->size() ) {
    -00453                         os << "    Email               : " << *eai << "\n";
    -00454                 }
    -00455         }
    -00456 
    -00457         // cycle through the type table
    -00458         for(    FieldLink<Contact> *b = ContactFieldLinks;
    -00459                 b->type != CFC_INVALID_FIELD;
    -00460                 b++ )
    -00461         {
    -00462                 const std::string *pField = 0;
    -00463                 if( b->strMember ) {
    -00464                         pField = &(this->*(b->strMember));
    -00465                 }
    -00466                 else if( b->postMember && b->postField ) {
    -00467                         pField = &((this->*(b->postMember)).*(b->postField));
    -00468                 }
    -00469 
    -00470                 // print only fields with data
    -00471                 if( pField && pField->size() ) {
    -00472                         os << "    " << setw(20) << b->name;
    -00473                         os << ": " << *pField << "\n";
    -00474                 }
    -00475         }
    -00476 
    -00477         if( Categories.size() ) {
    -00478                 string display;
    -00479                 CategoryList2Str(Categories, display);
    -00480                 os << "    Categories          : " << display << "\n";
    -00481         }
    -00482 
    -00483         // print Birthday and Anniversary
    -00484         if( Birthday.HasData() ) {
    -00485                 os << "    Birthday            : " << Birthday << "\n";
    -00486         }
    -00487         if( Anniversary.HasData() ) {
    -00488                 os << "    Anniversary         : " << Anniversary << "\n";
    -00489         }
    -00490 
    -00491         // print any group links
    -00492         GroupLinksType::const_iterator
    -00493                 gb = GroupLinks.begin(), ge = GroupLinks.end();
    -00494         if( gb != ge )
    -00495                 os << "    GroupLinks:\n";
    -00496         for( ; gb != ge; gb++ ) {
    -00497                 os << "        ID: 0x" << setbase(16) << gb->Link << "\n";
    -00498         }
    -00499 
    -00500         // and finally print unknowns
    -00501         os << Unknowns;
    -00502 
    -00503         // cleanup the stream
    -00504         os.flags(oldflags);
    -00505         os.fill(fill);
    -00506 }
    -00507 
    -00508 void Contact::SplitName(const std::string &full, std::string &first, std::string &last)
    -00509 {
    -00510         first.clear();
    -00511         last.clear();
    -00512 
    -00513         string::size_type pos = full.find_last_of(' ');
    -00514         if( pos != string::npos ) {
    -00515                 // has space, assume last word is last name
    -00516                 last = full.c_str() + pos + 1;
    -00517                 first = full.substr(0, pos);
    -00518         }
    -00519         else {
    -00520                 // no space, assume only first name
    -00521                 first = full.substr(0);
    -00522         }
    -00523 }
    -00524 
    -00525 void Contact::CategoryStr2List(const std::string &str,
    -00526                                Barry::CategoryList &list)
    -00527 {
    -00528         // start fresh
    -00529         list.clear();
    -00530 
    -00531         if( !str.size() )
    -00532                 return;
    -00533 
    -00534         // parse the comma-delimited string to a list, stripping away
    -00535         // any white space around each category name
    -00536         string::size_type start = 0, end = 0, delim = str.find(',', start);
    -00537         while( start != string::npos ) {
    -00538                 if( delim == string::npos )
    -00539                         end = str.size() - 1;
    -00540                 else
    -00541                         end = delim - 1;
    -00542 
    -00543                 // strip surrounding whitespace
    -00544                 while( str[start] == ' ' )
    -00545                         start++;
    -00546                 while( end && str[end] == ' ' )
    -00547                         end--;
    -00548 
    -00549                 if( start <= end ) {
    -00550                         string token = str.substr(start, end-start+1);
    -00551                         list.push_back(token);
    -00552                 }
    -00553 
    -00554                 // next
    -00555                 start = delim;
    -00556                 if( start != string::npos )
    -00557                         start++;
    -00558                 delim = str.find(',', start);
    -00559         }
    -00560 }
    -00561 
    -00562 void Contact::CategoryList2Str(const Barry::CategoryList &list,
    -00563                                std::string &str)
    -00564 {
    -00565         str.clear();
    -00566 
    -00567         Barry::CategoryList::const_iterator i = list.begin();
    -00568         for( ; i != list.end(); ++i ) {
    -00569                 if( str.size() )
    -00570                         str += ", ";
    -00571                 str += *i;
    -00572         }
    -00573 }
    -00574 
    -00575 } // namespace Barry
    -00576 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__contact_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__contact_8h.html --- barry-0.14/doc/www/doxygen/html/r__contact_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__contact_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ - - -Barry: r_contact.h File Reference - - - - - - - -

    r_contact.h File Reference


    Detailed Description

    -Blackberry database record parser class for contact records. -

    - -

    -Definition in file r_contact.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    struct  Barry::ContactGroupLink
    class  Barry::Contact

    Typedefs

    -typedef std::vector< std::string > Barry::CategoryList

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Contact &contact)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__contact_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__contact_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__contact_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__contact_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ - - -Barry: r_contact.h Source File - - - - - - - -

    r_contact.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_contact.h
    -00003 ///             Blackberry database record parser class for contact records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_RECORD_CONTACT_H__
    -00023 #define __BARRY_RECORD_CONTACT_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "record.h"
    -00027 #include <iosfwd>
    -00028 #include <string>
    -00029 #include <vector>
    -00030 #include <map>
    -00031 #include <stdint.h>
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 //
    -00036 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00037 //        operators in the future.
    -00038 //
    -00039 
    -00040 struct BXEXPORT ContactGroupLink
    -00041 {
    -00042         uint32_t Link;
    -00043         uint16_t Unknown;
    -00044 
    -00045         ContactGroupLink() : Link(0), Unknown(0) {}
    -00046         ContactGroupLink(uint32_t link, uint16_t unknown)
    -00047                 : Link(link), Unknown(unknown)
    -00048         {}
    -00049 };
    -00050 
    -00051 typedef std::vector<std::string> CategoryList;
    -00052 
    -00053 /// \addtogroup RecordParserClasses
    -00054 /// @{
    -00055 
    -00056 class BXEXPORT Contact
    -00057 {
    -00058 public:
    -00059         typedef Barry::CategoryList                     CategoryList;
    -00060         typedef ContactGroupLink                        GroupLink;
    -00061         typedef std::vector<GroupLink>                  GroupLinksType;
    -00062         typedef std::vector<UnknownField>               UnknownsType;
    -00063         typedef std::string                             EmailType;
    -00064         typedef std::vector<EmailType>                  EmailList;
    -00065 
    -00066         // contact specific data
    -00067         uint8_t RecType;
    -00068         uint32_t RecordId;
    -00069         EmailList EmailAddresses;
    -00070         std::string
    -00071                 Phone,
    -00072                 Fax,
    -00073                 WorkPhone,
    -00074                 HomePhone,
    -00075                 MobilePhone,
    -00076                 Pager,
    -00077                 PIN,
    -00078                 Radio,
    -00079                 WorkPhone2,
    -00080                 HomePhone2,
    -00081                 OtherPhone,
    -00082                 FirstName,
    -00083                 LastName,
    -00084                 Company,
    -00085                 DefaultCommunicationsMethod,
    -00086                 JobTitle,
    -00087                 PublicKey,
    -00088                 URL,
    -00089                 Prefix,
    -00090                 Notes,
    -00091                 UserDefined1,
    -00092                 UserDefined2,
    -00093                 UserDefined3,
    -00094                 UserDefined4,
    -00095                 Image;
    -00096 
    -00097         Date Birthday;
    -00098         Date Anniversary;
    -00099 
    -00100         PostalAddress WorkAddress;
    -00101         PostalAddress HomeAddress;
    -00102 
    -00103         // Categories are not allowed to have commas in them.
    -00104         // A category name containing a comma will be split into
    -00105         // two categories, not only by this library, but by the
    -00106         // device itself.
    -00107         CategoryList Categories;
    -00108 
    -00109         GroupLinksType GroupLinks;
    -00110         UnknownsType Unknowns;
    -00111 
    -00112 private:
    -00113         bool m_FirstNameSeen;
    -00114 
    -00115 //protected:
    -00116 public:
    -00117         const unsigned char* ParseField(const unsigned char *begin,
    -00118                 const unsigned char *end);
    -00119 
    -00120 public:
    -00121         Contact();
    -00122         ~Contact();
    -00123 
    -00124         uint32_t GetID() const { return RecordId; }
    -00125         std::string GetFullName() const;
    -00126         const std::string& GetEmail(unsigned int index = 0) const;
    -00127 
    -00128         // Parser / Builder API (see parser.h / builder.h)
    -00129         uint8_t GetRecType() const { return RecType; }
    -00130         uint32_t GetUniqueId() const { return RecordId; }
    -00131         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00132         void ParseHeader(const Data &data, size_t &offset);
    -00133         void ParseFields(const Data &data, size_t &offset);
    -00134         void BuildHeader(Data &data, size_t &offset) const;
    -00135         void BuildFields(Data &data, size_t &offset) const;
    -00136 
    -00137         void Clear();                   // erase everything
    -00138 
    -00139         void Dump(std::ostream &os) const;
    -00140 
    -00141         // sorting - put group links at the end
    -00142         bool operator<(const Contact &other) const {
    -00143                 return GroupLinks.size() == 0 && other.GroupLinks.size() > 0;
    -00144 //              // testing - put group links at the top
    -00145 //              return GroupLinks.size() > 0 && other.GroupLinks.size() == 0;
    -00146         }
    -00147 
    -00148         // database name
    -00149         static const char * GetDBName() { return "Address Book"; }
    -00150         static uint8_t GetDefaultRecType() { return 0; }
    -00151 
    -00152         // helpers
    -00153         static void SplitName(const std::string &full, std::string &first, std::string &last);
    -00154         static void CategoryStr2List(const std::string &str, Barry::CategoryList &list);
    -00155         static void CategoryList2Str(const Barry::CategoryList &list, std::string &str);
    -00156 };
    -00157 
    -00158 BXEXPORT inline std::ostream& operator<< (std::ostream &os, const Contact &contact) {
    -00159         contact.Dump(os);
    -00160         return os;
    -00161 }
    -00162 
    -00163 /// @}
    -00164 
    -00165 } // namespace Barry
    -00166 
    -00167 #endif
    -00168 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record_8cc.html barry-0.0.20110506/doc/www/doxygen/html/record_8cc.html --- barry-0.14/doc/www/doxygen/html/record_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ - - -Barry: record.cc File Reference - - - - - - - -

    record.cc File Reference


    Detailed Description

    -Blackberry database record classes. -

    -Help translate data from data packets to useful structurs, and back. This header provides the common types and classes used by the general record parser classes in the r_*.h files. Only application-safe API stuff goes in here. Internal library types go in record-internal.h -

    -Definition in file record.cc. -

    -#include "record.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <sstream>
    -#include <iomanip>
    -#include <string.h>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__

    Functions

    -void Barry::BuildField1900 (Data &data, size_t &size, uint8_t type, time_t t)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, char c)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, uint16_t value)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const std::string &str)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const void *buf, size_t bufsize)
    -void Barry::BuildField (Data &data, size_t &size, const Barry::UnknownField &field)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const Barry::Protocol::GroupLink &link)
    -std::string Barry::ParseFieldString (const Barry::Protocol::CommonField *field)
    -std::string Barry::ParseFieldString (const void *data, uint16_t maxlen)
    -std::ostream & Barry::operator<< (std::ostream &os, const std::vector< UnknownField > &unknowns)
    -std::ostream & Barry::operator<< (std::ostream &os, const EmailAddress &msga)
    -std::ostream & Barry::operator<< (std::ostream &os, const PostalAddress &post)
    -std::ostream & Barry::operator<< (std::ostream &os, const Date &date)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/record_8cc-source.html --- barry-0.14/doc/www/doxygen/html/record_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,727 +0,0 @@ - - -Barry: record.cc Source File - - - - - - - -

    record.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       record.cc
    -00003 ///             Blackberry database record classes.  Help translate data
    -00004 ///             from data packets to useful structurs, and back.
    -00005 ///             This header provides the common types and classes
    -00006 ///             used by the general record parser classes in the
    -00007 ///             r_*.h files.  Only application-safe API stuff goes in
    -00008 ///             here.  Internal library types go in record-internal.h
    -00009 ///
    -00010 
    -00011 /*
    -00012     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00013 
    -00014     This program is free software; you can redistribute it and/or modify
    -00015     it under the terms of the GNU General Public License as published by
    -00016     the Free Software Foundation; either version 2 of the License, or
    -00017     (at your option) any later version.
    -00018 
    -00019     This program is distributed in the hope that it will be useful,
    -00020     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00022 
    -00023     See the GNU General Public License in the COPYING file at the
    -00024     root directory of this project for more details.
    -00025 */
    -00026 
    -00027 #include "record.h"
    -00028 #include "record-internal.h"
    -00029 #include "protocol.h"
    -00030 #include "protostructs.h"
    -00031 #include "data.h"
    -00032 #include "time.h"
    -00033 #include "error.h"
    -00034 #include "endian.h"
    -00035 #include <sstream>
    -00036 #include <iomanip>
    -00037 #include <time.h>
    -00038 #include <string.h>
    -00039 #include <stdexcept>
    -00040 
    -00041 #define __DEBUG_MODE__
    -00042 #include "debug.h"
    -00043 
    -00044 using namespace std;
    -00045 using namespace Barry::Protocol;
    -00046 
    -00047 namespace Barry {
    -00048 
    -00049 //////////////////////////////////////////////////////////////////////////////
    -00050 // Field builder helper functions
    -00051 
    -00052 void BuildField1900(Data &data, size_t &size, uint8_t type, time_t t)
    -00053 {
    -00054         size_t timesize = COMMON_FIELD_MIN1900_SIZE;
    -00055         size_t fieldsize = COMMON_FIELD_HEADER_SIZE + timesize;
    -00056         unsigned char *pd = data.GetBuffer(size + fieldsize) + size;
    -00057         CommonField *field = (CommonField *) pd;
    -00058 
    -00059         field->size = htobs(timesize);
    -00060         field->type = type;
    -00061         field->u.min1900 = time2min(t);
    -00062 
    -00063         size += fieldsize;
    -00064 }
    -00065 
    -00066 void BuildField(Data &data, size_t &size, uint8_t type, char c)
    -00067 {
    -00068         size_t strsize = 1;
    -00069         size_t fieldsize = COMMON_FIELD_HEADER_SIZE + strsize;
    -00070         unsigned char *pd = data.GetBuffer(size + fieldsize) + size;
    -00071         CommonField *field = (CommonField *) pd;
    -00072 
    -00073         field->size = htobs(strsize);
    -00074         field->type = type;
    -00075         memcpy(field->u.raw, &c, strsize);
    -00076 
    -00077         size += fieldsize;
    -00078 }
    -00079 
    -00080 void BuildField(Data &data, size_t &size, uint8_t type, uint16_t value)
    -00081 {
    -00082         size_t strsize = 2;
    -00083         size_t fieldsize = COMMON_FIELD_HEADER_SIZE + strsize;
    -00084         unsigned char *pd = data.GetBuffer(size + fieldsize) + size;
    -00085         CommonField *field = (CommonField *) pd;
    -00086 
    -00087         field->size = htobs(strsize);
    -00088         field->type = type;
    -00089 
    -00090         uint16_t store = htobs(value);
    -00091         memcpy(field->u.raw, &store, strsize);
    -00092 
    -00093         size += fieldsize;
    -00094 }
    -00095 
    -00096 void BuildField(Data &data, size_t &size, uint8_t type, const std::string &str)
    -00097 {
    -00098         // include null terminator
    -00099         BuildField(data, size, type, str.c_str(), str.size() + 1);
    -00100 }
    -00101 
    -00102 void BuildField(Data &data, size_t &size, uint8_t type,
    -00103                 const void *buf, size_t bufsize)
    -00104 {
    -00105         // include null terminator
    -00106         size_t fieldsize = COMMON_FIELD_HEADER_SIZE + bufsize;
    -00107         unsigned char *pd = data.GetBuffer(size + fieldsize) + size;
    -00108         CommonField *field = (CommonField *) pd;
    -00109 
    -00110         field->size = htobs(bufsize);
    -00111         field->type = type;
    -00112         memcpy(field->u.raw, buf, bufsize);
    -00113 
    -00114         size += fieldsize;
    -00115 }
    -00116 
    -00117 void BuildField(Data &data, size_t &size, const Barry::UnknownField &field)
    -00118 {
    -00119         BuildField(data, size, field.type,
    -00120                 field.data.raw_data.data(), field.data.raw_data.size());
    -00121 }
    -00122 
    -00123 void BuildField(Data &data, size_t &size, uint8_t type, const Barry::Protocol::GroupLink &link)
    -00124 {
    -00125         size_t linksize = sizeof(Barry::Protocol::GroupLink);
    -00126         size_t fieldsize = COMMON_FIELD_HEADER_SIZE + linksize;
    -00127         unsigned char *pd = data.GetBuffer(size + fieldsize) + size;
    -00128         CommonField *field = (CommonField *) pd;
    -00129 
    -00130         field->size = htobs(linksize);
    -00131         field->type = type;
    -00132         field->u.link = link;
    -00133 
    -00134         size += fieldsize;
    -00135 }
    -00136 
    -00137 std::string ParseFieldString(const Barry::Protocol::CommonField *field)
    -00138 {
    -00139         // make no assumptions here, and pass the full size in as
    -00140         // the maxlen, even though 99% of the time, it will be a null...
    -00141         // this function can be used by non-null terminated strings as well
    -00142         return ParseFieldString(field->u.raw, btohs(field->size));
    -00143 }
    -00144 
    -00145 std::string ParseFieldString(const void *data, uint16_t maxlen)
    -00146 {
    -00147         const char *str = (const char *)data;
    -00148 
    -00149         // find last non-null character, since some fields
    -00150         // can have multiple null terminators
    -00151         while( maxlen && str[maxlen-1] == 0 )
    -00152                 maxlen--;
    -00153 
    -00154         return std::string(str, maxlen);
    -00155 }
    -00156 
    -00157 
    -00158 ///////////////////////////////////////////////////////////////////////////////
    -00159 // CommandTable class
    -00160 
    -00161 CommandTable::CommandTable()
    -00162 {
    -00163 }
    -00164 
    -00165 CommandTable::~CommandTable()
    -00166 {
    -00167 }
    -00168 
    -00169 const unsigned char* CommandTable::ParseField(const unsigned char *begin,
    -00170                                               const unsigned char *end)
    -00171 {
    -00172         // check if there is enough data for a header
    -00173         const unsigned char *headend = begin + sizeof(CommandTableField);
    -00174         if( headend > end )
    -00175                 return headend;
    -00176 
    -00177         const CommandTableField *field = (const CommandTableField *) begin;
    -00178 
    -00179         // advance and check size
    -00180         begin += COMMAND_FIELD_HEADER_SIZE + field->size;       // size is byte
    -00181         if( begin > end )               // if begin==end, we are ok
    -00182                 return begin;
    -00183 
    -00184         if( !field->size )              // if field has no size, something's up
    -00185                 return begin;
    -00186 
    -00187         Command command;
    -00188         command.Code = field->code;
    -00189         command.Name.assign((const char *)field->name, field->size);
    -00190         Commands.push_back(command);
    -00191         return begin;
    -00192 }
    -00193 
    -00194 void CommandTable::Parse(const Data &data, size_t offset)
    -00195 {
    -00196         if( offset >= data.GetSize() )
    -00197                 return;
    -00198 
    -00199         const unsigned char *begin = data.GetData() + offset;
    -00200         const unsigned char *end = data.GetData() + data.GetSize();
    -00201 
    -00202         while( begin < end )
    -00203                 begin = ParseField(begin, end);
    -00204 }
    -00205 
    -00206 void CommandTable::Clear()
    -00207 {
    -00208         Commands.clear();
    -00209 }
    -00210 
    -00211 unsigned int CommandTable::GetCommand(const std::string &name) const
    -00212 {
    -00213         CommandArrayType::const_iterator b = Commands.begin();
    -00214         for( ; b != Commands.end(); b++ )
    -00215                 if( b->Name == name )
    -00216                         return b->Code;
    -00217         return 0;
    -00218 }
    -00219 
    -00220 void CommandTable::Dump(std::ostream &os) const
    -00221 {
    -00222         CommandArrayType::const_iterator b = Commands.begin();
    -00223         os << "Command table:\n";
    -00224         for( ; b != Commands.end(); b++ ) {
    -00225                 os << "    Command: 0x" << setbase(16) << b->Code
    -00226                    << " '" << b->Name << "'\n";
    -00227         }
    -00228 }
    -00229 
    -00230 
    -00231 
    -00232 ///////////////////////////////////////////////////////////////////////////////
    -00233 // RecordStateTable class
    -00234 
    -00235 RecordStateTable::RecordStateTable()
    -00236         : m_LastNewRecordId(1)
    -00237 {
    -00238 }
    -00239 
    -00240 RecordStateTable::~RecordStateTable()
    -00241 {
    -00242 }
    -00243 
    -00244 const unsigned char* RecordStateTable::ParseField(const unsigned char *begin,
    -00245                                                   const unsigned char *end)
    -00246 {
    -00247         const RecordStateTableField *field = (const RecordStateTableField *) begin;
    -00248 
    -00249         // advance and check size
    -00250         begin += sizeof(RecordStateTableField);
    -00251         if( begin > end )               // if begin==end, we are ok
    -00252                 return begin;
    -00253 
    -00254         State state;
    -00255         state.Index = btohs(field->index);
    -00256         state.RecordId = btohl(field->uniqueId);
    -00257         state.Dirty = (field->flags & BARRY_RSTF_DIRTY) != 0;
    -00258         state.RecType = field->rectype;
    -00259         state.Unknown2.assign((const char*)field->unknown2, sizeof(field->unknown2));
    -00260         StateMap[state.Index] = state;
    -00261 
    -00262         return begin;
    -00263 }
    -00264 
    -00265 void RecordStateTable::Parse(const Data &data)
    -00266 {
    -00267         size_t offset = 12;     // skipping the unknown 2 bytes at start
    -00268 
    -00269         if( offset >= data.GetSize() )
    -00270                 return;
    -00271 
    -00272         const unsigned char *begin = data.GetData() + offset;
    -00273         const unsigned char *end = data.GetData() + data.GetSize();
    -00274 
    -00275         while( begin < end )
    -00276                 begin = ParseField(begin, end);
    -00277 }
    -00278 
    -00279 void RecordStateTable::Clear()
    -00280 {
    -00281         StateMap.clear();
    -00282         m_LastNewRecordId = 1;
    -00283 }
    -00284 
    -00285 // Searches the StateMap table for RecordId, and returns the "index"
    -00286 // in the map if found.  Returns true if found, false if not.
    -00287 // pFoundIndex can be null if only the existence of the index is desired
    -00288 bool RecordStateTable::GetIndex(uint32_t RecordId, IndexType *pFoundIndex) const
    -00289 {
    -00290         StateMapType::const_iterator i = StateMap.begin();
    -00291         for( ; i != StateMap.end(); ++i ) {
    -00292                 if( i->second.RecordId == RecordId ) {
    -00293                         if( pFoundIndex )
    -00294                                 *pFoundIndex = i->first;
    -00295                         return true;
    -00296                 }
    -00297         }
    -00298         return false;
    -00299 }
    -00300 
    -00301 // Generate a new RecordId that is not in the state table.
    -00302 // Starts at 1 and keeps incrementing until a free one is found.
    -00303 uint32_t RecordStateTable::MakeNewRecordId() const
    -00304 {
    -00305         // start with next Id
    -00306         m_LastNewRecordId++;
    -00307 
    -00308         // make sure it doesn't already exist
    -00309         StateMapType::const_iterator i = StateMap.begin();
    -00310         while( i != StateMap.end() ) {
    -00311                 if( m_LastNewRecordId == i->second.RecordId ) {
    -00312                         m_LastNewRecordId++;            // try again
    -00313                         i = StateMap.begin();           // start over
    -00314                 }
    -00315                 else {
    -00316                         ++i;                            // next State
    -00317                 }
    -00318         }
    -00319         return m_LastNewRecordId;
    -00320 }
    -00321 
    -00322 void RecordStateTable::Dump(std::ostream &os) const
    -00323 {
    -00324         ios::fmtflags oldflags = os.setf(ios::right);
    -00325         char fill = os.fill(' ');
    -00326         bool bPrintAscii = Data::PrintAscii();
    -00327         Data::PrintAscii(false);
    -00328 
    -00329         os << "  Index  RecordId    Dirty  RecType" << endl;
    -00330         os << "-------  ----------  -----  -------" << endl;
    -00331 
    -00332         StateMapType::const_iterator b, e = StateMap.end();
    -00333         for( b = StateMap.begin(); b != e ; ++b ) {
    -00334                 const State &state = b->second;
    -00335 
    -00336                 os.fill(' ');
    -00337                 os << setbase(10) << setw(7) << state.Index;
    -00338                 os << "  0x" << setbase(16) << setfill('0') << setw(8) << state.RecordId;
    -00339                 os << "  " << setfill(' ') << setw(5) << (state.Dirty ? "yes" : "no");
    -00340                 os << "     0x" << setbase(16) << setfill('0') << setw(2) << state.RecType;
    -00341                 os << "   " << Data(state.Unknown2.data(), state.Unknown2.size());
    -00342         }
    -00343 
    -00344         // cleanup the stream
    -00345         os.flags(oldflags);
    -00346         os.fill(fill);
    -00347         Data::PrintAscii(bPrintAscii);
    -00348 }
    -00349 
    -00350 
    -00351 
    -00352 ///////////////////////////////////////////////////////////////////////////////
    -00353 // DatabaseDatabase class
    -00354 
    -00355 DatabaseDatabase::DatabaseDatabase()
    -00356 {
    -00357 }
    -00358 
    -00359 DatabaseDatabase::~DatabaseDatabase()
    -00360 {
    -00361 }
    -00362 
    -00363 template <class RecordType, class FieldType>
    -00364 void DatabaseDatabase::ParseRec(const RecordType &rec, const unsigned char *end)
    -00365 {
    -00366 }
    -00367 
    -00368 template <class FieldType>
    -00369 const unsigned char* DatabaseDatabase::ParseField(const unsigned char *begin,
    -00370                                                   const unsigned char *end)
    -00371 {
    -00372         // check if there is enough data for a header
    -00373         const unsigned char *headend = begin + sizeof(FieldType);
    -00374         if( headend > end )
    -00375                 return headend;
    -00376 
    -00377         // get our header
    -00378         const FieldType *field = (const FieldType *) begin;
    -00379 
    -00380         // advance and check size
    -00381         begin += sizeof(FieldType) - sizeof(field->name) + ConvertHtoB(field->nameSize);
    -00382         if( begin > end )               // if begin==end, we are ok
    -00383                 return begin;
    -00384 
    -00385         if( !ConvertHtoB(field->nameSize) ) // if field has no size, something's up
    -00386                 return begin;
    -00387 
    -00388         Database db;
    -00389         db.Number = ConvertHtoB(field->dbNumber);
    -00390         db.RecordCount = ConvertHtoB(field->dbRecordCount);
    -00391         db.Name.assign((const char *)field->name, ConvertHtoB(field->nameSize) - 1);
    -00392         Databases.push_back(db);
    -00393         return begin;
    -00394 }
    -00395 
    -00396 void DatabaseDatabase::Parse(const Data &data)
    -00397 {
    -00398         // check size to make sure we have up to the DBAccess operation byte
    -00399         if( data.GetSize() < (SB_PACKET_DBACCESS_HEADER_SIZE + 1) )
    -00400                 return;
    -00401 
    -00402         MAKE_PACKET(pack, data);
    -00403         const unsigned char *begin = 0;
    -00404         const unsigned char *end = data.GetData() + data.GetSize();
    -00405 
    -00406         switch( pack->u.db.u.response.operation )
    -00407         {
    -00408         case SB_DBOP_GET_DBDB:
    -00409                 // using the new protocol
    -00410                 if( data.GetSize() > SB_PACKET_DBDB_HEADER_SIZE ) {
    -00411                         begin = (const unsigned char *)
    -00412                                 &pack->u.db.u.response.u.dbdb.field[0];
    -00413 
    -00414                         // this while check is ok, since ParseField checks
    -00415                         // for header size
    -00416                         while( begin < end )
    -00417                                 begin = ParseField<DBDBField>(begin, end);
    -00418                 }
    -00419                 else
    -00420                         dout("DatabaseDatabase: not enough data for parsing");
    -00421                 break;
    -00422 
    -00423         case SB_DBOP_OLD_GET_DBDB:
    -00424                 // using the old protocol
    -00425                 if( data.GetSize() > SB_PACKET_OLD_DBDB_HEADER_SIZE ) {
    -00426                         begin = (const unsigned char *)
    -00427                                 &pack->u.db.u.response.u.old_dbdb.field[0];
    -00428 
    -00429                         // this while check is ok, since ParseField checks
    -00430                         // for header size
    -00431                         while( begin < end )
    -00432                                 begin = ParseField<OldDBDBField>(begin, end);
    -00433                 }
    -00434                 else
    -00435                         dout("DatabaseDatabase: not enough data for parsing");
    -00436                 break;
    -00437 
    -00438         default:
    -00439                 // unknown protocol
    -00440                 dout("Unknown protocol");
    -00441                 break;
    -00442         }
    -00443 
    -00444 
    -00445 }
    -00446 
    -00447 void DatabaseDatabase::Clear()
    -00448 {
    -00449         Databases.clear();
    -00450 }
    -00451 
    -00452 bool DatabaseDatabase::GetDBNumber(const std::string &name,
    -00453                                    unsigned int &number) const
    -00454 {
    -00455         DatabaseArrayType::const_iterator b = Databases.begin();
    -00456         for( ; b != Databases.end(); b++ )
    -00457                 if( b->Name == name ) {
    -00458                         number = b->Number;
    -00459                         return true;
    -00460                 }
    -00461         return false;
    -00462 }
    -00463 
    -00464 bool DatabaseDatabase::GetDBName(unsigned int number,
    -00465                                  std::string &name) const
    -00466 {
    -00467         DatabaseArrayType::const_iterator b = Databases.begin();
    -00468         for( ; b != Databases.end(); b++ )
    -00469                 if( b->Number == number ) {
    -00470                         name = b->Name;
    -00471                         return true;
    -00472                 }
    -00473         return false;
    -00474 }
    -00475 
    -00476 void DatabaseDatabase::Dump(std::ostream &os) const
    -00477 {
    -00478         DatabaseArrayType::const_iterator b = Databases.begin();
    -00479         os << "Database database:\n";
    -00480         for( ; b != Databases.end(); b++ ) {
    -00481                 os << "    Database: 0x" << setbase(16) << b->Number
    -00482                    << " '" << b->Name << "' (records: "
    -00483                    << setbase(10) << b->RecordCount << ")\n";
    -00484         }
    -00485 }
    -00486 
    -00487 
    -00488 std::ostream& operator<< (std::ostream &os, const std::vector<UnknownField> &unknowns)
    -00489 {
    -00490         std::vector<UnknownField>::const_iterator
    -00491                 ub = unknowns.begin(), ue = unknowns.end();
    -00492         if( ub != ue )
    -00493                 os << "    Unknowns:\n";
    -00494         for( ; ub != ue; ub++ ) {
    -00495                 os << "        Type: 0x" << setbase(16)
    -00496                    << (unsigned int) ub->type
    -00497                    << " Data:\n" << Data(ub->data.data(), ub->data.size());
    -00498         }
    -00499         return os;
    -00500 }
    -00501 
    -00502 
    -00503 
    -00504 ///////////////////////////////////////////////////////////////////////////////
    -00505 // EmailAddress class
    -00506 
    -00507 std::ostream& operator<<(std::ostream &os, const EmailAddress &msga) {
    -00508         os << msga.Name.c_str() << " <" << msga.Email.c_str() << ">";
    -00509         return os;
    -00510 }
    -00511 
    -00512 
    -00513 ///////////////////////////////////////////////////////////////////////////////
    -00514 // PostalAddress class
    -00515 
    -00516 //
    -00517 // GetLabel
    -00518 //
    -00519 /// Format a mailing address into a single string, handling missing fields.
    -00520 ///
    -00521 std::string PostalAddress::GetLabel() const
    -00522 {
    -00523         std::string address = Address1;
    -00524         if( Address2.size() ) {
    -00525                 if( address.size() )
    -00526                         address += "\n";
    -00527                 address += Address2;
    -00528         }
    -00529         if( Address3.size() ) {
    -00530                 if( address.size() )
    -00531                         address += "\n";
    -00532                 address += Address3;
    -00533         }
    -00534         if( address.size() )
    -00535                 address += "\n";
    -00536         if( City.size() )
    -00537                 address += City + " ";
    -00538         if( Province.size() )
    -00539                 address += Province + " ";
    -00540         if( Country.size() )
    -00541                 address += Country;
    -00542         if( address.size() )
    -00543                 address += "\n";
    -00544         if( PostalCode.size() )
    -00545                 address += PostalCode;
    -00546         
    -00547         return address;
    -00548 }
    -00549 
    -00550 void PostalAddress::Clear()
    -00551 {
    -00552         Address1.clear();
    -00553         Address2.clear();
    -00554         Address3.clear();
    -00555         City.clear();
    -00556         Province.clear();
    -00557         PostalCode.clear();
    -00558         Country.clear();
    -00559 }
    -00560 
    -00561 std::ostream& operator<<(std::ostream &os, const PostalAddress &post) {
    -00562         os << post.GetLabel();
    -00563         return os;
    -00564 }
    -00565 
    -00566 
    -00567 
    -00568 ///////////////////////////////////////////////////////////////////////////////
    -00569 // Date class
    -00570 
    -00571 Date::Date(const struct tm *timep)
    -00572 {
    -00573         FromTm(timep);
    -00574 }
    -00575 
    -00576 void Date::Clear()
    -00577 {
    -00578         Month = Day = Year = 0;
    -00579 }
    -00580 
    -00581 void Date::ToTm(struct tm *timep) const
    -00582 {
    -00583         memset(timep, 0, sizeof(tm));
    -00584         timep->tm_year = Year - 1900;
    -00585         timep->tm_mon = Month;
    -00586         timep->tm_mday = Day;
    -00587 }
    -00588 
    -00589 std::string Date::ToYYYYMMDD() const
    -00590 {
    -00591         std::ostringstream oss;
    -00592         oss     << setw(4) << Year
    -00593                 << setw(2) << Month + 1
    -00594                 << setw(2) << Day;
    -00595         return oss.str();
    -00596 }
    -00597 
    -00598 //
    -00599 // ToBBString
    -00600 //
    -00601 /// The Blackberry stores Birthday and Anniversary date fields
    -00602 /// with the format: DD/MM/YYYY
    -00603 ///
    -00604 std::string Date::ToBBString() const
    -00605 {
    -00606         std::ostringstream oss;
    -00607         oss     << setw(2) << Day
    -00608                 << Month + 1
    -00609                 << Year;
    -00610         return oss.str();
    -00611 }
    -00612 
    -00613 bool Date::FromTm(const struct tm *timep)
    -00614 {
    -00615         Year = timep->tm_year + 1900;
    -00616         Month = timep->tm_mon;
    -00617         Day = timep->tm_mday;
    -00618         return true;
    -00619 }
    -00620 
    -00621 bool Date::FromBBString(const std::string &str)
    -00622 {
    -00623         int m, d, y;
    -00624         if( 3 == sscanf(str.c_str(), "%d/%d/%d", &d, &m, &y) ) {
    -00625                 Year = y;
    -00626                 Month = m - 1;
    -00627                 Day = d;
    -00628                 return true;
    -00629         }
    -00630         return false;
    -00631 }
    -00632 
    -00633 bool Date::FromYYYYMMDD(const std::string &str)
    -00634 {
    -00635         int m, d, y;
    -00636         if( 3 == sscanf(str.c_str(), "%4d%2d%2d", &y, &m, &d) ) {
    -00637                 Year = y;
    -00638                 Month = m - 1;
    -00639                 Day = d;
    -00640                 return true;
    -00641         }
    -00642         return false;
    -00643 }
    -00644 
    -00645 std::ostream& operator<<(std::ostream &os, const Date &date)
    -00646 {
    -00647         os      << setw(4) << date.Year << '/'
    -00648                 << setw(2) << date.Month << '/'
    -00649                 << setw(2) << date.Day;
    -00650         return os;
    -00651 }
    -00652 
    -00653 
    -00654 
    -00655 } // namespace Barry
    -00656 
    -00657 
    -00658 #ifdef __TEST_MODE__
    -00659 
    -00660 #include <iostream>
    -00661 
    -00662 int main(int argc, char *argv[])
    -00663 {
    -00664         if( argc < 2 ) {
    -00665                 cerr << "Usage: test <datafile>" << endl;
    -00666                 return 1;
    -00667         }
    -00668 
    -00669         std::vector<Data> array;
    -00670         if( !LoadDataArray(argv[1], array) ) {
    -00671                 cerr << "Unable to load file: " << argv[1] << endl;
    -00672                 return 1;
    -00673         }
    -00674 
    -00675         cout << "Loaded " << array.size() << " items" << endl;
    -00676 
    -00677         for( std::vector<Data>::iterator b = array.begin(), e = array.end();
    -00678                 b != e; b++ )
    -00679         {
    -00680                 Data &d = *b;
    -00681 //              cout << d << endl;
    -00682                 if( d.GetSize() > 13 && d.GetData()[6] == 0x4f ) {
    -00683                         Barry::Contact contact;
    -00684                         size_t size = 13;
    -00685                         contact.ParseFields(d, size);
    -00686                         cout << contact << endl;
    -00687                         contact.DumpLdif(cout, "ou=People,dc=example,dc=com");
    -00688                 }
    -00689                 else if( d.GetSize() > 13 && d.GetData()[6] == 0x44 ) {
    -00690                         Barry::Calendar cal;
    -00691                         size_t size = 13;
    -00692                         cal.ParseFields(d, size);
    -00693                         cout << cal << endl;
    -00694                 }
    -00695         }
    -00696 }
    -00697 
    -00698 #endif
    -00699 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record_8h.html barry-0.0.20110506/doc/www/doxygen/html/record_8h.html --- barry-0.14/doc/www/doxygen/html/record_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ - - -Barry: record.h File Reference - - - - - - - -

    record.h File Reference


    Detailed Description

    -Blackberry database record classes. -

    -Help translate data from data packets to useful structurs, and back. This header provides the common types and classes used by the general record parser classes in the r_*.h files. Only application-safe API stuff goes in here. Internal library types go in record-internal.h -

    -Definition in file record.h. -

    -#include "dll.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    -#include "r_calendar.h"
    -#include "r_contact.h"
    -#include "r_memo.h"
    -#include "r_message.h"
    -#include "r_servicebook.h"
    -#include "r_task.h"
    -#include "r_pin_message.h"
    -#include "r_saved_message.h"
    -#include "r_folder.h"
    -#include "r_timezone.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    struct  Barry::CommandTableCommand
    class  Barry::CommandTable
    struct  Barry::RecordStateTableState
    class  Barry::RecordStateTable
    struct  Barry::DatabaseItem
    class  Barry::DatabaseDatabase
    struct  Barry::UnknownData
    struct  Barry::UnknownField
    struct  Barry::EmailAddress
    struct  Barry::PostalAddress
    struct  Barry::Date

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const CommandTable &command)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const RecordStateTable &rst)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const DatabaseDatabase &dbdb)
    -std::ostream & Barry::operator<< (std::ostream &os, const std::vector< UnknownField > &unknowns)
    -std::ostream & Barry::operator<< (std::ostream &os, const EmailAddress &msga)
    -std::ostream & Barry::operator<< (std::ostream &os, const PostalAddress &post)
    -std::ostream & Barry::operator<< (std::ostream &os, const Date &date)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/record_8h-source.html --- barry-0.14/doc/www/doxygen/html/record_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,300 +0,0 @@ - - -Barry: record.h Source File - - - - - - - -

    record.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       record.h
    -00003 ///             Blackberry database record classes.  Help translate data
    -00004 ///             from data packets to useful structurs, and back.
    -00005 ///             This header provides the common types and classes
    -00006 ///             used by the general record parser classes in the
    -00007 ///             r_*.h files.  Only application-safe API stuff goes in
    -00008 ///             here.  Internal library types go in record-internal.h
    -00009 ///
    -00010 
    -00011 /*
    -00012     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00013 
    -00014     This program is free software; you can redistribute it and/or modify
    -00015     it under the terms of the GNU General Public License as published by
    -00016     the Free Software Foundation; either version 2 of the License, or
    -00017     (at your option) any later version.
    -00018 
    -00019     This program is distributed in the hope that it will be useful,
    -00020     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00022 
    -00023     See the GNU General Public License in the COPYING file at the
    -00024     root directory of this project for more details.
    -00025 */
    -00026 
    -00027 #ifndef __BARRY_RECORD_H__
    -00028 #define __BARRY_RECORD_H__
    -00029 
    -00030 #include "dll.h"
    -00031 #include <iosfwd>
    -00032 #include <string>
    -00033 #include <vector>
    -00034 #include <map>
    -00035 #include <stdint.h>
    -00036 
    -00037 // forward declarations
    -00038 namespace Barry { class Data; }
    -00039 
    -00040 namespace Barry {
    -00041 
    -00042 //
    -00043 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00044 //        operators in the future.
    -00045 //
    -00046 
    -00047 
    -00048 
    -00049 struct BXEXPORT CommandTableCommand
    -00050 {
    -00051         unsigned int Code;
    -00052         std::string Name;
    -00053 };
    -00054 
    -00055 class BXEXPORT CommandTable
    -00056 {
    -00057 public:
    -00058         typedef CommandTableCommand Command;
    -00059         typedef std::vector<Command> CommandArrayType;
    -00060 
    -00061         CommandArrayType Commands;
    -00062 
    -00063 private:
    -00064         BXLOCAL const unsigned char* ParseField(const unsigned char *begin,
    -00065                 const unsigned char *end);
    -00066 public:
    -00067         CommandTable();
    -00068         ~CommandTable();
    -00069 
    -00070         void Parse(const Data &data, size_t offset);
    -00071         void Clear();
    -00072 
    -00073         // returns 0 if unable to find command name, which is safe, since
    -00074         // 0 is a special command that shouldn't be in the table anyway
    -00075         unsigned int GetCommand(const std::string &name) const;
    -00076 
    -00077         void Dump(std::ostream &os) const;
    -00078 };
    -00079 
    -00080 BXEXPORT inline std::ostream& operator<< (std::ostream &os, const CommandTable &command) {
    -00081         command.Dump(os);
    -00082         return os;
    -00083 }
    -00084 
    -00085 
    -00086 
    -00087 struct BXEXPORT RecordStateTableState
    -00088 {
    -00089         unsigned int Index;
    -00090         uint32_t RecordId;
    -00091         bool Dirty;
    -00092         unsigned int RecType;
    -00093         std::string Unknown2;
    -00094 };
    -00095 
    -00096 class BXEXPORT RecordStateTable
    -00097 {
    -00098 public:
    -00099         typedef RecordStateTableState State;
    -00100         typedef unsigned int IndexType;
    -00101         typedef std::map<IndexType, State> StateMapType;
    -00102 
    -00103         StateMapType StateMap;
    -00104 
    -00105 private:
    -00106         mutable IndexType m_LastNewRecordId;
    -00107 
    -00108 private:
    -00109         BXLOCAL const unsigned char* ParseField(const unsigned char *begin,
    -00110                 const unsigned char *end);
    -00111 
    -00112 public:
    -00113         RecordStateTable();
    -00114         ~RecordStateTable();
    -00115 
    -00116         void Parse(const Data &data);
    -00117         void Clear();
    -00118 
    -00119         bool GetIndex(uint32_t RecordId, IndexType *pFoundIndex = 0) const;
    -00120         uint32_t MakeNewRecordId() const;
    -00121 
    -00122         void Dump(std::ostream &os) const;
    -00123 };
    -00124 
    -00125 BXEXPORT inline std::ostream& operator<< (std::ostream &os, const RecordStateTable &rst) {
    -00126         rst.Dump(os);
    -00127         return os;
    -00128 }
    -00129 
    -00130 
    -00131 
    -00132 struct BXEXPORT DatabaseItem
    -00133 {
    -00134         unsigned int Number;
    -00135         unsigned int RecordCount;
    -00136         std::string Name;
    -00137 };
    -00138 
    -00139 class BXEXPORT DatabaseDatabase
    -00140 {
    -00141 public:
    -00142         typedef DatabaseItem Database;
    -00143         typedef std::vector<Database> DatabaseArrayType;
    -00144 
    -00145         DatabaseArrayType Databases;
    -00146 
    -00147 private:
    -00148         template <class RecordType, class FieldType>
    -00149         void ParseRec(const RecordType &rec, const unsigned char *end);
    -00150 
    -00151         template <class FieldType>
    -00152         const unsigned char* ParseField(const unsigned char *begin,
    -00153                 const unsigned char *end);
    -00154 
    -00155 public:
    -00156         DatabaseDatabase();
    -00157         ~DatabaseDatabase();
    -00158 
    -00159         void Parse(const Data &data);
    -00160         void Clear();
    -00161 
    -00162         // returns true on success, and fills target
    -00163         bool GetDBNumber(const std::string &name, unsigned int &number) const;
    -00164         bool GetDBName(unsigned int number, std::string &name) const;
    -00165 
    -00166         void Dump(std::ostream &os) const;
    -00167 };
    -00168 
    -00169 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const DatabaseDatabase &dbdb) {
    -00170         dbdb.Dump(os);
    -00171         return os;
    -00172 }
    -00173 
    -00174 struct UnknownData
    -00175 {
    -00176         std::string raw_data;
    -00177 
    -00178         const std::string::value_type* data() const { return raw_data.data(); }
    -00179         std::string::size_type size() const { return raw_data.size(); }
    -00180         void assign(const std::string::value_type *s, std::string::size_type n)
    -00181                 { raw_data.assign(s, n); }
    -00182 };
    -00183 
    -00184 struct BXEXPORT UnknownField
    -00185 {
    -00186         uint8_t type;
    -00187         UnknownData data;
    -00188 };
    -00189 BXEXPORT std::ostream& operator<< (std::ostream &os, const std::vector<UnknownField> &unknowns);
    -00190 
    -00191 struct BXEXPORT EmailAddress
    -00192 {
    -00193         std::string Name;
    -00194         std::string Email;
    -00195 
    -00196         void clear()
    -00197         {
    -00198                 Name.clear();
    -00199                 Email.clear();
    -00200         }
    -00201 };
    -00202 BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddress &msga);
    -00203 
    -00204 struct BXEXPORT PostalAddress
    -00205 {
    -00206         std::string
    -00207                 Address1,
    -00208                 Address2,
    -00209                 Address3,
    -00210                 City,
    -00211                 Province,
    -00212                 PostalCode,
    -00213                 Country;
    -00214 
    -00215         std::string GetLabel() const;
    -00216         void Clear();
    -00217 
    -00218         bool HasData() const { return Address1.size() || Address2.size() ||
    -00219                 Address3.size() || City.size() || Province.size() ||
    -00220                 PostalCode.size() || Country.size(); }
    -00221 };
    -00222 BXEXPORT std::ostream& operator<<(std::ostream &os, const PostalAddress &msga);
    -00223 
    -00224 struct BXEXPORT Date
    -00225 {
    -00226         int Month;                      // 0 to 11
    -00227         int Day;                        // 1 to 31
    -00228         int Year;                       // exact number, eg. 2008
    -00229 
    -00230         Date() : Month(0), Day(0), Year(0) {}
    -00231         explicit Date(const struct tm *timep);
    -00232 
    -00233         bool HasData() const { return Month || Day || Year; }
    -00234         void Clear();
    -00235 
    -00236         void ToTm(struct tm *timep) const;
    -00237         std::string ToYYYYMMDD() const;
    -00238         std::string ToBBString() const; // converts to Blackberry string
    -00239                                         // format of DD/MM/YYYY
    -00240 
    -00241         bool FromTm(const struct tm *timep);
    -00242         bool FromBBString(const std::string &str);
    -00243         bool FromYYYYMMDD(const std::string &str);
    -00244 };
    -00245 BXEXPORT std::ostream& operator<<(std::ostream &os, const Date &date);
    -00246 
    -00247 
    -00248 /// \addtogroup RecordParserClasses
    -00249 ///             Parser and data storage classes.  These classes take a
    -00250 ///             Database Database record and convert them into C++ objects.
    -00251 ///             Each of these classes are safe to be used in standard
    -00252 ///             containers, and are meant to be used in conjunction with the
    -00253 ///             RecordParser<> template when calling Controller::LoadDatabase().
    -00254 /// @{
    -00255 /// @}
    -00256 
    -00257 } // namespace Barry
    -00258 
    -00259 // Include all parser classes, to make it easy for the application to use.
    -00260 #include "r_calendar.h"
    -00261 #include "r_contact.h"
    -00262 #include "r_memo.h"
    -00263 #include "r_message.h"
    -00264 #include "r_servicebook.h"
    -00265 #include "r_task.h"
    -00266 #include "r_pin_message.h"
    -00267 #include "r_saved_message.h"
    -00268 #include "r_folder.h"
    -00269 #include "r_timezone.h"
    -00270 
    -00271 #endif
    -00272 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record-internal_8h.html barry-0.0.20110506/doc/www/doxygen/html/record-internal_8h.html --- barry-0.14/doc/www/doxygen/html/record-internal_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record-internal_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ - - -Barry: record-internal.h File Reference - - - - - - - -

    record-internal.h File Reference


    Detailed Description

    -Support functions, types, and templates for the general record parsing classes in r_*.h files. -

    -This header is NOT installed for applications to use, so it is safe to put library-specific things in here. -

    -Definition in file record-internal.h. -

    -#include <string>
    -#include "protostructs.h"
    -#include "error.h"
    -#include "endian.h"
    -#include "record.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    struct  Barry::FieldLink< RecordT >

    Functions

    -template<class RecordT>
    const unsigned char * Barry::ParseCommonFields (RecordT &rec, const void *begin, const void *end)
    -template<class SizeT>
    SizeT Barry::ConvertHtoB (SizeT s)
    -void Barry::BuildField1900 (Data &data, size_t &size, uint8_t type, time_t t)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, char c)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, uint16_t value)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const std::string &str)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const void *buf, size_t bufsize)
    -void Barry::BuildField (Data &data, size_t &size, const Barry::UnknownField &field)
    -void Barry::BuildField (Data &data, size_t &size, uint8_t type, const Barry::Protocol::GroupLink &link)
    -std::string Barry::ParseFieldString (const Barry::Protocol::CommonField *field)
    -std::string Barry::ParseFieldString (const void *data, uint16_t maxlen)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/record-internal_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/record-internal_8h-source.html --- barry-0.14/doc/www/doxygen/html/record-internal_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/record-internal_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ - - -Barry: record-internal.h Source File - - - - - - - -

    record-internal.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       record-internal.h
    -00003 ///             Support functions, types, and templates for the
    -00004 ///             general record parsing classes in r_*.h files.
    -00005 ///             This header is NOT installed for applications to
    -00006 ///             use, so it is safe to put library-specific things
    -00007 ///             in here.
    -00008 ///
    -00009 
    -00010 /*
    -00011     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00012 
    -00013     This program is free software; you can redistribute it and/or modify
    -00014     it under the terms of the GNU General Public License as published by
    -00015     the Free Software Foundation; either version 2 of the License, or
    -00016     (at your option) any later version.
    -00017 
    -00018     This program is distributed in the hope that it will be useful,
    -00019     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00020     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00021 
    -00022     See the GNU General Public License in the COPYING file at the
    -00023     root directory of this project for more details.
    -00024 */
    -00025 
    -00026 #ifndef __BARRY_RECORD_INTERNAL_H__
    -00027 #define __BARRY_RECORD_INTERNAL_H__
    -00028 
    -00029 #include <string>
    -00030 #include "protostructs.h"
    -00031 #include "error.h"
    -00032 #include "endian.h"
    -00033 #include "record.h"
    -00034 
    -00035 // forward declarations
    -00036 namespace Barry { class Data; }
    -00037 
    -00038 namespace Barry {
    -00039 
    -00040 template <class RecordT>
    -00041 const unsigned char*  ParseCommonFields(RecordT &rec, const void *begin, const void *end)
    -00042 {
    -00043         const unsigned char *b = (const unsigned char*) begin;
    -00044         const unsigned char *e = (const unsigned char*) end;
    -00045 
    -00046         while( (b + COMMON_FIELD_HEADER_SIZE) < e )
    -00047                 b = rec.ParseField(b, e);
    -00048         return b;
    -00049 }
    -00050 
    -00051 // Use templates here to guarantee types are converted in the strictest manner.
    -00052 template <class SizeT>
    -00053 inline SizeT ConvertHtoB(SizeT s)
    -00054 {
    -00055         throw Error("Not implemented.");
    -00056 }
    -00057 
    -00058 // specializations for specific sizes
    -00059 template <> inline uint8_t ConvertHtoB<uint8_t>(uint8_t s)    { return s; }
    -00060 template <> inline uint16_t ConvertHtoB<uint16_t>(uint16_t s) { return htobs(s); }
    -00061 template <> inline uint32_t ConvertHtoB<uint32_t>(uint32_t s) { return htobl(s); }
    -00062 template <> inline uint64_t ConvertHtoB<uint64_t>(uint64_t s) { return htobll(s); }
    -00063 
    -00064 
    -00065 template <class RecordT>
    -00066 struct FieldLink
    -00067 {
    -00068         int type;
    -00069         const char *name;
    -00070         const char *ldif;
    -00071         const char *objectClass;
    -00072         std::string RecordT::* strMember;       // FIXME - find a more general
    -00073         EmailAddress RecordT::* addrMember;     // way to do this...
    -00074         time_t RecordT::* timeMember;
    -00075         PostalAddress RecordT::* postMember;
    -00076         std::string PostalAddress::* postField;
    -00077 };
    -00078 
    -00079 void BuildField1900(Data &data, size_t &size, uint8_t type, time_t t);
    -00080 void BuildField(Data &data, size_t &size, uint8_t type, char c);
    -00081 void BuildField(Data &data, size_t &size, uint8_t type, uint16_t value);
    -00082 void BuildField(Data &data, size_t &size, uint8_t type, const std::string &str);
    -00083 void BuildField(Data &data, size_t &size, uint8_t type, const void *buf, size_t bufsize);
    -00084 void BuildField(Data &data, size_t &size, const Barry::UnknownField &field);
    -00085 void BuildField(Data &data, size_t &size, uint8_t type, const Barry::Protocol::GroupLink &link);
    -00086 std::string ParseFieldString(const Barry::Protocol::CommonField *field);
    -00087 std::string ParseFieldString(const void *data, uint16_t maxlen);
    -00088 
    -00089 } // namespace Barry
    -00090 
    -00091 #endif
    -00092 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__folder_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__folder_8cc.html --- barry-0.14/doc/www/doxygen/html/r__folder_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__folder_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ - - -Barry: r_folder.cc File Reference - - - - - - - -

    r_folder.cc File Reference


    Detailed Description

    -Record parsing class for the folders database. -

    - -

    -Definition in file r_folder.cc. -

    -#include "r_folder.h"
    -#include "record-internal.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "debug.h"
    -#include <ostream>
    -#include <iomanip>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define FFC_NUMBER   0x0a
    -#define FFC_LEVEL   0x0b
    -#define FFC_NAME   0x0c
    -#define FFC_ADDRESS1   0x0d
    -#define FFC_ADDRESS2   0x0e
    -#define FFC_TYPE   0x0f
    -#define FFC_END   0xffff
    -#define SUBTREE   0x00
    -#define DELETED   0x01
    -#define INBOX   0x02
    -#define OUTBOX   0x03
    -#define SENT   0x04
    -#define OTHER   0x05
    -#define DRAFT   0x0a
    -#define ORPHAN   0x50
    -#define UNFILED   0x51
    -#define FILED   0x52
    -#define INVALID   -1
    -#define SEPARATOR   0x2f
    -#define ROOT_SEPARATOR   0x3a

    Variables

    -FieldLink< Folder > Barry::FolderFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__folder_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__folder_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__folder_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__folder_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ - - -Barry: r_folder.cc Source File - - - - - - - -

    r_folder.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_folder.cc
    -00003 ///             Record parsing class for the folders database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_folder.h"
    -00024 #include "record-internal.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "debug.h"
    -00029 #include <ostream>
    -00030 #include <iomanip>
    -00031 
    -00032 using namespace std;
    -00033 using namespace Barry::Protocol;
    -00034 
    -00035 namespace Barry {
    -00036 
    -00037 ///////////////////////////////////////////////////////////////////////////////
    -00038 // Folder Class
    -00039 
    -00040 // Folder Field Codes
    -00041 
    -00042 #define FFC_NUMBER      0x0a
    -00043 #define FFC_LEVEL       0x0b
    -00044 #define FFC_NAME        0x0c
    -00045 #define FFC_ADDRESS1    0x0d
    -00046 #define FFC_ADDRESS2    0x0e
    -00047 #define FFC_TYPE        0x0f
    -00048 #define FFC_END 0xffff
    -00049 
    -00050 // Folder Types
    -00051 #define SUBTREE 0x00
    -00052 #define DELETED 0x01
    -00053 #define INBOX           0x02
    -00054 #define OUTBOX          0x03
    -00055 #define SENT            0x04
    -00056 #define OTHER           0x05
    -00057 #define DRAFT           0x0a
    -00058 
    -00059 // Folder Status
    -00060 #define ORPHAN          0x50
    -00061 #define UNFILED 0x51
    -00062 #define FILED           0x52
    -00063 
    -00064 #define INVALID         -1
    -00065 
    -00066 #define SEPARATOR       0x2f
    -00067 #define ROOT_SEPARATOR  0x3a
    -00068 
    -00069 FieldLink<Folder> FolderFieldLinks[] = {
    -00070         { FFC_NAME,      "FolderName",   0, 0, &Folder::FolderName, 0, 0 },
    -00071         { FFC_END,       "End of List",  0, 0, 0, 0, 0 },
    -00072 };
    -00073 
    -00074 Folder::Folder()
    -00075 {
    -00076         Clear();
    -00077 }
    -00078 
    -00079 
    -00080 Folder::~Folder()
    -00081 {
    -00082 }
    -00083 
    -00084 const unsigned char* Folder::ParseField(const unsigned char *begin,
    -00085                                       const unsigned char *end)
    -00086 {
    -00087         const CommonField *field = (const CommonField *) begin;
    -00088 
    -00089         // advance and check size
    -00090         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00091         if( begin > end )       // if begin==end, we are ok
    -00092                 return begin;
    -00093 
    -00094         if( !btohs(field->size) )   // if field has no size, something's up
    -00095                 return begin;
    -00096         
    -00097         // cycle through the type table
    -00098         for(    FieldLink<Folder> *b = FolderFieldLinks;
    -00099                 b->type != FFC_END;
    -00100                 b++ )
    -00101         {
    -00102                 if( b->type == field->type ) {
    -00103                         if( b->strMember ) {
    -00104                                 std::string &s = this->*(b->strMember);
    -00105                                 s = ParseFieldString(field);
    -00106                                 return begin;   // done!
    -00107                         }
    -00108                         else if( b->timeMember && btohs(field->size) == 4 ) {
    -00109                                 time_t &t = this->*(b->timeMember);
    -00110                                 t = min2time(field->u.min1900);
    -00111                                 return begin;
    -00112                         }
    -00113                 }
    -00114         }
    -00115         // handle special cases
    -00116         switch( field->type )
    -00117         {
    -00118         case FFC_TYPE:
    -00119                 FolderType = (FolderTypeEnum)field->u.raw[0];
    -00120                 return begin;
    -00121         case FFC_NUMBER:
    -00122                 FolderNumber = field->u.raw[0]; // two's complement
    -00123                 return begin;
    -00124         case FFC_LEVEL:
    -00125                 FolderLevel = field->u.raw[0];
    -00126                 return begin;
    -00127         }
    -00128 
    -00129         // if still not handled, add to the Unknowns list
    -00130         UnknownField uf;
    -00131         uf.type = field->type;
    -00132         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00133         Unknowns.push_back(uf);
    -00134 
    -00135         // return new pointer for next field
    -00136         return begin;
    -00137 }
    -00138 
    -00139 void Folder::ParseHeader(const Data &data, size_t &offset)
    -00140 {
    -00141         // no header in Folder records
    -00142 }
    -00143 
    -00144 void Folder::ParseFields(const Data &data, size_t &offset)
    -00145 {
    -00146         const unsigned char *finish = ParseCommonFields(*this,
    -00147         data.GetData() + offset, data.GetData() + data.GetSize());
    -00148         offset += finish - (data.GetData() + offset);
    -00149 }
    -00150 
    -00151 void Folder::Clear()
    -00152 {
    -00153         FolderName.clear();
    -00154         Unknowns.clear();
    -00155         FolderType = FolderSubtree;
    -00156 }
    -00157 
    -00158 void Folder::Dump(std::ostream &os) const
    -00159 {
    -00160         static const char *FolderTypeString[] = { "Subtree", "Deleted", "Inbox", "Outbox", "Sent", "Other"};
    -00161 //      static const char *FolderStatusString[] = { "Orphan", "Unfiled", "Filed" };
    -00162         
    -00163         os << "Folder Records\n\n";
    -00164         os << "Folder Name: " << FolderName << "\n";
    -00165         os << "Folder Type: ";
    -00166         if( FolderType < FolderDraft )
    -00167                 os << FolderTypeString[FolderType] << "\n";
    -00168         else if( FolderType == FolderDraft )
    -00169                 os << "Draft\n";
    -00170         else
    -00171                 os << "Unknown (" << std::hex << FolderType << ")\n";
    -00172         os << "Folder Number: " << std::dec << FolderNumber << "\n";
    -00173         os << "Folder Level: " << std::dec << FolderLevel << "\n";
    -00174         os << "\n";
    -00175         os << Unknowns;
    -00176         os << "\n\n";
    -00177 }
    -00178 
    -00179 } // namespace Barry
    -00180 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__folder_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__folder_8h.html --- barry-0.14/doc/www/doxygen/html/r__folder_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__folder_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: r_folder.h File Reference - - - - - - - -

    r_folder.h File Reference


    Detailed Description

    -Record parsing class for the Folder database. -

    - -

    -Definition in file r_folder.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <vector>
    -#include <string>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Folder

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Folder &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__folder_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__folder_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__folder_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__folder_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ - - -Barry: r_folder.h Source File - - - - - - - -

    r_folder.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_folder.h
    -00003 ///             Record parsing class for the Folder database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_FOLDER_H__
    -00024 #define __BARRY_RECORD_FOLDER_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <vector>
    -00029 #include <string>
    -00030 #include <stdint.h>
    -00031 
    -00032 namespace Barry {
    -00033 
    -00034 class BXEXPORT Folder
    -00035 {
    -00036 public:
    -00037         typedef std::vector<UnknownField>                       UnknownsType;
    -00038         uint8_t RecType;
    -00039         uint32_t RecordId;
    -00040         
    -00041         std::string FolderName;
    -00042         uint16_t        FolderNumber;   // Not unique, used for ordering of subfolders - NOT level
    -00043         uint16_t        FolderLevel;    // From parent
    -00044         
    -00045         enum FolderTypeEnum {
    -00046                 FolderSubtree = 0,
    -00047                 FolderDeleted,
    -00048                 FolderInbox,
    -00049                 FolderOutbox,
    -00050                 FolderSent,
    -00051                 FolderOther,
    -00052                 FolderDraft = 0x0a
    -00053         };
    -00054         FolderTypeEnum FolderType;
    -00055         
    -00056         enum FolderStatusType {
    -00057                 FolderOrphan = 0x50,
    -00058                 FolderUnfiled,
    -00059                 FolderFiled
    -00060         };
    -00061 
    -00062         UnknownsType Unknowns;
    -00063 
    -00064 public: 
    -00065         Folder();
    -00066         ~Folder();
    -00067 
    -00068         const unsigned char* ParseField(const unsigned char *begin,
    -00069                 const unsigned char *end);      
    -00070         uint8_t GetRecType() const { return RecType; }
    -00071         uint32_t GetUniqueId() const { return RecordId; }
    -00072         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00073         void ParseHeader(const Data &data, size_t &offset);
    -00074         void ParseFields(const Data &data, size_t &offset);
    -00075         void BuildHeader(Data &data, size_t &offset) const;
    -00076 
    -00077         void Clear();
    -00078 
    -00079         void Dump(std::ostream &os) const;
    -00080         bool operator<(const Folder &other) const { return FolderName < other.FolderName; }
    -00081 
    -00082         // database name
    -00083         static const char * GetDBName() { return "Folders"; }
    -00084         static uint8_t GetDefaultRecType() { return 0; }
    -00085 
    -00086 };
    -00087 
    -00088 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Folder &msg) {
    -00089         msg.Dump(os);
    -00090         return os;
    -00091 }
    -00092 
    -00093 } // namespace Barry
    -00094 
    -00095 #endif  // __BARRY_RECORD_FOLDER_H__
    -00096 
    -00097 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__memo_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__memo_8cc.html --- barry-0.14/doc/www/doxygen/html/r__memo_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__memo_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - -Barry: r_memo.cc File Reference - - - - - - - -

    r_memo.cc File Reference


    Detailed Description

    -Record parsing class for the memo database. -

    - -

    -Definition in file r_memo.cc. -

    -#include "r_memo.h"
    -#include "record-internal.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include <ostream>
    -#include <iomanip>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define MEMFC_TITLE   0x01
    -#define MEMFC_BODY   0x02
    -#define MEMFC_MEMO_TYPE   0x03
    -#define MEMFC_CATEGORY   0x04
    -#define MEMFC_END   0xffff

    Variables

    -FieldLink< Memo > Barry::MemoFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__memo_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__memo_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__memo_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__memo_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ - - -Barry: r_memo.cc Source File - - - - - - - -

    r_memo.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_memo.cc
    -00003 ///             Record parsing class for the memo database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_memo.h"
    -00024 #include "record-internal.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include <ostream>
    -00029 #include <iomanip>
    -00030 
    -00031 using namespace std;
    -00032 using namespace Barry::Protocol;
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 ///////////////////////////////////////////////////////////////////////////////
    -00037 // Memo Class
    -00038 
    -00039 // Memo Field Codes
    -00040 #define MEMFC_TITLE             0x01
    -00041 #define MEMFC_BODY              0x02
    -00042 #define MEMFC_MEMO_TYPE         0x03
    -00043 #define MEMFC_CATEGORY          0x04
    -00044 #define MEMFC_END               0xffff
    -00045 
    -00046 FieldLink<Memo> MemoFieldLinks[] = {
    -00047         { MEMFC_TITLE,     "Title",       0, 0, &Memo::Title, 0, 0 },
    -00048         { MEMFC_BODY,      "Body",        0, 0, &Memo::Body, 0, 0 },
    -00049         { MEMFC_CATEGORY,  "Category",    0, 0, &Memo::Category, 0, 0 },
    -00050         { MEMFC_END,       "End of List", 0, 0, 0, 0, 0 }
    -00051 };
    -00052 
    -00053 Memo::Memo()
    -00054 {
    -00055         Clear();
    -00056 }
    -00057 
    -00058 Memo::~Memo()
    -00059 {
    -00060 }
    -00061 
    -00062 const unsigned char* Memo::ParseField(const unsigned char *begin,
    -00063                                       const unsigned char *end)
    -00064 {
    -00065         const CommonField *field = (const CommonField *) begin;
    -00066 
    -00067         // advance and check size
    -00068         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00069         if( begin > end )       // if begin==end, we are ok
    -00070                 return begin;
    -00071 
    -00072         if( !btohs(field->size) )   // if field has no size, something's up
    -00073                 return begin;
    -00074 
    -00075         if( field->type == MEMFC_MEMO_TYPE ) {
    -00076                 if( ( MemoType = field->u.raw[0] ) != 'm' ) {
    -00077                         throw Error( "Memo::ParseField: MemoType is not 'm'" );
    -00078                 }
    -00079         return begin;
    -00080         }
    -00081 
    -00082 
    -00083         // cycle through the type table
    -00084         for(    FieldLink<Memo> *b = MemoFieldLinks;
    -00085                 b->type != MEMFC_END;
    -00086                 b++ )
    -00087         {
    -00088                 if( b->type == field->type ) {
    -00089                         if( b->strMember ) {
    -00090                                 std::string &s = this->*(b->strMember);
    -00091                                 s = ParseFieldString(field);
    -00092                                 return begin;   // done!
    -00093                         }
    -00094                         else if( b->timeMember && btohs(field->size) == 4 ) {
    -00095                                 time_t &t = this->*(b->timeMember);
    -00096                                 t = min2time(field->u.min1900);
    -00097                                 return begin;
    -00098                         }
    -00099                 }
    -00100         }
    -00101 
    -00102         // if still not handled, add to the Unknowns list
    -00103         UnknownField uf;
    -00104         uf.type = field->type;
    -00105         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00106         Unknowns.push_back(uf);
    -00107 
    -00108         // return new pointer for next field
    -00109         return begin;
    -00110 }
    -00111 
    -00112 void Memo::ParseHeader(const Data &data, size_t &offset)
    -00113 {
    -00114         // no header in Memo records
    -00115 }
    -00116 
    -00117 void Memo::ParseFields(const Data &data, size_t &offset)
    -00118 {
    -00119         const unsigned char *finish = ParseCommonFields(*this,
    -00120         data.GetData() + offset, data.GetData() + data.GetSize());
    -00121         offset += finish - (data.GetData() + offset);
    -00122 }
    -00123 
    -00124 
    -00125 void Memo::Dump(std::ostream &os) const
    -00126 {
    -00127         os << "Memo entry: 0x" << setbase(16) << RecordId
    -00128            << " (" << (unsigned int)RecType << ")\n";
    -00129         os << "    Title: " << Title << "\n";
    -00130         os << "    Body: " << Body << "\n";
    -00131         os << "    Category: " << Category << "\n";
    -00132 
    -00133         os << Unknowns;
    -00134         os << "\n\n";
    -00135 }
    -00136 
    -00137 void Memo::Clear()
    -00138 {
    -00139         Title.clear();
    -00140         Body.clear();
    -00141         Category.clear();
    -00142 
    -00143         MemoType = 0;
    -00144 
    -00145         Unknowns.clear();
    -00146 }
    -00147 
    -00148 } // namespace Barry
    -00149 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__memo_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__memo_8h.html --- barry-0.14/doc/www/doxygen/html/r__memo_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__memo_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: r_memo.h File Reference - - - - - - - -

    r_memo.h File Reference


    Detailed Description

    -Record parsing class for the memo database. -

    - -

    -Definition in file r_memo.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <vector>
    -#include <string>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Memo

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Memo &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__memo_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__memo_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__memo_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__memo_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ - - -Barry: r_memo.h Source File - - - - - - - -

    r_memo.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_memo.h
    -00003 ///             Record parsing class for the memo database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_MEMO_H__
    -00024 #define __BARRY_RECORD_MEMO_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <vector>
    -00029 #include <string>
    -00030 #include <stdint.h>
    -00031 
    -00032 namespace Barry {
    -00033 
    -00034 class BXEXPORT Memo
    -00035 {
    -00036 public:
    -00037         typedef std::vector<UnknownField>       UnknownsType;
    -00038 
    -00039         uint8_t RecType;
    -00040         uint32_t RecordId;
    -00041 
    -00042         uint8_t MemoType;
    -00043         std::string Title;
    -00044         std::string Body;
    -00045         std::string Category;
    -00046 
    -00047         UnknownsType Unknowns;
    -00048 
    -00049 public:
    -00050         const unsigned char* ParseField(const unsigned char *begin,
    -00051                 const unsigned char *end);
    -00052 
    -00053 public:
    -00054         Memo();
    -00055         ~Memo();
    -00056 
    -00057         // Parser / Builder API (see parser.h / builder.h)
    -00058         uint8_t GetRecType() const { return RecType; }
    -00059         uint32_t GetUniqueId() const { return RecordId; }
    -00060         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00061         void ParseHeader(const Data &data, size_t &offset);
    -00062         void ParseFields(const Data &data, size_t &offset);
    -00063         void BuildHeader(Data &data, size_t &offset) const;
    -00064 
    -00065         void Clear();
    -00066 
    -00067         void Dump(std::ostream &os) const;
    -00068         
    -00069         bool operator<(const Memo &other) const { return Title < other.Title; }
    -00070         // database name
    -00071         static const char * GetDBName() { return "Memos"; }
    -00072         static uint8_t GetDefaultRecType() { return 0; }    // or 0?
    -00073 };
    -00074 
    -00075 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Memo &msg) {
    -00076         msg.Dump(os);
    -00077         return os;
    -00078 }
    -00079 
    -00080 } // namespace Barry
    -00081 
    -00082 #endif
    -00083 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__message_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__message_8cc.html --- barry-0.14/doc/www/doxygen/html/r__message_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__message_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ - - -Barry: r_message.cc File Reference - - - - - - - -

    r_message.cc File Reference


    Detailed Description

    -Blackberry database record parser class for email records. -

    - -

    -Definition in file r_message.cc. -

    -#include "r_message.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define MFC_TO   0x01
    -#define MFC_CC   0x02
    -#define MFC_BCC   0x03
    -#define MFC_SENDER   0x04
    -#define MFC_FROM   0x05
    -#define MFC_REPLY_TO   0x06
    -#define MFC_SUBJECT   0x0b
    -#define MFC_BODY   0x0c
    -#define MFC_REPLY_UNKNOWN   0x12
    -#define MFC_ATTACHMENT   0x16
    -#define MFC_RECORDID   0x4b
    -#define MFC_END   0xffff
    -#define PRIORITY_MASK   0x003f
    -#define PRIORITY_HIGH   0x0008
    -#define PRIORITY_LOW   0x0002
    -#define SENSITIVE_MASK   0xff80
    -#define SENSITIVE_CONFIDENTIAL   0x0100
    -#define SENSITIVE_PERSONAL   0x0080
    -#define SENSITIVE_PRIVATE   0x0040
    -#define MESSAGE_READ   0x0800
    -#define MESSAGE_REPLY   0x0001
    -#define MESSAGE_SAVED   0x0002
    -#define MESSAGE_FORWARD   0x0008
    -#define MESSAGE_TRUNCATED   0x0020
    -#define MESSAGE_SAVED_DELETED   0x0080

    Variables

    -FieldLink< Message > Barry::MessageFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__message_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__message_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__message_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__message_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,373 +0,0 @@ - - -Barry: r_message.cc Source File - - - - - - - -

    r_message.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_message.cc
    -00003 ///             Blackberry database record parser class for email records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "r_message.h"
    -00023 #include "record-internal.h"
    -00024 #include "protocol.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "error.h"
    -00029 #include "endian.h"
    -00030 #include <ostream>
    -00031 #include <iomanip>
    -00032 #include <time.h>
    -00033 #include <stdexcept>
    -00034 
    -00035 #define __DEBUG_MODE__
    -00036 #include "debug.h"
    -00037 
    -00038 using namespace std;
    -00039 using namespace Barry::Protocol;
    -00040 
    -00041 namespace Barry {
    -00042 
    -00043 ///////////////////////////////////////////////////////////////////////////////
    -00044 // Message class
    -00045 
    -00046 
    -00047 // Email / message field codes
    -00048 #define MFC_TO                  0x01            // can occur multiple times
    -00049 #define MFC_CC                  0x02            // ditto
    -00050 #define MFC_BCC                 0x03            // ditto
    -00051 #define MFC_SENDER              0x04
    -00052 #define MFC_FROM                0x05
    -00053 #define MFC_REPLY_TO            0x06
    -00054 #define MFC_SUBJECT             0x0b
    -00055 #define MFC_BODY                0x0c
    -00056 #define MFC_REPLY_UNKNOWN       0x12    // This shows up as 0x00 on replies but we don't do much with it now
    -00057 #define MFC_ATTACHMENT          0x16
    -00058 #define MFC_RECORDID            0x4b
    -00059 #define MFC_END         0xffff
    -00060 
    -00061 #define PRIORITY_MASK           0x003f
    -00062 #define PRIORITY_HIGH           0x0008
    -00063 #define PRIORITY_LOW            0x0002
    -00064 
    -00065 #define SENSITIVE_MASK          0xff80
    -00066 #define SENSITIVE_CONFIDENTIAL  0x0100
    -00067 #define SENSITIVE_PERSONAL      0x0080
    -00068 #define SENSITIVE_PRIVATE       0x0040  // actual pattern is 0x00C0
    -00069 
    -00070 #define MESSAGE_READ            0x0800
    -00071 #define MESSAGE_REPLY           0x0001
    -00072 #define MESSAGE_SAVED           0x0002
    -00073 #define MESSAGE_FORWARD         0x0008
    -00074 #define MESSAGE_TRUNCATED       0x0020
    -00075 #define MESSAGE_SAVED_DELETED   0x0080
    -00076 
    -00077 FieldLink<Message> MessageFieldLinks[] = {
    -00078    { MFC_TO,            "To",           0, 0,    0, &Message::To, 0 },
    -00079    { MFC_CC,            "Cc",           0, 0,    0, &Message::Cc, 0 },
    -00080    { MFC_BCC,           "Bcc",          0, 0,    0, &Message::Bcc, 0 },
    -00081    { MFC_SENDER,        "Sender",       0, 0,    0, &Message::Sender, 0 },
    -00082    { MFC_FROM,          "From",         0, 0,    0, &Message::From, 0 },
    -00083    { MFC_REPLY_TO,      "ReplyTo",      0, 0,    0, &Message::ReplyTo, 0 },
    -00084    { MFC_SUBJECT,       "Subject",      0, 0,    &Message::Subject, 0, 0 },
    -00085    { MFC_BODY,          "Body",         0, 0,    &Message::Body, 0, 0 },
    -00086    { MFC_ATTACHMENT,    "Attachment",   0, 0,    &Message::Attachment, 0, 0 },
    -00087    { MFC_END,           "End of List",  0, 0,    0, 0, 0 }
    -00088 };
    -00089 
    -00090 Message::Message()
    -00091 {
    -00092         Clear();
    -00093 }
    -00094 
    -00095 Message::~Message()
    -00096 {
    -00097 }
    -00098 
    -00099 const unsigned char* Message::ParseField(const unsigned char *begin,
    -00100                                          const unsigned char *end)
    -00101 {
    -00102         const CommonField *field = (const CommonField *) begin;
    -00103 
    -00104         // advance and check size
    -00105         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00106         if( begin > end )               // if begin==end, we are ok
    -00107                 return begin;
    -00108 
    -00109         if( !btohs(field->size) )       // if field has no size, something's up
    -00110                 return begin;
    -00111 
    -00112         // cycle through the type table
    -00113         for(    FieldLink<Message> *b = MessageFieldLinks;
    -00114                 b->type != MFC_END;
    -00115                 b++ )
    -00116         {
    -00117                 if( b->type == field->type ) {
    -00118                         if( b->strMember ) {
    -00119                                 // parse regular string
    -00120                                 std::string &s = this->*(b->strMember);
    -00121                                 s = ParseFieldString(field);
    -00122                                 return begin;   // done!
    -00123                         }
    -00124                         else if( b->addrMember ) {
    -00125                                 // parse email address
    -00126                                 // get dual name+addr string first
    -00127                                 const char *fa = (const char*)field->u.addr.addr;
    -00128                                 std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown));
    -00129 
    -00130                                 // assign first string, using null terminator...letting std::string add it for us if it doesn't exist
    -00131                                 EmailAddress &a = this->*(b->addrMember);
    -00132                                 a.Name = dual.c_str();
    -00133 
    -00134                                 // assign second string, using first size as starting point
    -00135                                 a.Email = dual.c_str() + a.Name.size() + 1;
    -00136                                 return begin;
    -00137                         }
    -00138                 }
    -00139         }
    -00140         // handle special cases
    -00141         char swallow;
    -00142         switch( field->type )
    -00143         {
    -00144         case MFC_RECORDID:
    -00145                 MessageRecordId = btohl(field->u.uint32);
    -00146                 return begin;
    -00147         case MFC_REPLY_UNKNOWN:
    -00148                 swallow = field->u.raw[0];
    -00149                 return begin;
    -00150         }
    -00151         // if still not handled, add to the Unknowns list
    -00152         UnknownField uf;
    -00153         uf.type = field->type;
    -00154         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00155         Unknowns.push_back(uf);
    -00156         
    -00157         return begin;
    -00158 }
    -00159 
    -00160 uint8_t Message::GetRecType() const
    -00161 {
    -00162         throw std::logic_error("Message::GetRecType() called, and not supported by the USB protocol.  Should never get called.");
    -00163 }
    -00164 
    -00165 // empty API, not required by protocol
    -00166 uint32_t Message::GetUniqueId() const
    -00167 {
    -00168         throw std::logic_error("Message::GetUniqueId() called, and not supported by the USB protocol.  Should never get called.");
    -00169 }
    -00170 
    -00171 void Message::ParseHeader(const Data &data, size_t &offset)
    -00172 {
    -00173         Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE);
    -00174 
    -00175         MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset);
    -00176 
    -00177         // Priority
    -00178         MessagePriority = NormalPriority;
    -00179 
    -00180         uint16_t priority = btohs(mr->priority);  // deal with endian swap once
    -00181         if( priority & PRIORITY_MASK ) {
    -00182                 if( priority & PRIORITY_HIGH ) {
    -00183                         MessagePriority = HighPriority;
    -00184                 }
    -00185                 else if( priority & PRIORITY_LOW ) {
    -00186                         MessagePriority = LowPriority;
    -00187                 }
    -00188                 else
    -00189                         MessagePriority = UnknownPriority;
    -00190         } 
    -00191         // Sensitivity
    -00192         MessageSensitivity = NormalSensitivity;
    -00193         if( priority & SENSITIVE_MASK ) {
    -00194                 if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) {
    -00195                         MessageSensitivity = Confidential;
    -00196                 }
    -00197                 else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) {
    -00198                         MessageSensitivity = Private;
    -00199                 }
    -00200                 else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) {
    -00201                         MessageSensitivity = Personal;
    -00202                 }
    -00203                 else
    -00204                         MessageSensitivity = UnknownSensitivity;
    -00205         }
    -00206         // X-rim-org-message-ref-id     // NOTE: I'm cheating a bit here and using this as a reply-to
    -00207         if( mr->inReplyTo )             // It's actually sent by BB with the actual UID in every message
    -00208                 MessageReplyTo = btohl(mr->inReplyTo);
    -00209 
    -00210         // Status Flags
    -00211         uint32_t flags = btohl(mr->flags);
    -00212         if( !( flags & MESSAGE_READ ))
    -00213                 MessageRead = true;     // NOTE: A lot of these flags are 'backwards' but this seemed
    -00214                                         // like the most logical way to interpret them for now
    -00215         if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY )
    -00216                 MessageReply = true;    // NOTE: This is a reply, the original message's flags are not changed
    -00217                                         // the inReplyTo field is updated with the original messages's UID
    -00218         if( !( flags & MESSAGE_TRUNCATED ))
    -00219                 MessageTruncated = true;        // NOTE: This bit is unset on truncation, around 4096 on my 7100g
    -00220                                         // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested
    -00221                                         //       the exact size yet
    -00222         if( !( flags & MESSAGE_SAVED ))
    -00223                 MessageSaved = true;    // NOTE: Saved to 'saved' folder
    -00224         if( !( flags & MESSAGE_SAVED_DELETED ))
    -00225                 MessageSavedDeleted = true;     // NOTE: Saved to 'saved' folder and then deleted from inbox
    -00226 
    -00227         MessageDateSent = Message2Time(mr->dateSent, mr->timeSent);
    -00228         MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived);
    -00229 
    -00230         offset += MESSAGE_RECORD_HEADER_SIZE;
    -00231 }
    -00232 
    -00233 void Message::ParseFields(const Data &data, size_t &offset)
    -00234 {
    -00235         const unsigned char *finish = ParseCommonFields(*this,
    -00236                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00237         offset += finish - (data.GetData() + offset);
    -00238 }
    -00239 
    -00240 void Message::BuildHeader(Data &data, size_t &offset) const
    -00241 {
    -00242         throw std::logic_error("Message::BuildHeader not yet implemented");
    -00243 }
    -00244 
    -00245 void Message::BuildFields(Data &data, size_t &offset) const
    -00246 {
    -00247         throw std::logic_error("Message::BuildFields not yet implemented");
    -00248 }
    -00249 
    -00250 void Message::Clear()
    -00251 {
    -00252         From.clear();
    -00253         To.clear();
    -00254         Cc.clear();
    -00255         Bcc.clear();
    -00256         Sender.clear();
    -00257         ReplyTo.clear();
    -00258         Subject.clear();
    -00259         Body.clear();
    -00260         Attachment.clear();
    -00261         
    -00262         MessageRecordId = 0;
    -00263         MessageReplyTo = 0;
    -00264         MessageDateSent = 0;
    -00265         MessageDateReceived = 0;
    -00266         MessageTruncated = false;
    -00267         MessageRead = false;
    -00268         MessageReply = false;
    -00269         MessageSaved = false;
    -00270         MessageSavedDeleted = false;
    -00271         
    -00272         Unknowns.clear();
    -00273 }
    -00274 
    -00275 std::string Message::SimpleEmailAddress() const
    -00276 {
    -00277         if( From.Email.size() ) {
    -00278                 // remove all spaces from the email
    -00279                 std::string ret;
    -00280                 for( size_t i = 0; i < From.Email.size(); i++ )
    -00281                         if( From.Email[i] != ' ' )
    -00282                                 ret += From.Email[i];
    -00283 
    -00284                 return ret;
    -00285         }
    -00286         else {
    -00287                 return "unknown";
    -00288         }
    -00289 }
    -00290 
    -00291 // dump message in mbox format
    -00292 void Message::Dump(std::ostream &os) const
    -00293 {
    -00294         static const char *MessageImportance[] = 
    -00295                 { "Low", "Normal", "High", "Unknown Priority" };
    -00296         static const char *MessageSensitivityString[] = 
    -00297                 { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" };
    -00298         
    -00299         os << "From " << SimpleEmailAddress() << "  " << ctime( &MessageDateReceived );
    -00300         os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n";
    -00301         if( MessageReplyTo )
    -00302                 os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n";
    -00303         if( MessageSaved )
    -00304                 os << "X-Message-Status: Saved\n";
    -00305         else if( MessageRead )
    -00306                 os << "Message Status: Opened\n";
    -00307         if( MessagePriority != NormalPriority )
    -00308                 os << "Importance: " << MessageImportance[MessagePriority] << "\n";
    -00309         if( MessageSensitivity != NormalSensitivity )
    -00310                 os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n";
    -00311         os << "Date: " << ctime(&MessageDateSent);
    -00312         os << "From: " << From << "\n";
    -00313         if( To.Email.size() )
    -00314                 os << "To: " << To << "\n";
    -00315         if( Cc.Email.size() )
    -00316                 os << "Cc: " << Cc << "\n";
    -00317         if( Bcc.Email.size() )
    -00318                 os << "Bcc: " << Bcc << "\n";
    -00319         if( Sender.Email.size() )
    -00320                 os << "Sender: " << Sender << "\n";
    -00321         if( ReplyTo.Email.size())
    -00322                 os << "Reply To: " << ReplyTo << "\n";
    -00323         if( Subject.size() )
    -00324                 os << "Subject: " << Subject << "\n";
    -00325         os << "\n";
    -00326         for(    std::string::const_iterator i = Body.begin();
    -00327                 i != Body.end() && *i;
    -00328                 i++)
    -00329         {
    -00330                 if( *i == '\r' )
    -00331                         os << '\n';
    -00332                 else
    -00333                         os << *i;
    -00334         }
    -00335         os << "\n";
    -00336         if( Attachment.size() )
    -00337                 os << "Attachments: " << Attachment << "\n";
    -00338         
    -00339         os << Unknowns;
    -00340         os << "\n\n";
    -00341 }
    -00342 
    -00343 
    -00344 } // namespace Barry
    -00345 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__message_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__message_8h.html --- barry-0.14/doc/www/doxygen/html/r__message_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__message_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: r_message.h File Reference - - - - - - - -

    r_message.h File Reference


    Detailed Description

    -Blackberry database record parser class for email records. -

    - -

    -Definition in file r_message.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Message

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Message &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__message_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__message_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__message_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__message_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ - - -Barry: r_message.h Source File - - - - - - - -

    r_message.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_message.h
    -00003 ///             Blackberry database record parser class for email records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_RECORD_MESSAGE_H__
    -00023 #define __BARRY_RECORD_MESSAGE_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include "record.h"
    -00027 #include <iosfwd>
    -00028 #include <string>
    -00029 #include <vector>
    -00030 #include <map>
    -00031 #include <stdint.h>
    -00032 
    -00033 namespace Barry {
    -00034 
    -00035 //
    -00036 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00037 //        operators in the future.
    -00038 //
    -00039 
    -00040 /// \addtogroup RecordParserClasses
    -00041 /// @{
    -00042 
    -00043 class BXEXPORT Message
    -00044 {
    -00045 public:
    -00046         uint8_t RecType;
    -00047         uint32_t RecordId;
    -00048 
    -00049         EmailAddress From;
    -00050         EmailAddress To;
    -00051         EmailAddress Cc;
    -00052         EmailAddress Bcc;
    -00053         EmailAddress Sender;
    -00054         EmailAddress ReplyTo;
    -00055         std::string Subject;
    -00056         std::string Body;
    -00057         std::string Attachment;
    -00058         uint32_t MessageRecordId;
    -00059         uint32_t MessageReplyTo;
    -00060         time_t MessageDateSent;
    -00061         time_t MessageDateReceived;
    -00062 
    -00063         // Message Flags
    -00064         bool    MessageTruncated;
    -00065         bool    MessageRead;
    -00066         bool    MessageReply;
    -00067         bool    MessageSaved;
    -00068         bool    MessageSavedDeleted;
    -00069 
    -00070         enum MessagePriorityType {
    -00071                 LowPriority = 0,
    -00072                 NormalPriority,
    -00073                 HighPriority,
    -00074                 UnknownPriority
    -00075         };
    -00076         MessagePriorityType MessagePriority;
    -00077 
    -00078         enum MessageSensitivityType {
    -00079                 NormalSensitivity = 0,
    -00080                 Personal,
    -00081                 Private,
    -00082                 Confidential,
    -00083                 UnknownSensitivity
    -00084         };
    -00085         MessageSensitivityType MessageSensitivity;
    -00086 
    -00087         std::vector<UnknownField> Unknowns;
    -00088 
    -00089 protected:
    -00090         std::string SimpleEmailAddress() const;
    -00091 
    -00092 public:
    -00093         const unsigned char* ParseField(const unsigned char *begin,
    -00094                 const unsigned char *end);
    -00095 
    -00096 public:
    -00097         Message();
    -00098         ~Message();
    -00099 
    -00100         // Parser / Builder API (see parser.h / builder.h)
    -00101         uint8_t GetRecType() const;
    -00102         uint32_t GetUniqueId() const;   // empty API, not required by protocol
    -00103         void SetIds(uint8_t Type, uint32_t Id){ RecType = Type; RecordId = Id; }
    -00104         void ParseHeader(const Data &data, size_t &offset);
    -00105         void ParseFields(const Data &data, size_t &offset);
    -00106         void BuildHeader(Data &data, size_t &offset) const;
    -00107         void BuildFields(Data &data, size_t &offset) const;
    -00108 
    -00109         void Clear();
    -00110 
    -00111         void Dump(std::ostream &os) const;
    -00112 
    -00113         // sorting
    -00114         bool operator<(const Message &other) const { return Subject < other.Subject; }
    -00115 
    -00116         // database name
    -00117         static const char * GetDBName() { return "Messages"; }
    -00118         static uint8_t GetDefaultRecType() { return 0; }
    -00119 };
    -00120 
    -00121 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Message &msg) {
    -00122         msg.Dump(os);
    -00123         return os;
    -00124 }
    -00125 
    -00126 /// @}
    -00127 
    -00128 } // namespace Barry
    -00129 
    -00130 #endif
    -00131 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/router_8cc.html barry-0.0.20110506/doc/www/doxygen/html/router_8cc.html --- barry-0.14/doc/www/doxygen/html/router_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/router_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: router.cc File Reference - - - - - - - -

    router.cc File Reference


    Detailed Description

    -Support classes for the pluggable socket routing system. -

    - -

    -Definition in file router.cc. -

    -#include "router.h"
    -#include "scoped_lock.h"
    -#include "data.h"
    -#include "protostructs.h"
    -#include "usbwrap.h"
    -#include "endian.h"
    -#include "debug.h"
    -#include <unistd.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/router_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/router_8cc-source.html --- barry-0.14/doc/www/doxygen/html/router_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/router_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,490 +0,0 @@ - - -Barry: router.cc Source File - - - - - - - -

    router.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       router.cc
    -00003 ///             Support classes for the pluggable socket routing system.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "router.h"
    -00023 #include "scoped_lock.h"
    -00024 #include "data.h"
    -00025 #include "protostructs.h"
    -00026 #include "usbwrap.h"
    -00027 #include "endian.h"
    -00028 #include "debug.h"
    -00029 #include <unistd.h>
    -00030 
    -00031 namespace Barry {
    -00032 
    -00033 ///////////////////////////////////////////////////////////////////////////////
    -00034 // SocketRoutingQueue constructors
    -00035 
    -00036 SocketRoutingQueue::SocketRoutingQueue(int prealloc_buffer_count)
    -00037         : m_dev(0)
    -00038         , m_writeEp(0)
    -00039         , m_readEp(0)
    -00040         , m_interest(false)
    -00041         , m_continue_reading(false)
    -00042 {
    -00043         pthread_mutex_init(&m_mutex, NULL);
    -00044 
    -00045         pthread_mutex_init(&m_readwaitMutex, NULL);
    -00046         pthread_cond_init(&m_readwaitCond, NULL);
    -00047 
    -00048         AllocateBuffers(prealloc_buffer_count);
    -00049 }
    -00050 
    -00051 SocketRoutingQueue::~SocketRoutingQueue()
    -00052 {
    -00053         // thread running?
    -00054         if( m_continue_reading ) {
    -00055                 m_continue_reading = false;
    -00056                 pthread_join(m_usb_read_thread, NULL);
    -00057         }
    -00058 }
    -00059 
    -00060 ///////////////////////////////////////////////////////////////////////////////
    -00061 // protected members
    -00062 
    -00063 //
    -00064 // ReturnBuffer
    -00065 //
    -00066 /// Provides a method of returning a buffer to the free queue
    -00067 /// after processing.  The DataHandle class calls this automatically
    -00068 /// from its destructor.
    -00069 void SocketRoutingQueue::ReturnBuffer(Data *buf)
    -00070 {
    -00071         // don't need to lock here, since m_free handles its own locking
    -00072         m_free.push(buf);
    -00073 }
    -00074 
    -00075 //
    -00076 // SimpleReadThread()
    -00077 //
    -00078 /// Convenience thread to handle USB read activity.
    -00079 ///
    -00080 void *SocketRoutingQueue::SimpleReadThread(void *userptr)
    -00081 {
    -00082         SocketRoutingQueue *q = (SocketRoutingQueue *)userptr;
    -00083 
    -00084         // read from USB and write to stdout until finished
    -00085         std::string msg;
    -00086         while( q->m_continue_reading ) {
    -00087                 if( !q->DoRead(msg, 1000) ) {   // timeout in milliseconds
    -00088                         eout("Error in SimpleReadThread: " << msg);
    -00089                 }
    -00090         }
    -00091         return 0;
    -00092 }
    -00093 
    -00094 
    -00095 ///////////////////////////////////////////////////////////////////////////////
    -00096 // public API
    -00097 
    -00098 // These functions connect the router to an external Usb::Device
    -00099 // object.  Normally this is handled automatically by the
    -00100 // Controller class, but are public here in case they are needed.
    -00101 void SocketRoutingQueue::SetUsbDevice(Usb::Device *dev, int writeEp, int readEp)
    -00102 {
    -00103         scoped_lock lock(m_mutex);
    -00104         m_dev = dev;
    -00105         m_writeEp = writeEp;
    -00106         m_readEp = readEp;
    -00107 }
    -00108 
    -00109 void SocketRoutingQueue::ClearUsbDevice()
    -00110 {
    -00111         scoped_lock lock(m_mutex);
    -00112         m_dev = 0;
    -00113         lock.unlock();
    -00114 
    -00115         // wait for the DoRead cycle to finish, so the external
    -00116         // Usb::Device object doesn't close before we're done with it
    -00117         scoped_lock wait(m_readwaitMutex);
    -00118         pthread_cond_wait(&m_readwaitCond, &m_readwaitMutex);
    -00119 }
    -00120 
    -00121 bool SocketRoutingQueue::UsbDeviceReady()
    -00122 {
    -00123         scoped_lock lock(m_mutex);
    -00124         return m_dev != 0;
    -00125 }
    -00126 
    -00127 //
    -00128 // AllocateBuffers
    -00129 //
    -00130 /// This class starts out with no buffers, and will grow one buffer
    -00131 /// at a time if needed.  Call this to allocate count buffers
    -00132 /// all at once and place them on the free queue.  After calling
    -00133 /// this function, at least count buffers will exist in the free
    -00134 /// queue.  If there are already count buffers, none will be added.
    -00135 ///
    -00136 void SocketRoutingQueue::AllocateBuffers(int count)
    -00137 {
    -00138         int todo = count - m_free.size();
    -00139 
    -00140         for( int i = 0; i < todo; i++ ) {
    -00141                 // m_free handles its own locking
    -00142                 m_free.push( new Data );
    -00143         }
    -00144 }
    -00145 
    -00146 //
    -00147 // DefaultRead (both variations)
    -00148 //
    -00149 /// Returns the data for the next unregistered socket.
    -00150 /// Blocks until timeout or data is available.
    -00151 /// Returns false (or null pointer) on timeout and no data.
    -00152 /// With the return version of the function, there is no
    -00153 /// copying performed.
    -00154 ///
    -00155 /// This version performs a copy.
    -00156 ///
    -00157 bool SocketRoutingQueue::DefaultRead(Data &receive, int timeout)
    -00158 {
    -00159         DataHandle buf = DefaultRead(timeout);
    -00160         if( !buf.get() )
    -00161                 return false;
    -00162 
    -00163         // copy to desired buffer
    -00164         receive = *buf.get();
    -00165         return true;
    -00166 }
    -00167 
    -00168 ///
    -00169 /// This version does not perform a copy.
    -00170 ///
    -00171 DataHandle SocketRoutingQueue::DefaultRead(int timeout)
    -00172 {
    -00173         // m_default handles its own locking
    -00174         Data *buf = m_default.wait_pop(timeout);
    -00175         return DataHandle(*this, buf);
    -00176 }
    -00177 
    -00178 //
    -00179 // RegisterInterest
    -00180 //
    -00181 /// Register an interest in data from a certain socket.  To read
    -00182 /// from that socket, use the SocketRead() function from then on.
    -00183 ///
    -00184 /// Any non-registered socket goes in the default queue
    -00185 /// and must be read by DefaultRead()
    -00186 ///
    -00187 /// If not null, handler is called when new data is read.  It will
    -00188 /// be called in the same thread instance that DoRead() is called from.
    -00189 /// Handler is passed the DataQueue Data pointer, and so no
    -00190 /// copying is done.  Once the handler returns, the data is
    -00191 /// considered processed and not added to the interested queue,
    -00192 /// but instead returned to m_free.
    -00193 ///
    -00194 /// Throws std::logic_error if already registered.
    -00195 ///
    -00196 void SocketRoutingQueue::RegisterInterest(SocketId socket,
    -00197                                           SocketDataHandler handler,
    -00198                                           void *context)
    -00199 {
    -00200         // modifying our own std::map, need a lock
    -00201         scoped_lock lock(m_mutex);
    -00202 
    -00203         SocketQueueMap::iterator qi = m_socketQueues.find(socket);
    -00204         if( qi != m_socketQueues.end() )
    -00205                 throw std::logic_error("RegisterInterest requesting a previously registered socket.");
    -00206 
    -00207         m_socketQueues[socket] = QueueEntryPtr( new QueueEntry(handler, context) );
    -00208         m_interest = true;
    -00209 }
    -00210 
    -00211 //
    -00212 // UnregisterInterest
    -00213 //
    -00214 /// Unregisters interest in data from the given socket, and discards
    -00215 /// any existing data in its interest queue.  Any new incoming data
    -00216 /// for this socket will be placed in the default queue.
    -00217 ///
    -00218 void SocketRoutingQueue::UnregisterInterest(SocketId socket)
    -00219 {
    -00220         // modifying our own std::map, need a lock
    -00221         scoped_lock lock(m_mutex);
    -00222 
    -00223         SocketQueueMap::iterator qi = m_socketQueues.find(socket);
    -00224         if( qi == m_socketQueues.end() )
    -00225                 return; // nothing registered, done
    -00226 
    -00227         // salvage all our data buffers
    -00228         m_free.append_from( qi->second->m_queue );
    -00229 
    -00230         // remove the QueueEntryPtr from the map
    -00231         m_socketQueues.erase( qi );
    -00232 
    -00233         // check the interest flag
    -00234         m_interest = m_socketQueues.size() > 0;
    -00235 }
    -00236 
    -00237 //
    -00238 // SocketRead
    -00239 //
    -00240 /// Reads data from the interested socket cache.  Can only read
    -00241 /// from sockets that have been previously registered.
    -00242 ///
    -00243 /// Blocks until timeout or data is available.
    -00244 ///
    -00245 /// Returns false (or null pointer) on timeout and no data.
    -00246 /// With the return version of the function, there is no
    -00247 /// copying performed.
    -00248 ///
    -00249 /// Throws std::logic_error if a socket was requested that was
    -00250 /// not previously registered.
    -00251 ///
    -00252 /// Copying is performed with this function.
    -00253 ///
    -00254 bool SocketRoutingQueue::SocketRead(SocketId socket, Data &receive, int timeout)
    -00255 {
    -00256         DataHandle buf = SocketRead(socket, timeout);
    -00257         if( !buf.get() )
    -00258                 return false;
    -00259 
    -00260         // copy to desired buffer
    -00261         receive = *buf.get();
    -00262         return true;
    -00263 }
    -00264 
    -00265 ///
    -00266 /// Copying is not performed with this function.
    -00267 ///
    -00268 /// Throws std::logic_error if a socket was requested that was
    -00269 /// not previously registered.
    -00270 ///
    -00271 DataHandle SocketRoutingQueue::SocketRead(SocketId socket, int timeout)
    -00272 {
    -00273         QueueEntryPtr qep;
    -00274         DataQueue *dq = 0;
    -00275 
    -00276         // accessing our own std::map, need a lock
    -00277         {
    -00278                 scoped_lock lock(m_mutex);
    -00279                 SocketQueueMap::iterator qi = m_socketQueues.find(socket);
    -00280                 if( qi == m_socketQueues.end() )
    -00281                         throw std::logic_error("SocketRead requested data from unregistered socket.");
    -00282 
    -00283                 // got our queue, save the whole QueueEntryPtr (shared_ptr),
    -00284                 // and unlock, since we will be waiting on the DataQueue,
    -00285                 // not the socketQueues map
    -00286                 //
    -00287                 // This is safe, since even if UnregisterInterest is called,
    -00288                 // our pointer won't be deleted until our shared_ptr
    -00289                 // (QueueEntryPtr) goes out of scope.
    -00290                 //
    -00291                 // The remaining problem is that wait_pop() might wait
    -00292                 // forever if there is no timeout... c'est la vie.
    -00293                 // Should'a used a timeout. :-)
    -00294                 qep = qi->second;
    -00295                 dq = &qep->m_queue;
    -00296         }
    -00297 
    -00298         // get data from DataQueue
    -00299         Data *buf = dq->wait_pop(timeout);
    -00300 
    -00301         // specifically delete our copy of shared pointer, in a locked
    -00302         // environment
    -00303         {
    -00304                 scoped_lock lock(m_mutex);
    -00305                 qep.reset();
    -00306         }
    -00307 
    -00308         return DataHandle(*this, buf);
    -00309 }
    -00310 
    -00311 // Returns true if data is available for that socket.
    -00312 bool SocketRoutingQueue::IsAvailable(SocketId socket) const
    -00313 {
    -00314         scoped_lock lock(m_mutex);
    -00315         SocketQueueMap::const_iterator qi = m_socketQueues.find(socket);
    -00316         if( qi == m_socketQueues.end() )
    -00317                 return false;
    -00318         return qi->second->m_queue.size() > 0;
    -00319 }
    -00320 
    -00321 //
    -00322 // DoRead
    -00323 //
    -00324 /// Called by the application's "read thread" to read the next usb
    -00325 /// packet and route it to the correct queue.  Returns after every
    -00326 /// read, even if a handler is associated with a queue.
    -00327 /// Note: this function is safe to call before SetUsbDevice() is
    -00328 /// called... it just doesn't do anything if there is no usb
    -00329 /// device to work with.
    -00330 ///
    -00331 /// Timeout is in milliseconds.
    -00332 ///
    -00333 /// Returns false in the case of USB errors and puts the error message
    -00334 /// in msg.
    -00335 ///
    -00336 bool SocketRoutingQueue::DoRead(std::string &msg, int timeout)
    -00337 {
    -00338         class ReadWaitSignal
    -00339         {
    -00340                 pthread_mutex_t &m_Mutex;
    -00341                 pthread_cond_t &m_Cond;
    -00342         public:
    -00343                 ReadWaitSignal(pthread_mutex_t &mut, pthread_cond_t &cond)
    -00344                         : m_Mutex(mut), m_Cond(cond)
    -00345                         {}
    -00346                 ~ReadWaitSignal()
    -00347                 {
    -00348                         scoped_lock wait(m_Mutex);
    -00349                         pthread_cond_signal(&m_Cond);
    -00350                 }
    -00351         } readwait(m_readwaitMutex, m_readwaitCond);
    -00352 
    -00353         Usb::Device * volatile dev = 0;
    -00354         int readEp;
    -00355         DataHandle buf(*this, 0);
    -00356 
    -00357         // if we are not connected to a USB device yet, just wait
    -00358         {
    -00359                 scoped_lock lock(m_mutex);
    -00360 
    -00361                 if( !m_dev ) {
    -00362                         lock.unlock();  // unlock early, since we're sleeping
    -00363                         // sleep only a short time, since things could be
    -00364                         // in the process of setup or teardown
    -00365                         usleep(125000);
    -00366                         return true;
    -00367                 }
    -00368 
    -00369                 dev = m_dev;
    -00370                 readEp = m_readEp;
    -00371 
    -00372                 // fetch a free buffer
    -00373                 Data *raw = m_free.pop();
    -00374                 if( !raw )
    -00375                         buf = DataHandle(*this, new Data);
    -00376                 else
    -00377                         buf = DataHandle(*this, raw);
    -00378         }
    -00379 
    -00380         // take a chance and do the read unlocked, as this has the potential
    -00381         // for blocking for a while
    -00382         try {
    -00383 
    -00384                 Data &data = *buf.get();
    -00385 
    -00386                 if( !dev->BulkRead(readEp, data, timeout) )
    -00387                         return true;    // no data, done!
    -00388 
    -00389                 MAKE_PACKET(pack, data);
    -00390 
    -00391                 // make sure the size is right
    -00392                 if( data.GetSize() < sizeof(pack->socket) )
    -00393                         return true;    // bad size, just skip
    -00394 
    -00395                 // extract the socket from the packet
    -00396                 uint16_t socket = btohs(pack->socket);
    -00397 
    -00398                 // we have data, now lock up again to place it
    -00399                 // in the right queue
    -00400                 scoped_lock lock(m_mutex);
    -00401 
    -00402                 // search for registration of socket
    -00403                 if( m_interest ) {
    -00404                         SocketQueueMap::iterator qi = m_socketQueues.find(socket);
    -00405                         if( qi != m_socketQueues.end() ) {
    -00406                                 SocketDataHandler sdh = qi->second->m_handler;
    -00407                                 void *ctx = qi->second->m_context;
    -00408 
    -00409                                 // is there a handler?
    -00410                                 if( sdh ) {
    -00411                                         // unlock & let the handler process it
    -00412                                         lock.unlock();
    -00413                                         (*sdh)(ctx, buf.get());
    -00414                                         return true;
    -00415                                 }
    -00416                                 else {
    -00417                                         qi->second->m_queue.push(buf.release());
    -00418                                         return true;
    -00419                                 }
    -00420                         }
    -00421 
    -00422                         // fall through
    -00423                 }
    -00424 
    -00425                 // safe to unlock now, we are done with the map
    -00426                 lock.unlock();
    -00427 
    -00428                 // if we get here, send to default queue
    -00429                 m_default.push(buf.release());
    -00430                 return true;
    -00431 
    -00432         }
    -00433         catch( Usb::Timeout & ) {
    -00434                 // this is expected... just ignore
    -00435         }
    -00436         catch( Usb::Error &ue ) {
    -00437                 // this is unexpected, but we're in a thread here...
    -00438                 // return false and the caller decide how to handle it
    -00439                 msg = ue.what();
    -00440                 return false;
    -00441         }
    -00442 
    -00443         return true;
    -00444 }
    -00445 
    -00446 void SocketRoutingQueue::SpinoffSimpleReadThread()
    -00447 {
    -00448         // signal that it's ok to run inside the thread
    -00449         if( m_continue_reading )
    -00450                 return; // already running
    -00451         m_continue_reading = true;
    -00452 
    -00453         // Start USB read thread, to handle all routing
    -00454         int ret = pthread_create(&m_usb_read_thread, NULL, &SimpleReadThread, this);
    -00455         if( ret ) {
    -00456                 m_continue_reading = false;
    -00457                 throw Barry::ErrnoError("SocketRoutingQueue: Error creating USB read thread.", ret);
    -00458         }
    -00459 }
    -00460 
    -00461 } // namespace Barry
    -00462 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/router_8h.html barry-0.0.20110506/doc/www/doxygen/html/router_8h.html --- barry-0.14/doc/www/doxygen/html/router_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/router_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: router.h File Reference - - - - - - - -

    router.h File Reference


    Detailed Description

    -Support classes for the pluggable socket routing system. -

    - -

    -Definition in file router.h. -

    -#include "dll.h"
    -#include <stdint.h>
    -#include <map>
    -#include <tr1/memory>
    -#include <stdexcept>
    -#include <pthread.h>
    -#include "dataqueue.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - -

    Namespaces

    namespace  Usb
    namespace  Barry

    Classes

    class  Barry::SocketRoutingQueue
    struct  Barry::SocketRoutingQueue::QueueEntry
    class  Barry::DataHandle
     std::auto_ptr like class that handles pointers to Data, but instead of freeing them completely, the Data objects are turned to the SocketRoutingQueue from whence they came. More...
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/router_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/router_8h-source.html --- barry-0.14/doc/www/doxygen/html/router_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/router_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ - - -Barry: router.h Source File - - - - - - - -

    router.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       router.h
    -00003 ///             Support classes for the pluggable socket routing system.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_ROUTER_H__
    -00023 #define __BARRY_ROUTER_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <stdint.h>
    -00027 #include <map>
    -00028 #include <tr1/memory>
    -00029 #include <stdexcept>
    -00030 #include <pthread.h>
    -00031 #include "dataqueue.h"
    -00032 
    -00033 namespace Usb { class Device; }
    -00034 
    -00035 namespace Barry {
    -00036 
    -00037 class DataHandle;
    -00038 
    -00039 class BXEXPORT SocketRoutingQueue
    -00040 {
    -00041         friend class DataHandle;
    -00042 
    -00043 public:
    -00044         typedef void (*SocketDataHandler)(void *ctx, Data*);    //< See RegisterInterest() for information on this callback.
    -00045         struct QueueEntry
    -00046         {
    -00047                 SocketDataHandler m_handler;
    -00048                 void *m_context;
    -00049                 DataQueue m_queue;
    -00050 
    -00051                 QueueEntry(SocketDataHandler h, void *c)
    -00052                         : m_handler(h)
    -00053                         , m_context(c)
    -00054                         {}
    -00055         };
    -00056         typedef std::tr1::shared_ptr<QueueEntry>        QueueEntryPtr;
    -00057         typedef uint16_t                                SocketId;
    -00058         typedef std::map<SocketId, QueueEntryPtr>       SocketQueueMap;
    -00059 
    -00060 private:
    -00061         Usb::Device * volatile m_dev;
    -00062         volatile int m_writeEp, m_readEp;
    -00063 
    -00064         volatile bool m_interest; // true if at least one socket has an interest.
    -00065                                 // used to optimize the reading
    -00066 
    -00067         mutable pthread_mutex_t m_mutex;// controls access to local data, but not
    -00068                                 // DataQueues, as they have their own
    -00069                                 // locking per queue
    -00070 
    -00071         pthread_mutex_t m_readwaitMutex;
    -00072         pthread_cond_t m_readwaitCond;
    -00073 
    -00074         DataQueue m_free;
    -00075         DataQueue m_default;
    -00076         SocketQueueMap m_socketQueues;
    -00077 
    -00078         // thread state
    -00079         pthread_t m_usb_read_thread;
    -00080         volatile bool m_continue_reading;// set to true when the thread is created,
    -00081                                 // then set to false in the destructor
    -00082                                 // to signal the end of the thread
    -00083                                 // and handle the join
    -00084 
    -00085 protected:
    -00086         // Provides a method of returning a buffer to the free queue
    -00087         // after processing.  The DataHandle class calls this automatically
    -00088         // from its destructor.
    -00089         void ReturnBuffer(Data *buf);
    -00090 
    -00091         // Thread function for the simple read behaviour... thread is
    -00092         // created in the SpinoffSimpleReadThread() member below.
    -00093         static void *SimpleReadThread(void *userptr);
    -00094 
    -00095 public:
    -00096         SocketRoutingQueue(int prealloc_buffer_count = 4);
    -00097         ~SocketRoutingQueue();
    -00098 
    -00099         // These functions connect the router to an external Usb::Device
    -00100         // object.  Normally this is handled automatically by the
    -00101         // Controller class, but are public here in case they are needed.
    -00102         void SetUsbDevice(Usb::Device *dev, int writeEp, int readEp);
    -00103         void ClearUsbDevice();
    -00104         bool UsbDeviceReady();
    -00105         Usb::Device* GetUsbDevice() { return m_dev; }
    -00106 
    -00107         // This class starts out with no buffers, and will grow one buffer
    -00108         // at a time if needed.  Call this to allocate count buffers
    -00109         // all at once and place them on the free queue.
    -00110         void AllocateBuffers(int count);
    -00111 
    -00112         // Returns the data for the next unregistered socket.
    -00113         // Blocks until timeout or data is available.
    -00114         // Returns false (or null pointer) on timeout and no data.
    -00115         // With the return version of the function, there is no
    -00116         // copying performed.
    -00117         bool DefaultRead(Data &receive, int timeout = -1);
    -00118         DataHandle DefaultRead(int timeout = -1);
    -00119 
    -00120         // Register an interest in data from a certain socket.  To read
    -00121         // from that socket, use the SocketRead() function from then on.
    -00122         // Any non-registered socket goes in the default queue
    -00123         // and must be read by DefaultRead()
    -00124         // If not null, handler is called when new data is read.  It will
    -00125         // be called in the same thread instance that DoRead() is called from.
    -00126         // Handler is passed the DataQueue Data pointer, and so no
    -00127         // copying is done.  Once the handler returns, the data is
    -00128         // considered processed and not added to the interested queue,
    -00129         // but instead returned to m_free.
    -00130         void RegisterInterest(SocketId socket, SocketDataHandler handler = 0, void *context = 0);
    -00131 
    -00132         // Unregisters interest in data from the given socket, and discards
    -00133         // any existing data in its interest queue.  Any new incoming data
    -00134         // for this socket will be placed in the default queue.
    -00135         void UnregisterInterest(SocketId socket);
    -00136 
    -00137         // Reads data from the interested socket cache.  Can only read
    -00138         // from sockets that have been previously registered.
    -00139         // Blocks until timeout or data is available.
    -00140         // Returns false (or null pointer) on timeout and no data.
    -00141         // With the return version of the function, there is no
    -00142         // copying performed.
    -00143         bool SocketRead(SocketId socket, Data &receive, int timeout = -1);
    -00144         DataHandle SocketRead(SocketId socket, int timeout = -1);
    -00145 
    -00146         // Returns true if data is available for that socket.
    -00147         bool IsAvailable(SocketId socket) const;
    -00148 
    -00149         // Called by the application's "read thread" to read the next usb
    -00150         // packet and route it to the correct queue.  Returns after every
    -00151         // read, even if a handler is associated with a queue.
    -00152         // Note: this function is safe to call before SetUsbDevice() is
    -00153         // called... it just doesn't do anything if there is no usb
    -00154         // device to work with.
    -00155         //
    -00156         // Timeout is in milliseconds.
    -00157         //
    -00158         // Returns false in the case of USB errors, and puts the error
    -00159         // message in msg.
    -00160         bool DoRead(std::string &msg, int timeout = -1);
    -00161 
    -00162         // Utility function to make it easier for the user to create the
    -00163         // USB pure-read thread.  If the user wants anything more complicated
    -00164         // in this background thread, he can implement it himself and call
    -00165         // the above DoRead() in a loop.  If only the basics are needed,
    -00166         // then this makes it easy.
    -00167         // Throws Barry::ErrnoError on thread creation error.
    -00168         void SpinoffSimpleReadThread();
    -00169 };
    -00170 
    -00171 
    -00172 //
    -00173 // DataHandle
    -00174 //
    -00175 /// std::auto_ptr like class that handles pointers to Data, but instead of
    -00176 /// freeing them completely, the Data objects are turned to the
    -00177 /// SocketRoutingQueue from whence they came.
    -00178 ///
    -00179 class BXEXPORT DataHandle
    -00180 {
    -00181 private:
    -00182         SocketRoutingQueue &m_queue;
    -00183         mutable Data *m_data;
    -00184 
    -00185 protected:
    -00186         void clear()
    -00187         {
    -00188                 if( m_data ) {
    -00189                         m_queue.ReturnBuffer(m_data);
    -00190                         m_data = 0;
    -00191                 }
    -00192         }
    -00193 
    -00194 public:
    -00195         DataHandle(SocketRoutingQueue &q, Data *data)
    -00196                 : m_queue(q)
    -00197                 , m_data(data)
    -00198         {
    -00199         }
    -00200 
    -00201         DataHandle(const DataHandle &other)
    -00202                 : m_queue(other.m_queue)
    -00203                 , m_data(other.m_data)
    -00204         {
    -00205                 // we now own the pointer
    -00206                 other.m_data = 0;
    -00207         }
    -00208 
    -00209         ~DataHandle()
    -00210         {
    -00211                 clear();
    -00212         }
    -00213 
    -00214         Data* get()
    -00215         {
    -00216                 return m_data;
    -00217         }
    -00218 
    -00219         Data* release() // no longer owns the pointer
    -00220         {
    -00221                 Data *ret = m_data;
    -00222                 m_data = 0;
    -00223                 return ret;
    -00224         }
    -00225 
    -00226         Data* operator->()
    -00227         {
    -00228                 return m_data;
    -00229         }
    -00230 
    -00231         const Data* operator->() const
    -00232         {
    -00233                 return m_data;
    -00234         }
    -00235 
    -00236         DataHandle& operator=(const DataHandle &other)
    -00237         {
    -00238                 if( &m_queue != &other.m_queue )
    -00239                         throw std::logic_error("Trying to copy DataHandles of different queus!");
    -00240 
    -00241                 // remove our current data
    -00242                 clear();
    -00243 
    -00244                 // accept the new
    -00245                 m_data = other.m_data;
    -00246 
    -00247                 // we now own it
    -00248                 other.m_data = 0;
    -00249 
    -00250                 return *this;
    -00251         }
    -00252 
    -00253 };
    -00254 
    -00255 
    -00256 } // namespace Barry
    -00257 
    -00258 #endif
    -00259 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__pin__message_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8cc.html --- barry-0.14/doc/www/doxygen/html/r__pin__message_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ - - -Barry: r_pin_message.cc File Reference - - - - - - - -

    r_pin_message.cc File Reference


    Detailed Description

    -Blackberry database record parser class for pin message records. -

    - -

    -Definition in file r_pin_message.cc. -

    -#include "r_pin_message.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define PNMFC_TO   0x01
    -#define PNMFC_CC   0x02
    -#define PNMFC_BCC   0x03
    -#define PNMFC_FROM   0x05
    -#define PNMFC_SUBJECT   0x0b
    -#define PNMFC_BODY   0x0c
    -#define PNMFC_REPLY_UNKNOWN   0x12
    -#define PNMFC_RECORDID   0x4b
    -#define PNMFC_END   0xffff
    -#define PRIORITY_MASK   0x003f
    -#define PRIORITY_HIGH   0x0008
    -#define PRIORITY_LOW   0x0002
    -#define SENSITIVE_MASK   0xff80
    -#define SENSITIVE_CONFIDENTIAL   0x0100
    -#define SENSITIVE_PERSONAL   0x0080
    -#define SENSITIVE_PRIVATE   0x0040
    -#define MESSAGE_READ   0x0800
    -#define MESSAGE_REPLY   0x0001
    -#define MESSAGE_SAVED   0x0002
    -#define MESSAGE_FORWARD   0x0008
    -#define MESSAGE_TRUNCATED   0x0020
    -#define MESSAGE_SAVED_DELETED   0x0080

    Variables

    -FieldLink< PINMessage > Barry::PINMessageFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__pin__message_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__pin__message_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ - - -Barry: r_pin_message.cc Source File - - - - - - - -

    r_pin_message.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_pin_message.cc
    -00003 ///             Blackberry database record parser class for pin message records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton (edge@edginton.net)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_pin_message.h"
    -00024 #include "record-internal.h"
    -00025 #include "protocol.h"
    -00026 #include "protostructs.h"
    -00027 #include "data.h"
    -00028 #include "time.h"
    -00029 #include "error.h"
    -00030 #include "endian.h"
    -00031 #include <ostream>
    -00032 #include <iomanip>
    -00033 #include <time.h>
    -00034 #include <stdexcept>
    -00035 
    -00036 #define __DEBUG_MODE__
    -00037 #include "debug.h"
    -00038 
    -00039 using namespace std;
    -00040 using namespace Barry::Protocol;
    -00041 
    -00042 namespace Barry {
    -00043 
    -00044 
    -00045 ///////////////////////////////////////////////////////////////////////////////
    -00046 // PINMessage class
    -00047 
    -00048 
    -00049 // PIN message field codes
    -00050 #define PNMFC_TO                0x01            // can occur multiple times
    -00051 #define PNMFC_CC                0x02            // ditto
    -00052 #define PNMFC_BCC               0x03            // ditto
    -00053 #define PNMFC_FROM              0x05
    -00054 #define PNMFC_SUBJECT           0x0b
    -00055 #define PNMFC_BODY              0x0c
    -00056 #define PNMFC_REPLY_UNKNOWN     0x12    // this appears on replies, always 0x00
    -00057 #define PNMFC_RECORDID          0x4b    // Internal Message ID, mimics header RecNumber
    -00058 #define PNMFC_END               0xffff
    -00059 
    -00060 #define PRIORITY_MASK           0x003f
    -00061 #define PRIORITY_HIGH           0x0008
    -00062 #define PRIORITY_LOW            0x0002
    -00063 
    -00064 #define SENSITIVE_MASK          0xff80
    -00065 #define SENSITIVE_CONFIDENTIAL  0x0100
    -00066 #define SENSITIVE_PERSONAL      0x0080
    -00067 #define SENSITIVE_PRIVATE       0x0040  // actual pattern is 0x00C0
    -00068 
    -00069 #define MESSAGE_READ            0x0800
    -00070 #define MESSAGE_REPLY           0x0001
    -00071 #define MESSAGE_SAVED           0x0002
    -00072 #define MESSAGE_FORWARD         0x0008
    -00073 #define MESSAGE_TRUNCATED       0x0020
    -00074 #define MESSAGE_SAVED_DELETED   0x0080
    -00075 
    -00076 FieldLink<PINMessage> PINMessageFieldLinks[] = {
    -00077    { PNMFC_TO,      "To",          0, 0,    0, &PINMessage::To,  0 },
    -00078    { PNMFC_CC,      "Cc",          0, 0,    0, &PINMessage::Cc, 0 },
    -00079    { PNMFC_BCC,     "Bcc",         0, 0,    0, &PINMessage::Bcc, 0 },
    -00080    { PNMFC_FROM,    "From",        0, 0,    0, &PINMessage::From, 0 },
    -00081    { PNMFC_SUBJECT, "Subject",     0, 0,    &PINMessage::Subject, 0, 0 },
    -00082    { PNMFC_BODY,    "Body",        0, 0,    &PINMessage::Body, 0, 0 },
    -00083    { PNMFC_END,     "End of List", 0, 0,    0, 0, 0 }
    -00084 };
    -00085 
    -00086 PINMessage::PINMessage()
    -00087 {
    -00088 }
    -00089 
    -00090 PINMessage::~PINMessage()
    -00091 {
    -00092 }
    -00093 
    -00094 const unsigned char* PINMessage::ParseField(const unsigned char *begin,
    -00095                                          const unsigned char *end)
    -00096 {
    -00097         const CommonField *field = (const CommonField *) begin;
    -00098 
    -00099         // advance and check size
    -00100         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00101         if( begin > end )               // if begin==end, we are ok
    -00102                 return begin;
    -00103 
    -00104         if( !btohs(field->size) )       // if field has no size, something's up
    -00105                 return begin;
    -00106 
    -00107         // cycle through the type table
    -00108         for(    FieldLink<PINMessage> *b = PINMessageFieldLinks;
    -00109                 b->type != PNMFC_END;
    -00110                 b++ )
    -00111         {
    -00112                 if( b->type == field->type ) {
    -00113                         if( b->strMember ) {
    -00114                                 // parse regular string
    -00115                                 std::string &s = this->*(b->strMember);
    -00116                                 s = ParseFieldString(field);
    -00117                                 return begin;   // done!
    -00118                         }
    -00119                         else if( b->addrMember ) {
    -00120                                 // parse email address
    -00121                                 // get dual name+addr string first
    -00122                                 const char *fa = (const char*)field->u.addr.addr;
    -00123                                 std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown));
    -00124 
    -00125                                 // assign first string, using null terminator...letting std::string add it for us if it doesn't exist
    -00126                                 EmailAddress &a = this->*(b->addrMember);
    -00127                                 a.Name = dual.c_str();
    -00128 
    -00129                                 // assign second string, using first size as starting point
    -00130                                 a.Email = dual.c_str() + a.Name.size() + 1;
    -00131                                 return begin;
    -00132                         }
    -00133                 }
    -00134         }
    -00135 
    -00136         // handle special cases
    -00137         switch( field->type )
    -00138         {
    -00139         case PNMFC_RECORDID:
    -00140                 MessageRecordId = btohl(field->u.uint32);
    -00141                 return begin;
    -00142         }
    -00143 
    -00144         // if still not handled, add to the Unknowns list
    -00145         UnknownField uf;
    -00146         uf.type = field->type;
    -00147         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00148         Unknowns.push_back(uf);
    -00149 
    -00150         return begin;
    -00151 }
    -00152 
    -00153 void PINMessage::ParseHeader(const Data &data, size_t &offset)
    -00154 {
    -00155         // FIXME - we are using a Message (email) record header size
    -00156         // for a PIN Message record... this is not necessarily guaranteed
    -00157         // to be the same... someday we could use some more info on
    -00158         // the message record header and pin message record header
    -00159         
    -00160         // FIXED - the header structure for both the PIN messages and
    -00161         // email messages are the same, as is the header structure for
    -00162         // 'Saved Email Messages' although some of the fields may not directly apply.
    -00163         //
    -00164         // and someday is now here ;) - edge
    -00165 
    -00166         Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE);
    -00167 
    -00168         MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset);
    -00169 
    -00170         // Priority
    -00171         MessagePriority = NormalPriority;
    -00172 
    -00173         uint16_t priority = btohs(mr->priority);  // deal with endian swap once
    -00174         if( priority & PRIORITY_MASK ) {
    -00175                 if( priority & PRIORITY_HIGH ) {
    -00176                         MessagePriority = HighPriority;
    -00177                 }
    -00178                 else if( priority & PRIORITY_LOW ) {
    -00179                         MessagePriority = LowPriority;
    -00180                 }
    -00181                 else
    -00182                         MessagePriority = UnknownPriority;
    -00183         } 
    -00184         // Sensitivity
    -00185         MessageSensitivity = NormalSensitivity;
    -00186         if( priority & SENSITIVE_MASK ) {
    -00187                 if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) {
    -00188                         MessageSensitivity = Confidential;
    -00189                 }
    -00190                 else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) {
    -00191                         MessageSensitivity = Private;
    -00192                 }
    -00193                 else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) {
    -00194                         MessageSensitivity = Personal;
    -00195                 }
    -00196                 else
    -00197                         MessageSensitivity = UnknownSensitivity;
    -00198         }
    -00199         // X-rim-org-message-ref-id     // NOTE: I'm cheating a bit here and using this as a reply-to
    -00200         if( mr->inReplyTo )             // It's actually sent by BB with the actual UID in every message
    -00201                 MessageReplyTo = btohl(mr->inReplyTo);
    -00202 
    -00203         // Status Flags
    -00204         uint32_t flags = btohl(mr->flags);
    -00205         if( !( flags & MESSAGE_READ ))
    -00206                 MessageRead = true;     // NOTE: A lot of these flags are 'backwards' but this seemed
    -00207                                         // like the most logical way to interpret them for now
    -00208         if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY )
    -00209                 MessageReply = true;    // NOTE: This is a reply, the original message's flags are not changed
    -00210                                         // the inReplyTo field is updated with the original messages's UID
    -00211         if( !( flags & MESSAGE_TRUNCATED ))
    -00212                 MessageTruncated = true;        // NOTE: This bit is unset on truncation, around 4096 on my 7100g
    -00213                                         // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested
    -00214                                         //       the exact size yet
    -00215         if( !( flags & MESSAGE_SAVED ))
    -00216                 MessageSaved = true;    // NOTE: Saved to 'saved' folder
    -00217         if( !( flags & MESSAGE_SAVED_DELETED ))
    -00218                 MessageSavedDeleted = true;     // NOTE: Saved to 'saved' folder and then deleted from inbox
    -00219 
    -00220         MessageDateSent = Message2Time(mr->dateSent, mr->timeSent);
    -00221         MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived);
    -00222 
    -00223         offset += MESSAGE_RECORD_HEADER_SIZE;
    -00224 }
    -00225 
    -00226 void PINMessage::ParseFields(const Data &data, size_t &offset)
    -00227 {
    -00228         const unsigned char *finish = ParseCommonFields(*this,
    -00229                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00230         offset += finish - (data.GetData() + offset);
    -00231 }
    -00232 
    -00233 void PINMessage::BuildHeader(Data &data, size_t &offset) const
    -00234 {
    -00235         throw std::logic_error("PINMessage::BuildHeader not yet implemented");
    -00236 }
    -00237 
    -00238 void PINMessage::BuildFields(Data &data, size_t &offset) const
    -00239 {
    -00240         throw std::logic_error("PINMessage::BuildFields not yet implemented");
    -00241 }
    -00242 
    -00243 void PINMessage::Clear()
    -00244 {
    -00245         From.clear();
    -00246         To.clear();
    -00247         Cc.clear();
    -00248         Bcc.clear();
    -00249 
    -00250         Subject.clear();
    -00251         Body.clear();
    -00252         
    -00253         MessageRecordId = 0;
    -00254         MessageReplyTo = 0;
    -00255         MessageDateSent = 0;
    -00256         MessageDateReceived = 0;
    -00257         MessageTruncated = false;
    -00258         MessageRead = false;
    -00259         MessageReply = false;
    -00260         MessageSaved = false;
    -00261         MessageSavedDeleted = false;
    -00262         
    -00263         Unknowns.clear();
    -00264 }
    -00265 
    -00266 // dump message in mbox format
    -00267 void PINMessage::Dump(std::ostream &os) const
    -00268 {
    -00269         static const char *MessageImportance[] = 
    -00270                 { "Low", "Normal", "High", "Unknown Priority" };
    -00271         static const char *MessageSensitivityString[] = 
    -00272                 { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" };
    -00273         
    -00274         os << "From " << (From.Email.size() ? From.Email.c_str() : "unknown")
    -00275            << "  " << ctime( &MessageDateSent );
    -00276         os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n";
    -00277         if( MessageReplyTo )
    -00278                 os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n";
    -00279         if( MessageSaved )
    -00280                 os << "Message Status: Saved\n";
    -00281         else if( MessageRead )
    -00282                 os << "Message Status: Opened\n";
    -00283         if( MessagePriority != NormalPriority )
    -00284                 os << "Importance: " << MessageImportance[MessagePriority] << "\n";
    -00285         if( MessageSensitivity != NormalSensitivity )
    -00286                 os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n";
    -00287         os << "Date: " << ctime(&MessageDateSent);
    -00288         
    -00289         if( From.Name.size()) {
    -00290                 os << "    From: " << From.Name << " <" << From.Email << ">\n";
    -00291         }
    -00292         if( To.Name.size()) {
    -00293                 os << "    To: " << To.Name << " <" << To.Email << ">\n";
    -00294         }
    -00295         if( Cc.Name.size()) {
    -00296                 os << "    Cc: " << Cc.Name << " <" << Cc.Email << ">\n";
    -00297         }
    -00298         if( Bcc.Name.size()) {
    -00299                 os << "    Bcc: " << Bcc.Name << " <" << Bcc.Email << ">\n";
    -00300         }
    -00301 
    -00302         if( Subject.size() )
    -00303                 os << "    Subject: " << Subject << "\n";
    -00304         else 
    -00305                 os << "    Subject: <>\n";
    -00306         os << "\n";
    -00307 
    -00308         for(    std::string::const_iterator i = Body.begin();
    -00309                 i != Body.end() && *i;
    -00310                 i++)
    -00311         {
    -00312                 if( *i == '\r' )
    -00313                         os << '\n';
    -00314                 else
    -00315                         os << *i;
    -00316         }
    -00317         os << "\n";
    -00318 
    -00319         os << Unknowns;
    -00320         os << "\n\n";
    -00321 }
    -00322 
    -00323 
    -00324 } // namespace Barry
    -00325 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__pin__message_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8h.html --- barry-0.14/doc/www/doxygen/html/r__pin__message_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ - - -Barry: r_pin_message.h File Reference - - - - - - - -

    r_pin_message.h File Reference


    Detailed Description

    -Blackberry database record parser class for pin message records. -

    - -

    -Definition in file r_pin_message.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::PINMessage

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const PINMessage &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__pin__message_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__pin__message_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__pin__message_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ - - -Barry: r_pin_message.h Source File - - - - - - - -

    r_pin_message.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_pin_message.h
    -00003 ///             Blackberry database record parser class for pin message records.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton (edge@edginton.net)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_PIN_MESSAGE_H__
    -00024 #define __BARRY_RECORD_PIN_MESSAGE_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <iosfwd>
    -00029 #include <string>
    -00030 #include <vector>
    -00031 #include <map>
    -00032 #include <stdint.h>
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 //
    -00037 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00038 //        operators in the future.
    -00039 //
    -00040 
    -00041 /// \addtogroup RecordParserClasses
    -00042 /// @{
    -00043 
    -00044 class BXEXPORT PINMessage
    -00045 {
    -00046 public:
    -00047         uint8_t RecType;
    -00048         uint32_t RecordId;
    -00049 
    -00050         EmailAddress From;
    -00051         EmailAddress To;
    -00052         EmailAddress Cc;
    -00053         EmailAddress Bcc;
    -00054         std::string Subject;
    -00055         std::string Body;
    -00056         uint32_t MessageRecordId;       // this happens to be the same as
    -00057                                         // RecordId in my (CDF) testing,
    -00058                                         // but interestingly, it is stored
    -00059                                         // as a field *inside* the record,
    -00060                                         // and not as part of the header...
    -00061                                         // in effect, this record ID occurs
    -00062                                         // twice in the protocol
    -00063         uint32_t MessageReplyTo;
    -00064         time_t MessageDateSent;
    -00065         time_t MessageDateReceived;
    -00066         
    -00067         // Message Flags
    -00068         bool    MessageTruncated;
    -00069         bool    MessageRead;
    -00070         bool    MessageReply;
    -00071         bool    MessageSaved;
    -00072         bool    MessageSavedDeleted;
    -00073         
    -00074         enum MessagePriorityType {
    -00075                 LowPriority = 0,
    -00076                 NormalPriority,
    -00077                 HighPriority,
    -00078                 UnknownPriority
    -00079         };
    -00080         MessagePriorityType MessagePriority;
    -00081         
    -00082         enum MessageSensitivityType {
    -00083                 NormalSensitivity = 0,
    -00084                 Personal,
    -00085                 Private,
    -00086                 Confidential,
    -00087                 UnknownSensitivity
    -00088         };
    -00089         MessageSensitivityType MessageSensitivity;
    -00090         
    -00091         std::vector<UnknownField> Unknowns;
    -00092 
    -00093 public:
    -00094         const unsigned char* ParseField(const unsigned char *begin,
    -00095                 const unsigned char *end);
    -00096 
    -00097 public:
    -00098         PINMessage();
    -00099         ~PINMessage();
    -00100 
    -00101         // Parser / Builder API (see parser.h / builder.h)
    -00102         uint8_t GetRecType() const { return RecType; }
    -00103         uint32_t GetUniqueId() const { return RecordId; }
    -00104         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00105         void ParseHeader(const Data &data, size_t &offset);
    -00106         void ParseFields(const Data &data, size_t &offset);
    -00107         void BuildHeader(Data &data, size_t &offset) const;
    -00108         void BuildFields(Data &data, size_t &offset) const;
    -00109 
    -00110         void Clear();
    -00111 
    -00112         void Dump(std::ostream &os) const;
    -00113 
    -00114         // sorting
    -00115         bool operator<(const PINMessage &other) const { return Subject < other.Subject; }
    -00116 
    -00117         // database name
    -00118         static const char * GetDBName() { return "PIN Messages"; }
    -00119         static uint8_t GetDefaultRecType() { return 0; }
    -00120 };
    -00121 
    -00122 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const PINMessage &msg) {
    -00123         msg.Dump(os);
    -00124         return os;
    -00125 }
    -00126 
    -00127 /// @}
    -00128 
    -00129 } // namespace Barry
    -00130 
    -00131 #endif // __BARRY_RECORD_PIN_MESSAGE_H__
    -00132 
    -00133 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__saved__message_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8cc.html --- barry-0.14/doc/www/doxygen/html/r__saved__message_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ - - -Barry: r_saved_message.cc File Reference - - - - - - - -

    r_saved_message.cc File Reference


    Detailed Description

    -Blackberry database record parser class for saved email message records. -

    - -

    -Definition in file r_saved_message.cc. -

    -#include "r_saved_message.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define SEMFC_TO   0x01
    -#define SEMFC_CC   0x02
    -#define SEMFC_BCC   0x03
    -#define SEMFC_SENDER   0x04
    -#define SEMFC_FROM   0x05
    -#define SEMFC_REPLY_TO   0x06
    -#define SEMFC_SUBJECT   0x0b
    -#define SEMFC_BODY   0x0c
    -#define SEMFC_ATTACHMENT   0x16
    -#define SEMFC_RECORDID   0x4b
    -#define SEMFC_END   0xffff
    -#define PRIORITY_MASK   0x003f
    -#define PRIORITY_HIGH   0x0008
    -#define PRIORITY_LOW   0x0002
    -#define SENSITIVE_MASK   0xff80
    -#define SENSITIVE_CONFIDENTIAL   0x0100
    -#define SENSITIVE_PERSONAL   0x0080
    -#define SENSITIVE_PRIVATE   0x0040
    -#define MESSAGE_READ   0x0800
    -#define MESSAGE_REPLY   0x0001
    -#define MESSAGE_SAVED   0x0002
    -#define MESSAGE_FORWARD   0x0008
    -#define MESSAGE_TRUNCATED   0x0020
    -#define MESSAGE_SAVED_DELETED   0x0080

    Variables

    -FieldLink< SavedMessage > Barry::SavedMessageFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__saved__message_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__saved__message_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ - - -Barry: r_saved_message.cc Source File - - - - - - - -

    r_saved_message.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_saved_message.cc
    -00003 ///             Blackberry database record parser class for saved email
    -00004 ///             message records.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009     Copyright (C) 2005-2007, Brian Edginton (edge@edginton.net)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #include "r_saved_message.h"
    -00025 #include "record-internal.h"
    -00026 #include "protocol.h"
    -00027 #include "protostructs.h"
    -00028 #include "data.h"
    -00029 #include "time.h"
    -00030 #include "error.h"
    -00031 #include "endian.h"
    -00032 #include <ostream>
    -00033 #include <iomanip>
    -00034 #include <time.h>
    -00035 #include <stdexcept>
    -00036 
    -00037 #define __DEBUG_MODE__
    -00038 #include "debug.h"
    -00039 
    -00040 using namespace std;
    -00041 using namespace Barry::Protocol;
    -00042 
    -00043 namespace Barry {
    -00044 
    -00045 ///////////////////////////////////////////////////////////////////////////////
    -00046 // Message class
    -00047 
    -00048 
    -00049 // Email / message field codes
    -00050 #define SEMFC_TO                0x01            // can occur multiple times
    -00051 #define SEMFC_CC                0x02            // ditto
    -00052 #define SEMFC_BCC               0x03            // ditto
    -00053 #define SEMFC_SENDER            0x04
    -00054 #define SEMFC_FROM              0x05
    -00055 #define SEMFC_REPLY_TO          0x06
    -00056 #define SEMFC_SUBJECT           0x0b
    -00057 #define SEMFC_BODY              0x0c
    -00058 #define SEMFC_ATTACHMENT        0x16
    -00059 #define SEMFC_RECORDID          0x4b
    -00060 #define SEMFC_END               0xffff
    -00061 
    -00062 #define PRIORITY_MASK           0x003f
    -00063 #define PRIORITY_HIGH           0x0008
    -00064 #define PRIORITY_LOW            0x0002
    -00065 
    -00066 #define SENSITIVE_MASK          0xff80
    -00067 #define SENSITIVE_CONFIDENTIAL  0x0100
    -00068 #define SENSITIVE_PERSONAL      0x0080
    -00069 #define SENSITIVE_PRIVATE       0x0040  // actual pattern is 0x00C0
    -00070 
    -00071 #define MESSAGE_READ            0x0800
    -00072 #define MESSAGE_REPLY           0x0001
    -00073 #define MESSAGE_SAVED           0x0002
    -00074 #define MESSAGE_FORWARD         0x0008
    -00075 #define MESSAGE_TRUNCATED       0x0020
    -00076 #define MESSAGE_SAVED_DELETED   0x0080
    -00077 
    -00078 FieldLink<SavedMessage> SavedMessageFieldLinks[] = {
    -00079    { SEMFC_TO,         "To",          0, 0,    0, &SavedMessage::To, 0 },
    -00080    { SEMFC_CC,         "Cc",          0, 0,    0, &SavedMessage::Cc, 0 },
    -00081    { SEMFC_BCC,        "Bcc",         0, 0,    0, &SavedMessage::Bcc, 0 },
    -00082    { SEMFC_SENDER,     "Sender",      0, 0,    0, &SavedMessage::Sender, 0 },
    -00083    { SEMFC_FROM,       "From",        0, 0,    0, &SavedMessage::From, 0 },
    -00084    { SEMFC_REPLY_TO,   "ReplyTo",     0, 0,    0, &SavedMessage::ReplyTo, 0 },
    -00085    { SEMFC_SUBJECT,    "Subject",     0, 0,    &SavedMessage::Subject, 0, 0 },
    -00086    { SEMFC_BODY,       "Body",        0, 0,    &SavedMessage::Body, 0, 0 },
    -00087    { SEMFC_ATTACHMENT, "Attachment",  0, 0,    &SavedMessage::Attachment, 0, 0 },
    -00088    { SEMFC_END,        "End of List", 0, 0,    0, 0, 0 }
    -00089 };
    -00090 
    -00091 SavedMessage::SavedMessage()
    -00092 {
    -00093         Clear();
    -00094 }
    -00095 
    -00096 SavedMessage::~SavedMessage()
    -00097 {
    -00098 }
    -00099 
    -00100 const unsigned char* SavedMessage::ParseField(const unsigned char *begin,
    -00101                                               const unsigned char *end)
    -00102 {
    -00103         const CommonField *field = (const CommonField *) begin;
    -00104 
    -00105         // advance and check size
    -00106         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00107         if( begin > end )               // if begin==end, we are ok
    -00108                 return begin;
    -00109 
    -00110         if( !btohs(field->size) )       // if field has no size, something's up
    -00111                 return begin;
    -00112 
    -00113         // cycle through the type table
    -00114         for(    FieldLink<SavedMessage> *b = SavedMessageFieldLinks;
    -00115                 b->type != SEMFC_END;
    -00116                 b++ )
    -00117         {
    -00118                 if( b->type == field->type ) {
    -00119                         if( b->strMember ) {
    -00120                                 // parse regular string
    -00121                                 std::string &s = this->*(b->strMember);
    -00122                                 s = ParseFieldString(field);
    -00123                                 return begin;   // done!
    -00124                         }
    -00125                         else if( b->addrMember ) {
    -00126                                 // parse email address
    -00127                                 // get dual name+addr string first
    -00128                                 const char *fa = (const char*)field->u.addr.addr;
    -00129                                 std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown));
    -00130 
    -00131                                 // assign first string, using null terminator...letting std::string add it for us if it doesn't exist
    -00132                                 EmailAddress &a = this->*(b->addrMember);
    -00133                                 a.Name = dual.c_str();
    -00134 
    -00135                                 // assign second string, using first size as starting point
    -00136                                 a.Email = dual.c_str() + a.Name.size() + 1;
    -00137                                 return begin;
    -00138                         }
    -00139                 }
    -00140         }
    -00141 
    -00142         // handle special cases
    -00143         switch( field->type )
    -00144         {
    -00145         case SEMFC_RECORDID:
    -00146                 MessageRecordId = btohl(field->u.uint32);
    -00147                 return begin;
    -00148         }
    -00149 
    -00150         // if still not handled, add to the Unknowns list
    -00151         UnknownField uf;
    -00152         uf.type = field->type;
    -00153         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00154         Unknowns.push_back(uf);
    -00155 
    -00156         return begin;
    -00157 }
    -00158 
    -00159 void SavedMessage::ParseHeader(const Data &data, size_t &offset)
    -00160 {
    -00161         Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE);
    -00162 
    -00163         MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset);
    -00164 
    -00165         // Priority
    -00166         MessagePriority = NormalPriority;
    -00167 
    -00168         uint16_t priority = btohs(mr->priority);  // deal with endian swap once
    -00169         if( priority & PRIORITY_MASK ) {
    -00170                 if( priority & PRIORITY_HIGH ) {
    -00171                         MessagePriority = HighPriority;
    -00172                 }
    -00173                 else if( priority & PRIORITY_LOW ) {
    -00174                         MessagePriority = LowPriority;
    -00175                 }
    -00176                 else
    -00177                         MessagePriority = UnknownPriority;
    -00178         } 
    -00179         // Sensitivity
    -00180         MessageSensitivity = NormalSensitivity;
    -00181         if( priority & SENSITIVE_MASK ) {
    -00182                 if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) {
    -00183                         MessageSensitivity = Confidential;
    -00184                 }
    -00185                 else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) {
    -00186                         MessageSensitivity = Private;
    -00187                 }
    -00188                 else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) {
    -00189                         MessageSensitivity = Personal;
    -00190                 }
    -00191                 else
    -00192                         MessageSensitivity = UnknownSensitivity;
    -00193         }
    -00194         // X-rim-org-message-ref-id             // NOTE: I'm cheating a bit here and using this as a reply-to
    -00195         if( mr->inReplyTo )                     // It's actually sent by BB with the actual UID in every message
    -00196                 MessageReplyTo = btohl(mr->inReplyTo);
    -00197 
    -00198         // Status Flags
    -00199         uint32_t flags = btohl(mr->flags);
    -00200         if( !( flags & MESSAGE_READ ))
    -00201                 MessageRead = true;             // NOTE: A lot of these flags are 'backwards' but this seemed
    -00202                                                 // like the most logical way to interpret them for now
    -00203         if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY )
    -00204                 MessageReply = true;            // NOTE: This is a reply, the original message's flags are not changed
    -00205                                                 // the inReplyTo field is updated with the original messages's UID
    -00206         if( !( flags & MESSAGE_TRUNCATED ))
    -00207                 MessageTruncated = true;        // NOTE: This bit is unset on truncation, around 4096 on my 7100g
    -00208                                                 // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested
    -00209                                                 //       the exact size yet
    -00210         if( !( flags & MESSAGE_SAVED ))
    -00211                 MessageSaved = true;            // NOTE: Saved to 'saved' folder
    -00212         if( !( flags & MESSAGE_SAVED_DELETED ))
    -00213                 MessageSavedDeleted = true;     // NOTE: Saved to 'saved' folder and then deleted from inbox
    -00214 
    -00215         MessageDateSent = Message2Time(mr->dateSent, mr->timeSent);
    -00216         MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived);
    -00217 
    -00218         offset += MESSAGE_RECORD_HEADER_SIZE;
    -00219 }
    -00220 
    -00221 void SavedMessage::ParseFields(const Data &data, size_t &offset)
    -00222 {
    -00223         const unsigned char *finish = ParseCommonFields(*this,
    -00224                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00225         offset += finish - (data.GetData() + offset);
    -00226 }
    -00227 
    -00228 void SavedMessage::BuildHeader(Data &data, size_t &offset) const
    -00229 {
    -00230         throw std::logic_error("SavedMessage::BuildHeader not yet implemented");
    -00231 }
    -00232 
    -00233 void SavedMessage::BuildFields(Data &data, size_t &offset) const
    -00234 {
    -00235         throw std::logic_error("SavedMessage::BuildFields not yet implemented");
    -00236 }
    -00237 
    -00238 void SavedMessage::Clear()
    -00239 {
    -00240         From.clear();
    -00241         To.clear();
    -00242         Cc.clear();
    -00243         Bcc.clear();
    -00244         Sender.clear();
    -00245         ReplyTo.clear();
    -00246         Subject.clear();
    -00247         Body.clear();
    -00248         Attachment.clear();
    -00249 
    -00250         MessageRecordId = 0;
    -00251         MessageReplyTo = 0;
    -00252         MessageDateSent = 0;
    -00253         MessageDateReceived = 0;
    -00254         MessageTruncated = false;
    -00255         MessageRead = false;
    -00256         MessageReply = false;
    -00257         MessageSaved = false;
    -00258         MessageSavedDeleted = false;
    -00259         Unknowns.clear();
    -00260 }
    -00261 
    -00262 // dump message in mbox format
    -00263 void SavedMessage::Dump(std::ostream &os) const
    -00264 {
    -00265         static const char *MessageImportance[] = 
    -00266                 { "Low", "Normal", "High", "Unknown Priority" };
    -00267         static const char *MessageSensitivityString[] = 
    -00268                 { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" };
    -00269         
    -00270         os << "From " << (From.Email.size() ? From.Email.c_str() : "unknown")
    -00271            << "  " << ctime( &MessageDateSent );
    -00272         os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n";
    -00273         if( MessageReplyTo )
    -00274                 os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n";
    -00275         if( MessageSaved )
    -00276                 os << "Message Status: Saved\n";
    -00277         else if( MessageRead )
    -00278                 os << "Message Status: Opened\n";
    -00279         if( MessagePriority != NormalPriority )
    -00280                 os << "Importance: " << MessageImportance[MessagePriority] << "\n";
    -00281         if( MessageSensitivity != NormalSensitivity )
    -00282                 os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n";
    -00283         os << "Date: " << ctime(&MessageDateSent);
    -00284         os << "From: " << From << "\n";
    -00285         if( To.Email.size() )
    -00286                 os << "To: " << To << "\n";
    -00287         if( Cc.Email.size() )
    -00288                 os << "Cc: " << Cc << "\n";
    -00289         if( Bcc.Email.size() )
    -00290                 os << "Bcc: " << Bcc << "\n";
    -00291         if( Sender.Email.size() )
    -00292                 os << "Sender: " << Sender << "\n";
    -00293         if( ReplyTo.Email.size())
    -00294                 os << "Reply To: " << ReplyTo << "\n";
    -00295         if( Subject.size() )
    -00296                 os << "Subject: " << Subject << "\n";
    -00297         os << "\n";
    -00298         for(    std::string::const_iterator i = Body.begin();
    -00299                 i != Body.end() && *i;
    -00300                 i++)
    -00301         {
    -00302                 if( *i == '\r' )
    -00303                         os << '\n';
    -00304                 else
    -00305                         os << *i;
    -00306         }
    -00307         os << "\n";
    -00308         if( Attachment.size() )
    -00309                 os << "Attachments: " << Attachment << "\n";
    -00310         
    -00311         os << Unknowns;
    -00312         os << "\n\n";
    -00313 }
    -00314 
    -00315 
    -00316 } // namespace Barry
    -00317 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__saved__message_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__saved__message_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__saved__message_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,157 +0,0 @@ - - -Barry: r_saved_message.h Source File - - - - - - - -

    r_saved_message.h

    00001 ///
    -00002 /// \file       r_save_message.h
    -00003 ///             Blackberry database record parser class for saved email
    -00004 ///             message records.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009     Copyright (C) 2007, Brian Edginton (edge@edginton.net)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #ifndef __BARRY_RECORD_SAVED_MESSAGE_H__
    -00025 #define __BARRY_RECORD_SAVED_MESSAGE_H__
    -00026 
    -00027 #include "dll.h"
    -00028 #include "record.h"
    -00029 #include <iosfwd>
    -00030 #include <string>
    -00031 #include <vector>
    -00032 #include <map>
    -00033 #include <stdint.h>
    -00034 
    -00035 namespace Barry {
    -00036 
    -00037 //
    -00038 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00039 //        operators in the future.
    -00040 //
    -00041 
    -00042 /// \addtogroup RecordParserClasses
    -00043 /// @{
    -00044 
    -00045 class BXEXPORT SavedMessage
    -00046 {
    -00047 public:
    -00048         uint8_t RecType;
    -00049         uint32_t RecordId;
    -00050         
    -00051         EmailAddress From;
    -00052         EmailAddress To;
    -00053         EmailAddress Cc;
    -00054         EmailAddress Bcc;
    -00055         EmailAddress Sender;
    -00056         EmailAddress ReplyTo;
    -00057         std::string Subject;
    -00058         std::string Body;
    -00059         std::string Attachment;
    -00060         uint32_t MessageRecordId;
    -00061         uint32_t MessageReplyTo;
    -00062         time_t MessageDateSent;
    -00063         time_t MessageDateReceived;
    -00064         
    -00065         // Message Flags
    -00066         bool    MessageTruncated;
    -00067         bool    MessageRead;
    -00068         bool    MessageReply;
    -00069         bool    MessageSaved;
    -00070         bool    MessageSavedDeleted;
    -00071         
    -00072         enum MessagePriorityType {
    -00073                 LowPriority = 0,
    -00074                 NormalPriority,
    -00075                 HighPriority,
    -00076                 UnknownPriority
    -00077         };
    -00078         MessagePriorityType MessagePriority;
    -00079         
    -00080         enum MessageSensitivityType {
    -00081                 NormalSensitivity = 0,
    -00082                 Personal,
    -00083                 Private,
    -00084                 Confidential,
    -00085                 UnknownSensitivity
    -00086         };
    -00087         MessageSensitivityType MessageSensitivity;
    -00088         
    -00089         std::vector<UnknownField> Unknowns;
    -00090 
    -00091 public:
    -00092         const unsigned char* ParseField(const unsigned char *begin,
    -00093                 const unsigned char *end);
    -00094 
    -00095 public:
    -00096         SavedMessage();
    -00097         ~SavedMessage();
    -00098 
    -00099         // Parser / Builder API (see parser.h / builder.h)
    -00100         uint8_t GetRecType() const { return RecType; }
    -00101         uint32_t GetUniqueId() const { return RecordId; }
    -00102         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00103         void ParseHeader(const Data &data, size_t &offset);
    -00104         void ParseFields(const Data &data, size_t &offset);
    -00105         void BuildHeader(Data &data, size_t &offset) const;
    -00106         void BuildFields(Data &data, size_t &offset) const;
    -00107         void Clear();
    -00108         void Dump(std::ostream &os) const;
    -00109         
    -00110         // sorting
    -00111         bool operator<(const SavedMessage &other) const { return Subject < other.Subject; }
    -00112 
    -00113         // database name
    -00114         static const char * GetDBName() { return "Saved Email Messages"; }
    -00115         static uint8_t GetDefaultRecType() { return 3; }
    -00116 };
    -00117 
    -00118 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const SavedMessage &msg) {
    -00119         msg.Dump(os);
    -00120         return os;
    -00121 }
    -00122 
    -00123 /// @}
    -00124 
    -00125 } // namespace Barry
    -00126 
    -00127 #endif // __BARRY_RECORD_SAVED_MESSAGE_H__
    -00128 
    -00129 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__servicebook_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8cc.html --- barry-0.14/doc/www/doxygen/html/r__servicebook_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ - - -Barry: r_servicebook.cc File Reference - - - - - - - -

    r_servicebook.cc File Reference


    Detailed Description

    -Blackberry database record parser class for Service Book records. -

    - -

    -Definition in file r_servicebook.cc. -

    -#include "r_servicebook.h"
    -#include "record-internal.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "error.h"
    -#include "endian.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <stdexcept>
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define __DEBUG_MODE__
    -#define SBFCC_END   0xffff
    -#define SBFC_OLD_NAME   0x01
    -#define SBFC_HIDDEN_NAME   0x02
    -#define SBFC_NAME   0x03
    -#define SBFC_OLD_UNIQUE_ID   0x06
    -#define SBFC_UNIQUE_ID   0x07
    -#define SBFC_CONTENT_ID   0x08
    -#define SBFC_CONFIG   0x09
    -#define SBFC_OLD_DESC   0x32
    -#define SBFC_DESCRIPTION   0x0f
    -#define SBFC_DSID   0xa1
    -#define SBFC_BES_DOMAIN   0xa2
    -#define SBFC_USER_ID   0xa3
    -#define SBFC_END   0xffff

    Variables

    -FieldLink< ServiceBookConfig > Barry::ServiceBookConfigFieldLinks []
    -FieldLink< ServiceBook > Barry::ServiceBookFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__servicebook_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__servicebook_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,424 +0,0 @@ - - -Barry: r_servicebook.cc Source File - - - - - - - -

    r_servicebook.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_servicebook.cc
    -00003 ///             Blackberry database record parser class for
    -00004 ///             Service Book records.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_servicebook.h"
    -00024 #include "record-internal.h"
    -00025 #include "protocol.h"
    -00026 #include "protostructs.h"
    -00027 #include "data.h"
    -00028 #include "time.h"
    -00029 #include "error.h"
    -00030 #include "endian.h"
    -00031 #include <ostream>
    -00032 #include <iomanip>
    -00033 #include <time.h>
    -00034 #include <stdexcept>
    -00035 
    -00036 #define __DEBUG_MODE__
    -00037 #include "debug.h"
    -00038 
    -00039 using namespace std;
    -00040 using namespace Barry::Protocol;
    -00041 
    -00042 namespace Barry {
    -00043 
    -00044 
    -00045 ///////////////////////////////////////////////////////////////////////////////
    -00046 // ServiceBookConfig class
    -00047 
    -00048 // service book packed field codes
    -00049 #define SBFCC_END                       0xffff
    -00050 
    -00051 FieldLink<ServiceBookConfig> ServiceBookConfigFieldLinks[] = {
    -00052 //   { SBFC_DSID,        "DSID",       0, 0,    &ServiceBook::DSID, 0, 0 },
    -00053    { SBFCC_END,         "End of List",0, 0,    0, 0, 0 }
    -00054 };
    -00055 
    -00056 ServiceBookConfig::ServiceBookConfig()
    -00057         : Format(0)
    -00058 {
    -00059         Clear();
    -00060 }
    -00061 
    -00062 ServiceBookConfig::~ServiceBookConfig()
    -00063 {
    -00064 }
    -00065 
    -00066 const unsigned char* ServiceBookConfig::ParseField(const unsigned char *begin,
    -00067                                                    const unsigned char *end)
    -00068 {
    -00069         const void *raw;
    -00070         uint16_t size, type;
    -00071 
    -00072         switch( Format )
    -00073         {
    -00074         case 0x02:
    -00075                 {
    -00076                         const PackedField_02 *field = (const PackedField_02 *) begin;
    -00077                         raw = field->raw;
    -00078                         size = field->size;
    -00079                         type = field->type;
    -00080                         begin += PACKED_FIELD_02_HEADER_SIZE + size;
    -00081                 }
    -00082                 break;
    -00083 
    -00084         case 0x10:
    -00085                 {
    -00086                         const PackedField_10 *field = (const PackedField_10 *) begin;
    -00087                         raw = field->raw;
    -00088                         size = field->size;
    -00089                         type = field->type;
    -00090                         begin += PACKED_FIELD_10_HEADER_SIZE + size;
    -00091                 }
    -00092                 break;
    -00093 
    -00094         default:
    -00095                 eout("Unknown packed field format" << Format);
    -00096                 return begin + 1;
    -00097         }
    -00098 
    -00099 
    -00100         // check size
    -00101         if( begin > end )               // if begin==end, we are ok
    -00102                 return begin;
    -00103 
    -00104         if( !size )             // if field has no size, something's up
    -00105                 return begin;
    -00106 
    -00107         // cycle through the type table
    -00108         for(    FieldLink<ServiceBookConfig> *b = ServiceBookConfigFieldLinks;
    -00109                 b->type != SBFCC_END;
    -00110                 b++ )
    -00111         {
    -00112                 if( b->type == type ) {
    -00113                         if( b->strMember ) {
    -00114                                 std::string &s = this->*(b->strMember);
    -00115                                 s = ParseFieldString(raw, size-1);
    -00116                                 return begin;   // done!
    -00117                         }
    -00118                 }
    -00119         }
    -00120 
    -00121 /*
    -00122         // handle special cases
    -00123         switch( type )
    -00124         {
    -00125         }
    -00126 */
    -00127 
    -00128         // if still not handled, add to the Unknowns list
    -00129         UnknownField uf;
    -00130         uf.type = type;
    -00131         uf.data.assign((const char*)raw, size);
    -00132         Unknowns.push_back(uf);
    -00133 
    -00134         // return new pointer for next field
    -00135         return begin;
    -00136 }
    -00137 
    -00138 void ServiceBookConfig::ParseHeader(const Data &data, size_t &offset)
    -00139 {
    -00140         MAKE_RECORD(const Barry::Protocol::ServiceBookConfigField, sbc, data, offset);
    -00141         offset += SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE;
    -00142         if( data.GetSize() >= offset ) {        // size check!
    -00143                 Format = sbc->format;
    -00144         }
    -00145 }
    -00146 
    -00147 void ServiceBookConfig::ParseFields(const Data &data, size_t &offset)
    -00148 {
    -00149         const unsigned char *finish = ParseCommonFields(*this,
    -00150                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00151         offset += finish - (data.GetData() + offset);
    -00152 }
    -00153 
    -00154 void ServiceBookConfig::BuildHeader(Data &data, size_t &offset) const
    -00155 {
    -00156         // make sure there is enough space
    -00157         data.GetBuffer(offset + SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE);
    -00158 
    -00159         MAKE_RECORD(Barry::Protocol::ServiceBookConfigField, sbc, data, offset);
    -00160         sbc->format = Format;
    -00161 
    -00162         offset += SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE;
    -00163 }
    -00164 
    -00165 //
    -00166 // BuildFields
    -00167 //
    -00168 /// Build fields part of record
    -00169 ///
    -00170 void ServiceBookConfig::BuildFields(Data &data, size_t &offset) const
    -00171 {
    -00172         throw std::logic_error("ServiceBookConfig::Build not yet implemented");
    -00173 }
    -00174 
    -00175 void ServiceBookConfig::Clear()
    -00176 {
    -00177         Unknowns.clear();
    -00178 }
    -00179 
    -00180 void ServiceBookConfig::Dump(std::ostream &os) const
    -00181 {
    -00182         os << "   ServiceBookConfig Format: " << setbase(16) << (uint16_t)Format << "\n";
    -00183 
    -00184         // cycle through the type table
    -00185         for(    const FieldLink<ServiceBookConfig> *b = ServiceBookConfigFieldLinks;
    -00186                 b->type != SBFCC_END;
    -00187                 b++ )
    -00188         {
    -00189                 if( b->strMember ) {
    -00190                         const std::string &s = this->*(b->strMember);
    -00191                         if( s.size() )
    -00192                                 os << "      " << b->name << ": " << s << "\n";
    -00193                 }
    -00194                 else if( b->timeMember ) {
    -00195                         time_t t = this->*(b->timeMember);
    -00196                         if( t > 0 )
    -00197                                 os << "      " << b->name << ": " << ctime(&t);
    -00198                 }
    -00199         }
    -00200 
    -00201         // print any unknowns
    -00202         os << Unknowns;
    -00203         os << "   ------------------- End of Config Field\n";
    -00204 }
    -00205 
    -00206 
    -00207 ///////////////////////////////////////////////////////////////////////////////
    -00208 // ServiceBook class
    -00209 
    -00210 // service book field codes
    -00211 #define SBFC_OLD_NAME                   0x01
    -00212 #define SBFC_HIDDEN_NAME                0x02
    -00213 #define SBFC_NAME                       0x03
    -00214 #define SBFC_OLD_UNIQUE_ID              0x06
    -00215 #define SBFC_UNIQUE_ID                  0x07
    -00216 #define SBFC_CONTENT_ID                 0x08
    -00217 #define SBFC_CONFIG                     0x09
    -00218 #define SBFC_OLD_DESC                   0x32
    -00219 #define SBFC_DESCRIPTION                0x0f
    -00220 #define SBFC_DSID                       0xa1
    -00221 #define SBFC_BES_DOMAIN                 0xa2
    -00222 #define SBFC_USER_ID                    0xa3
    -00223 #define SBFC_END                        0xffff
    -00224 
    -00225 FieldLink<ServiceBook> ServiceBookFieldLinks[] = {
    -00226    { SBFC_HIDDEN_NAME, "Hidden Name",0, 0,    &ServiceBook::HiddenName, 0, 0 },
    -00227    { SBFC_DSID,        "DSID",       0, 0,    &ServiceBook::DSID, 0, 0 },
    -00228    { SBFC_END,         "End of List",0, 0,    0, 0, 0 }
    -00229 };
    -00230 
    -00231 ServiceBook::ServiceBook()
    -00232         : NameType(SBFC_OLD_NAME),
    -00233         DescType(SBFC_OLD_DESC),
    -00234         UniqueIdType(SBFC_OLD_UNIQUE_ID),
    -00235         RecordId(0)
    -00236 {
    -00237         Clear();
    -00238 }
    -00239 
    -00240 ServiceBook::~ServiceBook()
    -00241 {
    -00242 }
    -00243 
    -00244 const unsigned char* ServiceBook::ParseField(const unsigned char *begin,
    -00245                                           const unsigned char *end)
    -00246 {
    -00247         const CommonField *field = (const CommonField *) begin;
    -00248 
    -00249         // advance and check size
    -00250         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00251         if( begin > end )               // if begin==end, we are ok
    -00252                 return begin;
    -00253 
    -00254         if( !btohs(field->size) )       // if field has no size, something's up
    -00255                 return begin;
    -00256 
    -00257         // cycle through the type table
    -00258         for(    FieldLink<ServiceBook> *b = ServiceBookFieldLinks;
    -00259                 b->type != SBFC_END;
    -00260                 b++ )
    -00261         {
    -00262                 if( b->type == field->type ) {
    -00263                         if( b->strMember ) {
    -00264                                 std::string &s = this->*(b->strMember);
    -00265                                 s = ParseFieldString(field);
    -00266                                 return begin;   // done!
    -00267                         }
    -00268                         else if( b->timeMember && btohs(field->size) == 4 ) {
    -00269                                 time_t &t = this->*(b->timeMember);
    -00270                                 t = min2time(field->u.min1900);
    -00271                                 return begin;
    -00272                         }
    -00273                 }
    -00274         }
    -00275 
    -00276         // handle special cases
    -00277         switch( field->type )
    -00278         {
    -00279         case SBFC_OLD_NAME:             // strings with old/new type codes
    -00280         case SBFC_NAME:
    -00281                 Name = ParseFieldString(field);
    -00282                 NameType = field->type;
    -00283                 return begin;
    -00284 
    -00285         case SBFC_OLD_DESC:
    -00286         case SBFC_DESCRIPTION:
    -00287                 Description = ParseFieldString(field);
    -00288                 DescType = field->type;
    -00289                 return begin;
    -00290 
    -00291         case SBFC_OLD_UNIQUE_ID:
    -00292         case SBFC_UNIQUE_ID:
    -00293                 UniqueId = ParseFieldString(field);
    -00294                 UniqueIdType = field->type;
    -00295                 return begin;
    -00296 
    -00297         case SBFC_CONTENT_ID:
    -00298                 ContentId = ParseFieldString(field);
    -00299                 return begin;
    -00300 
    -00301         case SBFC_BES_DOMAIN:
    -00302                 BesDomain = ParseFieldString(field);
    -00303                 return begin;
    -00304 
    -00305         case SBFC_CONFIG:
    -00306                 {
    -00307                         Data config((const void *)field->u.raw, btohs(field->size));
    -00308                         size_t offset = 0;
    -00309                         Config.ParseHeader(config, offset);
    -00310                         Config.ParseFields(config, offset);
    -00311                 }
    -00312                 break;  // break here so raw packet is still visible in dump
    -00313 //              return begin;
    -00314         }
    -00315 
    -00316         // if still not handled, add to the Unknowns list
    -00317         UnknownField uf;
    -00318         uf.type = field->type;
    -00319         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00320         Unknowns.push_back(uf);
    -00321 
    -00322         // return new pointer for next field
    -00323         return begin;
    -00324 }
    -00325 
    -00326 void ServiceBook::ParseHeader(const Data &data, size_t &offset)
    -00327 {
    -00328         // no header in this record (?)
    -00329 }
    -00330 
    -00331 void ServiceBook::ParseFields(const Data &data, size_t &offset)
    -00332 {
    -00333         const unsigned char *finish = ParseCommonFields(*this,
    -00334                 data.GetData() + offset, data.GetData() + data.GetSize());
    -00335         offset += finish - (data.GetData() + offset);
    -00336 }
    -00337 
    -00338 void ServiceBook::BuildHeader(Data &data, size_t &offset) const
    -00339 {
    -00340         // no header in this record (?)
    -00341 }
    -00342 
    -00343 //
    -00344 // BuildFields
    -00345 //
    -00346 /// Build fields part of record
    -00347 ///
    -00348 void ServiceBook::BuildFields(Data &data, size_t &offset) const
    -00349 {
    -00350         throw std::logic_error("ServiceBook::BuildFields not yet implemented");
    -00351 }
    -00352 
    -00353 void ServiceBook::Clear()
    -00354 {
    -00355         Unknowns.clear();
    -00356         Config.Clear();
    -00357 }
    -00358 
    -00359 void ServiceBook::Dump(std::ostream &os) const
    -00360 {
    -00361         os << "ServiceBook entry: 0x" << setbase(16) << RecordId
    -00362                 << " (" << (unsigned int)RecType << ")\n";
    -00363 
    -00364         // cycle through the type table
    -00365         for(    const FieldLink<ServiceBook> *b = ServiceBookFieldLinks;
    -00366                 b->type != SBFC_END;
    -00367                 b++ )
    -00368         {
    -00369                 if( b->strMember ) {
    -00370                         const std::string &s = this->*(b->strMember);
    -00371                         if( s.size() )
    -00372                                 os << "   " << b->name << ": " << s << "\n";
    -00373                 }
    -00374                 else if( b->timeMember ) {
    -00375                         time_t t = this->*(b->timeMember);
    -00376                         if( t > 0 )
    -00377                                 os << "   " << b->name << ": " << ctime(&t);
    -00378                 }
    -00379         }
    -00380 
    -00381         // special cases
    -00382         if( UniqueId.size() )
    -00383                 os << "   Unique ID: " << UniqueId << "\n";
    -00384         if( ContentId.size() )
    -00385                 os << "   Content ID: " << ContentId << "\n";
    -00386         if( BesDomain.size() )
    -00387                 os << "   (BES) Domain: " << BesDomain << "\n";
    -00388 
    -00389         os << Config;
    -00390 
    -00391         // print any unknowns
    -00392         os << Unknowns;
    -00393 }
    -00394 
    -00395 } // namespace Barry
    -00396 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__servicebook_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8h.html --- barry-0.14/doc/www/doxygen/html/r__servicebook_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - -Barry: r_servicebook.h File Reference - - - - - - - -

    r_servicebook.h File Reference


    Detailed Description

    -Blackberry database record parser class for the Service Book record. -

    - -

    -Definition in file r_servicebook.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <iosfwd>
    -#include <string>
    -#include <vector>
    -#include <map>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::ServiceBookConfig
    class  Barry::ServiceBook

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const ServiceBookConfig &msg)
    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const ServiceBook &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__servicebook_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__servicebook_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__servicebook_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ - - -Barry: r_servicebook.h Source File - - - - - - - -

    r_servicebook.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_servicebook.h
    -00003 ///             Blackberry database record parser class for the
    -00004 ///             Service Book record.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_SERVICEBOOK_H__
    -00024 #define __BARRY_RECORD_SERVICEBOOK_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <iosfwd>
    -00029 #include <string>
    -00030 #include <vector>
    -00031 #include <map>
    -00032 #include <stdint.h>
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 //
    -00037 // NOTE:  All classes here must be container-safe!  Perhaps add sorting
    -00038 //        operators in the future.
    -00039 //
    -00040 
    -00041 
    -00042 /// \addtogroup RecordParserClasses
    -00043 /// @{
    -00044 
    -00045 // This is a packed field, which is a group of fields packed in
    -00046 // variable length records inside one larger field of a normal record.
    -00047 class BXEXPORT ServiceBookConfig
    -00048 {
    -00049 public:
    -00050         typedef std::vector<UnknownField>               UnknownsType;
    -00051 
    -00052         uint8_t Format;
    -00053 
    -00054         UnknownsType Unknowns;
    -00055 
    -00056 public:
    -00057         const unsigned char* ParseField(const unsigned char *begin,
    -00058                 const unsigned char *end);
    -00059 
    -00060 public:
    -00061         ServiceBookConfig();
    -00062         ~ServiceBookConfig();
    -00063 
    -00064         // Parser / Builder API (see parser.h / builder.h)
    -00065         void ParseHeader(const Data &data, size_t &offset);
    -00066         void ParseFields(const Data &data, size_t &offset);
    -00067         void BuildHeader(Data &data, size_t &offset) const;
    -00068         void BuildFields(Data &data, size_t &offset) const;
    -00069 
    -00070         void Clear();
    -00071 
    -00072         void Dump(std::ostream &os) const;
    -00073 };
    -00074 
    -00075 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const ServiceBookConfig &msg) {
    -00076         msg.Dump(os);
    -00077         return os;
    -00078 }
    -00079 
    -00080 
    -00081 class BXEXPORT ServiceBook
    -00082 {
    -00083         int NameType, DescType, UniqueIdType;
    -00084 
    -00085 public:
    -00086         typedef std::vector<UnknownField>               UnknownsType;
    -00087 
    -00088         uint8_t RecType;
    -00089         uint32_t RecordId;
    -00090         std::string Name;
    -00091         std::string HiddenName;
    -00092         std::string Description;
    -00093         std::string DSID;
    -00094         std::string BesDomain;
    -00095         std::string UniqueId;
    -00096         std::string ContentId;
    -00097         ServiceBookConfig Config;
    -00098 
    -00099         UnknownsType Unknowns;
    -00100 
    -00101 public:
    -00102         const unsigned char* ParseField(const unsigned char *begin,
    -00103                 const unsigned char *end);
    -00104 
    -00105 public:
    -00106         ServiceBook();
    -00107         ~ServiceBook();
    -00108 
    -00109         // Parser / Builder API (see parser.h / builder.h)
    -00110         uint8_t GetRecType() const { return RecType; }
    -00111         uint32_t GetUniqueId() const { return RecordId; }
    -00112         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00113         void ParseHeader(const Data &data, size_t &offset);
    -00114         void ParseFields(const Data &data, size_t &offset);
    -00115         void BuildHeader(Data &data, size_t &offset) const;
    -00116         void BuildFields(Data &data, size_t &offset) const;
    -00117 
    -00118         void Clear();
    -00119 
    -00120         void Dump(std::ostream &os) const;
    -00121 
    -00122         // sorting
    -00123         bool operator<(const ServiceBook &other) const { return RecordId < RecordId; }
    -00124 
    -00125         // database name
    -00126         static const char * GetDBName() { return "Service Book"; }
    -00127         static uint8_t GetDefaultRecType() { return 0; }
    -00128 };
    -00129 
    -00130 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const ServiceBook &msg) {
    -00131         msg.Dump(os);
    -00132         return os;
    -00133 }
    -00134 
    -00135 /// @}
    -00136 
    -00137 } // namespace Barry
    -00138 
    -00139 #endif
    -00140 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__task_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__task_8cc.html --- barry-0.14/doc/www/doxygen/html/r__task_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__task_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ - - -Barry: r_task.cc File Reference - - - - - - - -

    r_task.cc File Reference


    Detailed Description

    -Record parsing class for the task database. -

    - -

    -Definition in file r_task.cc. -

    -#include "r_task.h"
    -#include "record-internal.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "debug.h"
    -#include <ostream>
    -#include <iomanip>
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define TSKFC_TASK_TYPE   0x01
    -#define TSKFC_TITLE   0x02
    -#define TSKFC_NOTES   0x03
    -#define TSKFC_START_TIME   0x05
    -#define TSKFC_DUE_TIME   0x06
    -#define TSKFC_DUE_FLAG   0x08
    -#define TSKFC_STATUS   0x09
    -#define TSKFC_PRIORITY   0x0a
    -#define TSKFC_RECURRENCE_DATA   0x0c
    -#define TSKFC_ALARM_TYPE   0x0e
    -#define TSKFC_ALARM_TIME   0x0f
    -#define TSKFC_TIMEZONE_CODE   0x10
    -#define TSKFC_CATEGORIES   0x11
    -#define TSKFC_END   0xffff

    Variables

    -FieldLink< Task > Barry::TaskFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__task_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__task_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__task_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__task_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,478 +0,0 @@ - - -Barry: r_task.cc Source File - - - - - - - -

    r_task.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_task.cc
    -00003 ///             Record parsing class for the task database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_task.h"
    -00024 #include "record-internal.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "debug.h"
    -00029 #include <ostream>
    -00030 #include <iomanip>
    -00031 #include <string.h>
    -00032 
    -00033 using namespace std;
    -00034 using namespace Barry::Protocol;
    -00035 
    -00036 namespace Barry {
    -00037 
    -00038 ///////////////////////////////////////////////////////////////////////////////
    -00039 // Task Class
    -00040 
    -00041 // Task Field Codes
    -00042 #define TSKFC_TASK_TYPE         0x01
    -00043 #define TSKFC_TITLE             0x02
    -00044 #define TSKFC_NOTES             0x03
    -00045 #define TSKFC_START_TIME        0x05
    -00046 #define TSKFC_DUE_TIME          0x06
    -00047 #define TSKFC_DUE_FLAG          0x08
    -00048 #define TSKFC_STATUS            0x09
    -00049 #define TSKFC_PRIORITY          0x0a
    -00050 #define TSKFC_RECURRENCE_DATA   0x0c
    -00051 #define TSKFC_ALARM_TYPE        0x0e
    -00052 #define TSKFC_ALARM_TIME        0x0f
    -00053 #define TSKFC_TIMEZONE_CODE     0x10
    -00054 #define TSKFC_CATEGORIES        0x11
    -00055 #define TSKFC_END               0xffff
    -00056 
    -00057 FieldLink<Task> TaskFieldLinks[] = {
    -00058         { TSKFC_TITLE,      "Summary",     0, 0, &Task::Summary, 0, 0 },
    -00059         { TSKFC_NOTES,      "Notes",       0, 0, &Task::Notes, 0, 0 },
    -00060         { TSKFC_START_TIME, "Start Time",  0, 0, 0, 0, &Task::StartTime },
    -00061         { TSKFC_DUE_TIME,   "Due Time",    0, 0, 0, 0, &Task::DueTime },
    -00062         { TSKFC_ALARM_TIME, "Alarm Time",  0, 0, 0, 0, &Task::AlarmTime },
    -00063         { TSKFC_CATEGORIES, "Categories",  0, 0, &Task::Categories, 0, 0 },
    -00064         { TSKFC_END,        "End of List", 0, 0, 0, 0, 0 },
    -00065 };
    -00066 
    -00067 Task::Task()
    -00068 {
    -00069         Clear();
    -00070 }
    -00071 
    -00072 Task::~Task()
    -00073 {
    -00074 }
    -00075 
    -00076 const unsigned char* Task::ParseField(const unsigned char *begin,
    -00077                                       const unsigned char *end)
    -00078 {
    -00079         const CommonField *field = (const CommonField *) begin;
    -00080 
    -00081         // advance and check size
    -00082         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00083         if( begin > end )       // if begin==end, we are ok
    -00084                 return begin;
    -00085 
    -00086         if( !btohs(field->size) )   // if field has no size, something's up
    -00087                 return begin;
    -00088 
    -00089         if( field->type == TSKFC_TASK_TYPE ) {
    -00090                 if( ( TaskType = field->u.raw[0] ) != 't' ) {
    -00091                         throw Error("Task::ParseField: Task Type is not 't'");
    -00092                 }
    -00093                 return begin;
    -00094         }
    -00095 
    -00096         // cycle through the type table
    -00097         for(    FieldLink<Task> *b = TaskFieldLinks;
    -00098                 b->type != TSKFC_END;
    -00099                 b++ )
    -00100         {
    -00101                 if( b->type == field->type ) {
    -00102                         if( b->strMember ) {
    -00103                                 std::string &s = this->*(b->strMember);
    -00104                                 s = ParseFieldString(field);
    -00105                                 return begin;   // done!
    -00106                         }
    -00107                         else if( b->timeMember && btohs(field->size) == 4 ) {
    -00108                                 time_t &t = this->*(b->timeMember);
    -00109                                 t = min2time(field->u.min1900);
    -00110                                 return begin;
    -00111                         }
    -00112                 }
    -00113         }
    -00114         // handle special cases
    -00115         switch( field->type )
    -00116         {
    -00117         case TSKFC_PRIORITY:
    -00118                 if( field->u.raw[0] > Low ) {
    -00119                         throw Error( "Task::ParseField: priority field out of bounds" );
    -00120                 }
    -00121                 else {
    -00122                         PriorityFlag = (PriorityFlagType)field->u.raw[0];
    -00123                 }
    -00124                 return begin;
    -00125 
    -00126         case TSKFC_STATUS:
    -00127                 if( field->u.raw[0] > Deferred ) {
    -00128                         throw Error( "Task::ParseField: priority field out of bounds" );
    -00129                 }
    -00130                 else {
    -00131                         StatusFlag = (StatusFlagType)field->u.raw[0];
    -00132                 }
    -00133                 return begin;
    -00134 
    -00135         case TSKFC_TIMEZONE_CODE:
    -00136                 if( btohs(field->size) == 4 ) {
    -00137                         TimeZoneCode = btohs(field->u.code);
    -00138                 }
    -00139                 else {
    -00140                         throw Error("Task::ParseField: not enough data in time zone code field");
    -00141                 }
    -00142                 return begin;
    -00143 
    -00144         case TSKFC_RECURRENCE_DATA:
    -00145                 if( btohs(field->size) >= CALENDAR_RECURRENCE_DATA_FIELD_SIZE ) {
    -00146                         Recurring = true;
    -00147                         ParseRecurrenceData(&field->u.raw[0]);
    -00148                 }
    -00149                 else {
    -00150                         throw Error("Task::ParseField: not enough data in recurrence data field");
    -00151                 }
    -00152                 return begin;
    -00153 
    -00154         case TSKFC_DUE_FLAG:
    -00155                 DueDateFlag = field->u.raw[0];
    -00156                 return begin;           
    -00157 
    -00158         case TSKFC_ALARM_TYPE:
    -00159                 if( field->u.raw[0] > Relative ) {
    -00160                         throw Error("Task::ParseField: AlarmType out of bounds" );
    -00161                 }
    -00162                 else {
    -00163                         AlarmType = (AlarmFlagType)field->u.raw[0];
    -00164                 }
    -00165                 return begin;
    -00166         }
    -00167 
    -00168         // if still not handled, add to the Unknowns list
    -00169         UnknownField uf;
    -00170         uf.type = field->type;
    -00171         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00172         Unknowns.push_back(uf);
    -00173 
    -00174         // return new pointer for next field
    -00175         return begin;
    -00176 }
    -00177 
    -00178 // this function assumes the size has already been checked
    -00179 void Task::ParseRecurrenceData(const void *data)
    -00180 {
    -00181         const CalendarRecurrenceDataField *rec =
    -00182                 (const CalendarRecurrenceDataField*) data;
    -00183 
    -00184         Interval = btohs(rec->interval);
    -00185         if( Interval < 1 )
    -00186                 Interval = 1;   // must always be >= 1
    -00187 
    -00188         if( rec->endTime == 0xffffffff ) {
    -00189                 Perpetual = true;
    -00190         }
    -00191         else {
    -00192                 RecurringEndTime = min2time(rec->endTime);
    -00193                 Perpetual = false;
    -00194         }
    -00195 
    -00196         switch( rec->type )
    -00197         {
    -00198         case CRDF_TYPE_DAY:
    -00199                 RecurringType = Day;
    -00200                 // no extra data
    -00201                 break;
    -00202 
    -00203         case CRDF_TYPE_MONTH_BY_DATE:
    -00204                 RecurringType = MonthByDate;
    -00205                 DayOfMonth = rec->u.month_by_date.monthDay;
    -00206                 break;
    -00207 
    -00208         case CRDF_TYPE_MONTH_BY_DAY:
    -00209                 RecurringType = MonthByDay;
    -00210                 DayOfWeek = rec->u.month_by_day.weekDay;
    -00211                 WeekOfMonth = rec->u.month_by_day.week;
    -00212                 break;
    -00213 
    -00214         case CRDF_TYPE_YEAR_BY_DATE:
    -00215                 RecurringType = YearByDate;
    -00216                 DayOfMonth = rec->u.year_by_date.monthDay;
    -00217                 MonthOfYear = rec->u.year_by_date.month;
    -00218                 break;
    -00219 
    -00220         case CRDF_TYPE_YEAR_BY_DAY:
    -00221                 RecurringType = YearByDay;
    -00222                 DayOfWeek = rec->u.year_by_day.weekDay;
    -00223                 WeekOfMonth = rec->u.year_by_day.week;
    -00224                 MonthOfYear = rec->u.year_by_day.month;
    -00225                 break;
    -00226 
    -00227         case CRDF_TYPE_WEEK:
    -00228                 RecurringType = Week;
    -00229 
    -00230                 // Note: this simple copy is only possible since
    -00231                 // the CAL_WD_* constants are the same as CRDF_WD_* constants.
    -00232                 // If this ever changes, this code will need to change.
    -00233                 WeekDays = rec->u.week.days;
    -00234                 break;
    -00235 
    -00236         default:
    -00237                 eout("Unknown recurrence data type: 0x"
    -00238                         << setbase(16) << (unsigned int) rec->type);
    -00239                 throw Error("Unknown recurrence data type");
    -00240         }
    -00241 }
    -00242 
    -00243 // this function assumes there is CALENDAR_RECURRENCE_DATA_FIELD_SIZE bytes
    -00244 // available in data
    -00245 void Task::BuildRecurrenceData(void *data)
    -00246 {
    -00247         if( !Recurring )
    -00248                 throw Error("Task::BuildRecurrenceData: Attempting to build recurrence data on non-recurring record.");
    -00249 
    -00250         CalendarRecurrenceDataField *rec = (CalendarRecurrenceDataField*) data;
    -00251 
    -00252         // set all to zero
    -00253         memset(data, 0, CALENDAR_RECURRENCE_DATA_FIELD_SIZE);
    -00254 
    -00255         rec->interval = htobs(Interval);
    -00256         rec->startTime = time2min(StartTime);
    -00257         if( Perpetual )
    -00258                 rec->endTime = 0xffffffff;
    -00259         else
    -00260                 rec->endTime = time2min(RecurringEndTime);
    -00261 
    -00262         switch( RecurringType )
    -00263         {
    -00264         case Day:
    -00265                 rec->type = CRDF_TYPE_DAY;
    -00266                 // no extra data
    -00267                 break;
    -00268 
    -00269         case MonthByDate:
    -00270                 rec->type = CRDF_TYPE_MONTH_BY_DATE;
    -00271                 rec->u.month_by_date.monthDay = DayOfMonth;
    -00272                 break;
    -00273 
    -00274         case MonthByDay:
    -00275                 rec->type = CRDF_TYPE_MONTH_BY_DAY;
    -00276                 rec->u.month_by_day.weekDay = DayOfWeek;
    -00277                 rec->u.month_by_day.week = WeekOfMonth;
    -00278                 break;
    -00279 
    -00280         case YearByDate:
    -00281                 rec->type = CRDF_TYPE_YEAR_BY_DATE;
    -00282                 rec->u.year_by_date.monthDay = DayOfMonth;
    -00283                 rec->u.year_by_date.month = MonthOfYear;
    -00284                 break;
    -00285 
    -00286         case YearByDay:
    -00287                 rec->type = CRDF_TYPE_YEAR_BY_DAY;
    -00288                 rec->u.year_by_day.weekDay = DayOfWeek;
    -00289                 rec->u.year_by_day.week = WeekOfMonth;
    -00290                 rec->u.year_by_day.month = MonthOfYear;
    -00291                 break;
    -00292 
    -00293         case Week:
    -00294                 rec->type = CRDF_TYPE_WEEK;
    -00295 
    -00296                 // Note: this simple copy is only possible since
    -00297                 // the CAL_WD_* constants are the same as CRDF_WD_* constants.
    -00298                 // If this ever changes, this code will need to change.
    -00299                 rec->u.week.days = WeekDays;
    -00300                 break;
    -00301 
    -00302         default:
    -00303                 eout("Task::BuildRecurrenceData: "
    -00304                 "Unknown recurrence data type: " << rec->type);
    -00305                 throw Error("Task::BuildRecurrenceData: Unknown recurrence data type");
    -00306         }
    -00307 }
    -00308 
    -00309 void Task::ParseHeader(const Data &data, size_t &offset)
    -00310 {
    -00311         // no header in Task records
    -00312 }
    -00313 
    -00314 void Task::ParseFields(const Data &data, size_t &offset)
    -00315 {
    -00316         const unsigned char *finish = ParseCommonFields(*this,
    -00317         data.GetData() + offset, data.GetData() + data.GetSize());
    -00318         offset += finish - (data.GetData() + offset);
    -00319 }
    -00320 
    -00321 void Task::Clear()
    -00322 {
    -00323         Summary.clear();
    -00324         Notes.clear();
    -00325         Categories.clear();
    -00326         StartTime = DueTime = AlarmTime = 0;
    -00327 
    -00328         PriorityFlag = (PriorityFlagType)0;
    -00329         StatusFlag = (StatusFlagType)0;
    -00330         AlarmType = (AlarmFlagType)0;
    -00331 
    -00332         TaskType = 0;
    -00333 
    -00334         Perpetual = false;
    -00335         DueDateFlag = false;
    -00336         Recurring = false;
    -00337 
    -00338         TimeZoneCode = GetTimeZoneCode( 0, 0 );
    -00339 
    -00340         Unknowns.clear();
    -00341 }
    -00342 
    -00343 void Task::Dump(std::ostream &os) const
    -00344 {
    -00345         static const char *PriorityName[] = { "High", "Normal", "Low" };
    -00346         static const char *StatusName[] = { "Not Started", "In Progress",
    -00347                 "Completed", "Waiting", "Deferred" };
    -00348         static const char *DayNames[] = { "Sun", "Mon", "Tue", "Wed",
    -00349                 "Thu", "Fri", "Sat" };
    -00350         static const char *MonthNames[] = { "Jan", "Feb", "Mar", "Apr",
    -00351                 "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
    -00352         static const char *AlarmTypeName[] = { "None", "By Date", "Relative" };
    -00353 
    -00354         os << "Task entry: 0x" << setbase(16) << RecordId
    -00355            << " (" << (unsigned int)RecType << ")\n";
    -00356 
    -00357         // cycle through the type table
    -00358         for(    const FieldLink<Task> *b = TaskFieldLinks;
    -00359                 b->type != TSKFC_END;
    -00360                 b++ )
    -00361         {
    -00362                 if( b->strMember ) {
    -00363                         const std::string &s = this->*(b->strMember);
    -00364                         if( s.size() )
    -00365                                 os << "   " << b->name << ": " << s << "\n";
    -00366                 }
    -00367                 else if( b->timeMember ) {
    -00368                         time_t t = this->*(b->timeMember);
    -00369                         if( t > 0 )
    -00370                                 os << "   " << b->name << ": " << ctime(&t);
    -00371                 }
    -00372         }
    -00373 
    -00374         os << "   Priority: " << PriorityName[PriorityFlag] << "\n";
    -00375         os << "   Status: " << StatusName[StatusFlag] << "\n";
    -00376         if( AlarmType ) {
    -00377                 os << "   Alarm Type: " << AlarmTypeName[AlarmType] << "\n";
    -00378         }
    -00379 
    -00380         // print recurrence data if available
    -00381         os << "   Recurring: " << (Recurring ? "yes" : "no") << "\n";
    -00382         if( Recurring ) {
    -00383                 switch( RecurringType )
    -00384                 {
    -00385                 case Day:
    -00386                         os << "      Every day.\n";
    -00387                         break;
    -00388 
    -00389                 case MonthByDate:
    -00390                         os << "      Every month on the "
    -00391                            << DayOfMonth
    -00392                            << (DayOfMonth == 1 ? "st" : "")
    -00393                            << (DayOfMonth == 2 ? "nd" : "")
    -00394                            << (DayOfMonth == 3 ? "rd" : "")
    -00395                            << (DayOfMonth > 3  ? "th" : "")
    -00396                            << "\n";
    -00397                         break;
    -00398 
    -00399                 case MonthByDay:
    -00400                         os << "      Every month on the "
    -00401                            << DayNames[DayOfWeek]
    -00402                            << " of week "
    -00403                            << WeekOfMonth
    -00404                            << "\n";
    -00405                         break;
    -00406 
    -00407                 case YearByDate:
    -00408                         os << "      Every year on "
    -00409                            << MonthNames[MonthOfYear-1]
    -00410                            << " " << DayOfMonth << "\n";
    -00411                         break;
    -00412 
    -00413                 case YearByDay:
    -00414                         os << "      Every year in " << MonthNames[MonthOfYear-1]
    -00415                            << " on "
    -00416                            << DayNames[DayOfWeek]
    -00417                            << " of week " << WeekOfMonth << "\n";
    -00418                         break;
    -00419 
    -00420                 case Week:
    -00421                         os << "      Every week on: ";
    -00422                         if( WeekDays & CAL_WD_SUN ) os << "Sun ";
    -00423                         if( WeekDays & CAL_WD_MON ) os << "Mon ";
    -00424                         if( WeekDays & CAL_WD_TUE ) os << "Tue ";
    -00425                         if( WeekDays & CAL_WD_WED ) os << "Wed ";
    -00426                         if( WeekDays & CAL_WD_THU ) os << "Thu ";
    -00427                         if( WeekDays & CAL_WD_FRI ) os << "Fri ";
    -00428                         if( WeekDays & CAL_WD_SAT ) os << "Sat ";
    -00429                         os << "\n";
    -00430                         break;
    -00431 
    -00432                 default:
    -00433                         os << "      Unknown recurrence type\n";
    -00434                         break;
    -00435                 }
    -00436 
    -00437                 os << "      Interval: " << Interval << "\n";
    -00438 
    -00439                 if( Perpetual )
    -00440                         os << "      Ends: never\n";
    -00441                 else
    -00442                         os << "      Ends: " << ctime(&RecurringEndTime);
    -00443         }               
    -00444 
    -00445         os << Unknowns;
    -00446         os << "\n\n";
    -00447 }
    -00448 
    -00449 } // namespace Barry
    -00450 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__task_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__task_8h.html --- barry-0.14/doc/www/doxygen/html/r__task_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__task_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: r_task.h File Reference - - - - - - - -

    r_task.h File Reference


    Detailed Description

    -Record parsing class for the task database. -

    - -

    -Definition in file r_task.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <vector>
    -#include <string>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Task

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Task &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__task_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__task_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__task_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__task_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,171 +0,0 @@ - - -Barry: r_task.h Source File - - - - - - - -

    r_task.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_task.h
    -00003 ///             Record parsing class for the task database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2007, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_TASK_H__
    -00024 #define __BARRY_RECORD_TASK_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <vector>
    -00029 #include <string>
    -00030 #include <stdint.h>
    -00031 
    -00032 namespace Barry {
    -00033 
    -00034 class BXEXPORT Task
    -00035 {
    -00036 public:
    -00037         typedef std::vector<UnknownField>                       UnknownsType;
    -00038         uint8_t RecType;
    -00039         uint32_t RecordId;
    -00040 
    -00041         uint8_t TaskType;
    -00042         std::string Summary;
    -00043         std::string Notes;
    -00044         std::string Categories;
    -00045         std::string UID;
    -00046 
    -00047         time_t StartTime;
    -00048         time_t DueTime;
    -00049         time_t AlarmTime;
    -00050         int TimeZoneCode;
    -00051 
    -00052         enum AlarmFlagType
    -00053         {
    -00054                 Date = 1,
    -00055                 Relative
    -00056         };
    -00057         AlarmFlagType AlarmType;
    -00058 
    -00059         unsigned short Interval;
    -00060         enum RecurringCodeType {
    -00061                 Day = 1,                //< eg. every day
    -00062                                         //< set: nothing
    -00063                 MonthByDate = 3,        //< eg. every month on the 12th
    -00064                                         //< set: DayOfMonth
    -00065                 MonthByDay = 4,         //< eg. every month on 3rd Wed
    -00066                                         //< set: DayOfWeek and WeekOfMonth
    -00067                 YearByDate = 5,         //< eg. every year on March 5
    -00068                                         //< set: DayOfMonth and MonthOfYear
    -00069                 YearByDay = 6,          //< eg. every year on 3rd Wed of Jan
    -00070                                         //< set: DayOfWeek, WeekOfMonth, and
    -00071                                         //<      MonthOfYear
    -00072                 Week = 12               //< eg. every week on Mon and Fri
    -00073                                         //< set: WeekDays
    -00074         };
    -00075         RecurringCodeType RecurringType;
    -00076         time_t RecurringEndTime;        
    -00077         unsigned short                  // recurring details, depending on type
    -00078                 DayOfWeek,              // 0-6
    -00079                 WeekOfMonth,            // 1-5
    -00080                 DayOfMonth,             // 1-31
    -00081                 MonthOfYear;            // 1-12
    -00082         unsigned char WeekDays;         // bitmask, bit 0 = sunday
    -00083 
    -00084         int ClassType;
    -00085         enum PriorityFlagType
    -00086         {
    -00087                 High = 0,
    -00088                 Normal,
    -00089                 Low
    -00090         };
    -00091         PriorityFlagType PriorityFlag;
    -00092 
    -00093         enum StatusFlagType
    -00094         {
    -00095                 NotStarted = 0,
    -00096                 InProgress,
    -00097                 Completed,
    -00098                 Waiting,
    -00099                 Deferred
    -00100         };
    -00101         StatusFlagType StatusFlag;
    -00102 
    -00103         bool Recurring;
    -00104         bool Perpetual;
    -00105         bool DueDateFlag;       // true if due date is set
    -00106 
    -00107         UnknownsType Unknowns;
    -00108 
    -00109 public: 
    -00110         Task();
    -00111         ~Task();
    -00112 
    -00113         const unsigned char* ParseField(const unsigned char *begin,
    -00114                 const unsigned char *end);      
    -00115         void ParseRecurrenceData(const void *data);
    -00116         void BuildRecurrenceData(void *data);
    -00117         uint8_t GetRecType() const { return RecType; }
    -00118         uint32_t GetUniqueId() const { return RecordId; }
    -00119         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00120         void ParseHeader(const Data &data, size_t &offset);
    -00121         void ParseFields(const Data &data, size_t &offset);
    -00122         void BuildHeader(Data &data, size_t &offset) const;
    -00123 
    -00124         void Clear();
    -00125 
    -00126         void Dump(std::ostream &os) const;
    -00127         bool operator<(const Task &other) const { return Summary < other.Summary; }
    -00128 
    -00129         // database name
    -00130         static const char * GetDBName() { return "Tasks"; }
    -00131         static uint8_t GetDefaultRecType() { return 2; }
    -00132 
    -00133 };
    -00134 
    -00135 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Task &msg) {
    -00136         msg.Dump(os);
    -00137         return os;
    -00138 }
    -00139 
    -00140 } // namespace Barry
    -00141 
    -00142 #endif
    -00143 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__timezone_8cc.html barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8cc.html --- barry-0.14/doc/www/doxygen/html/r__timezone_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ - - -Barry: r_timezone.cc File Reference - - - - - - - -

    r_timezone.cc File Reference


    Detailed Description

    -Record parsing class for the timezone database. -

    - -

    -Definition in file r_timezone.cc. -

    -#include "r_timezone.h"
    -#include "record-internal.h"
    -#include "protostructs.h"
    -#include "data.h"
    -#include "time.h"
    -#include "debug.h"
    -#include <ostream>
    -#include <iomanip>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define TZFC_INDEX   0x01
    -#define TZFC_NAME   0x02
    -#define TZFC_OFFSET   0x03
    -#define TZFC_DST   0x04
    -#define TZFC_STARTMONTH   0x06
    -#define TZFC_ENDMONTH   0x0B
    -#define TZFC_TZTYPE   0x64
    -#define TZFC_END   0xffff

    Variables

    -FieldLink< Timezone > Barry::TimezoneFieldLinks []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__timezone_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8cc-source.html --- barry-0.14/doc/www/doxygen/html/r__timezone_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,243 +0,0 @@ - - -Barry: r_timezone.cc Source File - - - - - - - -

    r_timezone.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_timezone.cc
    -00003 ///             Record parsing class for the timezone database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2008, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "r_timezone.h"
    -00024 #include "record-internal.h"
    -00025 #include "protostructs.h"
    -00026 #include "data.h"
    -00027 #include "time.h"
    -00028 #include "debug.h"
    -00029 #include <ostream>
    -00030 #include <iomanip>
    -00031 
    -00032 using namespace std;
    -00033 using namespace Barry::Protocol;
    -00034 
    -00035 namespace Barry
    -00036 {
    -00037 
    -00038 ///////////////////////////////////////////////////////////////////////////////
    -00039 // Timezone Class
    -00040 
    -00041 // Timezone Field Codes
    -00042 #define TZFC_INDEX              0x01
    -00043 #define TZFC_NAME               0x02
    -00044 #define TZFC_OFFSET             0x03
    -00045 #define TZFC_DST                0x04
    -00046 #define TZFC_STARTMONTH 0x06
    -00047 #define TZFC_ENDMONTH   0x0B
    -00048 #define TZFC_TZTYPE             0x64
    -00049 
    -00050 #define TZFC_END                0xffff
    -00051 
    -00052 FieldLink<Timezone> TimezoneFieldLinks[] = {
    -00053         { TZFC_NAME,      "Name",        0, 0, &Timezone::TimeZoneName, 0, 0 },
    -00054         { TZFC_END,       "End of List", 0, 0, 0, 0, 0 },
    -00055 };
    -00056 
    -00057 Timezone::Timezone()
    -00058 {
    -00059         Clear();
    -00060 }
    -00061 
    -00062 Timezone::~Timezone()
    -00063 {
    -00064 }
    -00065 
    -00066 const unsigned char* Timezone::ParseField(const unsigned char *begin,
    -00067                                       const unsigned char *end)
    -00068 {
    -00069         const CommonField *field = (const CommonField *) begin;
    -00070 
    -00071         // advance and check size
    -00072         begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size);
    -00073         if( begin > end )       // if begin==end, we are ok
    -00074                 return begin;
    -00075 
    -00076         if( !btohs(field->size) )   // if field has no size, something's up
    -00077                 return begin;
    -00078         
    -00079         if( field->type == TZFC_TZTYPE ) {
    -00080                 if( ( TZType = field->u.uint32 ) != 1 ) {
    -00081                         throw Error("Timezone::ParseField: Timezone Type is not valid");
    -00082                 }
    -00083                 return begin;
    -00084         }
    -00085 
    -00086         // cycle through the type table
    -00087         for(    FieldLink<Timezone> *b = TimezoneFieldLinks;
    -00088                 b->type != TZFC_END;
    -00089                 b++ )
    -00090         {
    -00091                 if( b->type == field->type ) {
    -00092                         if( b->strMember ) {
    -00093                                 std::string &s = this->*(b->strMember);
    -00094                                 s = ParseFieldString(field);
    -00095                                 return begin;   // done!
    -00096                         }
    -00097                 }
    -00098         }
    -00099 
    -00100         switch( field->type )
    -00101         {
    -00102         case TZFC_INDEX:
    -00103                 Index = btohl(field->u.uint32);
    -00104                 return begin;
    -00105                 
    -00106         case TZFC_OFFSET:
    -00107                 Offset = btohs(field->u.int16);
    -00108                 if (Offset < 0) {
    -00109                         Offset =~ Offset;
    -00110                         Offset++;
    -00111                         OffsetFraction = Offset % 60;
    -00112                         Offset = Offset / 60;
    -00113                         Left = true;
    -00114                 } else {
    -00115                         OffsetFraction = Offset % 60;
    -00116                         Offset = Offset / 60;
    -00117                         Left = false;
    -00118                 }
    -00119                 return begin;
    -00120                 
    -00121         case TZFC_DST:
    -00122                 DSTOffset = btohl(field->u.uint32);
    -00123                 if (DSTOffset) {
    -00124                         UseDST = true;
    -00125                 }
    -00126                 return begin;
    -00127                 
    -00128         case TZFC_STARTMONTH:
    -00129                 StartMonth = btohl(field->u.uint32);
    -00130                 return begin;
    -00131                 
    -00132         case TZFC_ENDMONTH:
    -00133                 EndMonth = btohl(field->u.uint32);
    -00134                 return begin;
    -00135         }
    -00136         
    -00137         // if still not handled, add to the Unknowns list
    -00138         UnknownField uf;
    -00139         uf.type = field->type;
    -00140         uf.data.assign((const char*)field->u.raw, btohs(field->size));
    -00141         Unknowns.push_back(uf);
    -00142 
    -00143         // return new pointer for next field
    -00144         return begin;
    -00145 }
    -00146 
    -00147 void Timezone::ParseHeader(const Data &data, size_t &offset)
    -00148 {
    -00149         // no header in Task records
    -00150 }
    -00151 
    -00152 void Timezone::ParseFields(const Data &data, size_t &offset)
    -00153 {
    -00154         const unsigned char *finish = ParseCommonFields(*this,
    -00155         data.GetData() + offset, data.GetData() + data.GetSize());
    -00156         offset += finish - (data.GetData() + offset);
    -00157 }
    -00158 
    -00159 void Timezone::Clear()
    -00160 {
    -00161         TimeZoneName.clear();
    -00162         
    -00163         Index = 0;
    -00164         Left = false;
    -00165         UseDST = false;
    -00166         Offset = 0;
    -00167         OffsetFraction = 0;
    -00168         DSTOffset = 0;
    -00169         StartMonth = -1;
    -00170         EndMonth = -1;
    -00171 
    -00172         Unknowns.clear();
    -00173 }
    -00174 
    -00175 void Timezone::Dump(std::ostream &os) const
    -00176 {
    -00177         static const char *month[] = {
    -00178                         "Jan", "Feb", "Mar", "Apr", "May",
    -00179                         "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" 
    -00180         };
    -00181         
    -00182         os << "Task entry: 0x" << setbase(16) << RecordId
    -00183            << " (" << (unsigned int)RecType << ")\n";
    -00184 
    -00185         // cycle through the type table
    -00186         for(    const FieldLink<Timezone> *b = TimezoneFieldLinks;
    -00187                 b->type != TZFC_END;
    -00188                 b++ )
    -00189         {
    -00190                 if( b->strMember ) {
    -00191                         const std::string &s = this->*(b->strMember);
    -00192                         if( s.size() )
    -00193                                 os << "       " << b->name << ": " << s << "\n";
    -00194                 }
    -00195         }
    -00196 
    -00197         os << "      Index: 0x" <<setw(2) << Index << "\n";
    -00198         os << "     Offset: " << (Left ? "-" : "+") << setbase(10) << Offset << "." << OffsetFraction << "\n";
    -00199         os << "    Use DST: " << (UseDST ? "true" : "false") << "\n";
    -00200         if (UseDST) {
    -00201                 if ((StartMonth > 0) && (StartMonth < 11))
    -00202                                 os << "Start Month: " << month[StartMonth] << "\n";
    -00203                 else
    -00204                                 os << "Start Month: unknown (" << setbase(10) << StartMonth << ")\n";
    -00205                 if ((EndMonth > 0) && (EndMonth < 11))
    -00206                         os << "  End Month: " << month[EndMonth] << "\n";
    -00207                 else
    -00208                         os << "  End Month: unknown (" << setbase(10) << EndMonth << ")\n";
    -00209         }
    -00210 
    -00211         os << Unknowns;
    -00212         os << "\n\n";
    -00213 }
    -00214 
    -00215 }
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__timezone_8h.html barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8h.html --- barry-0.14/doc/www/doxygen/html/r__timezone_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: r_timezone.h File Reference - - - - - - - -

    r_timezone.h File Reference


    Detailed Description

    -Record parsing class for the timezone database. -

    - -

    -Definition in file r_timezone.h. -

    -#include "dll.h"
    -#include "record.h"
    -#include <vector>
    -#include <string>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::Timezone

    Functions

    -BXEXPORT std::ostream & Barry::operator<< (std::ostream &os, const Timezone &msg)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/r__timezone_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8h-source.html --- barry-0.14/doc/www/doxygen/html/r__timezone_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/r__timezone_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: r_timezone.h Source File - - - - - - - -

    r_timezone.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       r_timezone.h
    -00003 ///             Record parsing class for the timezone database.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008     Copyright (C) 2008, Brian Edginton
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #ifndef __BARRY_RECORD_TIMEZONE_H__
    -00024 #define __BARRY_RECORD_TIMEZONE_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include "record.h"
    -00028 #include <vector>
    -00029 #include <string>
    -00030 #include <stdint.h>
    -00031 
    -00032 namespace Barry
    -00033 {
    -00034 
    -00035 class BXEXPORT Timezone
    -00036 {
    -00037 public:
    -00038         typedef std::vector<UnknownField>                       UnknownsType;
    -00039 
    -00040         uint8_t RecType;
    -00041         uint32_t RecordId;
    -00042 
    -00043         uint8_t TZType;
    -00044         uint32_t DSTOffset;
    -00045         int32_t Index;
    -00046         int32_t Offset;
    -00047         int32_t OffsetFraction;
    -00048         uint32_t StartMonth;
    -00049         uint32_t EndMonth;
    -00050         bool Left;
    -00051         bool UseDST;
    -00052 
    -00053         std::string TimeZoneName;
    -00054 
    -00055         UnknownsType Unknowns;
    -00056         
    -00057 public:
    -00058         
    -00059         Timezone();
    -00060         virtual ~Timezone();
    -00061         
    -00062         const unsigned char* ParseField(const unsigned char *begin,
    -00063                 const unsigned char *end);      
    -00064         void ParseRecurrenceData(const void *data);
    -00065         void BuildRecurrenceData(void *data);
    -00066         uint8_t GetRecType() const { return RecType; }
    -00067         uint32_t GetUniqueId() const { return RecordId; }
    -00068         void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
    -00069         void ParseHeader(const Data &data, size_t &offset);
    -00070         void ParseFields(const Data &data, size_t &offset);
    -00071         void BuildHeader(Data &data, size_t &offset) const;
    -00072 
    -00073         void Clear();
    -00074 
    -00075         void Dump(std::ostream &os) const;
    -00076         bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; }
    -00077 
    -00078         // database name
    -00079         static const char * GetDBName() { return "Time Zones"; }
    -00080         static uint8_t GetDefaultRecType() { return 2; }
    -00081 };
    -00082 
    -00083 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Timezone &msg) {
    -00084         msg.Dump(os);
    -00085         return os;
    -00086 }
    -00087 } // namespace Barry
    -00088 
    -00089 #endif /* __BARRY_RECORD_TIMEZONE_H__*/
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/s11n-boost_8h.html barry-0.0.20110506/doc/www/doxygen/html/s11n-boost_8h.html --- barry-0.14/doc/www/doxygen/html/s11n-boost_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/s11n-boost_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ - - -Barry: s11n-boost.h File Reference - - - - - - - -

    s11n-boost.h File Reference


    Detailed Description

    -Non-intrusive versions of serialization functions for the record classes. -

    -These template functions make it possible to use the record classes with the Boost::Serialization library. -

    -Definition in file s11n-boost.h. -

    -#include "record.h"
    -#include <boost/serialization/vector.hpp>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  boost
    namespace  boost::serialization

    Defines

    -#define BARRY_BASE_S11N_VERSION   0
    -#define BARRY_POD_MAP_VERSION   1000

    Functions

    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::UnknownField &uf, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Contact::GroupLink &g, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Contact &c, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::EmailAddress &a, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Message &m, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Calendar &c, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::ServiceBook &c, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Memo &m, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Task &t, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::PINMessage &p, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::SavedMessage &m, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Folder &f, const unsigned int ver)
    -template<class ArchiveT>
    void boost::serialization::serialize (ArchiveT &ar, Barry::Timezone &t, const unsigned int ver)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/s11n-boost_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/s11n-boost_8h-source.html --- barry-0.14/doc/www/doxygen/html/s11n-boost_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/s11n-boost_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,412 +0,0 @@ - - -Barry: s11n-boost.h Source File - - - - - - - -

    s11n-boost.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       s11n-boost.h
    -00003 ///             Non-intrusive versions of serialization functions for the
    -00004 ///             record classes.  These template functions make it possible
    -00005 ///             to use the record classes with the Boost::Serialization
    -00006 ///             library.
    -00007 ///
    -00008 
    -00009 /*
    -00010     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00011 
    -00012     This program is free software; you can redistribute it and/or modify
    -00013     it under the terms of the GNU General Public License as published by
    -00014     the Free Software Foundation; either version 2 of the License, or
    -00015     (at your option) any later version.
    -00016 
    -00017     This program is distributed in the hope that it will be useful,
    -00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00020 
    -00021     See the GNU General Public License in the COPYING file at the
    -00022     root directory of this project for more details.
    -00023 */
    -00024 
    -00025 #ifndef __BARRY_S11N_BOOST_H__
    -00026 #define __BARRY_S11N_BOOST_H__
    -00027 
    -00028 #include "record.h"
    -00029 #include <boost/serialization/vector.hpp>
    -00030 
    -00031 ///////////////////////////////////////////////////////////////////////////////
    -00032 // special versions
    -00033 //
    -00034 // BARRY_BASE_S11N_VERSION      - the base version where all record data is
    -00035 //                                stored so it can be fully retrieved and
    -00036 //                                uploaded to the handheld device later.
    -00037 // BARRY_POD_MAP_VERSION        - if these templates are called with a version
    -00038 //                                equal or greater than this, only mappable,
    -00039 //                                POD data is included in the serialization
    -00040 //
    -00041 #define BARRY_BASE_S11N_VERSION         0
    -00042 #define BARRY_POD_MAP_VERSION           1000
    -00043 
    -00044 // namespace boost::serialization, for the non-intrusive version
    -00045 namespace boost {
    -00046 namespace serialization {
    -00047 
    -00048 template <class ArchiveT>
    -00049 void serialize(ArchiveT &ar, Barry::UnknownField &uf, const unsigned int ver)
    -00050 {
    -00051         ar & make_nvp("type", uf.type);
    -00052         ar & make_nvp("data", uf.data.raw_data);
    -00053 }
    -00054 
    -00055 template <class ArchiveT>
    -00056 void serialize(ArchiveT &ar, Barry::Contact::GroupLink &g, const unsigned int ver)
    -00057 {
    -00058         ar & make_nvp("Link", g.Link);
    -00059         ar & make_nvp("Unknown", g.Unknown);
    -00060 }
    -00061 
    -00062 template <class ArchiveT>
    -00063 void serialize(ArchiveT &ar, Barry::Contact &c, const unsigned int ver)
    -00064 {
    -00065         ar & make_nvp("RecType", c.RecType);
    -00066         ar & make_nvp("RecordId", c.RecordId);
    -00067 
    -00068         ar & make_nvp("EmailAddresses", c.EmailAddresses);
    -00069         ar & make_nvp("Phone", c.Phone);
    -00070         ar & make_nvp("Fax", c.Fax);
    -00071         ar & make_nvp("WorkPhone", c.WorkPhone);
    -00072         ar & make_nvp("HomePhone", c.HomePhone);
    -00073         ar & make_nvp("MobilePhone", c.MobilePhone);
    -00074         ar & make_nvp("Pager", c.Pager);
    -00075         ar & make_nvp("PIN", c.PIN);
    -00076         ar & make_nvp("Radio", c.Radio);
    -00077         ar & make_nvp("WorkPhone2", c.WorkPhone2);
    -00078         ar & make_nvp("HomePhone2", c.HomePhone2);
    -00079         ar & make_nvp("OtherPhone", c.OtherPhone);
    -00080         ar & make_nvp("FirstName", c.FirstName);
    -00081         ar & make_nvp("LastName", c.LastName);
    -00082         ar & make_nvp("Company", c.Company);
    -00083         ar & make_nvp("DefaultCommunicationsMethod", c.DefaultCommunicationsMethod);
    -00084         ar & make_nvp("Address1", c.WorkAddress.Address1);
    -00085         ar & make_nvp("Address2", c.WorkAddress.Address2);
    -00086         ar & make_nvp("Address3", c.WorkAddress.Address3);
    -00087         ar & make_nvp("City", c.WorkAddress.City);
    -00088         ar & make_nvp("Province", c.WorkAddress.Province);
    -00089         ar & make_nvp("PostalCode", c.WorkAddress.PostalCode);
    -00090         ar & make_nvp("Country", c.WorkAddress.Country);
    -00091         ar & make_nvp("JobTitle", c.JobTitle);
    -00092         ar & make_nvp("PublicKey", c.PublicKey);
    -00093         ar & make_nvp("URL", c.URL);
    -00094         ar & make_nvp("Prefix", c.Prefix);
    -00095         ar & make_nvp("Categories", c.Categories);
    -00096         ar & make_nvp("HomeAddress1", c.HomeAddress.Address1);
    -00097         ar & make_nvp("HomeAddress2", c.HomeAddress.Address2);
    -00098         ar & make_nvp("HomeAddress3", c.HomeAddress.Address3);
    -00099         ar & make_nvp("Notes", c.Notes);
    -00100         ar & make_nvp("UserDefined1", c.UserDefined1);
    -00101         ar & make_nvp("UserDefined2", c.UserDefined2);
    -00102         ar & make_nvp("UserDefined3", c.UserDefined3);
    -00103         ar & make_nvp("UserDefined4", c.UserDefined4);
    -00104         ar & make_nvp("HomeCity", c.HomeAddress.City);
    -00105         ar & make_nvp("HomeProvince", c.HomeAddress.Province);
    -00106         ar & make_nvp("HomePostalCode", c.HomeAddress.PostalCode);
    -00107         ar & make_nvp("HomeCountry", c.HomeAddress.Country);
    -00108         ar & make_nvp("Image", c.Image);
    -00109         
    -00110         if( ver < BARRY_POD_MAP_VERSION ) {
    -00111                 ar & make_nvp("GroupLinks", c.GroupLinks);
    -00112                 ar & make_nvp("Unknowns", c.Unknowns);
    -00113         }
    -00114 }
    -00115 
    -00116 template <class ArchiveT>
    -00117 void serialize(ArchiveT &ar, Barry::EmailAddress &a, const unsigned int ver)
    -00118 {
    -00119         ar & make_nvp("Name", a.Name);
    -00120         ar & make_nvp("Email", a.Email);
    -00121 }
    -00122 
    -00123 template <class ArchiveT>
    -00124 void serialize(ArchiveT &ar, Barry::Message &m, const unsigned int ver)
    -00125 {
    -00126         ar & make_nvp("From", m.From);
    -00127         ar & make_nvp("To", m.To);
    -00128         ar & make_nvp("Cc", m.Cc);
    -00129         ar & make_nvp("Sender", m.Sender);
    -00130         ar & make_nvp("ReplyTo", m.ReplyTo);
    -00131         ar & make_nvp("Subject", m.Subject);
    -00132         ar & make_nvp("Body", m.Body);
    -00133         ar & make_nvp("Attachment", m.Attachment);
    -00134         ar & make_nvp("MessageRecordId", m.MessageRecordId);
    -00135         ar & make_nvp("MessageReplyTo", m.MessageReplyTo);
    -00136         ar & make_nvp("MessageDateSent", m.MessageDateSent);
    -00137         ar & make_nvp("MessageDateReceived", m.MessageDateReceived);
    -00138 
    -00139         ar & make_nvp("MessageTruncated", m.MessageTruncated);
    -00140         ar & make_nvp("MessageRead", m.MessageRead);
    -00141         ar & make_nvp("MessageReply", m.MessageReply);
    -00142         ar & make_nvp("MessageSaved", m.MessageSaved);
    -00143         ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted);
    -00144 
    -00145         ar & make_nvp("MessagePriority", m.MessagePriority);
    -00146         ar & make_nvp("MessageSensitivity", m.MessageSensitivity);
    -00147 
    -00148         if( ver < BARRY_POD_MAP_VERSION ) {
    -00149                 ar & make_nvp("Unknowns", m.Unknowns);
    -00150         }
    -00151 }
    -00152 
    -00153 template <class ArchiveT>
    -00154 void serialize(ArchiveT &ar, Barry::Calendar &c, const unsigned int ver)
    -00155 {
    -00156         ar & make_nvp("RecType", c.RecType);
    -00157         ar & make_nvp("RecordId", c.RecordId);
    -00158 
    -00159         ar & make_nvp("AllDayEvent", c.AllDayEvent);
    -00160 
    -00161         ar & make_nvp("Subject", c.Subject);
    -00162         ar & make_nvp("Notes", c.Notes);
    -00163         ar & make_nvp("Location", c.Location);
    -00164 
    -00165         ar & make_nvp("NotificationTime", c.NotificationTime);
    -00166         ar & make_nvp("StartTime", c.StartTime);
    -00167         ar & make_nvp("EndTime", c.EndTime);
    -00168         
    -00169         ar & make_nvp("FreeBusyFlag", c.FreeBusyFlag);
    -00170         ar & make_nvp("ClassFlag", c.ClassFlag);
    -00171         
    -00172         ar & make_nvp("Recurring", c.Recurring);
    -00173         ar & make_nvp("RecurringType", c.RecurringType);
    -00174         ar & make_nvp("Interval", c.Interval);
    -00175         ar & make_nvp("RecurringEndTime", c.RecurringEndTime);
    -00176         ar & make_nvp("Perpetual", c.Perpetual);
    -00177         ar & make_nvp("TimeZoneCode", c.TimeZoneCode);
    -00178         ar & make_nvp("TimeZoneValid", c.TimeZoneValid);
    -00179 
    -00180         ar & make_nvp("DayOfWeek", c.DayOfWeek);
    -00181         ar & make_nvp("WeekOfMonth", c.WeekOfMonth);
    -00182         ar & make_nvp("DayOfMonth", c.DayOfMonth);
    -00183         ar & make_nvp("MonthOfYear", c.MonthOfYear);
    -00184         ar & make_nvp("WeekDays", c.WeekDays);
    -00185 
    -00186         if( ver < BARRY_POD_MAP_VERSION ) {
    -00187                 ar & make_nvp("Unknowns", c.Unknowns);
    -00188         }
    -00189 }
    -00190 
    -00191 template <class ArchiveT>
    -00192 void serialize(ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned int ver)
    -00193 {
    -00194         ar & make_nvp("Format", c.Format);
    -00195 
    -00196         if( ver < BARRY_POD_MAP_VERSION ) {
    -00197                 ar & make_nvp("Unknowns", c.Unknowns);
    -00198         }
    -00199 }
    -00200 
    -00201 template <class ArchiveT>
    -00202 void serialize(ArchiveT &ar, Barry::ServiceBook &c, const unsigned int ver)
    -00203 {
    -00204         ar & make_nvp("RecType", c.RecType);
    -00205         ar & make_nvp("RecordId", c.RecordId);
    -00206 
    -00207         ar & make_nvp("Name", c.Name);
    -00208         ar & make_nvp("HiddenName", c.HiddenName);
    -00209         ar & make_nvp("Description", c.Description);
    -00210         ar & make_nvp("DSID", c.DSID);
    -00211         ar & make_nvp("BesDomain", c.BesDomain);
    -00212         ar & make_nvp("UniqueId", c.UniqueId);
    -00213         ar & make_nvp("ContentId", c.ContentId);
    -00214         ar & make_nvp("Config", c.Config);
    -00215 
    -00216         if( ver < BARRY_POD_MAP_VERSION ) {
    -00217                 ar & make_nvp("Unknowns", c.Unknowns);
    -00218         }
    -00219 }
    -00220 
    -00221 template <class ArchiveT>
    -00222 void serialize(ArchiveT &ar, Barry::Memo &m, const unsigned int ver)
    -00223 {
    -00224         ar & make_nvp("RecType", m.RecType);
    -00225         ar & make_nvp("RecordId", m.RecordId);
    -00226 
    -00227         ar & make_nvp("MemoType", m.MemoType);
    -00228         ar & make_nvp("Title", m.Title);
    -00229         ar & make_nvp("Body", m.Body);
    -00230         ar & make_nvp("Category", m.Category);
    -00231         
    -00232         if( ver < BARRY_POD_MAP_VERSION ) {
    -00233                 ar & make_nvp( "Unknowns", m.Unknowns);
    -00234         }
    -00235 }
    -00236 
    -00237 template <class ArchiveT>
    -00238 void serialize(ArchiveT &ar, Barry::Task &t, const unsigned int ver)
    -00239 {
    -00240         ar & make_nvp("RecType", t.RecType);
    -00241         ar & make_nvp("RecordId", t.RecordId);
    -00242 
    -00243         ar & make_nvp("TaskType", t.TaskType);
    -00244         ar & make_nvp("Summary", t.Summary);
    -00245         ar & make_nvp("Notes", t.Notes);
    -00246         ar & make_nvp("Categories", t.Categories);
    -00247         ar & make_nvp("UID", t.UID);
    -00248 
    -00249         ar & make_nvp("StartTime", t.StartTime);
    -00250         ar & make_nvp("DueTime", t.DueTime);
    -00251         ar & make_nvp("AlarmTime", t.AlarmTime);
    -00252         
    -00253         ar & make_nvp("TimeZoneCode", t.TimeZoneCode);
    -00254 
    -00255         ar & make_nvp("AlarmType", t.AlarmType);
    -00256         ar & make_nvp("Interval", t.Interval);
    -00257         ar & make_nvp("RecurringType", t.RecurringType);
    -00258         ar & make_nvp("RecurringEndTime", t.RecurringEndTime);
    -00259         ar & make_nvp("DayOfWeek", t.DayOfWeek);
    -00260         ar & make_nvp("WeekOfMonth", t.WeekOfMonth);
    -00261         ar & make_nvp("DayOfMonth", t.DayOfMonth);
    -00262         ar & make_nvp("MonthOfYear", t.MonthOfYear);
    -00263         ar & make_nvp("WeekDays", t.WeekDays);
    -00264 
    -00265         ar & make_nvp("ClassType", t.ClassType);
    -00266         ar & make_nvp("PriorityFlag", t.PriorityFlag);
    -00267         ar & make_nvp("StatusFlag", t.StatusFlag);
    -00268         ar & make_nvp("Recurring", t.Recurring);
    -00269         ar & make_nvp("Perpetual", t.Perpetual);
    -00270         ar & make_nvp("DueDateFlag", t.DueDateFlag);
    -00271 
    -00272         if( ver < BARRY_POD_MAP_VERSION ) {
    -00273                 ar & make_nvp( "Unknowns", t.Unknowns);
    -00274         }
    -00275 }
    -00276 
    -00277 template<class ArchiveT>
    -00278 void serialize(ArchiveT &ar, Barry::PINMessage &p, const unsigned int ver)
    -00279 {
    -00280         ar & make_nvp("RecType", p.RecType);
    -00281         ar & make_nvp("RecordId", p.RecordId);
    -00282 
    -00283         ar & make_nvp("From", p.From);
    -00284         ar & make_nvp("To", p.To);
    -00285         ar & make_nvp("Cc", p.Cc);
    -00286         ar & make_nvp("Bcc", p.Bcc);
    -00287         ar & make_nvp("Subject", p.Subject);
    -00288         ar & make_nvp("Body", p.Body);
    -00289         ar & make_nvp("MessageRecordId", p.MessageRecordId);
    -00290         ar & make_nvp("MessageReplyTo", p.MessageReplyTo);
    -00291         ar & make_nvp("MessageDateSent", p.MessageDateSent);
    -00292         ar & make_nvp("MessageDateReceived", p.MessageDateReceived);
    -00293 
    -00294         ar & make_nvp("MessageTruncated", p.MessageTruncated);
    -00295         ar & make_nvp("MessageRead", p.MessageRead);
    -00296         ar & make_nvp("MessageReply", p.MessageReply);
    -00297         ar & make_nvp("MessageSaved", p.MessageSaved);
    -00298         ar & make_nvp("MessageSavedDeleted", p.MessageSavedDeleted);
    -00299 
    -00300         ar & make_nvp("MessagePriority", p.MessagePriority);
    -00301         ar & make_nvp("MessageSensitivity", p.MessageSensitivity);
    -00302 
    -00303         if(ver < BARRY_POD_MAP_VERSION) {
    -00304                 ar & make_nvp("Unknowns", p.Unknowns);
    -00305         }
    -00306 }
    -00307 
    -00308 template <class ArchiveT>
    -00309 void serialize(ArchiveT &ar, Barry::SavedMessage &m, const unsigned int ver)
    -00310 {
    -00311         ar & make_nvp("RecType", m.RecType);
    -00312         ar & make_nvp("RecordId", m.RecordId);
    -00313 
    -00314         ar & make_nvp("From", m.From);
    -00315         ar & make_nvp("To", m.To);
    -00316         ar & make_nvp("Cc", m.Cc);
    -00317         ar & make_nvp("Bcc", m.Bcc);
    -00318         ar & make_nvp("Sender", m.Sender);
    -00319         ar & make_nvp("ReplyTo", m.ReplyTo);
    -00320         ar & make_nvp("Subject", m.Subject);
    -00321         ar & make_nvp("Body", m.Body);
    -00322         ar & make_nvp("Attachment", m.Attachment);
    -00323         ar & make_nvp("MessageRecordId", m.MessageRecordId);
    -00324         ar & make_nvp("MessageReplyTo", m.MessageReplyTo);
    -00325         ar & make_nvp("MessageDateSent", m.MessageDateSent);
    -00326         ar & make_nvp("MessageDateReceived", m.MessageDateReceived);
    -00327 
    -00328         ar & make_nvp("MessageTruncated", m.MessageTruncated);
    -00329         ar & make_nvp("MessageRead", m.MessageRead);
    -00330         ar & make_nvp("MessageReply", m.MessageReply);
    -00331         ar & make_nvp("MessageSaved", m.MessageSaved);
    -00332         ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted);
    -00333 
    -00334         ar & make_nvp("MessagePriority", m.MessagePriority);
    -00335         ar & make_nvp("MessageSensitivity", m.MessageSensitivity);
    -00336 
    -00337         if( ver < BARRY_POD_MAP_VERSION ) {
    -00338                 ar & make_nvp("Unknowns", m.Unknowns);
    -00339         }
    -00340 }
    -00341 
    -00342 template <class ArchiveT>
    -00343 void serialize(ArchiveT &ar, Barry::Folder &f, const unsigned int ver)
    -00344 {
    -00345         ar & make_nvp("RecType", f.RecType);
    -00346         ar & make_nvp("RecordId", f.RecordId);
    -00347 
    -00348         ar & make_nvp("FolderName", f.FolderName);
    -00349         ar & make_nvp("FolderNumber", f.FolderNumber);
    -00350         ar & make_nvp("FolderLevel", f.FolderLevel);
    -00351         ar & make_nvp("FolderType", f.FolderType);
    -00352 
    -00353         if( ver < BARRY_POD_MAP_VERSION ) {
    -00354                 ar & make_nvp( "Unknowns", f.Unknowns);
    -00355         }
    -00356 }
    -00357 
    -00358 template <class ArchiveT>
    -00359 void serialize(ArchiveT &ar, Barry::Timezone &t, const unsigned int ver)
    -00360 {
    -00361         ar & make_nvp("RecType", t.RecType);
    -00362         ar & make_nvp("RecordId", t.RecordId);
    -00363 
    -00364         ar & make_nvp("TZType", t.TZType);
    -00365         ar & make_nvp("DSTOffset", t.DSTOffset);
    -00366         ar & make_nvp("Index", t.Index);
    -00367         ar & make_nvp("Offset", t.Offset);
    -00368         ar & make_nvp("OffsetFraction", t.OffsetFraction);
    -00369         ar & make_nvp("StartMonth", t.StartMonth);
    -00370         ar & make_nvp("EndMonth", t.EndMonth);
    -00371         ar & make_nvp("Left", t.Left);
    -00372         ar & make_nvp("UseDST", t.UseDST);
    -00373 
    -00374         ar & make_nvp("TimeZoneName", t.TimeZoneName);
    -00375 
    -00376         if( ver < BARRY_POD_MAP_VERSION ) {
    -00377                 ar & make_nvp("Unknowns", t.Unknowns);
    -00378         }
    -00379 }
    -00380 
    -00381 }} // namespace boost::serialization
    -00382 
    -00383 #endif
    -00384 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/scoped__lock_8h.html barry-0.0.20110506/doc/www/doxygen/html/scoped__lock_8h.html --- barry-0.14/doc/www/doxygen/html/scoped__lock_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/scoped__lock_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: scoped_lock.h File Reference - - - - - - - -

    scoped_lock.h File Reference


    Detailed Description

    -Simple scope class for dealing with pthread mutex locking. -

    - -

    -Definition in file scoped_lock.h. -

    -#include <pthread.h>
    - -

    -Go to the source code of this file. - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    class  Barry::scoped_lock
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/scoped__lock_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/scoped__lock_8h-source.html --- barry-0.14/doc/www/doxygen/html/scoped__lock_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/scoped__lock_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ - - -Barry: scoped_lock.h Source File - - - - - - - -

    scoped_lock.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       scoped_lock.h
    -00003 ///             Simple scope class for dealing with pthread mutex locking.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_SCOPED_LOCK_H__
    -00023 #define __BARRY_SCOPED_LOCK_H__
    -00024 
    -00025 #include <pthread.h>
    -00026 
    -00027 namespace Barry {
    -00028 
    -00029 class scoped_lock
    -00030 {
    -00031         pthread_mutex_t *m_mutex;
    -00032 
    -00033 public:
    -00034         scoped_lock(pthread_mutex_t &mutex)
    -00035                 : m_mutex(&mutex)
    -00036         {
    -00037                 while( pthread_mutex_lock(m_mutex) != 0 )
    -00038                         ;
    -00039         }
    -00040 
    -00041         ~scoped_lock()
    -00042         {
    -00043                 unlock();
    -00044         }
    -00045 
    -00046         void unlock()
    -00047         {
    -00048                 if( m_mutex ) {
    -00049                         pthread_mutex_unlock(m_mutex);
    -00050                         m_mutex = 0;
    -00051                 }
    -00052         }
    -00053 };
    -00054 
    -00055 } // namespace Barry
    -00056 
    -00057 #endif
    -00058 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/sha1_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/sha1_8cc-source.html --- barry-0.14/doc/www/doxygen/html/sha1_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/sha1_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ - - -Barry: sha1.cc Source File - - - - - - - -

    sha1.cc

    00001 /* 
    -00002  * The contents of this file are subject to the Mozilla Public
    -00003  * License Version 1.1 (the "License"); you may not use this file
    -00004  * except in compliance with the License. You may obtain a copy of
    -00005  * the License at http://www.mozilla.org/MPL/
    -00006  * 
    -00007  * Software distributed under the License is distributed on an "AS
    -00008  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    -00009  * implied. See the License for the specific language governing
    -00010  * rights and limitations under the License.
    -00011  * 
    -00012  * The Original Code is SHA 180-1 Reference Implementation (Compact version)
    -00013  * 
    -00014  * The Initial Developer of the Original Code is Paul Kocher of
    -00015  * Cryptography Research.  Portions created by Paul Kocher are 
    -00016  * Copyright (C) 1995-9 by Cryptography Research, Inc.  All
    -00017  * Rights Reserved.
    -00018  * 
    -00019  * Contributor(s):
    -00020  *
    -00021  *     Paul Kocher
    -00022  * 
    -00023  * Alternatively, the contents of this file may be used under the
    -00024  * terms of the GNU General Public License Version 2 or later (the
    -00025  * "GPL"), in which case the provisions of the GPL are applicable 
    -00026  * instead of those above.  If you wish to allow use of your 
    -00027  * version of this file only under the terms of the GPL and not to
    -00028  * allow others to use your version of this file under the MPL,
    -00029  * indicate your decision by deleting the provisions above and
    -00030  * replace them with the notice and other provisions required by
    -00031  * the GPL.  If you do not delete the provisions above, a recipient
    -00032  * may use your version of this file under either the MPL or the
    -00033  * GPL.
    -00034  */
    -00035 
    -00036 /*
    -00037 Copied from the git sources, with the following revision history:
    -00038 
    -00039 commit 77ab8798d3f8df39877235be17bb6e70077aaba2
    -00040 Author: Junio C Hamano <junkio@cox.net>
    -00041 Date:   Tue Nov 1 10:56:03 2005 -0800
    -00042 
    -00043     Fix constness of input in mozilla-sha1/sha1.c::SHA1_Update().
    -00044 
    -00045     Among the three of our own implementations, only this one lacked
    -00046     "const" from the second argument.
    -00047 
    -00048     Signed-off-by: Junio C Hamano <junkio@cox.net>
    -00049 
    -00050 commit cef661fc799a3a13ffdea4a3f69f1acd295de53d
    -00051 Author: Linus Torvalds <torvalds@ppc970.osdl.org>
    -00052 Date:   Thu Apr 21 12:33:22 2005 -0700
    -00053 
    -00054     Add support for alternate SHA1 library implementations.
    -00055 
    -00056     This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig.
    -00057     It's dual-licenced under MPL-1.1 or GPL, so in the context of git, we
    -00058     obviously use the GPL version.
    -00059 
    -00060     Side note: the Mozilla SHA1 implementation is about twice as fast as the
    -00061     default openssl one on my G5, but the default openssl one has optimized
    -00062     x86 assembly language on x86. So choose wisely.
    -00063 
    -00064 */
    -00065 
    -00066 #include "sha1.h"
    -00067 
    -00068 namespace Barry {
    -00069 
    -00070 static void shaHashBlock(SHA_CTX *ctx);
    -00071 
    -00072 void SHA1(const void *dataIn, int len, unsigned char *hashout)
    -00073 {
    -00074         SHA_CTX ctx;
    -00075         SHA1_Init(&ctx);
    -00076         SHA1_Update(&ctx, dataIn, len);
    -00077         SHA1_Final(hashout, &ctx);
    -00078 }
    -00079 
    -00080 void SHA1_Init(SHA_CTX *ctx) {
    -00081   int i;
    -00082 
    -00083   ctx->lenW = 0;
    -00084   ctx->sizeHi = ctx->sizeLo = 0;
    -00085 
    -00086   /* Initialize H with the magic constants (see FIPS180 for constants)
    -00087    */
    -00088   ctx->H[0] = 0x67452301;
    -00089   ctx->H[1] = 0xefcdab89;
    -00090   ctx->H[2] = 0x98badcfe;
    -00091   ctx->H[3] = 0x10325476;
    -00092   ctx->H[4] = 0xc3d2e1f0;
    -00093 
    -00094   for (i = 0; i < 80; i++)
    -00095     ctx->W[i] = 0;
    -00096 }
    -00097 
    -00098 
    -00099 void SHA1_Update(SHA_CTX *ctx, const void *_dataIn, int len) {
    -00100   const unsigned char *dataIn = (const unsigned char *) _dataIn;
    -00101   int i;
    -00102 
    -00103   /* Read the data into W and process blocks as they get full
    -00104    */
    -00105   for (i = 0; i < len; i++) {
    -00106     ctx->W[ctx->lenW / 4] <<= 8;
    -00107     ctx->W[ctx->lenW / 4] |= (unsigned int)dataIn[i];
    -00108     if ((++ctx->lenW) % 64 == 0) {
    -00109       shaHashBlock(ctx);
    -00110       ctx->lenW = 0;
    -00111     }
    -00112     ctx->sizeLo += 8;
    -00113     ctx->sizeHi += (ctx->sizeLo < 8);
    -00114   }
    -00115 }
    -00116 
    -00117 
    -00118 void SHA1_Final(unsigned char hashout[20], SHA_CTX *ctx) {
    -00119   unsigned char pad0x80 = 0x80;
    -00120   unsigned char pad0x00 = 0x00;
    -00121   unsigned char padlen[8];
    -00122   int i;
    -00123 
    -00124   /* Pad with a binary 1 (e.g. 0x80), then zeroes, then length
    -00125    */
    -00126   padlen[0] = (unsigned char)((ctx->sizeHi >> 24) & 255);
    -00127   padlen[1] = (unsigned char)((ctx->sizeHi >> 16) & 255);
    -00128   padlen[2] = (unsigned char)((ctx->sizeHi >> 8) & 255);
    -00129   padlen[3] = (unsigned char)((ctx->sizeHi >> 0) & 255);
    -00130   padlen[4] = (unsigned char)((ctx->sizeLo >> 24) & 255);
    -00131   padlen[5] = (unsigned char)((ctx->sizeLo >> 16) & 255);
    -00132   padlen[6] = (unsigned char)((ctx->sizeLo >> 8) & 255);
    -00133   padlen[7] = (unsigned char)((ctx->sizeLo >> 0) & 255);
    -00134   SHA1_Update(ctx, &pad0x80, 1);
    -00135   while (ctx->lenW != 56)
    -00136     SHA1_Update(ctx, &pad0x00, 1);
    -00137   SHA1_Update(ctx, padlen, 8);
    -00138 
    -00139   /* Output hash
    -00140    */
    -00141   for (i = 0; i < 20; i++) {
    -00142     hashout[i] = (unsigned char)(ctx->H[i / 4] >> 24);
    -00143     ctx->H[i / 4] <<= 8;
    -00144   }
    -00145 
    -00146   /*
    -00147    *  Re-initialize the context (also zeroizes contents)
    -00148    */
    -00149   SHA1_Init(ctx);
    -00150 }
    -00151 
    -00152 
    -00153 #define SHA_ROT(X,n) (((X) << (n)) | ((X) >> (32-(n))))
    -00154 
    -00155 static void shaHashBlock(SHA_CTX *ctx) {
    -00156   int t;
    -00157   unsigned int A,B,C,D,E,TEMP;
    -00158 
    -00159   for (t = 16; t <= 79; t++)
    -00160     ctx->W[t] =
    -00161       SHA_ROT(ctx->W[t-3] ^ ctx->W[t-8] ^ ctx->W[t-14] ^ ctx->W[t-16], 1);
    -00162 
    -00163   A = ctx->H[0];
    -00164   B = ctx->H[1];
    -00165   C = ctx->H[2];
    -00166   D = ctx->H[3];
    -00167   E = ctx->H[4];
    -00168 
    -00169   for (t = 0; t <= 19; t++) {
    -00170     TEMP = SHA_ROT(A,5) + (((C^D)&B)^D)     + E + ctx->W[t] + 0x5a827999;
    -00171     E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
    -00172   }
    -00173   for (t = 20; t <= 39; t++) {
    -00174     TEMP = SHA_ROT(A,5) + (B^C^D)           + E + ctx->W[t] + 0x6ed9eba1;
    -00175     E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
    -00176   }
    -00177   for (t = 40; t <= 59; t++) {
    -00178     TEMP = SHA_ROT(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdc;
    -00179     E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
    -00180   }
    -00181   for (t = 60; t <= 79; t++) {
    -00182     TEMP = SHA_ROT(A,5) + (B^C^D)           + E + ctx->W[t] + 0xca62c1d6;
    -00183     E = D; D = C; C = SHA_ROT(B, 30); B = A; A = TEMP;
    -00184   }
    -00185 
    -00186   ctx->H[0] += A;
    -00187   ctx->H[1] += B;
    -00188   ctx->H[2] += C;
    -00189   ctx->H[3] += D;
    -00190   ctx->H[4] += E;
    -00191 }
    -00192 
    -00193 }
    -00194 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/sha1_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/sha1_8h-source.html --- barry-0.14/doc/www/doxygen/html/sha1_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/sha1_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ - - -Barry: sha1.h Source File - - - - - - - -

    sha1.h

    00001 /* 
    -00002  * The contents of this file are subject to the Mozilla Public
    -00003  * License Version 1.1 (the "License"); you may not use this file
    -00004  * except in compliance with the License. You may obtain a copy of
    -00005  * the License at http://www.mozilla.org/MPL/
    -00006  * 
    -00007  * Software distributed under the License is distributed on an "AS
    -00008  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    -00009  * implied. See the License for the specific language governing
    -00010  * rights and limitations under the License.
    -00011  * 
    -00012  * The Original Code is SHA 180-1 Header File
    -00013  * 
    -00014  * The Initial Developer of the Original Code is Paul Kocher of
    -00015  * Cryptography Research.  Portions created by Paul Kocher are 
    -00016  * Copyright (C) 1995-9 by Cryptography Research, Inc.  All
    -00017  * Rights Reserved.
    -00018  * 
    -00019  * Contributor(s):
    -00020  *
    -00021  *     Paul Kocher
    -00022  * 
    -00023  * Alternatively, the contents of this file may be used under the
    -00024  * terms of the GNU General Public License Version 2 or later (the
    -00025  * "GPL"), in which case the provisions of the GPL are applicable 
    -00026  * instead of those above.  If you wish to allow use of your 
    -00027  * version of this file only under the terms of the GPL and not to
    -00028  * allow others to use your version of this file under the MPL,
    -00029  * indicate your decision by deleting the provisions above and
    -00030  * replace them with the notice and other provisions required by
    -00031  * the GPL.  If you do not delete the provisions above, a recipient
    -00032  * may use your version of this file under either the MPL or the
    -00033  * GPL.
    -00034  */
    -00035 
    -00036 /*
    -00037 Copied from the git sources, with the following revision history:
    -00038 commit 77ab8798d3f8df39877235be17bb6e70077aaba2
    -00039 Author: Junio C Hamano <junkio@cox.net>
    -00040 Date:   Tue Nov 1 10:56:03 2005 -0800
    -00041 
    -00042     Fix constness of input in mozilla-sha1/sha1.c::SHA1_Update().
    -00043 
    -00044     Among the three of our own implementations, only this one lacked
    -00045     "const" from the second argument.
    -00046 
    -00047     Signed-off-by: Junio C Hamano <junkio@cox.net>
    -00048 
    -00049 commit cef661fc799a3a13ffdea4a3f69f1acd295de53d
    -00050 Author: Linus Torvalds <torvalds@ppc970.osdl.org>
    -00051 Date:   Thu Apr 21 12:33:22 2005 -0700
    -00052 
    -00053     Add support for alternate SHA1 library implementations.
    -00054 
    -00055     This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig.
    -00056     It's dual-licenced under MPL-1.1 or GPL, so in the context of git, we
    -00057     obviously use the GPL version.
    -00058 
    -00059     Side note: the Mozilla SHA1 implementation is about twice as fast as the
    -00060     default openssl one on my G5, but the default openssl one has optimized
    -00061     x86 assembly language on x86. So choose wisely.
    -00062 
    -00063 */
    -00064 
    -00065 #ifndef __BARRY_SHA1_H__
    -00066 #define __BARRY_SHA1_H__
    -00067 
    -00068 #include "dll.h"
    -00069 
    -00070 #define SHA_DIGEST_LENGTH 20
    -00071 
    -00072 namespace Barry {
    -00073 
    -00074 struct BXEXPORT SHA_CTX {
    -00075   unsigned int H[5];
    -00076   unsigned int W[80];
    -00077   int lenW;
    -00078   unsigned int sizeHi,sizeLo;
    -00079 };
    -00080 
    -00081 BXEXPORT void SHA1(const void *dataIn, int len, unsigned char *hashout);
    -00082 BXEXPORT void SHA1_Init(SHA_CTX *ctx);
    -00083 BXEXPORT void SHA1_Update(SHA_CTX *ctx, const void *dataIn, int len);
    -00084 BXEXPORT void SHA1_Final(unsigned char hashout[20], SHA_CTX *ctx);
    -00085 
    -00086 }
    -00087 
    -00088 #endif
    -00089 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/socket_8cc.html barry-0.0.20110506/doc/www/doxygen/html/socket_8cc.html --- barry-0.14/doc/www/doxygen/html/socket_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/socket_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: socket.cc File Reference - - - - - - - -

    socket.cc File Reference


    Detailed Description

    -Class wrapper to encapsulate the Blackberry USB logical socket. -

    - -

    -Definition in file socket.cc. -

    -#include "socket.h"
    -#include "usbwrap.h"
    -#include "data.h"
    -#include "protocol.h"
    -#include "protostructs.h"
    -#include "endian.h"
    -#include "debug.h"
    -#include "packet.h"
    -#include "sha1.h"
    -#include <sstream>
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Barry
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/socket_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/socket_8cc-source.html --- barry-0.14/doc/www/doxygen/html/socket_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/socket_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,882 +0,0 @@ - - -Barry: socket.cc Source File - - - - - - - -

    socket.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       socket.cc
    -00003 ///             Class wrapper to encapsulate the Blackberry USB logical socket
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "socket.h"
    -00023 #include "usbwrap.h"
    -00024 #include "data.h"
    -00025 #include "protocol.h"
    -00026 #include "protostructs.h"
    -00027 #include "endian.h"
    -00028 #include "debug.h"
    -00029 #include "packet.h"
    -00030 #include "sha1.h"
    -00031 #include <sstream>
    -00032 #include <string.h>
    -00033 
    -00034 using namespace Usb;
    -00035 
    -00036 
    -00037 namespace Barry {
    -00038 
    -00039 
    -00040 //////////////////////////////////////////////////////////////////////////////
    -00041 // SocketZero class
    -00042 
    -00043 SocketZero::SocketZero( SocketRoutingQueue &queue,
    -00044                         int writeEndpoint,
    -00045                         uint8_t zeroSocketSequenceStart)
    -00046         : m_dev(0),
    -00047         m_queue(&queue),
    -00048         m_writeEp(writeEndpoint),
    -00049         m_readEp(0),
    -00050         m_zeroSocketSequence(zeroSocketSequenceStart),
    -00051         m_sequenceId(0),
    -00052         m_halfOpen(false),
    -00053         m_challengeSeed(0),
    -00054         m_remainingTries(0)
    -00055 {
    -00056 }
    -00057 
    -00058 SocketZero::SocketZero( Device &dev,
    -00059                         int writeEndpoint, int readEndpoint,
    -00060                         uint8_t zeroSocketSequenceStart)
    -00061         : m_dev(&dev),
    -00062         m_queue(0),
    -00063         m_writeEp(writeEndpoint),
    -00064         m_readEp(readEndpoint),
    -00065         m_zeroSocketSequence(zeroSocketSequenceStart),
    -00066         m_sequenceId(0),
    -00067         m_halfOpen(false),
    -00068         m_challengeSeed(0),
    -00069         m_remainingTries(0)
    -00070 {
    -00071 }
    -00072 
    -00073 SocketZero::~SocketZero()
    -00074 {
    -00075         // nothing to close for socket zero
    -00076 }
    -00077 
    -00078 
    -00079 ///////////////////////////////////////
    -00080 // Socket Zero static calls
    -00081 
    -00082 // appends fragment to whole... if whole is empty, simply copies, and
    -00083 // sets command to DATA instead of FRAGMENTED.  Always updates the
    -00084 // packet size of whole, to reflect the total size
    -00085 void SocketZero::AppendFragment(Data &whole, const Data &fragment)
    -00086 {
    -00087         if( whole.GetSize() == 0 ) {
    -00088                 // empty, so just copy
    -00089                 whole = fragment;
    -00090         }
    -00091         else {
    -00092                 // has some data already, so just append
    -00093                 int size = whole.GetSize();
    -00094                 unsigned char *buf = whole.GetBuffer(size + fragment.GetSize());
    -00095                 MAKE_PACKET(fpack, fragment);
    -00096                 int fragsize = fragment.GetSize() - SB_FRAG_HEADER_SIZE;
    -00097 
    -00098                 memcpy(buf+size, &fpack->u.db.u.fragment, fragsize);
    -00099                 whole.ReleaseBuffer(size + fragsize);
    -00100         }
    -00101 
    -00102         // update whole's size and command type for future sanity
    -00103         Barry::Protocol::Packet *wpack = (Barry::Protocol::Packet *) whole.GetBuffer();
    -00104         wpack->size = htobs((uint16_t) whole.GetSize());
    -00105         wpack->command = SB_COMMAND_DB_DATA;
    -00106         // don't need to call ReleaseBuffer here, since we're not changing
    -00107         // the real data size, and ReleaseBuffer was called above during copy
    -00108 }
    -00109 
    -00110 // If offset is 0, starts fresh, taking the first fragment packet size chunk
    -00111 // out of whole and creating a sendable packet in fragment.  Returns the
    -00112 // next offset if there is still more data, or 0 if finished.
    -00113 unsigned int SocketZero::MakeNextFragment(const Data &whole, Data &fragment, unsigned int offset)
    -00114 {
    -00115         // sanity check
    -00116         if( whole.GetSize() < SB_FRAG_HEADER_SIZE ) {
    -00117                 eout("Whole packet too short to fragment: " << whole.GetSize());
    -00118                 throw Error("Socket: Whole packet too short to fragment");
    -00119         }
    -00120 
    -00121         // calculate size
    -00122         unsigned int todo = whole.GetSize() - SB_FRAG_HEADER_SIZE - offset;
    -00123         unsigned int nextOffset = 0;
    -00124         if( todo > (MAX_PACKET_SIZE - SB_FRAG_HEADER_SIZE) ) {
    -00125                 todo = MAX_PACKET_SIZE - SB_FRAG_HEADER_SIZE;
    -00126                 nextOffset = offset + todo;
    -00127         }
    -00128 
    -00129         // create fragment header
    -00130         unsigned char *buf = fragment.GetBuffer(SB_FRAG_HEADER_SIZE + todo);
    -00131         memcpy(buf, whole.GetData(), SB_FRAG_HEADER_SIZE);
    -00132 
    -00133         // copy over a fragment size of data
    -00134         memcpy(buf + SB_FRAG_HEADER_SIZE, whole.GetData() + SB_FRAG_HEADER_SIZE + offset, todo);
    -00135 
    -00136         // update fragment's size and command type
    -00137         Barry::Protocol::Packet *wpack = (Barry::Protocol::Packet *) buf;
    -00138         wpack->size = htobs((uint16_t) (todo + SB_FRAG_HEADER_SIZE));
    -00139         if( nextOffset )
    -00140                 wpack->command = SB_COMMAND_DB_FRAGMENTED;
    -00141         else
    -00142                 wpack->command = SB_COMMAND_DB_DATA;
    -00143 
    -00144         // adjust the new fragment size
    -00145         fragment.ReleaseBuffer(SB_FRAG_HEADER_SIZE + todo);
    -00146 
    -00147         // return next round
    -00148         return nextOffset;
    -00149 }
    -00150 
    -00151 
    -00152 ///////////////////////////////////////
    -00153 // SocketZero private API
    -00154 
    -00155 //
    -00156 // FIXME - not sure yet whether sequence ID's are per socket or not... if
    -00157 // they are per socket, then this global sequence behaviour will not work,
    -00158 // and we need to track m_sequenceId on a Socket level.
    -00159 //
    -00160 void SocketZero::CheckSequence(uint16_t socket, const Data &seq)
    -00161 {
    -00162         MAKE_PACKET(spack, seq);
    -00163         if( (unsigned int) seq.GetSize() < SB_SEQUENCE_PACKET_SIZE ) {
    -00164                 eout("Short sequence packet:\n" << seq);
    -00165                 throw Error("Socket: invalid sequence packet");
    -00166         }
    -00167 
    -00168         // we'll cheat here... if the packet's sequence is 0, we'll
    -00169         // silently restart, otherwise, fail
    -00170         uint32_t sequenceId = btohl(spack->u.sequence.sequenceId);
    -00171         if( sequenceId == 0 ) {
    -00172                 // silently restart (will advance below)
    -00173                 m_sequenceId = 0;
    -00174         }
    -00175         else {
    -00176                 if( sequenceId != m_sequenceId ) {
    -00177                         if( socket != 0 ) {
    -00178                                 std::ostringstream oss;
    -00179                                 oss << "Socket 0x" << std::hex << (unsigned int)socket
    -00180                                         << ": out of sequence. "
    -00181                                         << "(Global sequence: " << m_sequenceId
    -00182                                         << ". Packet sequence: " << sequenceId
    -00183                                         << ")";
    -00184                                 eout(oss.str());
    -00185                                 throw Error(oss.str());
    -00186                         }
    -00187                         else {
    -00188                                 dout("Bad sequence on socket 0: expected: "
    -00189                                         << msequenceId
    -00190                                         << ". Packet sequence: " << sequenceId);
    -00191                         }
    -00192                 }
    -00193         }
    -00194 
    -00195         // advance!
    -00196         m_sequenceId++;
    -00197 }
    -00198 
    -00199 void SocketZero::SendOpen(uint16_t socket, Data &receive)
    -00200 {
    -00201         // build open command
    -00202         Barry::Protocol::Packet packet;
    -00203         packet.socket = 0;
    -00204         packet.size = htobs(SB_SOCKET_PACKET_HEADER_SIZE);
    -00205         packet.command = SB_COMMAND_OPEN_SOCKET;
    -00206         packet.u.socket.socket = htobs(socket);
    -00207         packet.u.socket.sequence = m_zeroSocketSequence;// overwritten by Send()
    -00208 
    -00209         Data send(&packet, SB_SOCKET_PACKET_HEADER_SIZE);
    -00210         try {
    -00211                 RawSend(send);
    -00212                 RawReceive(receive);
    -00213         } catch( Usb::Error & ) {
    -00214                 eeout(send, receive);
    -00215                 throw;
    -00216         }
    -00217 
    -00218         // check sequence ID
    -00219         Protocol::CheckSize(receive);
    -00220         if( IS_COMMAND(receive, SB_COMMAND_SEQUENCE_HANDSHAKE) ) {
    -00221                 CheckSequence(0, receive);
    -00222 
    -00223                 // still need our ACK
    -00224                 RawReceive(receive);
    -00225         }
    -00226 
    -00227         // receive now holds the Open response
    -00228 }
    -00229 
    -00230 // SHA1 hashing logic based on Rick Scott's XmBlackBerry's send_password()
    -00231 void SocketZero::SendPasswordHash(uint16_t socket, const char *password, Data &receive)
    -00232 {
    -00233         unsigned char pwdigest[SHA_DIGEST_LENGTH];
    -00234         unsigned char prefixedhash[SHA_DIGEST_LENGTH + 4];
    -00235 
    -00236         // first, hash the password by itself
    -00237         SHA1((unsigned char *) password, strlen(password), pwdigest);
    -00238 
    -00239         // prefix the resulting hash with the provided seed
    -00240         uint32_t seed = htobl(m_challengeSeed);
    -00241         memcpy(&prefixedhash[0], &seed, sizeof(uint32_t));
    -00242         memcpy(&prefixedhash[4], pwdigest, SHA_DIGEST_LENGTH);
    -00243 
    -00244         // hash again
    -00245         SHA1((unsigned char *) prefixedhash, SHA_DIGEST_LENGTH + 4, pwdigest);
    -00246 
    -00247 
    -00248         size_t size = SB_SOCKET_PACKET_HEADER_SIZE + PASSWORD_CHALLENGE_SIZE;
    -00249 
    -00250         // build open command
    -00251         Barry::Protocol::Packet packet;
    -00252         packet.socket = 0;
    -00253         packet.size = htobs(size);
    -00254         packet.command = SB_COMMAND_PASSWORD;
    -00255         packet.u.socket.socket = htobs(socket);
    -00256         packet.u.socket.sequence = m_zeroSocketSequence;// overwritten by Send()
    -00257         packet.u.socket.u.password.remaining_tries = 0;
    -00258         packet.u.socket.u.password.unknown = 0;
    -00259         packet.u.socket.u.password.param = htobs(0x14); // FIXME - what does this mean?
    -00260         memcpy(packet.u.socket.u.password.u.hash, pwdigest,
    -00261                 sizeof(packet.u.socket.u.password.u.hash));
    -00262 
    -00263         // blank password hashes as we don't need these anymore
    -00264         memset(pwdigest, 0, sizeof(pwdigest));
    -00265         memset(prefixedhash, 0, sizeof(prefixedhash));
    -00266 
    -00267         Data send(&packet, size);
    -00268         RawSend(send);
    -00269         RawReceive(receive);
    -00270 
    -00271         // blank password hash as we don't need this anymore either
    -00272         memset(packet.u.socket.u.password.u.hash, 0,
    -00273                 sizeof(packet.u.socket.u.password.u.hash));
    -00274         send.Zap();
    -00275 
    -00276         // check sequence ID
    -00277         Protocol::CheckSize(receive);
    -00278         if( IS_COMMAND(receive, SB_COMMAND_SEQUENCE_HANDSHAKE) ) {
    -00279                 CheckSequence(0, receive);
    -00280 
    -00281                 // still need our ACK
    -00282                 RawReceive(receive);
    -00283         }
    -00284 
    -00285         // receive now holds the Password response
    -00286 }
    -00287 
    -00288 void SocketZero::RawSend(Data &send, int timeout)
    -00289 {
    -00290         Usb::Device *dev = m_queue ? m_queue->GetUsbDevice() : m_dev;
    -00291 
    -00292         // Special case: it seems that sending packets with a size that's an
    -00293         // exact multiple of 0x40 causes the device to get confused.
    -00294         //
    -00295         // To get around that, it is observed in the captures that the size
    -00296         // is sent in a special 3 byte packet before the real packet.
    -00297         // Check for this case here.
    -00298         //
    -00299         if( (send.GetSize() % 0x40) == 0 ) {
    -00300                 Protocol::SizePacket packet;
    -00301                 packet.size = htobs(send.GetSize());
    -00302                 packet.buffer[2] = 0;           // zero the top byte
    -00303                 Data sizeCommand(&packet, 3);
    -00304 
    -00305                 dev->BulkWrite(m_writeEp, sizeCommand);
    -00306         }
    -00307 
    -00308         dev->BulkWrite(m_writeEp, send);
    -00309 }
    -00310 
    -00311 void SocketZero::RawReceive(Data &receive, int timeout)
    -00312 {
    -00313         do {
    -00314                 if( m_queue ) {
    -00315                         if( !m_queue->DefaultRead(receive, timeout) )
    -00316                                 throw Timeout("SocketZero::RawReceive: queue DefaultRead returned false (likely a timeout)");
    -00317                 }
    -00318                 else {
    -00319                         m_dev->BulkRead(m_readEp, receive, timeout);
    -00320                 }
    -00321                 ddout("SocketZero::RawReceive: Endpoint " << m_readEp
    -00322                         << "\nReceived:\n" << receive);
    -00323         } while( SequencePacket(receive) );
    -00324 }
    -00325 
    -00326 //
    -00327 // SequencePacket
    -00328 //
    -00329 /// Returns true if this is a sequence packet that should be ignored.
    -00330 /// This function is used in SocketZero::RawReceive() in order
    -00331 /// to determine whether to keep reading or not.  By default,
    -00332 /// this function checks whether the packet is a sequence packet
    -00333 /// or not, and returns true if so.  Also, if it is a sequence
    -00334 /// packet, it checks the validity of the sequence number.
    -00335 ///
    -00336 /// If sequence packets become important in the future, this
    -00337 /// function could be changed to call a user-defined callback,
    -00338 /// in order to handle these things out of band.
    -00339 ///
    -00340 bool SocketZero::SequencePacket(const Data &data)
    -00341 {
    -00342         if( data.GetSize() >= MIN_PACKET_SIZE ) {
    -00343                 if( IS_COMMAND(data, SB_COMMAND_SEQUENCE_HANDSHAKE) ) {
    -00344                         CheckSequence(0, data);
    -00345                         return true;
    -00346                 }
    -00347         }
    -00348         return false;   // not a sequence packet
    -00349 }
    -00350 
    -00351 
    -00352 ///////////////////////////////////////
    -00353 // SocketZero public API
    -00354 
    -00355 void SocketZero::SetRoutingQueue(SocketRoutingQueue &queue)
    -00356 {
    -00357         // replace the current queue pointer
    -00358         m_queue = &queue;
    -00359 }
    -00360 
    -00361 void SocketZero::UnlinkRoutingQueue()
    -00362 {
    -00363         m_queue = 0;
    -00364 }
    -00365 
    -00366 void SocketZero::Send(Data &send, int timeout)
    -00367 {
    -00368         // force the socket number to 0
    -00369         if( send.GetSize() >= SB_SOCKET_PACKET_HEADER_SIZE ) {
    -00370                 MAKE_PACKETPTR_BUF(spack, send.GetBuffer());
    -00371                 spack->socket = 0;
    -00372         }
    -00373 
    -00374         // This is a socket 0 packet, so force the send packet data's
    -00375         // socket 0 sequence number to something correct.
    -00376         if( send.GetSize() >= SB_SOCKET_PACKET_HEADER_SIZE ) {
    -00377                 MAKE_PACKETPTR_BUF(spack, send.GetBuffer());
    -00378                 spack->u.socket.sequence = m_zeroSocketSequence;
    -00379                 m_zeroSocketSequence++;
    -00380         }
    -00381 
    -00382         RawSend(send, timeout);
    -00383 }
    -00384 
    -00385 void SocketZero::Send(Data &send, Data &receive, int timeout)
    -00386 {
    -00387         Send(send, timeout);
    -00388         RawReceive(receive, timeout);
    -00389 }
    -00390 
    -00391 void SocketZero::Send(Barry::Packet &packet, int timeout)
    -00392 {
    -00393         Send(packet.m_send, packet.m_receive, timeout);
    -00394 }
    -00395 
    -00396 
    -00397 //
    -00398 // Open
    -00399 //
    -00400 /// Open a logical socket on the device.
    -00401 ///
    -00402 /// Both the socket number and the flag are based on the response to the
    -00403 /// SELECT_MODE command.  See Controller::SelectMode() for more info
    -00404 /// on this.
    -00405 ///
    -00406 /// The packet sequence is normal for most socket operations.
    -00407 ///
    -00408 ///     - Down: command packet with OPEN_SOCKET
    -00409 ///     - Up: optional sequence handshake packet
    -00410 ///     - Up: command response, which repeats the socket and flag data
    -00411 ///             as confirmation
    -00412 ///
    -00413 /// \exception  Barry::Error
    -00414 ///             Thrown on protocol error.
    -00415 ///
    -00416 /// \exception  Barry::BadPassword
    -00417 ///             Thrown on invalid password, or not enough retries left
    -00418 ///             on device.
    -00419 ///
    -00420 SocketHandle SocketZero::Open(uint16_t socket, const char *password)
    -00421 {
    -00422         // Things get a little funky here, as we may be left in an
    -00423         // intermediate state in the case of a failed password.
    -00424         // This function should support being called as many times
    -00425         // as needed to handle the password
    -00426 
    -00427         Data send, receive;
    -00428         ZeroPacket packet(send, receive);
    -00429 
    -00430         // save sequence for later close
    -00431         uint8_t closeFlag = GetZeroSocketSequence();
    -00432 
    -00433         if( !m_halfOpen ) {
    -00434                 // starting fresh
    -00435                 m_remainingTries = 0;
    -00436 
    -00437                 SendOpen(socket, receive);
    -00438 
    -00439                 // check for password challenge, or success
    -00440                 if( packet.Command() == SB_COMMAND_PASSWORD_CHALLENGE ) {
    -00441                         m_halfOpen = true;
    -00442                         m_challengeSeed = packet.ChallengeSeed();
    -00443                         m_remainingTries = packet.RemainingTries();
    -00444                 }
    -00445 
    -00446                 // fall through to challenge code...
    -00447         }
    -00448 
    -00449         if( m_halfOpen ) {
    -00450                 // half open, device is expecting a password hash... do we
    -00451                 // have a password?
    -00452                 if( !password ) {
    -00453                         throw BadPassword("No password specified.", m_remainingTries, false);
    -00454                 }
    -00455 
    -00456                 // only allow password attempts if there are
    -00457                 // BARRY_MIN_PASSWORD_TRIES or more tries remaining...
    -00458                 // we want to give the user at least some chance on a
    -00459                 // Windows machine before the device commits suicide.
    -00460                 if( m_remainingTries < BARRY_MIN_PASSWORD_TRIES ) {
    -00461                         throw BadPassword("Fewer than " BARRY_MIN_PASSWORD_TRIES_ASC " password tries remaining in device. Refusing to proceed, to avoid device zapping itself.  Use a Windows client, or re-cradle the device.",
    -00462                                 m_remainingTries,
    -00463                                 true);
    -00464                 }
    -00465 
    -00466                 // save sequence for later close (again after SendOpen())
    -00467                 closeFlag = GetZeroSocketSequence();
    -00468 
    -00469                 SendPasswordHash(socket, password, receive);
    -00470 
    -00471                 if( packet.Command() == SB_COMMAND_PASSWORD_FAILED ) {
    -00472                         m_halfOpen = true;
    -00473                         m_challengeSeed = packet.ChallengeSeed();
    -00474                         m_remainingTries = packet.RemainingTries();
    -00475                         throw BadPassword("Password rejected by device.", m_remainingTries, false);
    -00476                 }
    -00477 
    -00478                 // if we get this far, we are no longer in half-open password
    -00479                 // mode, so we can reset our flags
    -00480                 m_halfOpen = false;
    -00481 
    -00482                 // fall through to success check...
    -00483         }
    -00484 
    -00485         if( packet.Command() != SB_COMMAND_OPENED_SOCKET ||
    -00486             packet.SocketResponse() != socket ||
    -00487             packet.SocketSequence() != closeFlag )
    -00488         {
    -00489                 eout("Packet:\n" << receive);
    -00490                 throw Error("Socket: Bad OPENED packet in Open");
    -00491         }
    -00492 
    -00493         // success!  save the socket
    -00494         return SocketHandle(new Socket(*this, socket, closeFlag));
    -00495 }
    -00496 
    -00497 //
    -00498 // Close
    -00499 //
    -00500 /// Closes a non-default socket (i.e. non-zero socket number)
    -00501 ///
    -00502 /// The packet sequence is just like Open(), except the command is
    -00503 /// CLOSE_SOCKET.
    -00504 ///
    -00505 /// \exception  Barry::Error
    -00506 ///
    -00507 void SocketZero::Close(Socket &socket)
    -00508 {
    -00509         if( socket.GetSocket() == 0 )
    -00510                 return;         // nothing to do
    -00511 
    -00512         // build close command
    -00513         Barry::Protocol::Packet packet;
    -00514         packet.socket = 0;
    -00515         packet.size = htobs(SB_SOCKET_PACKET_HEADER_SIZE);
    -00516         packet.command = SB_COMMAND_CLOSE_SOCKET;
    -00517         packet.u.socket.socket = htobs(socket.GetSocket());
    -00518         packet.u.socket.sequence = socket.GetCloseFlag();
    -00519 
    -00520         Data command(&packet, SB_SOCKET_PACKET_HEADER_SIZE);
    -00521         Data response;
    -00522         try {
    -00523                 Send(command, response);
    -00524         }
    -00525         catch( Usb::Error & ) {
    -00526                 // reset so this won't be called again
    -00527                 socket.ForceClosed();
    -00528 
    -00529                 eeout(command, response);
    -00530                 throw;
    -00531         }
    -00532 
    -00533         // starting fresh, reset sequence ID
    -00534         Protocol::CheckSize(response);
    -00535         if( IS_COMMAND(response, SB_COMMAND_SEQUENCE_HANDSHAKE) ) {
    -00536                 CheckSequence(0, response);
    -00537 
    -00538                 // still need our ACK
    -00539                 RawReceive(response);
    -00540         }
    -00541 
    -00542         Protocol::CheckSize(response, SB_SOCKET_PACKET_HEADER_SIZE);
    -00543         MAKE_PACKET(rpack, response);
    -00544         if( rpack->command != SB_COMMAND_CLOSED_SOCKET ||
    -00545             btohs(rpack->u.socket.socket) != socket.GetSocket() ||
    -00546             rpack->u.socket.sequence != socket.GetCloseFlag() )
    -00547         {
    -00548                 // reset so this won't be called again
    -00549                 socket.ForceClosed();
    -00550 
    -00551                 eout("Packet:\n" << response);
    -00552                 throw Error("Socket: Bad CLOSED packet in Close");
    -00553         }
    -00554 
    -00555 //      // and finally, there always seems to be an extra read of
    -00556 //      // an empty packet at the end... just throw it away
    -00557 //      try {
    -00558 //              RawReceive(response, 1);
    -00559 //      }
    -00560 //      catch( Usb::Timeout & ) {
    -00561 //      }
    -00562 
    -00563         // reset socket and flag
    -00564         socket.ForceClosed();
    -00565 }
    -00566 
    -00567 
    -00568 
    -00569 
    -00570 
    -00571 
    -00572 //////////////////////////////////////////////////////////////////////////////
    -00573 // Socket class
    -00574 
    -00575 Socket::Socket( SocketZero &zero,
    -00576                 uint16_t socket,
    -00577                 uint8_t closeFlag)
    -00578         : m_zero(&zero)
    -00579         , m_socket(socket)
    -00580         , m_closeFlag(closeFlag)
    -00581         , m_registered(false)
    -00582 {
    -00583 }
    -00584 
    -00585 Socket::~Socket()
    -00586 {
    -00587         // trap exceptions in the destructor
    -00588         try {
    -00589                 // a non-default socket has been opened, close it
    -00590                 Close();
    -00591         }
    -00592         catch( std::runtime_error &re ) {
    -00593                 // do nothing... log it?
    -00594                 dout("Exception caught in ~Socket: " << re.what());
    -00595         }
    -00596 }
    -00597 
    -00598 
    -00599 ////////////////////////////////////
    -00600 // Socket protected API
    -00601 
    -00602 void Socket::CheckSequence(const Data &seq)
    -00603 {
    -00604         m_zero->CheckSequence(m_socket, seq);
    -00605 }
    -00606 
    -00607 void Socket::ForceClosed()
    -00608 {
    -00609         m_socket = 0;
    -00610         m_closeFlag = 0;
    -00611 }
    -00612 
    -00613 
    -00614 ////////////////////////////////////
    -00615 // Socket public API
    -00616 
    -00617 void Socket::Close()
    -00618 {
    -00619         UnregisterInterest();
    -00620         m_zero->Close(*this);
    -00621 }
    -00622 
    -00623 
    -00624 //
    -00625 // Send
    -00626 //
    -00627 /// Sends 'send' data to device, no receive.
    -00628 ///
    -00629 /// \returns    void
    -00630 ///
    -00631 /// \exception  Usb::Error on underlying bus errors.
    -00632 ///
    -00633 void Socket::Send(Data &send, int timeout)
    -00634 {
    -00635         // force the socket number to this socket
    -00636         if( send.GetSize() >= SB_PACKET_HEADER_SIZE ) {
    -00637                 MAKE_PACKETPTR_BUF(spack, send.GetBuffer());
    -00638                 spack->socket = htobs(m_socket);
    -00639         }
    -00640         m_zero->RawSend(send, timeout);
    -00641 }
    -00642 
    -00643 //
    -00644 // Send
    -00645 //
    -00646 /// Sends 'send' data to device, and waits for response.
    -00647 ///
    -00648 /// \returns    void
    -00649 ///
    -00650 /// \exception  Usb::Error on underlying bus errors.
    -00651 ///
    -00652 void Socket::Send(Data &send, Data &receive, int timeout)
    -00653 {
    -00654         Send(send, timeout);
    -00655         Receive(receive, timeout);
    -00656 }
    -00657 
    -00658 void Socket::Send(Barry::Packet &packet, int timeout)
    -00659 {
    -00660         Send(packet.m_send, packet.m_receive, timeout);
    -00661 }
    -00662 
    -00663 void Socket::Receive(Data &receive, int timeout)
    -00664 {
    -00665         if( m_registered ) {
    -00666                 if( m_zero->m_queue ) {
    -00667                         if( !m_zero->m_queue->SocketRead(m_socket, receive, timeout) )
    -00668                                 throw Timeout("Socket::Receive: queue SocketRead returned false (likely a timeout)");
    -00669                 }
    -00670                 else {
    -00671                         throw std::logic_error("NULL queue pointer in a registered socket read.");
    -00672                 }
    -00673         }
    -00674         else {
    -00675                 m_zero->RawReceive(receive, timeout);
    -00676         }
    -00677 }
    -00678 
    -00679 // sends the send packet down to the device, fragmenting if
    -00680 // necessary, and returns the response in receive, defragmenting
    -00681 // if needed
    -00682 // Blocks until response received or timed out in Usb::Device
    -00683 void Socket::Packet(Data &send, Data &receive, int timeout)
    -00684 {
    -00685 /*
    -00686 // FIXME - this might be a good idea someday, or perhaps provide a wrapper
    -00687 // function that forces the socket number to the correct current value,
    -00688 // but putting it here means a copy on every packet.
    -00689 
    -00690         // force socket to our socket
    -00691         Data send = sendorig;
    -00692         Barry::Protocol::Packet *sspack = (Barry::Protocol::Packet *)send.GetBuffer(2);
    -00693         sspack->socket = htobs(GetSocket());
    -00694 */
    -00695 
    -00696         MAKE_PACKET(spack, send);
    -00697         if( send.GetSize() < MIN_PACKET_SIZE ||
    -00698             (spack->command != SB_COMMAND_DB_DATA &&
    -00699              spack->command != SB_COMMAND_DB_DONE) )
    -00700         {
    -00701                 // we don't do that around here
    -00702                 throw std::logic_error("Socket: unknown send data in Packet()");
    -00703         }
    -00704 
    -00705         Data inFrag;
    -00706         receive.Zap();
    -00707 
    -00708         if( send.GetSize() <= MAX_PACKET_SIZE ) {
    -00709                 // send non-fragmented
    -00710                 Send(send, inFrag, timeout);
    -00711         }
    -00712         else {
    -00713                 // send fragmented
    -00714                 unsigned int offset = 0;
    -00715                 Data outFrag;
    -00716 
    -00717                 do {
    -00718                         offset = SocketZero::MakeNextFragment(send, outFrag, offset);
    -00719                         Send(outFrag, inFrag, timeout);
    -00720 
    -00721                         MAKE_PACKET(rpack, inFrag);
    -00722                         // only process sequence handshakes... once we
    -00723                         // get to the last fragment, we fall through to normal
    -00724                         // processing below
    -00725                         if( offset && inFrag.GetSize() > 0 ) {
    -00726 
    -00727                                 Protocol::CheckSize(inFrag);
    -00728 
    -00729                                 switch( rpack->command )
    -00730                                 {
    -00731                                 case SB_COMMAND_SEQUENCE_HANDSHAKE:
    -00732                                         CheckSequence(inFrag);
    -00733                                         break;
    -00734 
    -00735                                 default: {
    -00736                                         std::ostringstream oss;
    -00737                                         oss << "Socket: unhandled packet in Packet() (send): 0x" << std::hex << (unsigned int)rpack->command;
    -00738                                         eout(oss.str());
    -00739                                         throw Error(oss.str());
    -00740                                         }
    -00741                                         break;
    -00742                                 }
    -00743                         }
    -00744 
    -00745 
    -00746                 } while( offset > 0 );
    -00747         }
    -00748 
    -00749         bool done = false, frag = false;
    -00750         int blankCount = 0;
    -00751         while( !done ) {
    -00752                 MAKE_PACKET(rpack, inFrag);
    -00753 
    -00754                 // check the packet's validity
    -00755                 if( inFrag.GetSize() > 0 ) {
    -00756                         blankCount = 0;
    -00757 
    -00758                         Protocol::CheckSize(inFrag);
    -00759 
    -00760                         switch( rpack->command )
    -00761                         {
    -00762                         case SB_COMMAND_SEQUENCE_HANDSHAKE:
    -00763                                 CheckSequence(inFrag);
    -00764                                 break;
    -00765 
    -00766                         case SB_COMMAND_DB_DATA:
    -00767                                 if( frag ) {
    -00768                                         SocketZero::AppendFragment(receive, inFrag);
    -00769                                 }
    -00770                                 else {
    -00771                                         receive = inFrag;
    -00772                                 }
    -00773                                 done = true;
    -00774                                 break;
    -00775 
    -00776                         case SB_COMMAND_DB_FRAGMENTED:
    -00777                                 SocketZero::AppendFragment(receive, inFrag);
    -00778                                 frag = true;
    -00779                                 break;
    -00780 
    -00781                         case SB_COMMAND_DB_DONE:
    -00782                                 receive = inFrag;
    -00783                                 done = true;
    -00784                                 break;
    -00785 
    -00786                         default: {
    -00787                                 std::ostringstream oss;
    -00788                                 oss << "Socket: unhandled packet in Packet() (read): 0x" << std::hex << (unsigned int)rpack->command;
    -00789                                 eout(oss.str());
    -00790                                 throw Error(oss.str());
    -00791                                 }
    -00792                                 break;
    -00793                         }
    -00794                 }
    -00795                 else {
    -00796                         blankCount++;
    -00797                         //std::cerr << "Blank! " << blankCount << std::endl;
    -00798                         if( blankCount == 10 ) {
    -00799                                 // only ask for more data on stalled sockets
    -00800                                 // for so long
    -00801                                 throw Error("Socket: 10 blank packets received");
    -00802                         }
    -00803                 }
    -00804 
    -00805                 if( !done ) {
    -00806                         // not done yet, ask for another read
    -00807                         Receive(inFrag);
    -00808                 }
    -00809         }
    -00810 }
    -00811 
    -00812 void Socket::Packet(Barry::Packet &packet, int timeout)
    -00813 {
    -00814         Packet(packet.m_send, packet.m_receive, timeout);
    -00815 }
    -00816 
    -00817 void Socket::NextRecord(Data &receive)
    -00818 {
    -00819         Barry::Protocol::Packet packet;
    -00820         packet.socket = htobs(GetSocket());
    -00821         packet.size = htobs(7);
    -00822         packet.command = SB_COMMAND_DB_DONE;
    -00823         packet.u.db.tableCmd = 0;
    -00824         packet.u.db.u.command.operation = 0;
    -00825 
    -00826         Data command(&packet, 7);
    -00827         Packet(command, receive);
    -00828 }
    -00829 
    -00830 void Socket::RegisterInterest(SocketRoutingQueue::SocketDataHandler handler,
    -00831                                 void *context)
    -00832 {
    -00833         if( !m_zero->m_queue )
    -00834                 throw std::logic_error("SocketRoutingQueue required in SocketZero in order to call Socket::RegisterInterest()");
    -00835 
    -00836         if( m_registered )
    -00837                 throw std::logic_error("Socket already registered in Socket::RegisterInterest()!");
    -00838 
    -00839         m_zero->m_queue->RegisterInterest(m_socket, handler, context);
    -00840         m_registered = true;
    -00841 }
    -00842 
    -00843 void Socket::UnregisterInterest()
    -00844 {
    -00845         if( m_registered ) {
    -00846                 if( m_zero->m_queue )
    -00847                         m_zero->m_queue->UnregisterInterest(m_socket);
    -00848                 m_registered = false;
    -00849         }
    -00850 }
    -00851 
    -00852 
    -00853 } // namespace Barry
    -00854 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/socket_8h.html barry-0.0.20110506/doc/www/doxygen/html/socket_8h.html --- barry-0.14/doc/www/doxygen/html/socket_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/socket_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: socket.h File Reference - - - - - - - -

    socket.h File Reference


    Detailed Description

    -Class wrapper to encapsulate the Blackberry USB logical socket. -

    - -

    -Definition in file socket.h. -

    -#include "dll.h"
    -#include <stdint.h>
    -#include <queue>
    -#include <memory>
    -#include "router.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Usb
    namespace  Barry

    Classes

    class  Barry::SocketZero
    class  Barry::Socket
     Encapsulates a "logical socket" in the Blackberry USB protocol. More...

    Typedefs

    -typedef std::auto_ptr< Socket > Barry::SocketHandle
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/socket_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/socket_8h-source.html --- barry-0.14/doc/www/doxygen/html/socket_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/socket_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ - - -Barry: socket.h Source File - - - - - - - -

    socket.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       socket.h
    -00003 ///             Class wrapper to encapsulate the Blackberry USB logical socket
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_SOCKET_H__
    -00023 #define __BARRY_SOCKET_H__
    -00024 
    -00025 #include "dll.h"
    -00026 #include <stdint.h>
    -00027 #include <queue>
    -00028 #include <memory>
    -00029 #include "router.h"
    -00030 
    -00031 // forward declarations
    -00032 namespace Usb { class Device; }
    -00033 namespace Barry {
    -00034         class Data;
    -00035         class Packet;
    -00036         class SocketRoutingQueue;
    -00037 }
    -00038 
    -00039 namespace Barry {
    -00040 
    -00041 class Socket;
    -00042 typedef std::auto_ptr<Socket>   SocketHandle;
    -00043 
    -00044 class BXEXPORT SocketZero
    -00045 {
    -00046         friend class Socket;
    -00047 
    -00048         Usb::Device *m_dev;
    -00049         SocketRoutingQueue *m_queue;
    -00050         int m_writeEp, m_readEp;
    -00051         uint8_t m_zeroSocketSequence;
    -00052 
    -00053         uint32_t m_sequenceId;
    -00054 
    -00055         // half open socket stata, for passwords
    -00056         bool m_halfOpen;
    -00057         uint32_t m_challengeSeed;
    -00058         unsigned int m_remainingTries;
    -00059 
    -00060 private:
    -00061         static void AppendFragment(Data &whole, const Data &fragment);
    -00062         static unsigned int MakeNextFragment(const Data &whole, Data &fragment,
    -00063                 unsigned int offset = 0);
    -00064         void CheckSequence(uint16_t socket, const Data &seq);
    -00065 
    -00066         void SendOpen(uint16_t socket, Data &receive);
    -00067         void SendPasswordHash(uint16_t socket, const char *password, Data &receive);
    -00068 
    -00069         // Raw send and receive functions, used for all low level
    -00070         // communication to the USB level.
    -00071         void RawSend(Data &send, int timeout = -1);
    -00072         void RawReceive(Data &receive, int timeout = -1);
    -00073 
    -00074 protected:
    -00075         bool SequencePacket(const Data &data);
    -00076 
    -00077 public:
    -00078         explicit SocketZero(SocketRoutingQueue &queue, int writeEndpoint,
    -00079                 uint8_t zeroSocketSequenceStart = 0);
    -00080         SocketZero(Usb::Device &dev, int writeEndpoint, int readEndpoint,
    -00081                 uint8_t zeroSocketSequenceStart = 0);
    -00082         ~SocketZero();
    -00083 
    -00084         uint8_t GetZeroSocketSequence() const { return m_zeroSocketSequence; }
    -00085 
    -00086         void SetRoutingQueue(SocketRoutingQueue &queue);
    -00087         void UnlinkRoutingQueue();
    -00088 
    -00089         // Send functions for socket 0 only.
    -00090         // These functions will overwrite:
    -00091         //     - the zeroSocketSequence byte *inside* the packet
    -00092         //     - the socket number to 0
    -00093         //
    -00094         void Send(Data &send, int timeout = -1);        // send only
    -00095         void Send(Data &send, Data &receive, int timeout = -1); // send+recv
    -00096         void Send(Barry::Packet &packet, int timeout = -1);
    -00097 //      void Receive(Data &receive, int timeout = -1);
    -00098 
    -00099         // Opens a new socket and returns a Socket object to manage it
    -00100         SocketHandle Open(uint16_t socket, const char *password = 0);
    -00101         void Close(Socket &socket);
    -00102 };
    -00103 
    -00104 
    -00105 //
    -00106 // Socket class
    -00107 //
    -00108 /// Encapsulates a "logical socket" in the Blackberry USB protocol.
    -00109 /// By default, provides raw send/receive access, as well as packet
    -00110 /// writing on socket 0, which is always open.
    -00111 ///
    -00112 /// There are Open and Close members to open data sockets which are used
    -00113 /// to transfer data to and from the device.
    -00114 ///
    -00115 /// The destructor will close any non-0 open sockets automatically.
    -00116 ///
    -00117 /// Requires an active Usb::Device object to work on.
    -00118 ///
    -00119 class BXEXPORT Socket
    -00120 {
    -00121         friend class SocketZero;
    -00122 
    -00123         SocketZero *m_zero;
    -00124         uint16_t m_socket;
    -00125         uint8_t m_closeFlag;
    -00126 
    -00127         bool m_registered;
    -00128 
    -00129 protected:
    -00130         void CheckSequence(const Data &seq);
    -00131         void ForceClosed();
    -00132 
    -00133         Socket(SocketZero &zero, uint16_t socket, uint8_t closeFlag);
    -00134 
    -00135 public:
    -00136         ~Socket();
    -00137 
    -00138         uint16_t GetSocket() const { return m_socket; }
    -00139         uint8_t GetCloseFlag() const { return m_closeFlag; }
    -00140 
    -00141         void Close();
    -00142 
    -00143         // Send and Receive are available before Open...
    -00144         // an unopened socket defaults to socket 0, which you need
    -00145         // in order to set the blackberry mode
    -00146         // The send function will overwrite the zeroSocketSequence byte
    -00147         // *inside* the packet, if the current m_socket is 0.
    -00148         void Send(Data &send, int timeout = -1);        // send only
    -00149         void Send(Data &send, Data &receive, int timeout = -1); // send+recv
    -00150         void Send(Barry::Packet &packet, int timeout = -1);
    -00151         void Receive(Data &receive, int timeout = -1);
    -00152 
    -00153         // sends the send packet down to the device, fragmenting if
    -00154         // necessary, and returns the response in receive, defragmenting
    -00155         // if needed
    -00156         // Blocks until response received or timed out in Usb::Device
    -00157         void Packet(Data &send, Data &receive, int timeout = -1);
    -00158         void Packet(Barry::Packet &packet, int timeout = -1);
    -00159 
    -00160         // some handy wrappers for the Packet() interface
    -00161         void NextRecord(Data &receive);
    -00162 
    -00163         // Register a callback for incoming data from the device.
    -00164         // This function assumes that this socket is based on a socketZero
    -00165         // that has a SocketRoutingQueue, otherwise throws logic_error.
    -00166         void RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, void *context);
    -00167         void UnregisterInterest();
    -00168 };
    -00169 
    -00170 
    -00171 } // namespace Barry
    -00172 
    -00173 #endif
    -00174 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/strnlen_8c.html barry-0.0.20110506/doc/www/doxygen/html/strnlen_8c.html --- barry-0.14/doc/www/doxygen/html/strnlen_8c.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/strnlen_8c.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - -Barry: strnlen.c File Reference - - - - - - - -

    strnlen.c File Reference


    Detailed Description

    -Implementation of strnlen() call, for systems that don't have GNU. -

    - -

    -Definition in file strnlen.c. -

    -#include "strnlen.h"
    - -

    -Go to the source code of this file. - - - - -

    Functions

    -size_t barry_strnlen (const char *s, size_t maxlen)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/strnlen_8c-source.html barry-0.0.20110506/doc/www/doxygen/html/strnlen_8c-source.html --- barry-0.14/doc/www/doxygen/html/strnlen_8c-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/strnlen_8c-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: strnlen.c Source File - - - - - - - -

    strnlen.c

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       strnlen.c
    -00003 ///             Implementation of strnlen() call, for systems that
    -00004 ///             don't have GNU.
    -00005 ///
    -00006 
    -00007 /*
    -00008     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00009 
    -00010     This program is free software; you can redistribute it and/or modify
    -00011     it under the terms of the GNU General Public License as published by
    -00012     the Free Software Foundation; either version 2 of the License, or
    -00013     (at your option) any later version.
    -00014 
    -00015     This program is distributed in the hope that it will be useful,
    -00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00018 
    -00019     See the GNU General Public License in the COPYING file at the
    -00020     root directory of this project for more details.
    -00021 */
    -00022 
    -00023 #include "strnlen.h"
    -00024 
    -00025 size_t barry_strnlen(const char *s, size_t maxlen)
    -00026 {
    -00027         size_t len = 0;
    -00028         while( len < maxlen && s[len] )
    -00029                 len++;
    -00030         return len;
    -00031 }
    -00032 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/strnlen_8h.html barry-0.0.20110506/doc/www/doxygen/html/strnlen_8h.html --- barry-0.14/doc/www/doxygen/html/strnlen_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/strnlen_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: strnlen.h File Reference - - - - - - - -

    strnlen.h File Reference


    Detailed Description

    -Header for strnlen() call, for systems that don't have GNU. -

    - -

    -Definition in file strnlen.h. -

    -#include "config.h"
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - - - - -

    Defines

    -#define strnlen(s, l)   barry_strnlen(s,l)

    Functions

    -size_t barry_strnlen (const char *s, size_t maxlen)
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/strnlen_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/strnlen_8h-source.html --- barry-0.14/doc/www/doxygen/html/strnlen_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/strnlen_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ - - -Barry: strnlen.h Source File - - - - - - - -

    strnlen.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       strnlen.h
    -00003 ///             Header for strnlen() call, for systems that don't have GNU.
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_STRNLEN_H__
    -00023 #define __BARRY_STRNLEN_H__
    -00024 
    -00025 #include "config.h"
    -00026 #include <string.h>
    -00027 
    -00028 // this is always defined by configure, if not, then the autoconf
    -00029 // sources changed (likely in /usr/share/autoconf/autoconf/functions.m4)
    -00030 // and configure.ac is no longer accurate
    -00031 #ifndef HAVE_WORKING_STRNLEN
    -00032 #error Configure.ac is not accurate. Read comments in strnlen.h.
    -00033 #endif
    -00034 
    -00035 // now, if defined and set to 0, then strnlen() either does not exist at all,
    -00036 // or is broken (on AIX)
    -00037 #if !HAVE_WORKING_STRNLEN
    -00038 
    -00039 // so define our own version...
    -00040 #ifdef __cplusplus
    -00041 extern "C" {
    -00042 #endif
    -00043 
    -00044 size_t barry_strnlen(const char *s, size_t maxlen);
    -00045 
    -00046 #ifdef __cplusplus
    -00047 }
    -00048 #endif
    -00049 
    -00050 // and override the system's name so we call our own
    -00051 #define strnlen(s,l) barry_strnlen(s,l)
    -00052 
    -00053 #endif  // !HAVE_WORKING_STRNLEN
    -00054 
    -00055 #endif  // __BARRY_STRNLEN_H__
    -00056 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1CommandTableCommand.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1CommandTableCommand.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1CommandTableCommand.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1CommandTableCommand.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::CommandTableCommand Struct Reference - - - - - - - -

    Barry::CommandTableCommand Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 49 of file record.h. - - - - - - -

    Public Attributes

    -unsigned int Code
    -std::string Name
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1CommandTableCommand-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1CommandTableCommand-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1CommandTableCommand-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1CommandTableCommand-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::CommandTableCommand Member List

    This is the complete list of members for Barry::CommandTableCommand, including all inherited members.

    - - -
    CodeBarry::CommandTableCommand
    NameBarry::CommandTableCommand


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactGroupLink.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactGroupLink.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactGroupLink.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactGroupLink.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: Barry::ContactGroupLink Struct Reference - - - - - - - -

    Barry::ContactGroupLink Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 40 of file r_contact.h. - - - - - - - - - - - -

    Public Member Functions

    ContactGroupLink ()
    ContactGroupLink (uint32_t link, uint16_t unknown)

    Public Attributes

    -uint32_t Link
    -uint16_t Unknown
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactGroupLink-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactGroupLink-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactGroupLink-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactGroupLink-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ContactGroupLink Member List

    This is the complete list of members for Barry::ContactGroupLink, including all inherited members.

    - - - - -
    ContactGroupLink()Barry::ContactGroupLink [inline]
    ContactGroupLink(uint32_t link, uint16_t unknown)Barry::ContactGroupLink [inline]
    LinkBarry::ContactGroupLink
    UnknownBarry::ContactGroupLink


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: Barry::ContactLdif::AccessPair Struct Reference - - - - - - - -

    Barry::ContactLdif::AccessPair Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 98 of file ldif.h. - - - - - - - - - - - -

    Public Member Functions

    AccessPair ()
    AccessPair (GetFunctionType r, SetFunctionType w)

    Public Attributes

    -GetFunctionType read
    -SetFunctionType write
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1AccessPair-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ContactLdif::AccessPair Member List

    This is the complete list of members for Barry::ContactLdif::AccessPair, including all inherited members.

    - - - - -
    AccessPair()Barry::ContactLdif::AccessPair [inline]
    AccessPair(GetFunctionType r, SetFunctionType w)Barry::ContactLdif::AccessPair [inline]
    readBarry::ContactLdif::AccessPair
    writeBarry::ContactLdif::AccessPair


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ - - -Barry: Barry::ContactLdif::LdifAttribute Struct Reference - - - - - - - -

    Barry::ContactLdif::LdifAttribute Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 80 of file ldif.h. - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    LdifAttribute ()
    LdifAttribute (const char *name, const std::string &oc="")
    LdifAttribute (const std::string &name, const std::string &oc="")
    -bool operator< (const LdifAttribute &other) const
    -bool operator== (const LdifAttribute &other) const

    Public Attributes

    -std::string name
    -std::string objectClass
    -int order
    -


    The documentation for this struct was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1LdifAttribute-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ContactLdif::LdifAttribute Member List

    This is the complete list of members for Barry::ContactLdif::LdifAttribute, including all inherited members.

    - - - - - - - - -
    LdifAttribute()Barry::ContactLdif::LdifAttribute [inline]
    LdifAttribute(const char *name, const std::string &oc="")Barry::ContactLdif::LdifAttribute [inline]
    LdifAttribute(const std::string &name, const std::string &oc="")Barry::ContactLdif::LdifAttribute [inline]
    nameBarry::ContactLdif::LdifAttribute
    objectClassBarry::ContactLdif::LdifAttribute
    operator<(const LdifAttribute &other) constBarry::ContactLdif::LdifAttribute
    operator==(const LdifAttribute &other) constBarry::ContactLdif::LdifAttribute
    orderBarry::ContactLdif::LdifAttribute


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ - - -Barry: Barry::ContactLdif::NameToFunc Struct Reference - - - - - - - -

    Barry::ContactLdif::NameToFunc Struct Reference

    #include <ldif.h> -

    -List of all members.


    Detailed Description

    -Used to create a List of supported Barry field names, including calculated names, such as full postal address. -

    - -

    -Definition at line 72 of file ldif.h. - - - - - - - - - - -

    Public Attributes

    -const char * name
    -const char * description
    -GetFunctionType read
    -SetFunctionType write
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ContactLdif_1_1NameToFunc-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ContactLdif::NameToFunc Member List

    This is the complete list of members for Barry::ContactLdif::NameToFunc, including all inherited members.

    - - - - -
    descriptionBarry::ContactLdif::NameToFunc
    nameBarry::ContactLdif::NameToFunc
    readBarry::ContactLdif::NameToFunc
    writeBarry::ContactLdif::NameToFunc


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1DatabaseItem.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1DatabaseItem.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1DatabaseItem.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1DatabaseItem.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::DatabaseItem Struct Reference - - - - - - - -

    Barry::DatabaseItem Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 132 of file record.h. - - - - - - - - -

    Public Attributes

    -unsigned int Number
    -unsigned int RecordCount
    -std::string Name
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1DatabaseItem-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1DatabaseItem-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1DatabaseItem-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1DatabaseItem-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::DatabaseItem Member List

    This is the complete list of members for Barry::DatabaseItem, including all inherited members.

    - - - -
    NameBarry::DatabaseItem
    NumberBarry::DatabaseItem
    RecordCountBarry::DatabaseItem


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Date.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Date.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Date.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Date.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,107 +0,0 @@ - - -Barry: Barry::Date Struct Reference - - - - - - - -

    Barry::Date Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 224 of file record.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Date ()
    Date (const struct tm *timep)
    -bool HasData () const
    -void Clear ()
    -void ToTm (struct tm *timep) const
    -std::string ToYYYYMMDD () const
    std::string ToBBString () const
     The Blackberry stores Birthday and Anniversary date fields with the format: DD/MM/YYYY.
    -bool FromTm (const struct tm *timep)
    -bool FromBBString (const std::string &str)
    -bool FromYYYYMMDD (const std::string &str)

    Public Attributes

    -int Month
    -int Day
    -int Year
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    std::string Barry::Date::ToBBString (  )  const
    -
    -
    - -

    -The Blackberry stores Birthday and Anniversary date fields with the format: DD/MM/YYYY. -

    - -

    -Definition at line 604 of file record.cc. -

    -References Day, Month, and Year. -

    -

    -


    The documentation for this struct was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Date-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Date-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Date-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Date-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Date Member List

    This is the complete list of members for Barry::Date, including all inherited members.

    - - - - - - - - - - - - - -
    Clear()Barry::Date
    Date()Barry::Date [inline]
    Date(const struct tm *timep)Barry::Date [explicit]
    DayBarry::Date
    FromBBString(const std::string &str)Barry::Date
    FromTm(const struct tm *timep)Barry::Date
    FromYYYYMMDD(const std::string &str)Barry::Date
    HasData() constBarry::Date [inline]
    MonthBarry::Date
    ToBBString() constBarry::Date
    ToTm(struct tm *timep) constBarry::Date
    ToYYYYMMDD() constBarry::Date
    YearBarry::Date


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1EmailAddress.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1EmailAddress.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1EmailAddress.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1EmailAddress.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: Barry::EmailAddress Struct Reference - - - - - - - -

    Barry::EmailAddress Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 191 of file record.h. - - - - - - - - - -

    Public Member Functions

    -void clear ()

    Public Attributes

    -std::string Name
    -std::string Email
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1EmailAddress-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1EmailAddress-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1EmailAddress-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1EmailAddress-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::EmailAddress Member List

    This is the complete list of members for Barry::EmailAddress, including all inherited members.

    - - - -
    clear()Barry::EmailAddress [inline]
    EmailBarry::EmailAddress
    NameBarry::EmailAddress


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1FieldLink.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1FieldLink.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1FieldLink.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1FieldLink.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ - - -Barry: Barry::FieldLink< RecordT > Struct Template Reference - - - - - - - -

    Barry::FieldLink< RecordT > Struct Template Reference

    List of all members.

    Detailed Description

    -

    template<class RecordT>
    - struct Barry::FieldLink< RecordT >

    - - -

    - -

    -Definition at line 66 of file record-internal.h. - - - - - - - - - - - - - - - - - - - - -

    Public Attributes

    -int type
    -const char * name
    -const char * ldif
    -const char * objectClass
    -std::string RecordT::* strMember
    -EmailAddress RecordT::* addrMember
    -time_t RecordT::* timeMember
    -PostalAddress RecordT::* postMember
    -std::string PostalAddress::* postField
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1FieldLink-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1FieldLink-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1FieldLink-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1FieldLink-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::FieldLink< RecordT > Member List

    This is the complete list of members for Barry::FieldLink< RecordT >, including all inherited members.

    - - - - - - - - - -
    addrMemberBarry::FieldLink< RecordT >
    ldifBarry::FieldLink< RecordT >
    nameBarry::FieldLink< RecordT >
    objectClassBarry::FieldLink< RecordT >
    postFieldBarry::FieldLink< RecordT >
    postMemberBarry::FieldLink< RecordT >
    strMemberBarry::FieldLink< RecordT >
    timeMemberBarry::FieldLink< RecordT >
    typeBarry::FieldLink< RecordT >


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1PostalAddress.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1PostalAddress.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1PostalAddress.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1PostalAddress.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ - - -Barry: Barry::PostalAddress Struct Reference - - - - - - - -

    Barry::PostalAddress Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 204 of file record.h. - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    std::string GetLabel () const
     Format a mailing address into a single string, handling missing fields.
    -void Clear ()
    -bool HasData () const

    Public Attributes

    -std::string Address1
    -std::string Address2
    -std::string Address3
    -std::string City
    -std::string Province
    -std::string PostalCode
    -std::string Country
    -


    Member Function Documentation

    - -
    -
    - - - - - - - - -
    std::string Barry::PostalAddress::GetLabel (  )  const
    -
    -
    - -

    -Format a mailing address into a single string, handling missing fields. -

    - -

    -Definition at line 521 of file record.cc. -

    -References Address1, Address2, Address3, City, Country, PostalCode, and Province. -

    -Referenced by Barry::operator<<(), and Barry::ContactLdif::PostalAddress(). -

    -

    -


    The documentation for this struct was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1PostalAddress-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1PostalAddress-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1PostalAddress-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1PostalAddress-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::PostalAddress Member List

    This is the complete list of members for Barry::PostalAddress, including all inherited members.

    - - - - - - - - - - -
    Address1Barry::PostalAddress
    Address2Barry::PostalAddress
    Address3Barry::PostalAddress
    CityBarry::PostalAddress
    Clear()Barry::PostalAddress
    CountryBarry::PostalAddress
    GetLabel() constBarry::PostalAddress
    HasData() constBarry::PostalAddress [inline]
    PostalCodeBarry::PostalAddress
    ProvinceBarry::PostalAddress


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ProbeResult.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ProbeResult.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ProbeResult.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ProbeResult.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - - -Barry: Barry::ProbeResult Struct Reference - - - - - - - -

    Barry::ProbeResult Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 33 of file probe.h. - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    ProbeResult ()
    -void DumpAll (std::ostream &os) const
    -bool HasIpModem () const

    Public Attributes

    -Usb::DeviceIDType m_dev
    -unsigned char m_interface
    -uint32_t m_pin
    -Usb::EndpointPair m_ep
    -Usb::EndpointPair m_epModem
    -uint8_t m_zeroSocketSequence
    -std::string m_description
    -


    The documentation for this struct was generated from the following files: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1ProbeResult-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ProbeResult-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1ProbeResult-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1ProbeResult-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::ProbeResult Member List

    This is the complete list of members for Barry::ProbeResult, including all inherited members.

    - - - - - - - - - - -
    DumpAll(std::ostream &os) constBarry::ProbeResult
    HasIpModem() constBarry::ProbeResult [inline]
    m_descriptionBarry::ProbeResult
    m_devBarry::ProbeResult
    m_epBarry::ProbeResult
    m_epModemBarry::ProbeResult
    m_interfaceBarry::ProbeResult
    m_pinBarry::ProbeResult
    m_zeroSocketSequenceBarry::ProbeResult
    ProbeResult()Barry::ProbeResult [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::AttributeFetch Struct Reference - - - - - - - -

    Barry::Protocol::AttributeFetch Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 328 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint16_t object
    -uint16_t attribute
    -uint8_t raw [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1AttributeFetch-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::AttributeFetch Member List

    This is the complete list of members for Barry::Protocol::AttributeFetch, including all inherited members.

    - - - -
    attributeBarry::Protocol::AttributeFetch
    objectBarry::Protocol::AttributeFetch
    rawBarry::Protocol::AttributeFetch


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::Day Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::Day Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 168 of file protostructs.h. - - - - -

    Public Attributes

    -uint8_t day [6]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::Day Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::Day, including all inherited members.

    - -
    dayBarry::Protocol::CalendarRecurrenceDataField::Additional::Day


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 173 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint8_t monthDay
    -uint8_t blank [5]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate, including all inherited members.

    - - -
    blankBarry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate
    monthDayBarry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDate


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 180 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint8_t weekDay
    -uint8_t week
    -uint8_t blank [4]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay, including all inherited members.

    - - - -
    blankBarry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay
    weekBarry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay
    weekDayBarry::Protocol::CalendarRecurrenceDataField::Additional::MonthByDay


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::Week Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::Week Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 206 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint8_t days
    -uint8_t blank [5]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::Week Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::Week, including all inherited members.

    - - -
    blankBarry::Protocol::CalendarRecurrenceDataField::Additional::Week
    daysBarry::Protocol::CalendarRecurrenceDataField::Additional::Week


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 189 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -uint8_t monthDay
    -uint8_t blank
    -uint8_t month
    -uint8_t blank_ [3]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate, including all inherited members.

    - - - - -
    blankBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
    blank_Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
    monthBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate
    monthDayBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDate


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 198 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -uint8_t weekDay
    -uint8_t week
    -uint8_t month
    -uint8_t blank [3]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay, including all inherited members.

    - - - - -
    blankBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
    monthBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
    weekBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay
    weekDayBarry::Protocol::CalendarRecurrenceDataField::Additional::YearByDay


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField Struct Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 149 of file protostructs.h. - - - - - - - - - - - - - - - -

    Public Attributes

    -uint8_t type
    -uint8_t unknown
    -uint16_t interval
    -uint32_t startTime
    -uint32_t endTime

    Classes

    union  Additional
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CalendarRecurrenceDataField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField, including all inherited members.

    - - - - - -
    endTimeBarry::Protocol::CalendarRecurrenceDataField
    intervalBarry::Protocol::CalendarRecurrenceDataField
    startTimeBarry::Protocol::CalendarRecurrenceDataField
    typeBarry::Protocol::CalendarRecurrenceDataField
    unknownBarry::Protocol::CalendarRecurrenceDataField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::CommandTableField Struct Reference - - - - - - - -

    Barry::Protocol::CommandTableField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 93 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint8_t size
    -uint8_t code
    -uint8_t name [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommandTableField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CommandTableField Member List

    This is the complete list of members for Barry::Protocol::CommandTableField, including all inherited members.

    - - - -
    codeBarry::Protocol::CommandTableField
    nameBarry::Protocol::CommandTableField
    sizeBarry::Protocol::CommandTableField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::CommonField Struct Reference - - - - - - - -

    Barry::Protocol::CommonField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 71 of file protostructs.h. - - - - - - - - - -

    Public Attributes

    -uint16_t size
    -uint8_t type

    Classes

    union  CommonFieldData
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1CommonField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CommonField Member List

    This is the complete list of members for Barry::Protocol::CommonField, including all inherited members.

    - - -
    sizeBarry::Protocol::CommonField
    typeBarry::Protocol::CommonField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::DBAccess Struct Reference - - - - - - - -

    Barry::Protocol::DBAccess Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 518 of file protostructs.h. - - - - - - - -

    Public Attributes

    -uint8_t tableCmd

    Classes

    union  DBData
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBAccess-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBAccess Member List

    This is the complete list of members for Barry::Protocol::DBAccess, including all inherited members.

    - -
    tableCmdBarry::Protocol::DBAccess


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::DBC_IndexedUpload Struct Reference - - - - - - - -

    Barry::Protocol::DBC_IndexedUpload Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 293 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint8_t unknown
    -uint16_t index
    -uint8_t data [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__IndexedUpload-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBC_IndexedUpload Member List

    This is the complete list of members for Barry::Protocol::DBC_IndexedUpload, including all inherited members.

    - - - -
    dataBarry::Protocol::DBC_IndexedUpload
    indexBarry::Protocol::DBC_IndexedUpload
    unknownBarry::Protocol::DBC_IndexedUpload


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::DBCommand Struct Reference - - - - - - - -

    Barry::Protocol::DBCommand Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 376 of file protostructs.h. - - - - - - - - - -

    Public Attributes

    -uint8_t operation
    -uint16_t databaseId

    Classes

    union  Parameters
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBCommand-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBCommand Member List

    This is the complete list of members for Barry::Protocol::DBCommand, including all inherited members.

    - - -
    databaseIdBarry::Protocol::DBCommand
    operationBarry::Protocol::DBCommand


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::DBC_RecordFlags Struct Reference - - - - - - - -

    Barry::Protocol::DBC_RecordFlags Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 271 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint8_t unknown
    -uint16_t index
    -uint8_t unknown2 [5]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__RecordFlags-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBC_RecordFlags Member List

    This is the complete list of members for Barry::Protocol::DBC_RecordFlags, including all inherited members.

    - - - -
    indexBarry::Protocol::DBC_RecordFlags
    unknownBarry::Protocol::DBC_RecordFlags
    unknown2Barry::Protocol::DBC_RecordFlags


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::DBC_Record Struct Reference - - - - - - - -

    Barry::Protocol::DBC_Record Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 264 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint16_t recordIndex
    -uint8_t data [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__Record-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBC_Record Member List

    This is the complete list of members for Barry::Protocol::DBC_Record, including all inherited members.

    - - -
    dataBarry::Protocol::DBC_Record
    recordIndexBarry::Protocol::DBC_Record


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::DBC_TaggedUpload Struct Reference - - - - - - - -

    Barry::Protocol::DBC_TaggedUpload Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 279 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -uint8_t rectype
    -uint32_t uniqueId
    -uint8_t unknown2
    -uint8_t data [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBC__TaggedUpload-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBC_TaggedUpload Member List

    This is the complete list of members for Barry::Protocol::DBC_TaggedUpload, including all inherited members.

    - - - - -
    dataBarry::Protocol::DBC_TaggedUpload
    rectypeBarry::Protocol::DBC_TaggedUpload
    uniqueIdBarry::Protocol::DBC_TaggedUpload
    unknown2Barry::Protocol::DBC_TaggedUpload


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ - - -Barry: Barry::Protocol::DBDBField Struct Reference - - - - - - - -

    Barry::Protocol::DBDBField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 114 of file protostructs.h. - - - - - - - - - - - - - - - - - - - - -

    Public Attributes

    -uint16_t dbNumber
    -uint8_t unknown1
    -uint32_t dbSize
    -uint32_t dbRecordCount
    -uint16_t unknown2
    -uint16_t nameSize
    -uint8_t unknown3
    -uint8_t name [1]
    -uint16_t unknown
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBDBField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBDBField Member List

    This is the complete list of members for Barry::Protocol::DBDBField, including all inherited members.

    - - - - - - - - - -
    dbNumberBarry::Protocol::DBDBField
    dbRecordCountBarry::Protocol::DBDBField
    dbSizeBarry::Protocol::DBDBField
    nameBarry::Protocol::DBDBField
    nameSizeBarry::Protocol::DBDBField
    unknownBarry::Protocol::DBDBField
    unknown1Barry::Protocol::DBDBField
    unknown2Barry::Protocol::DBDBField
    unknown3Barry::Protocol::DBDBField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::DBR_DBDBRecord Struct Reference - - - - - - - -

    Barry::Protocol::DBR_DBDBRecord Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 406 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint16_t count
    -uint8_t unknown [3]
    -DBDBField field [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__DBDBRecord-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBR_DBDBRecord Member List

    This is the complete list of members for Barry::Protocol::DBR_DBDBRecord, including all inherited members.

    - - - -
    countBarry::Protocol::DBR_DBDBRecord
    fieldBarry::Protocol::DBR_DBDBRecord
    unknownBarry::Protocol::DBR_DBDBRecord


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::DBResponse Struct Reference - - - - - - - -

    Barry::Protocol::DBResponse Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 496 of file protostructs.h. - - - - - - - -

    Public Attributes

    -uint8_t operation

    Classes

    union  Parameters
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBResponse-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBResponse Member List

    This is the complete list of members for Barry::Protocol::DBResponse, including all inherited members.

    - -
    operationBarry::Protocol::DBResponse


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::DBR_OldDBDBRecord Struct Reference - - - - - - - -

    Barry::Protocol::DBR_OldDBDBRecord Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 399 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint16_t count
    -OldDBDBField field [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldDBDBRecord-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBR_OldDBDBRecord Member List

    This is the complete list of members for Barry::Protocol::DBR_OldDBDBRecord, including all inherited members.

    - - -
    countBarry::Protocol::DBR_OldDBDBRecord
    fieldBarry::Protocol::DBR_OldDBDBRecord


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::Protocol::DBR_OldTaggedRecord Struct Reference - - - - - - - -

    Barry::Protocol::DBR_OldTaggedRecord Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 420 of file protostructs.h. - - - - - - - - - - - - - -

    Public Attributes

    -uint8_t rectype
    -uint16_t index
    -uint32_t uniqueId
    -uint8_t unknown2

    Classes

    union  TaggedData
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1DBR__OldTaggedRecord-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBR_OldTaggedRecord Member List

    This is the complete list of members for Barry::Protocol::DBR_OldTaggedRecord, including all inherited members.

    - - - - -
    indexBarry::Protocol::DBR_OldTaggedRecord
    rectypeBarry::Protocol::DBR_OldTaggedRecord
    uniqueIdBarry::Protocol::DBR_OldTaggedRecord
    unknown2Barry::Protocol::DBR_OldTaggedRecord


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::GroupLink Struct Reference - - - - - - - -

    Barry::Protocol::GroupLink Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 52 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint32_t uniqueId
    -uint16_t unknown
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1GroupLink-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::GroupLink Member List

    This is the complete list of members for Barry::Protocol::GroupLink, including all inherited members.

    - - -
    uniqueIdBarry::Protocol::GroupLink
    unknownBarry::Protocol::GroupLink


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::MessageAddress Struct Reference - - - - - - - -

    Barry::Protocol::MessageAddress Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 58 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint8_t unknown [8]
    -uint8_t addr [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageAddress-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::MessageAddress Member List

    This is the complete list of members for Barry::Protocol::MessageAddress, including all inherited members.

    - - -
    addrBarry::Protocol::MessageAddress
    unknownBarry::Protocol::MessageAddress


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,164 +0,0 @@ - - -Barry: Barry::Protocol::MessageRecord Struct Reference - - - - - - - -

    Barry::Protocol::MessageRecord Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 434 of file protostructs.h. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Attributes

    -uint8_t field1
    -uint32_t field2
    -uint32_t flags
    -uint32_t field4
    -uint32_t field5
    -uint32_t field6
    -uint32_t field7
    -uint32_t field8
    -uint16_t field9
    -uint16_t dateReceived
    -uint16_t timeReceived
    -uint16_t dateDuplicate
    -uint16_t timeDuplicate
    -uint16_t dateSent
    -uint16_t timeSent
    -uint16_t priority
    -uint32_t field14
    -uint32_t field15
    -uint16_t field16
    -uint32_t field13
    -uint16_t messageSize
    -uint32_t field18
    -uint32_t field19
    -uint16_t field20
    -uint16_t field21
    -uint32_t inReplyTo
    -uint32_t field22
    -uint16_t field23
    -uint32_t folderOne
    -uint32_t folderTwo
    -uint16_t replyMessageFlags
    -uint16_t field27
    -uint32_t headerUID
    -uint32_t field29
    -uint16_t field30
    -uint16_t field31
    -uint16_t field32
    -uint16_t field34
    -uint8_t field33
    -uint32_t timeBlock
    -CommonField field [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1MessageRecord-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::MessageRecord Member List

    This is the complete list of members for Barry::Protocol::MessageRecord, including all inherited members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    dateDuplicateBarry::Protocol::MessageRecord
    dateReceivedBarry::Protocol::MessageRecord
    dateSentBarry::Protocol::MessageRecord
    fieldBarry::Protocol::MessageRecord
    field1Barry::Protocol::MessageRecord
    field13Barry::Protocol::MessageRecord
    field14Barry::Protocol::MessageRecord
    field15Barry::Protocol::MessageRecord
    field16Barry::Protocol::MessageRecord
    field18Barry::Protocol::MessageRecord
    field19Barry::Protocol::MessageRecord
    field2Barry::Protocol::MessageRecord
    field20Barry::Protocol::MessageRecord
    field21Barry::Protocol::MessageRecord
    field22Barry::Protocol::MessageRecord
    field23Barry::Protocol::MessageRecord
    field27Barry::Protocol::MessageRecord
    field29Barry::Protocol::MessageRecord
    field30Barry::Protocol::MessageRecord
    field31Barry::Protocol::MessageRecord
    field32Barry::Protocol::MessageRecord
    field33Barry::Protocol::MessageRecord
    field34Barry::Protocol::MessageRecord
    field4Barry::Protocol::MessageRecord
    field5Barry::Protocol::MessageRecord
    field6Barry::Protocol::MessageRecord
    field7Barry::Protocol::MessageRecord
    field8Barry::Protocol::MessageRecord
    field9Barry::Protocol::MessageRecord
    flagsBarry::Protocol::MessageRecord
    folderOneBarry::Protocol::MessageRecord
    folderTwoBarry::Protocol::MessageRecord
    headerUIDBarry::Protocol::MessageRecord
    inReplyToBarry::Protocol::MessageRecord
    messageSizeBarry::Protocol::MessageRecord
    priorityBarry::Protocol::MessageRecord
    replyMessageFlagsBarry::Protocol::MessageRecord
    timeBlockBarry::Protocol::MessageRecord
    timeDuplicateBarry::Protocol::MessageRecord
    timeReceivedBarry::Protocol::MessageRecord
    timeSentBarry::Protocol::MessageRecord


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ - - -Barry: Barry::Protocol::ModeSelect::ResponseBlock Struct Reference - - - - - - - -

    Barry::Protocol::ModeSelect::ResponseBlock Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 339 of file protostructs.h. - - - - -

    Public Attributes

    -uint8_t unknown [20]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::ModeSelect::ResponseBlock Member List

    This is the complete list of members for Barry::Protocol::ModeSelect::ResponseBlock, including all inherited members.

    - -
    unknownBarry::Protocol::ModeSelect::ResponseBlock


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::ModeSelect Struct Reference - - - - - - - -

    Barry::Protocol::ModeSelect Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 336 of file protostructs.h. - - - - - - - -

    Public Attributes

    -uint8_t name [16]

    Classes

    struct  ResponseBlock
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ModeSelect-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::ModeSelect Member List

    This is the complete list of members for Barry::Protocol::ModeSelect, including all inherited members.

    - -
    nameBarry::Protocol::ModeSelect


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - -Barry: Barry::Protocol::OldDBDBField Struct Reference - - - - - - - -

    Barry::Protocol::OldDBDBField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 101 of file protostructs.h. - - - - - - - - - - - - - - - - -

    Public Attributes

    -uint16_t dbNumber
    -uint8_t unknown1
    -uint32_t dbSize
    -uint16_t dbRecordCount
    -uint16_t unknown2
    -uint16_t nameSize
    -uint8_t name [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1OldDBDBField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::OldDBDBField Member List

    This is the complete list of members for Barry::Protocol::OldDBDBField, including all inherited members.

    - - - - - - - -
    dbNumberBarry::Protocol::OldDBDBField
    dbRecordCountBarry::Protocol::OldDBDBField
    dbSizeBarry::Protocol::OldDBDBField
    nameBarry::Protocol::OldDBDBField
    nameSizeBarry::Protocol::OldDBDBField
    unknown1Barry::Protocol::OldDBDBField
    unknown2Barry::Protocol::OldDBDBField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::PackedField_02 Struct Reference - - - - - - - -

    Barry::Protocol::PackedField_02 Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 230 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -uint8_t code
    -uint8_t size
    -uint8_t type
    -uint8_t raw [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__02-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::PackedField_02 Member List

    This is the complete list of members for Barry::Protocol::PackedField_02, including all inherited members.

    - - - - -
    codeBarry::Protocol::PackedField_02
    rawBarry::Protocol::PackedField_02
    sizeBarry::Protocol::PackedField_02
    typeBarry::Protocol::PackedField_02


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::PackedField_10 Struct Reference - - - - - - - -

    Barry::Protocol::PackedField_10 Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 239 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -uint8_t type
    -uint8_t size
    -uint8_t raw [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PackedField__10-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::PackedField_10 Member List

    This is the complete list of members for Barry::Protocol::PackedField_10, including all inherited members.

    - - - -
    rawBarry::Protocol::PackedField_10
    sizeBarry::Protocol::PackedField_10
    typeBarry::Protocol::PackedField_10


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::Packet Struct Reference - - - - - - - -

    Barry::Protocol::Packet Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 540 of file protostructs.h. - - - - - - - - - - - -

    Public Attributes

    -uint16_t socket
    -uint16_t size
    -uint8_t command

    Classes

    union  PacketData
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1Packet-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::Packet Member List

    This is the complete list of members for Barry::Protocol::Packet, including all inherited members.

    - - - -
    commandBarry::Protocol::Packet
    sizeBarry::Protocol::Packet
    socketBarry::Protocol::Packet


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::PasswordChallenge Struct Reference - - - - - - - -

    Barry::Protocol::PasswordChallenge Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 301 of file protostructs.h. - - - - - - - - - - - -

    Public Attributes

    -uint8_t remaining_tries
    -uint8_t unknown
    -uint16_t param

    Classes

    union  Hash
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1PasswordChallenge-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::PasswordChallenge Member List

    This is the complete list of members for Barry::Protocol::PasswordChallenge, including all inherited members.

    - - - -
    paramBarry::Protocol::PasswordChallenge
    remaining_triesBarry::Protocol::PasswordChallenge
    unknownBarry::Protocol::PasswordChallenge


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::Protocol::RecordStateTableField Struct Reference - - - - - - - -

    Barry::Protocol::RecordStateTableField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 131 of file protostructs.h. - - - - - - - - - - - - -

    Public Attributes

    -uint8_t rectype
    -uint16_t index
    -uint32_t uniqueId
    -uint8_t flags
    -uint8_t unknown2 [4]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1RecordStateTableField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::RecordStateTableField Member List

    This is the complete list of members for Barry::Protocol::RecordStateTableField, including all inherited members.

    - - - - - -
    flagsBarry::Protocol::RecordStateTableField
    indexBarry::Protocol::RecordStateTableField
    rectypeBarry::Protocol::RecordStateTableField
    uniqueIdBarry::Protocol::RecordStateTableField
    unknown2Barry::Protocol::RecordStateTableField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::SequenceCommand Struct Reference - - - - - - - -

    Barry::Protocol::SequenceCommand Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 368 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -uint8_t unknown1
    -uint8_t unknown2
    -uint8_t unknown3
    -uint32_t sequenceId
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SequenceCommand-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::SequenceCommand Member List

    This is the complete list of members for Barry::Protocol::SequenceCommand, including all inherited members.

    - - - - -
    sequenceIdBarry::Protocol::SequenceCommand
    unknown1Barry::Protocol::SequenceCommand
    unknown2Barry::Protocol::SequenceCommand
    unknown3Barry::Protocol::SequenceCommand


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::ServiceBookConfigField Struct Reference - - - - - - - -

    Barry::Protocol::ServiceBookConfigField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 253 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint8_t format
    -uint8_t fields [1]
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1ServiceBookConfigField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::ServiceBookConfigField Member List

    This is the complete list of members for Barry::Protocol::ServiceBookConfigField, including all inherited members.

    - - -
    fieldsBarry::Protocol::ServiceBookConfigField
    formatBarry::Protocol::ServiceBookConfigField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::SocketCommand Struct Reference - - - - - - - -

    Barry::Protocol::SocketCommand Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 349 of file protostructs.h. - - - - - - - - - -

    Public Attributes

    -uint16_t socket
    -uint8_t sequence

    Classes

    union  PacketData
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1Protocol_1_1SocketCommand-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::SocketCommand Member List

    This is the complete list of members for Barry::Protocol::SocketCommand, including all inherited members.

    - - -
    sequenceBarry::Protocol::SocketCommand
    socketBarry::Protocol::SocketCommand


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1RecordStateTableState.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1RecordStateTableState.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1RecordStateTableState.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1RecordStateTableState.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::RecordStateTableState Struct Reference - - - - - - - -

    Barry::RecordStateTableState Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 87 of file record.h. - - - - - - - - - - - - -

    Public Attributes

    -unsigned int Index
    -uint32_t RecordId
    -bool Dirty
    -unsigned int RecType
    -std::string Unknown2
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1RecordStateTableState-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1RecordStateTableState-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1RecordStateTableState-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1RecordStateTableState-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::RecordStateTableState Member List

    This is the complete list of members for Barry::RecordStateTableState, including all inherited members.

    - - - - - -
    DirtyBarry::RecordStateTableState
    IndexBarry::RecordStateTableState
    RecordIdBarry::RecordStateTableState
    RecTypeBarry::RecordStateTableState
    Unknown2Barry::RecordStateTableState


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1SHA__CTX.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SHA__CTX.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1SHA__CTX.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SHA__CTX.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::SHA_CTX Struct Reference - - - - - - - -

    Barry::SHA_CTX Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 74 of file sha1.h. - - - - - - - - - - - - -

    Public Attributes

    -unsigned int H [5]
    -unsigned int W [80]
    -int lenW
    -unsigned int sizeHi
    -unsigned int sizeLo
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1SHA__CTX-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SHA__CTX-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1SHA__CTX-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SHA__CTX-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::SHA_CTX Member List

    This is the complete list of members for Barry::SHA_CTX, including all inherited members.

    - - - - - -
    HBarry::SHA_CTX
    lenWBarry::SHA_CTX
    sizeHiBarry::SHA_CTX
    sizeLoBarry::SHA_CTX
    WBarry::SHA_CTX


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: Barry::SocketRoutingQueue::QueueEntry Struct Reference - - - - - - - -

    Barry::SocketRoutingQueue::QueueEntry Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 45 of file router.h. - - - - - - - - - - - -

    Public Member Functions

    QueueEntry (SocketDataHandler h, void *c)

    Public Attributes

    -SocketDataHandler m_handler
    -void * m_context
    -DataQueue m_queue
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1SocketRoutingQueue_1_1QueueEntry-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::SocketRoutingQueue::QueueEntry Member List

    This is the complete list of members for Barry::SocketRoutingQueue::QueueEntry, including all inherited members.

    - - - - -
    m_contextBarry::SocketRoutingQueue::QueueEntry
    m_handlerBarry::SocketRoutingQueue::QueueEntry
    m_queueBarry::SocketRoutingQueue::QueueEntry
    QueueEntry(SocketDataHandler h, void *c)Barry::SocketRoutingQueue::QueueEntry [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1TimeZone.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1TimeZone.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1TimeZone.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1TimeZone.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::TimeZone Struct Reference - - - - - - - -

    Barry::TimeZone Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 57 of file time.h. - - - - - - - - - - -

    Public Attributes

    -unsigned short Code
    -signed short HourOffset
    -signed short MinOffset
    -const char * Name
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1TimeZone-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1TimeZone-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1TimeZone-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1TimeZone-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::TimeZone Member List

    This is the complete list of members for Barry::TimeZone, including all inherited members.

    - - - - -
    CodeBarry::TimeZone
    HourOffsetBarry::TimeZone
    MinOffsetBarry::TimeZone
    NameBarry::TimeZone


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownData.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownData.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ - - -Barry: Barry::UnknownData Struct Reference - - - - - - - -

    Barry::UnknownData Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 174 of file record.h. - - - - - - - - - - - -

    Public Member Functions

    -const std::string::value_type * data () const
    -std::string::size_type size () const
    -void assign (const std::string::value_type *s, std::string::size_type n)

    Public Attributes

    -std::string raw_data
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownData-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownData-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::UnknownData Member List

    This is the complete list of members for Barry::UnknownData, including all inherited members.

    - - - - -
    assign(const std::string::value_type *s, std::string::size_type n)Barry::UnknownData [inline]
    data() constBarry::UnknownData [inline]
    raw_dataBarry::UnknownData
    size() constBarry::UnknownData [inline]


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownField.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownField.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownField.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownField.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::UnknownField Struct Reference - - - - - - - -

    Barry::UnknownField Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 184 of file record.h. - - - - - - -

    Public Attributes

    -uint8_t type
    -UnknownData data
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownField-members.html barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownField-members.html --- barry-0.14/doc/www/doxygen/html/structBarry_1_1UnknownField-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structBarry_1_1UnknownField-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::UnknownField Member List

    This is the complete list of members for Barry::UnknownField, including all inherited members.

    - - -
    dataBarry::UnknownField
    typeBarry::UnknownField


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structStateTableCommand.html barry-0.0.20110506/doc/www/doxygen/html/structStateTableCommand.html --- barry-0.14/doc/www/doxygen/html/structStateTableCommand.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structStateTableCommand.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ - - -Barry: StateTableCommand Struct Reference - - - - - - -

    StateTableCommand Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 346 of file btool.cc. - - - - - - - - - - - -

    Public Member Functions

    StateTableCommand (char f, bool c, unsigned int i)

    Public Attributes

    -char flag
    -bool clear
    -unsigned int index
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structStateTableCommand-members.html barry-0.0.20110506/doc/www/doxygen/html/structStateTableCommand-members.html --- barry-0.14/doc/www/doxygen/html/structStateTableCommand-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structStateTableCommand-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    StateTableCommand Member List

    This is the complete list of members for StateTableCommand, including all inherited members.

    - - - - -
    clearStateTableCommand
    flagStateTableCommand
    indexStateTableCommand
    StateTableCommand(char f, bool c, unsigned int i)StateTableCommand [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structStore.html barry-0.0.20110506/doc/www/doxygen/html/structStore.html --- barry-0.14/doc/www/doxygen/html/structStore.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structStore.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ - - -Barry: Store< Record > Struct Template Reference - - - - - - -

    Store< Record > Struct Template Reference

    List of all members.

    Detailed Description

    -

    template<class Record>
    - struct Store< Record >

    - - -

    - -

    -Definition at line 116 of file btool.cc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    Store (const string &filename, bool load)
    ~Store ()
    -void operator() (const Record &rec)
    -bool operator() (Record &rec, unsigned int databaseId) const
    Store (std::istream &is)
    ~Store ()
    -bool operator() (Record &rec, unsigned int databaseId) const
    -void Dump (std::ostream &os) const

    Public Attributes

    -std::vector< Record > records
    -std::vector< Record >::const_iterator rec_it
    -std::string filename
    -bool load
    -int count
    -std::vector< Record > records
    -std::vector< Record >::const_iterator rec_it
    -Barry::ContactLdif ldif
    -


    The documentation for this struct was generated from the following files: -
    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structStore-members.html barry-0.0.20110506/doc/www/doxygen/html/structStore-members.html --- barry-0.14/doc/www/doxygen/html/structStore-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structStore-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ - - -Barry: Member List - - - - - - -

    Store< Record > Member List

    This is the complete list of members for Store< Record >, including all inherited members.

    - - - - - - - - - - - - - - - - -
    countStore< Record >
    Dump(std::ostream &os) constStore< Record > [inline]
    filenameStore< Record >
    ldifStore< Record >
    loadStore< Record >
    operator()(const Record &rec)Store< Record > [inline]
    operator()(Record &rec, unsigned int databaseId) constStore< Record > [inline]
    operator()(Record &rec, unsigned int databaseId) constStore< Record > [inline]
    rec_itStore< Record > [mutable]
    rec_itStore< Record > [mutable]
    recordsStore< Record >
    recordsStore< Record >
    Store(const string &filename, bool load)Store< Record > [inline]
    Store(std::istream &is)Store< Record > [inline]
    ~Store()Store< Record > [inline]
    ~Store()Store< Record > [inline]


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1ConfigDesc.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1ConfigDesc.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1ConfigDesc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1ConfigDesc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Usb::ConfigDesc Struct Reference - - - - - - - -

    Usb::ConfigDesc Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 220 of file usbwrap.h. - - - - - - -

    Public Attributes

    -usb_config_descriptor desc
    -InterfaceDiscovery interfaces
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1ConfigDesc-members.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1ConfigDesc-members.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1ConfigDesc-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1ConfigDesc-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::ConfigDesc Member List

    This is the complete list of members for Usb::ConfigDesc, including all inherited members.

    - - -
    descUsb::ConfigDesc
    interfacesUsb::ConfigDesc


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1EndpointPair.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1EndpointPair.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1EndpointPair.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1EndpointPair.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ - - -Barry: Usb::EndpointPair Struct Reference - - - - - - - -

    Usb::EndpointPair Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 157 of file usbwrap.h. - - - - - - - - - - - - - - - -

    Public Member Functions

    EndpointPair ()
    -bool IsTypeSet () const
    -bool IsComplete () const

    Public Attributes

    -unsigned char read
    -unsigned char write
    -unsigned char type
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1EndpointPair-members.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1EndpointPair-members.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1EndpointPair-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1EndpointPair-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::EndpointPair Member List

    This is the complete list of members for Usb::EndpointPair, including all inherited members.

    - - - - - - -
    EndpointPair()Usb::EndpointPair [inline]
    IsComplete() constUsb::EndpointPair [inline]
    IsTypeSet() constUsb::EndpointPair [inline]
    readUsb::EndpointPair
    typeUsb::EndpointPair
    writeUsb::EndpointPair


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1InterfaceDesc.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1InterfaceDesc.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1InterfaceDesc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1InterfaceDesc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Usb::InterfaceDesc Struct Reference - - - - - - - -

    Usb::InterfaceDesc Struct Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 193 of file usbwrap.h. - - - - - - -

    Public Attributes

    -usb_interface_descriptor desc
    -EndpointDiscovery endpoints
    -


    The documentation for this struct was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/structUsb_1_1InterfaceDesc-members.html barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1InterfaceDesc-members.html --- barry-0.14/doc/www/doxygen/html/structUsb_1_1InterfaceDesc-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/structUsb_1_1InterfaceDesc-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Usb::InterfaceDesc Member List

    This is the complete list of members for Usb::InterfaceDesc, including all inherited members.

    - - -
    descUsb::InterfaceDesc
    endpointsUsb::InterfaceDesc


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/tab_b.gif and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/tab_b.gif differ Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/tab_l.gif and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/tab_l.gif differ Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/doxygen/html/tab_r.gif and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/doxygen/html/tab_r.gif differ diff -Nru barry-0.14/doc/www/doxygen/html/tabs.css barry-0.0.20110506/doc/www/doxygen/html/tabs.css --- barry-0.14/doc/www/doxygen/html/tabs.css 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/tabs.css 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ - -DIV.tabs -{ - float : left; - width : 100%; - background : url("tab_b.gif") repeat-x bottom; - margin-bottom : 4px; -} - -DIV.tabs UL -{ - margin : 0px; - padding-left : 10px; - list-style : none; -} - -DIV.tabs LI, DIV.tabs FORM -{ - display : inline; - margin : 0px; - padding : 0px; -} - -DIV.tabs FORM -{ - float : right; -} - -DIV.tabs A -{ - float : left; - background : url("tab_r.gif") no-repeat right top; - border-bottom : 1px solid #84B0C7; - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - -DIV.tabs A:hover -{ - background-position: 100% -150px; -} - -DIV.tabs A:link, DIV.tabs A:visited, -DIV.tabs A:active, DIV.tabs A:hover -{ - color: #1A419D; -} - -DIV.tabs SPAN -{ - float : left; - display : block; - background : url("tab_l.gif") no-repeat left top; - padding : 5px 9px; - white-space : nowrap; -} - -DIV.tabs INPUT -{ - float : right; - display : inline; - font-size : 1em; -} - -DIV.tabs TD -{ - font-size : x-small; - font-weight : bold; - text-decoration : none; -} - - - -/* Commented Backslash Hack hides rule from IE5-Mac \*/ -DIV.tabs SPAN {float : none;} -/* End IE5-Mac hack */ - -DIV.tabs A:hover SPAN -{ - background-position: 0% -150px; -} - -DIV.tabs LI#current A -{ - background-position: 100% -150px; - border-width : 0px; -} - -DIV.tabs LI#current SPAN -{ - background-position: 0% -150px; - padding-bottom : 6px; -} - -DIV.nav -{ - background : none; - border : none; - border-bottom : 1px solid #84B0C7; -} diff -Nru barry-0.14/doc/www/doxygen/html/time_8cc.html barry-0.0.20110506/doc/www/doxygen/html/time_8cc.html --- barry-0.14/doc/www/doxygen/html/time_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/time_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ - - -Barry: time.cc File Reference - - - - - - - -

    time.cc File Reference


    Detailed Description

    -Conversion between time_t and cenmin_t and back. -

    -time_t is the POSIX time, seconds from Jan 1, 1970 min1900_t is the minutes from Jan 1, 1900 -

    -Definition in file time.cc. -

    -#include "time.h"
    -#include "endian.h"
    -#include "debug.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    -min1900_t Barry::time2min (time_t t)
    -time_t Barry::min2time (min1900_t m)
    const TimeZone * Barry::GetTimeZoneTable ()
     Returns a pointer to an array of TimeZone structs.
    const TimeZone * Barry::GetTimeZone (unsigned short Code)
     Searches the internal timezone code table for the given Code and returns a pointer to a TimeZone struct found.
    unsigned short Barry::GetTimeZoneCode (signed short HourOffset, signed short MinOffset)
     Searches the internal timezone table for the first matching Code.
    time_t Barry::DayToDate (unsigned short Day)
     This routine takes the day of the year and returns a time_t adjusted from the first of the year.
    time_t Barry::Message2Time (uint16_t r_date, uint16_t r_time)
     Localize the funky math used to convert a Blackberry message timestamp into a time_t.

    Variables

    -TimeZone Barry::Zones []
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/time_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/time_8cc-source.html --- barry-0.14/doc/www/doxygen/html/time_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/time_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,325 +0,0 @@ - - -Barry: time.cc Source File - - - - - - - -

    time.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       time.cc
    -00003 ///             Conversion between time_t and cenmin_t and back.
    -00004 ///             time_t is the POSIX time, seconds from Jan 1, 1970
    -00005 ///             min1900_t is the minutes from Jan 1, 1900
    -00006 ///
    -00007 
    -00008 /*
    -00009     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #include "time.h"
    -00025 #include "endian.h"
    -00026 #include "debug.h"
    -00027 
    -00028 namespace Barry {
    -00029 
    -00030 TimeZone Zones[] = {
    -00031         { 0x0000,  -12,   0, "Eniwetok, Kwajalein (-12)" },
    -00032         { 0x0001,  -12,   0, "Midway Island, Samoa (-12)" },
    -00033         { 0x0002,  -10,   0, "Hawaii (-10)" },
    -00034         { 0x0003,   -9,   0, "Alaska (-9)" },
    -00035         { 0x0004,   -8,   0, "Pacific Time (US & Canada), Tijuana (-8)" },
    -00036         { 0x000a,   -7,   0, "Mountain Time (US & Canada) (-7)" },
    -00037         { 0x000f,   -7,   0, "Arizona (-7)" },
    -00038         { 0x000d,   -7,   0, "Chihuahua, La Paz, Mazatlan (-7)" },
    -00039         { 0x0014,   -6,   0, "Central Time (US & Canada) (-6)" },
    -00040         { 0x0021,   -6,   0, "Central America (-6)" },
    -00041         { 0x0019,   -6,   0, "Saskatchewan (-6)" },
    -00042         { 0x001e,   -6,   0, "Mexico City (-6)" },
    -00043         { 0x0023,   -5,   0, "Eastern Time (US & Canada) (-5)" },
    -00044         { 0x002d,   -5,   0, "Bogota, Lima, Quito (-5)" },
    -00045         { 0x0028,   -5,   0, "Indiana (East) (-5)" },
    -00046         { 0x0032,   -4,   0, "Atlantic Time (Canada) (-4)" },
    -00047         { 0x0037,   -4,   0, "Caracas, La Paz (-4)" },
    -00048         { 0x0038,   -4,   0, "Santiago (-4)" },
    -00049         { 0x003c,   -3, -30, "Newfoundland (-3.5)" },
    -00050         { 0x0046,   -3,   0, "Buenos Aires, Georgetown (-3)" },
    -00051         { 0x0041,   -3,   0, "Brasilia (-3)" },
    -00052         { 0x0049,   -3,   0, "Greenland (-3)" },
    -00053         { 0x004b,   -2,   0, "Mid-Atlantic (-2)" },
    -00054         { 0x0053,   -1,   0, "Cape Verde Island (-1)" },
    -00055         { 0x0050,   -1,   0, "Azores (-1)" },
    -00056         { 0x0055,    0,   0, "Dublin, Edinburgh, Lisbon, London (GMT)" },
    -00057         { 0x005a,    0,   0, "Casablanca, Monrovia (GMT)" },
    -00058         { 0x006e,    1,   0, "Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+1)" },
    -00059         { 0x0071,    1,   0, "West Central Africa (+1)" },
    -00060         { 0x005f,    1,   0, "Belgrade, Bratislava, Budapest, Ljubljana, Prague (+1)" },
    -00061         { 0x0069,    1,   0, "Brussels, Copenhagen, Madrid, Paris (+1)" },
    -00062         { 0x0064,    1,   0, "Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb (+1)" },
    -00063         { 0x008c,    2,   0, "Harare, Pretoria (+2)" },
    -00064         { 0x0087,    2,   0, "Jerusalem (+2)" },
    -00065         { 0x0073,    2,   0, "Bucharest (+2)" },
    -00066         { 0x0078,    2,   0, "Cairo (+2)" },
    -00067         { 0x0082,    2,   0, "Athens, Istanbul, Minsk (+2)" },
    -00068         { 0x007d,    2,   0, "Helsinki, Riga, Tallinn (+2)" },
    -00069         { 0x0096,    3,   0, "Kuwait, Riyadh (+3)" },
    -00070         { 0x009b,    3,   0, "Nairobi (+3)" },
    -00071         { 0x009e,    3,   0, "Baghdad (+3)" },
    -00072         { 0x0091,    3,   0, "Moscow, St. Petersburg, Volgograd (+3)" },
    -00073         { 0x00a0,    3,  30, "Tehran (+3.5)" },
    -00074         { 0x00a5,    4,   0, "Abu Dhabi, Muscat (+4)" },
    -00075         { 0x00aa,    4,   0, "Baku, Tbilisi, Yerevan (+4)" },
    -00076         { 0x00af,    4,  30, "Kabul (+4.5)" },
    -00077         { 0x00b9,    5,   0, "Islamabad, Karachi, Tashkent (+5)" },
    -00078         { 0x00b4,    5,   0, "Ekaterinburg (+5)" },
    -00079         { 0x00be,    5,  30, "Calcutta, Chennai, Mumbai, New Delhi (+5.5)" },
    -00080         { 0x00c1,    5,  45, "Kathmandu (+5.75)" },
    -00081         { 0x00c3,    6,   0, "Astana, Dhaka (+6)" },
    -00082         { 0x00c8,    6,   0, "Sri Lanka (+6)" },
    -00083         { 0x00c9,    6,   0, "Almaty, Novosibirsk (+6)" },
    -00084         { 0x00cb,    6,  30, "Rangoon (+6.5)" },
    -00085         { 0x00cd,    7,   0, "Bangkok, Hanoi, Jakarta (+7)" },
    -00086         { 0x00cf,    7,   0, "Krasnoyarsk (+7)" },
    -00087         { 0x00d2,    8,   0, "Beijing, Chongqing, Hong Kong, Urumqi (+8)" },
    -00088         { 0x00d7,    8,   0, "Kuala Lumpur, Singapore (+8)" },
    -00089         { 0x00e1,    8,   0, "Perth (+8)" },
    -00090         { 0x00dc,    8,   0, "Taipei (+8)" },
    -00091         { 0x00e3,    8,   0, "Irkutsk, Ulaan Bataar (+8)" },
    -00092         { 0x00eb,    9,   0, "Osaka, Sapporo, Tokyo (+9)" },
    -00093         { 0x00e6,    9,   0, "Seoul (+9)" },
    -00094         { 0x00f0,    9,   0, "Yakutsk (+9)" },
    -00095         { 0x00f5,    9,  30, "Darwin (+9.5)" },
    -00096         { 0x00fa,    9,  30, "Adelaide (+9.5)" },
    -00097         { 0x0104,   10,   0, "Brisbane (+10)" },
    -00098         { 0x0113,   10,   0, "Guam, Port Moresby (+10)" },
    -00099         { 0x00ff,   10,   0, "Canberra, Melbourne, Sydney (+10)" },
    -00100         { 0x0109,   10,   0, "Hobart (+10)" },
    -00101         { 0x010e,   10,   0, "Vladivostok (+10)" },
    -00102         { 0x0118,   11,   0, "Magadan, Solomon Islands, New Caledonia (+11)" },
    -00103         { 0x011d,   12,   0, "Fiji, Kamchatka, Marshall Islands (+12)" },
    -00104         { 0x0122,   12,   0, "Auckland, Wellington (+12)" },
    -00105         { 0x012c,   13,   0, "Nuku'alofa (+13)" },
    -00106         { 0,         0,   0, 0 }
    -00107 };
    -00108 
    -00109 min1900_t time2min(time_t t)
    -00110 {
    -00111         if( t == 0 )
    -00112                 return htobl(0xffffffff);
    -00113 
    -00114         min1900_t r = t / 60 + STDC_MIN1900_DIFF;
    -00115         return htobl(r);
    -00116 }
    -00117 
    -00118 time_t min2time(min1900_t m)
    -00119 {
    -00120         if( (unsigned long) btohl(m) == 0xffffffff )
    -00121                 return 0;
    -00122         else
    -00123                 return (btohl(m) - STDC_MIN1900_DIFF) * 60;
    -00124 }
    -00125 
    -00126 
    -00127 //
    -00128 // GetTimeZoneTable
    -00129 //
    -00130 /// Returns a pointer to an array of TimeZone structs.
    -00131 /// The last struct contains 0 in all fields, and can be used as
    -00132 /// an "end of array" marker.
    -00133 ///
    -00134 const TimeZone* GetTimeZoneTable()
    -00135 {
    -00136         return Zones;
    -00137 }
    -00138 
    -00139 //
    -00140 // GetTimeZone
    -00141 //
    -00142 /// Searches the internal timezone code table for the given Code
    -00143 /// and returns a pointer to a TimeZone struct found.  If the
    -00144 /// code is not found, a pointer to a valid TimeZone struct is
    -00145 /// is still returned, but the struct's Code contains TIME_ZONE_CODE_ERR,
    -00146 /// and the name is "Unknown time zone."  The unknown timezone
    -00147 /// is the same offset as GMT.
    -00148 ///
    -00149 const TimeZone* GetTimeZone(unsigned short Code)
    -00150 {
    -00151         static TimeZone Unknown = { TIME_ZONE_CODE_ERR, 0, 0, "Unknown time zone" };
    -00152 
    -00153         for( TimeZone *z = Zones; z->Name; z++ ) {
    -00154                 if( Code == z->Code )
    -00155                         return z;
    -00156         }
    -00157         return &Unknown;
    -00158 }
    -00159 
    -00160 //
    -00161 // GetTimeZoneCode
    -00162 //
    -00163 /// Searches the internal timezone table for the first matching
    -00164 /// Code.  If no matching Code is found, TIME_ZONE_CODE_ERR is returned.
    -00165 ///
    -00166 /// This function does not adjust for daylight saving time.
    -00167 ///
    -00168 unsigned short GetTimeZoneCode(signed short HourOffset,
    -00169                                signed short MinOffset)
    -00170 {
    -00171         for( TimeZone *z = Zones; z->Name; z++ ) {
    -00172                 if( HourOffset == z->HourOffset && MinOffset == z->MinOffset )
    -00173                         return z->Code;
    -00174         }
    -00175         return TIME_ZONE_CODE_ERR;
    -00176 }
    -00177 
    -00178 /// This routine takes the day of the year and
    -00179 /// returns a time_t adjusted from the first of
    -00180 /// the year.
    -00181 ///
    -00182 /// FIXME This function assumes the year hasn't changed,
    -00183 /// but I don't have enough information to determine 
    -00184 /// where the year is in this header info
    -00185 /// 
    -00186 time_t DayToDate( unsigned short Day )
    -00187 {
    -00188         struct tm *now, then;
    -00189         time_t t = time( NULL );
    -00190         
    -00191         now = localtime( &t ); // need this to get year
    -00192         // set to Jan 1 midnight, this year;
    -00193         then.tm_sec = 0;
    -00194         then.tm_min = 0;
    -00195         then.tm_hour = 0;
    -00196         then.tm_mday = 0;
    -00197         then.tm_mon = 0;
    -00198         then.tm_year = now->tm_year;
    -00199         then.tm_isdst = -1;
    -00200         t = mktime(&then);
    -00201         t -= 60*60;                     // need to subract an hour
    -00202         t += Day * 24 * 60 * 60;        // Add the day converted to seconds
    -00203         
    -00204         return t;
    -00205 }
    -00206 
    -00207 //
    -00208 // Message2Time
    -00209 //
    -00210 /// Localize the funky math used to convert a Blackberry message
    -00211 /// timestamp into a time_t.
    -00212 ///
    -00213 /// Both r_date and r_time are expected to be fed in from the
    -00214 /// Protocol::MessageRecord struct in raw form, without endian
    -00215 /// conversion.  This function handles that.
    -00216 ///
    -00217 time_t Message2Time(uint16_t r_date, uint16_t r_time)
    -00218 {
    -00219         dout("Message2Time(0x" << std::hex << btohs(r_date) << ", 0x"
    -00220                 << btohs(r_time) << ")");
    -00221 
    -00222         time_t result = ( btohs(r_date) & 0x01ff ) - 0x29;
    -00223         result = DayToDate( result );
    -00224         result += (time_t)( btohs(r_time)*1.77 );
    -00225 
    -00226         dout("Message2Time result: " << ctime(&result));
    -00227         return result;
    -00228 }
    -00229 
    -00230 
    -00231 } // namespace Barry
    -00232 
    -00233 
    -00234 #ifdef __TEST_MODE__
    -00235 
    -00236 #include <iostream>
    -00237 #include <iomanip>
    -00238 
    -00239 using namespace std;
    -00240 using namespace Barry;
    -00241 
    -00242 void display(const char *msg, time_t t)
    -00243 {
    -00244         cout << msg << ": " << ctime(&t);
    -00245         cout << msg << " seconds: "
    -00246                 << setbase(10) << t
    -00247                 << "(0x" << setbase(16) << t << ")"
    -00248                 << endl;
    -00249         cout << msg << " minutes: "
    -00250                 << setbase(10) << (t/60)
    -00251                 << "(0x" << setbase(16) << (t/60) << ")"
    -00252                 << endl;
    -00253         cout << endl;
    -00254 }
    -00255 
    -00256 void calc(const char *msg, time_t t, min1900_t dbval)
    -00257 {
    -00258         cout << msg << endl;
    -00259         display("    Initial time", t);
    -00260         display("    DB Val", min2time(dbval));
    -00261 }
    -00262 
    -00263 int main()
    -00264 {
    -00265         struct tm start;
    -00266         time_t t;
    -00267 
    -00268         // set to Oct 4, 2005, 2pm;
    -00269         start.tm_sec = 0;
    -00270         start.tm_min = 0;
    -00271         start.tm_hour = 14;
    -00272         start.tm_mday = 4;
    -00273         start.tm_mon = 9;
    -00274         start.tm_year = 105;
    -00275         start.tm_isdst = -1;
    -00276         t = mktime(&start);
    -00277         calc("Oct 4", t, 0x0350c118);
    -00278 
    -00279         // comparison
    -00280         t = time(NULL);
    -00281         min1900_t m = time2min(t);
    -00282         time_t tc = min2time(m);
    -00283         cout << "Original time: " << t << endl;
    -00284         cout << "time2min:      " << m << endl;
    -00285         cout << "min2time:      " << tc << endl;
    -00286         if( t == (tc + t % 60) )
    -00287                 cout << "Success! (orig == converted + mod)" << endl;
    -00288         else
    -00289                 cout << "Failed!" << endl;
    -00290 
    -00291         // time zone
    -00292         cout << "Should say Eastern: " << GetTimeZone(0x23)->Name << endl;
    -00293         cout << "should say Unknown: " << GetTimeZone(0xffff)->Name << endl;
    -00294 }
    -00295 
    -00296 #endif
    -00297 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/time_8h.html barry-0.0.20110506/doc/www/doxygen/html/time_8h.html --- barry-0.14/doc/www/doxygen/html/time_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/time_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ - - -Barry: time.h File Reference - - - - - - - -

    time.h File Reference


    Detailed Description

    -Time related conversion routines. -

    -time_t is the POSIX time. min1900_t is the minutes from Jan 1, 1900 -

    -Definition in file time.h. -

    -#include "dll.h"
    -#include <time.h>
    -#include <stdint.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Classes

    struct  Barry::TimeZone

    Defines

    -#define DAY_MINUTES   (24 * 60)
    -#define YEAR_MINUTES   (365 * DAY_MINUTES)
    -#define LEAP_YEAR_COUNT   ((1970-1901) / 4)
    -#define YEAR_COUNT   (1970 - 1900)
    -#define STDC_MIN1900_DIFF   (YEAR_COUNT * YEAR_MINUTES + LEAP_YEAR_COUNT * DAY_MINUTES)
    -#define TIME_ZONE_CODE_ERR   0xffff

    Typedefs

    -typedef long Barry::min1900_t

    Functions

    -min1900_t Barry::time2min (time_t t)
    -time_t Barry::min2time (min1900_t m)
    const TimeZone * Barry::GetTimeZoneTable ()
     Returns a pointer to an array of TimeZone structs.
    const TimeZone * Barry::GetTimeZone (unsigned short Code)
     Searches the internal timezone code table for the given Code and returns a pointer to a TimeZone struct found.
    unsigned short Barry::GetTimeZoneCode (signed short HourOffset, signed short MinOffset)
     Searches the internal timezone table for the first matching Code.
    time_t Barry::DayToDate (unsigned short Day)
     This routine takes the day of the year and returns a time_t adjusted from the first of the year.
    time_t Barry::Message2Time (uint16_t r_date, uint16_t r_time)
     Localize the funky math used to convert a Blackberry message timestamp into a time_t.
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/time_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/time_8h-source.html --- barry-0.14/doc/www/doxygen/html/time_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/time_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ - - -Barry: time.h Source File - - - - - - - -

    time.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       time.h
    -00003 ///             Time related conversion routines.
    -00004 ///             time_t is the POSIX time.
    -00005 ///             min1900_t is the minutes from Jan 1, 1900
    -00006 ///
    -00007 
    -00008 /*
    -00009     Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00010 
    -00011     This program is free software; you can redistribute it and/or modify
    -00012     it under the terms of the GNU General Public License as published by
    -00013     the Free Software Foundation; either version 2 of the License, or
    -00014     (at your option) any later version.
    -00015 
    -00016     This program is distributed in the hope that it will be useful,
    -00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00019 
    -00020     See the GNU General Public License in the COPYING file at the
    -00021     root directory of this project for more details.
    -00022 */
    -00023 
    -00024 #ifndef __BARRY_TIME_H__
    -00025 #define __BARRY_TIME_H__
    -00026 
    -00027 #include "dll.h"
    -00028 #include <time.h>
    -00029 #include <stdint.h>
    -00030 
    -00031 //
    -00032 // Calculate the number of minutes between Jan 01, 1900 and Jan 01, 1970
    -00033 //
    -00034 // There are 17 leap years between 1900 and 1970
    -00035 //    (1969-1900) / 4 = 17.25
    -00036 //
    -00037 // 1900 itself is not a leap year (not divisible by 400)
    -00038 //
    -00039 #define DAY_MINUTES (24 * 60)
    -00040 #define YEAR_MINUTES (365 * DAY_MINUTES)
    -00041 #define LEAP_YEAR_COUNT ((1970-1901) / 4)
    -00042 #define YEAR_COUNT (1970 - 1900)
    -00043 
    -00044 // therefore, the difference between standard C's time and min1900_t's
    -00045 // time in minutes:
    -00046 #define STDC_MIN1900_DIFF (YEAR_COUNT * YEAR_MINUTES + LEAP_YEAR_COUNT * DAY_MINUTES)
    -00047 
    -00048 namespace Barry {
    -00049 
    -00050 typedef long min1900_t;
    -00051 
    -00052 BXEXPORT min1900_t time2min(time_t t);
    -00053 BXEXPORT time_t min2time(min1900_t m);
    -00054 
    -00055 // FIXME - turn TimeZone into a C typedef and wrap this in extern "C"
    -00056 // so the data can be used in both C and C++ libraries
    -00057 struct BXEXPORT TimeZone
    -00058 {
    -00059         unsigned short Code;
    -00060         signed short HourOffset;
    -00061         signed short MinOffset;
    -00062         const char *Name;
    -00063 };
    -00064 
    -00065 // FIXME - put this somewhere for both C and C++
    -00066 #define TIME_ZONE_CODE_ERR      0xffff
    -00067 
    -00068 BXEXPORT const TimeZone* GetTimeZoneTable();
    -00069 BXEXPORT const TimeZone* GetTimeZone(unsigned short Code);
    -00070 BXEXPORT unsigned short GetTimeZoneCode(signed short HourOffset,
    -00071         signed short MinOffset = 0);
    -00072         
    -00073 // Message time conversion stuff
    -00074 BXEXPORT time_t DayToDate( unsigned short Day );
    -00075 BXEXPORT time_t Message2Time(uint16_t r_date, uint16_t r_time);
    -00076 
    -00077 } // namespace Barry
    -00078 
    -00079 #endif
    -00080 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::CalendarRecurrenceDataField::Additional Union Reference - - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 164 of file protostructs.h. - - - - - - - - - - - - - - -

    Classes

    struct  Day
    struct  MonthByDate
    struct  MonthByDay
    struct  Week
    struct  YearByDate
    struct  YearByDay
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CalendarRecurrenceDataField::Additional Member List

    This is the complete list of members for Barry::Protocol::CalendarRecurrenceDataField::Additional, including all inherited members.

    -


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - -Barry: Barry::Protocol::CommonField::CommonFieldData Union Reference - - - - - - - -

    Barry::Protocol::CommonField::CommonFieldData Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 76 of file protostructs.h. - - - - - - - - - - - - - - - - -

    Public Attributes

    -GroupLink link
    -MessageAddress addr
    -uint32_t uint32
    -int32_t min1900
    -uint16_t code
    -uint8_t raw [1]
    -int16_t int16
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::CommonField::CommonFieldData Member List

    This is the complete list of members for Barry::Protocol::CommonField::CommonFieldData, including all inherited members.

    - - - - - - - -
    addrBarry::Protocol::CommonField::CommonFieldData
    codeBarry::Protocol::CommonField::CommonFieldData
    int16Barry::Protocol::CommonField::CommonFieldData
    linkBarry::Protocol::CommonField::CommonFieldData
    min1900Barry::Protocol::CommonField::CommonFieldData
    rawBarry::Protocol::CommonField::CommonFieldData
    uint32Barry::Protocol::CommonField::CommonFieldData


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::Protocol::DBAccess::DBData Union Reference - - - - - - - -

    Barry::Protocol::DBAccess::DBData Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 522 of file protostructs.h. - - - - - - - - - - - - -

    Public Attributes

    -DBCommand command
    -DBResponse response
    -CommandTableField table [1]
    -uint8_t return_code
    -uint8_t fragment [1]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBAccess_1_1DBData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBAccess::DBData Member List

    This is the complete list of members for Barry::Protocol::DBAccess::DBData, including all inherited members.

    - - - - - -
    commandBarry::Protocol::DBAccess::DBData
    fragmentBarry::Protocol::DBAccess::DBData
    responseBarry::Protocol::DBAccess::DBData
    return_codeBarry::Protocol::DBAccess::DBData
    tableBarry::Protocol::DBAccess::DBData


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ - - -Barry: Barry::Protocol::DBCommand::Parameters Union Reference - - - - - - - -

    Barry::Protocol::DBCommand::Parameters Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 381 of file protostructs.h. - - - - - - - - - - - - -

    Public Attributes

    -DBC_Record record
    -DBC_RecordFlags flags
    -DBC_TaggedUpload tag_upload
    -DBC_IndexedUpload index_upload
    -uint8_t raw [1]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBCommand::Parameters Member List

    This is the complete list of members for Barry::Protocol::DBCommand::Parameters, including all inherited members.

    - - - - - -
    flagsBarry::Protocol::DBCommand::Parameters
    index_uploadBarry::Protocol::DBCommand::Parameters
    rawBarry::Protocol::DBCommand::Parameters
    recordBarry::Protocol::DBCommand::Parameters
    tag_uploadBarry::Protocol::DBCommand::Parameters


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ - - -Barry: Barry::Protocol::DBResponse::Parameters Union Reference - - - - - - - -

    Barry::Protocol::DBResponse::Parameters Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 500 of file protostructs.h. - - - - - - - - -

    Public Attributes

    -DBR_OldTaggedRecord tagged
    -DBR_OldDBDBRecord old_dbdb
    -DBR_DBDBRecord dbdb
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBResponse::Parameters Member List

    This is the complete list of members for Barry::Protocol::DBResponse::Parameters, including all inherited members.

    - - - -
    dbdbBarry::Protocol::DBResponse::Parameters
    old_dbdbBarry::Protocol::DBResponse::Parameters
    taggedBarry::Protocol::DBResponse::Parameters


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ - - -Barry: Barry::Protocol::DBR_OldTaggedRecord::TaggedData Union Reference - - - - - - - -

    Barry::Protocol::DBR_OldTaggedRecord::TaggedData Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 427 of file protostructs.h. - - - - -

    Public Attributes

    -CommonField field [1]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::DBR_OldTaggedRecord::TaggedData Member List

    This is the complete list of members for Barry::Protocol::DBR_OldTaggedRecord::TaggedData, including all inherited members.

    - -
    fieldBarry::Protocol::DBR_OldTaggedRecord::TaggedData


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::Packet::PacketData Union Reference - - - - - - - -

    Barry::Protocol::Packet::PacketData Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 546 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -SocketCommand socket
    -SequenceCommand sequence
    -DBAccess db
    -uint8_t raw [1]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1Packet_1_1PacketData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::Packet::PacketData Member List

    This is the complete list of members for Barry::Protocol::Packet::PacketData, including all inherited members.

    - - - - -
    dbBarry::Protocol::Packet::PacketData
    rawBarry::Protocol::Packet::PacketData
    sequenceBarry::Protocol::Packet::PacketData
    socketBarry::Protocol::Packet::PacketData


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::PasswordChallenge::Hash Union Reference - - - - - - - -

    Barry::Protocol::PasswordChallenge::Hash Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 317 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint32_t seed
    -uint8_t hash [20]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::PasswordChallenge::Hash Member List

    This is the complete list of members for Barry::Protocol::PasswordChallenge::Hash, including all inherited members.

    - - -
    hashBarry::Protocol::PasswordChallenge::Hash
    seedBarry::Protocol::PasswordChallenge::Hash


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ - - -Barry: Barry::Protocol::SizePacket Union Reference - - - - - - - -

    Barry::Protocol::SizePacket Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 42 of file protostructs.h. - - - - - - -

    Public Attributes

    -uint16_t size
    -char buffer [4]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SizePacket-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::SizePacket Member List

    This is the complete list of members for Barry::Protocol::SizePacket, including all inherited members.

    - - -
    bufferBarry::Protocol::SizePacket
    sizeBarry::Protocol::SizePacket


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ - - -Barry: Barry::Protocol::SocketCommand::PacketData Union Reference - - - - - - - -

    Barry::Protocol::SocketCommand::PacketData Union Reference

    List of all members.

    Detailed Description

    - -

    - -

    -Definition at line 356 of file protostructs.h. - - - - - - - - - - -

    Public Attributes

    -PasswordChallenge password
    -AttributeFetch fetch
    -ModeSelect mode
    -uint8_t raw [1]
    -


    The documentation for this union was generated from the following file: -
    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData-members.html barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData-members.html --- barry-0.14/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData-members.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData-members.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ - - -Barry: Member List - - - - - - -

    Barry::Protocol::SocketCommand::PacketData Member List

    This is the complete list of members for Barry::Protocol::SocketCommand::PacketData, including all inherited members.

    - - - - -
    fetchBarry::Protocol::SocketCommand::PacketData
    modeBarry::Protocol::SocketCommand::PacketData
    passwordBarry::Protocol::SocketCommand::PacketData
    rawBarry::Protocol::SocketCommand::PacketData


    Generated on Wed Sep 24 21:27:33 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/upldif_8cc.html barry-0.0.20110506/doc/www/doxygen/html/upldif_8cc.html --- barry-0.14/doc/www/doxygen/html/upldif_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/upldif_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ - - -Barry: upldif.cc File Reference - - - - - - - -

    upldif.cc File Reference


    Detailed Description

    -LDIF contact uploader. -

    - -

    -Definition in file upldif.cc. -

    -#include <barry/barry.h>
    -#include <iomanip>
    -#include <iostream>
    -#include <fstream>
    -#include <vector>
    -#include <string>
    -#include <getopt.h>
    - -

    -Go to the source code of this file. - - - - - - - - - - - - -

    Classes

    struct  Store< Record >

    Functions

    -void Usage ()
    -template<class Record>
    std::ostream & operator<< (std::ostream &os, const Store< Record > &store)
    -int main (int argc, char *argv[])
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/upldif_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/upldif_8cc-source.html --- barry-0.14/doc/www/doxygen/html/upldif_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/upldif_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,219 +0,0 @@ - - -Barry: upldif.cc Source File - - - - - - - -

    upldif.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       upldif.cc
    -00003 ///             LDIF contact uploader
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include <barry/barry.h>
    -00023 #include <iomanip>
    -00024 #include <iostream>
    -00025 #include <fstream>
    -00026 #include <vector>
    -00027 #include <string>
    -00028 #include <getopt.h>
    -00029 
    -00030 
    -00031 using namespace std;
    -00032 using namespace Barry;
    -00033 
    -00034 void Usage()
    -00035 {
    -00036    cerr
    -00037    << "upldif - Command line LDIF uploader\n"
    -00038    << "         Copyright 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)\n\n"
    -00039    << "   -p pin    PIN of device to talk with\n"
    -00040    << "             If only one device plugged in, this flag is optional\n"
    -00041    << "   -u        Do the upload.  If not specified, only dumps parsed\n"
    -00042    << "             LDIF data to stdout.\n"
    -00043    << "   -v        Dump protocol data during operation\n"
    -00044    << "   -h        This help output\n"
    -00045    << endl;
    -00046 }
    -00047 
    -00048 template <class Record>
    -00049 struct Store
    -00050 {
    -00051         std::vector<Record> records;
    -00052         mutable typename std::vector<Record>::const_iterator rec_it;
    -00053         int count;
    -00054 
    -00055         Barry::ContactLdif ldif;
    -00056 
    -00057         // Store constructor -- reads LDIF records from the given
    -00058         // stream object and stores them in memory.
    -00059         Store(std::istream &is)
    -00060                 : count(0),
    -00061                 ldif("")
    -00062         {
    -00063                 Record rec;
    -00064                 while( is ) {
    -00065                         if( ldif.ReadLdif(is, rec) ) {
    -00066                                 count++;
    -00067                                 records.push_back(rec);
    -00068                         }
    -00069                 }
    -00070 
    -00071                 rec_it = records.begin();
    -00072         }
    -00073 
    -00074         ~Store()
    -00075         {
    -00076                 cout << "Store counted " << dec << count << " records." << endl;
    -00077         }
    -00078 
    -00079         // Retrieval operator -- called by Barry during the upload
    -00080         // process to get the next object
    -00081         bool operator()(Record &rec, unsigned int databaseId) const
    -00082         {
    -00083                 if( rec_it == records.end() )
    -00084                         return false;
    -00085                 rec = *rec_it;
    -00086                 rec_it++;
    -00087                 return true;
    -00088         }
    -00089 
    -00090         // For easy data display and debugging.
    -00091         void Dump(std::ostream &os) const
    -00092         {
    -00093                 typename std::vector<Record>::const_iterator b = records.begin();
    -00094                 for( ; b != records.end(); ++b ) {
    -00095                         os << *b << endl;
    -00096                 }
    -00097         }
    -00098 };
    -00099 
    -00100 template <class Record>
    -00101 std::ostream& operator<< (std::ostream &os, const Store<Record> &store)
    -00102 {
    -00103         store.Dump(os);
    -00104         return os;
    -00105 }
    -00106 
    -00107 int main(int argc, char *argv[])
    -00108 {
    -00109         cout.sync_with_stdio(true);     // leave this on, since libusb uses
    -00110                                         // stdio for debug messages
    -00111 
    -00112         try {
    -00113 
    -00114                 uint32_t pin = 0;
    -00115                 bool    data_dump = false,
    -00116                         do_upload = false;
    -00117 
    -00118                 // process command line options
    -00119                 for(;;) {
    -00120                         int cmd = getopt(argc, argv, "hp:uv");
    -00121                         if( cmd == -1 )
    -00122                                 break;
    -00123 
    -00124                         switch( cmd )
    -00125                         {
    -00126                         case 'p':       // Blackberry PIN
    -00127                                 pin = strtoul(optarg, NULL, 16);
    -00128                                 break;
    -00129 
    -00130                         case 'u':       // do upload
    -00131                                 do_upload = true;
    -00132                                 break;
    -00133 
    -00134                         case 'v':       // data dump on
    -00135                                 data_dump = true;
    -00136                                 break;
    -00137 
    -00138                         case 'h':       // help
    -00139                         default:
    -00140                                 Usage();
    -00141                                 return 0;
    -00142                         }
    -00143                 }
    -00144 
    -00145                 // Read all contacts from stdin
    -00146                 Store<Contact> contactStore(cin);
    -00147 
    -00148                 // Only dump to stdout if not uploading to device
    -00149                 if( !do_upload ) {
    -00150                         cout << contactStore << endl;
    -00151                         return 0;
    -00152                 }
    -00153 
    -00154                 // Initialize the barry library.  Must be called before
    -00155                 // anything else.
    -00156                 Barry::Init(data_dump);
    -00157 
    -00158                 // Probe the USB bus for Blackberry devices
    -00159                 // If user has specified a PIN, search for it
    -00160                 Barry::Probe probe;
    -00161                 int activeDevice = probe.FindActive(pin);
    -00162                 if( activeDevice == -1 ) {
    -00163                         cerr << "Device not found, or not specified" << endl;
    -00164                         return 1;
    -00165                 }
    -00166 
    -00167                 // Create our controller object
    -00168                 Barry::Controller con(probe.Get(activeDevice));
    -00169 
    -00170                 // make sure we're in desktop mode
    -00171                 Barry::Mode::Desktop desktop(con);
    -00172                 desktop.Open();
    -00173 
    -00174                 // upload all records to device
    -00175                 desktop.SaveDatabaseByType<Barry::Contact>(contactStore);
    -00176 
    -00177         }
    -00178         catch( Usb::Error &ue) {
    -00179                 std::cerr << "Usb::Error caught: " << ue.what() << endl;
    -00180         }
    -00181         catch( Barry::Error &se ) {
    -00182                 std::cerr << "Barry::Error caught: " << se.what() << endl;
    -00183         }
    -00184         catch( std::exception &e ) {
    -00185                 std::cerr << "std::exception caught: " << e.what() << endl;
    -00186                 return 1;
    -00187         }
    -00188 
    -00189         return 0;
    -00190 }
    -00191 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/usbwrap_8cc.html barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8cc.html --- barry-0.14/doc/www/doxygen/html/usbwrap_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ - - -Barry: usbwrap.cc File Reference - - - - - - - -

    usbwrap.cc File Reference


    Detailed Description

    -USB API wrapper. -

    - -

    -Definition in file usbwrap.cc. -

    -#include "usbwrap.h"
    -#include "data.h"
    -#include "error.h"
    -#include "debug.h"
    -#include <iomanip>
    -#include <sstream>
    -#include <errno.h>
    -#include <string.h>
    - -

    -Go to the source code of this file. - - - - -

    Namespaces

    namespace  Usb
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/usbwrap_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8cc-source.html --- barry-0.14/doc/www/doxygen/html/usbwrap_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,636 +0,0 @@ - - -Barry: usbwrap.cc Source File - - - - - - - -

    usbwrap.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       usbwrap.cc
    -00003 ///             USB API wrapper
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Chris Frey
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 
    -00023 #include "usbwrap.h"
    -00024 #include "data.h"
    -00025 #include "error.h"
    -00026 #include "debug.h"
    -00027 
    -00028 #include <iomanip>
    -00029 #include <sstream>
    -00030 #include <errno.h>
    -00031 #include <string.h>
    -00032 
    -00033 #ifndef __DEBUG_MODE__
    -00034 #define __DEBUG_MODE__
    -00035 #endif
    -00036 #include "debug.h"
    -00037 
    -00038 namespace Usb {
    -00039 
    -00040 ///////////////////////////////////////////////////////////////////////////////
    -00041 // Usb::Error exception class
    -00042 
    -00043 static std::string GetErrorString(int libusb_errcode, const std::string &str)
    -00044 {
    -00045         std::ostringstream oss;
    -00046         oss << "(";
    -00047         
    -00048         if( libusb_errcode ) {
    -00049                 oss << std::setbase(10) << libusb_errcode << ", ";
    -00050         }
    -00051 
    -00052 //      oss << strerror(-libusb_errno) << "): "
    -00053         oss << usb_strerror() << "): ";
    -00054         oss << str;
    -00055         return oss.str();
    -00056 }
    -00057 
    -00058 Error::Error(const std::string &str)
    -00059         : Barry::Error(GetErrorString(0, str))
    -00060         , m_libusb_errcode(0)
    -00061 {
    -00062 }
    -00063 
    -00064 Error::Error(int libusb_errcode, const std::string &str)
    -00065         : Barry::Error(GetErrorString(libusb_errcode, str))
    -00066         , m_libusb_errcode(libusb_errcode)
    -00067 {
    -00068 }
    -00069 
    -00070 
    -00071 ///////////////////////////////////////////////////////////////////////////////
    -00072 // Match
    -00073 
    -00074 Match::Match(int vendor, int product,
    -00075                 const char *busname, const char *devname)
    -00076         : m_busses(0)
    -00077         , m_dev(0)
    -00078         , m_vendor(vendor)
    -00079         , m_product(product)
    -00080         , m_busname(busname)
    -00081         , m_devname(devname)
    -00082 {
    -00083         usb_find_busses();
    -00084         usb_find_devices();
    -00085         m_busses = usb_get_busses();
    -00086 }
    -00087 
    -00088 Match::~Match()
    -00089 {
    -00090 }
    -00091 
    -00092 bool Match::ToNum(const char *str, long &num)
    -00093 {
    -00094         char *end = 0;
    -00095         num = strtol(str, &end, 10);
    -00096         return  num >= 0 &&                     // no negative numbers
    -00097                 num != LONG_MIN && num != LONG_MAX &&   // no overflow
    -00098                 str != end && *end == '\0';     // whole string valid
    -00099 }
    -00100 
    -00101 //
    -00102 // Linux treats bus and device path names as numbers, sometimes left
    -00103 // padded with zeros.  Other platforms, such as Windows, use strings,
    -00104 // such as "bus-1" or similar.
    -00105 //
    -00106 // Here we try to convert each string to a number, and if successful,
    -00107 // compare them.  If unable to convert, then compare as strings.
    -00108 // This way, "3" == "003" and "bus-foobar" == "bus-foobar".
    -00109 //
    -00110 bool Match::NameCompare(const char *n1, const char *n2)
    -00111 {
    -00112         long l1, l2;
    -00113         if( ToNum(n1, l1) && ToNum(n2, l2) ) {
    -00114                 return l1 == l2;
    -00115         }
    -00116         else {
    -00117                 return strcmp(n1, n2) == 0;
    -00118         }
    -00119 }
    -00120 
    -00121 bool Match::next_device(Usb::DeviceIDType *devid)
    -00122 {
    -00123         for( ; m_busses; m_busses = m_busses->next ) {
    -00124 
    -00125                 // only search on given bus
    -00126                 if( m_busname && !NameCompare(m_busname, m_busses->dirname) )
    -00127                         continue;
    -00128 
    -00129                 if( !m_dev )
    -00130                         m_dev = m_busses->devices;
    -00131 
    -00132                 for( ; m_dev; m_dev = m_dev->next ) {
    -00133 
    -00134                         // search for specific device
    -00135                         if( m_devname && !NameCompare(m_devname, m_dev->filename) )
    -00136                                 continue;
    -00137 
    -00138                         // is there a match?
    -00139                         if( m_dev->descriptor.idVendor == m_vendor &&
    -00140                             m_dev->descriptor.idProduct == m_product ) {
    -00141                                 // found!
    -00142                                 *devid = m_dev;
    -00143 
    -00144                                 // advance for next time
    -00145                                 m_dev = m_dev->next;
    -00146                                 if( !m_dev )
    -00147                                         m_busses = m_busses->next;
    -00148 
    -00149                                 // done
    -00150                                 return true;
    -00151                         }
    -00152                 }
    -00153         }
    -00154         return false;
    -00155 }
    -00156 
    -00157 
    -00158 ///////////////////////////////////////////////////////////////////////////////
    -00159 // Device
    -00160 
    -00161 Device::Device(Usb::DeviceIDType id, int timeout)
    -00162         : m_id(id),
    -00163         m_timeout(timeout)
    -00164 {
    -00165         dout("usb_open(" << std::dec << id << ")");
    -00166         m_handle = usb_open(id);
    -00167         if( !m_handle )
    -00168                 throw Error("open failed");
    -00169 }
    -00170 
    -00171 Device::~Device()
    -00172 {
    -00173         dout("usb_close(" << std::dec << m_handle << ")");
    -00174         usb_close(m_handle);
    -00175 }
    -00176 
    -00177 bool Device::SetConfiguration(unsigned char cfg)
    -00178 {
    -00179         dout("usb_set_configuration(" << std::dec << m_handle << "," << std::dec << (unsigned int) cfg << ")");
    -00180         int ret = usb_set_configuration(m_handle, cfg);
    -00181         m_lasterror = ret;
    -00182         return ret >= 0;
    -00183 }
    -00184 
    -00185 bool Device::ClearHalt(int ep)
    -00186 {
    -00187         dout("usb_clear_halt(" << std::dec << m_handle << "," << std::dec << ep << ")");
    -00188         int ret = usb_clear_halt(m_handle, ep);
    -00189         m_lasterror = ret;
    -00190         return ret >= 0;
    -00191 }
    -00192 
    -00193 bool Device::Reset()
    -00194 {
    -00195         dout("usb_reset(" << std::dec << m_handle << ")");
    -00196         int ret = usb_reset(m_handle);
    -00197         m_lasterror = ret;
    -00198         return ret == 0;
    -00199 }
    -00200 
    -00201 bool Device::BulkRead(int ep, Barry::Data &data, int timeout)
    -00202 {
    -00203         int ret;
    -00204         do {
    -00205                 ret = usb_bulk_read(m_handle, ep,
    -00206                         (char*) data.GetBuffer(), data.GetBufSize(),
    -00207                         timeout == -1 ? m_timeout : timeout);
    -00208                 if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) {
    -00209                         m_lasterror = ret;
    -00210                         if( ret == -ETIMEDOUT )
    -00211                                 throw Timeout(ret, "Timeout in usb_bulk_read");
    -00212                         else
    -00213                                 throw Error(ret, "Error in usb_bulk_read");
    -00214                 }
    -00215                 data.ReleaseBuffer(ret);
    -00216         } while( ret == -EINTR || ret == -EAGAIN );
    -00217 
    -00218         return ret >= 0;
    -00219 }
    -00220 
    -00221 bool Device::BulkWrite(int ep, const Barry::Data &data, int timeout)
    -00222 {
    -00223         ddout("BulkWrite to endpoint " << std::dec << ep << ":\n" << data);
    -00224         int ret;
    -00225         do {
    -00226                 ret = usb_bulk_write(m_handle, ep,
    -00227                         (char*) data.GetData(), data.GetSize(),
    -00228                         timeout == -1 ? m_timeout : timeout);
    -00229                 if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) {
    -00230                         m_lasterror = ret;
    -00231                         if( ret == -ETIMEDOUT )
    -00232                                 throw Timeout(ret, "Timeout in usb_bulk_write");
    -00233                         else
    -00234                                 throw Error(ret, "Error in usb_bulk_write");
    -00235                 }
    -00236         } while( ret == -EINTR || ret == -EAGAIN );
    -00237 
    -00238         return ret >= 0;
    -00239 }
    -00240 
    -00241 bool Device::BulkWrite(int ep, const void *data, size_t size, int timeout)
    -00242 {
    -00243 #ifdef __DEBUG_MODE__
    -00244         Barry::Data dump(data, size);
    -00245         ddout("BulkWrite to endpoint " << std::dec << ep << ":\n" << dump);
    -00246 #endif
    -00247 
    -00248         int ret;
    -00249         do {
    -00250                 ret = usb_bulk_write(m_handle, ep,
    -00251                         (char*) data, size,
    -00252                         timeout == -1 ? m_timeout : timeout);
    -00253                 if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) {
    -00254                         m_lasterror = ret;
    -00255                         if( ret == -ETIMEDOUT )
    -00256                                 throw Timeout(ret, "Timeout in usb_bulk_read");
    -00257                         else
    -00258                                 throw Error(ret, "Error in usb_bulk_read");
    -00259                 }
    -00260         } while( ret == -EINTR || ret == -EAGAIN );
    -00261 
    -00262         return ret >= 0;
    -00263 }
    -00264 
    -00265 bool Device::InterruptRead(int ep, Barry::Data &data, int timeout)
    -00266 {
    -00267         int ret;
    -00268         do {
    -00269                 ret = usb_interrupt_read(m_handle, ep,
    -00270                         (char*) data.GetBuffer(), data.GetBufSize(),
    -00271                         timeout == -1 ? m_timeout : timeout);
    -00272                 if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) {
    -00273                         m_lasterror = ret;
    -00274                         if( ret == -ETIMEDOUT )
    -00275                                 throw Timeout(ret, "Timeout in usb_bulk_read");
    -00276                         else
    -00277                                 throw Error(ret, "Error in usb_bulk_read");
    -00278                 }
    -00279                 data.ReleaseBuffer(ret);
    -00280         } while( ret == -EINTR || ret == -EAGAIN );
    -00281 
    -00282         return ret >= 0;
    -00283 }
    -00284 
    -00285 bool Device::InterruptWrite(int ep, const Barry::Data &data, int timeout)
    -00286 {
    -00287         ddout("InterruptWrite to endpoint " << std::dec << ep << ":\n" << data);
    -00288 
    -00289         int ret;
    -00290         do {
    -00291                 ret = usb_interrupt_write(m_handle, ep,
    -00292                         (char*) data.GetData(), data.GetSize(),
    -00293                         timeout == -1 ? m_timeout : timeout);
    -00294                 if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) {
    -00295                         m_lasterror = ret;
    -00296                         if( ret == -ETIMEDOUT )
    -00297                                 throw Timeout(ret, "Timeout in usb_bulk_read");
    -00298                         else
    -00299                                 throw Error(ret, "Error in usb_bulk_read");
    -00300                 }
    -00301         } while( ret == -EINTR || ret == -EAGAIN );
    -00302 
    -00303         return ret >= 0;
    -00304 }
    -00305 
    -00306 //
    -00307 // BulkDrain
    -00308 //
    -00309 /// Reads anything available on the given endpoint, with a low timeout,
    -00310 /// in order to clear any pending reads.
    -00311 ///
    -00312 void Device::BulkDrain(int ep, int timeout)
    -00313 {
    -00314         try {
    -00315                 Barry::Data data;
    -00316                 while( BulkRead(ep, data, timeout) )
    -00317                 ;
    -00318         }
    -00319         catch( Usb::Error & ) {}
    -00320 }
    -00321 
    -00322 //
    -00323 // GetConfiguration
    -00324 //
    -00325 /// Uses the GET_CONFIGURATION control message to determine the currently
    -00326 /// selected USB configuration, returning it in the cfg argument.
    -00327 /// If unsuccessful, returns false.
    -00328 ///
    -00329 bool Device::GetConfiguration(unsigned char &cfg)
    -00330 {
    -00331         int result = usb_control_msg(m_handle, 0x80, USB_REQ_GET_CONFIGURATION, 0, 0,
    -00332                 (char*) &cfg, 1, m_timeout);
    -00333         m_lasterror = result;
    -00334         return result >= 0;
    -00335 }
    -00336 
    -00337 
    -00338 
    -00339 ///////////////////////////////////////////////////////////////////////////////
    -00340 // Interface
    -00341 
    -00342 Interface::Interface(Device &dev, int iface)
    -00343         : m_dev(dev), m_iface(iface)
    -00344 {
    -00345         dout("usb_claim_interface(" << dev.GetHandle() << "," << std::dec << iface << ")");
    -00346         int ret = usb_claim_interface(dev.GetHandle(), iface);
    -00347         if( ret < 0 )
    -00348                 throw Error(ret, "claim interface failed");
    -00349 }
    -00350 
    -00351 Interface::~Interface()
    -00352 {
    -00353         dout("usb_release_interface(" << m_dev.GetHandle() << "," << std::dec << m_iface << ")");
    -00354         usb_release_interface(m_dev.GetHandle(), m_iface);
    -00355 }
    -00356 
    -00357 
    -00358 
    -00359 ///////////////////////////////////////////////////////////////////////////////
    -00360 // EndpointDiscovery
    -00361 
    -00362 bool EndpointDiscovery::Discover(struct usb_interface_descriptor *interface, int epcount)
    -00363 {
    -00364         // start fresh
    -00365         clear();
    -00366         m_valid = false;
    -00367 
    -00368         EndpointPair pair;
    -00369 
    -00370         if( !interface || !interface->endpoint ) {
    -00371                 dout("EndpointDiscovery::Discover: empty interface pointer");
    -00372                 return false;
    -00373         }
    -00374 
    -00375         for( int i = 0; i < epcount; i++ ) {
    -00376                 // load descriptor
    -00377                 usb_endpoint_descriptor desc;
    -00378                 desc = interface->endpoint[i];
    -00379                 dout("      endpoint_desc #" << i << " loaded"
    -00380                         << "\nbLength: " << (unsigned ) desc.bLength
    -00381                         << "\nbDescriptorType: " << (unsigned ) desc.bDescriptorType
    -00382                         << "\nbEndpointAddress: " << (unsigned ) desc.bEndpointAddress
    -00383                         << "\nbmAttributes: " << (unsigned ) desc.bmAttributes
    -00384                         << "\nwMaxPacketSize: " << (unsigned ) desc.wMaxPacketSize
    -00385                         << "\nbInterval: " << (unsigned ) desc.bInterval
    -00386                         << "\nbRefresh: " << (unsigned ) desc.bRefresh
    -00387                         << "\nbSynchAddress: " << (unsigned ) desc.bSynchAddress
    -00388                         << "\n"
    -00389                         );
    -00390 
    -00391                 // add to the map
    -00392                 (*this)[desc.bEndpointAddress] = desc;
    -00393                 dout("      endpoint added to map with bEndpointAddress: " << (unsigned int)desc.bEndpointAddress);
    -00394 
    -00395                 // parse the endpoint into read/write sets, if possible,
    -00396                 // going in discovery order...
    -00397                 // Assumptions:
    -00398                 //      - endpoints of related utility will be grouped
    -00399                 //      - endpoints with same type will be grouped
    -00400                 //      - endpoints that do not meet the above assumptions
    -00401                 //              do not belong in a pair
    -00402                 unsigned char type = desc.bmAttributes & USB_ENDPOINT_TYPE_MASK;
    -00403                 if( desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK ) {
    -00404                         // read endpoint
    -00405                         pair.read = desc.bEndpointAddress;
    -00406                         dout("        pair.read = " << (unsigned int)pair.read);
    -00407                         if( pair.IsTypeSet() && pair.type != type ) {
    -00408                                 // if type is already set, we must start over
    -00409                                 pair.write = 0;
    -00410                         }
    -00411                 }
    -00412                 else {
    -00413                         // write endpoint
    -00414                         pair.write = desc.bEndpointAddress;
    -00415                         dout("        pair.write = " << (unsigned int)pair.write);
    -00416                         if( pair.IsTypeSet() && pair.type != type ) {
    -00417                                 // if type is already set, we must start over
    -00418                                 pair.read = 0;
    -00419                         }
    -00420                 }
    -00421                 // save the type last
    -00422                 pair.type = type;
    -00423                 dout("        pair.type = " << (unsigned int)pair.type);
    -00424 
    -00425                 // if pair is complete, add to array
    -00426                 if( pair.IsComplete() ) {
    -00427                         m_endpoints.push_back(pair);
    -00428                         dout("        pair added! ("
    -00429                                 << "read: " << (unsigned int)pair.read << ","
    -00430                                 << "write: " << (unsigned int)pair.write << ","
    -00431                                 << "type: " << (unsigned int)pair.type << ")");
    -00432                         pair = EndpointPair();  // clear
    -00433                 }
    -00434         }
    -00435 
    -00436         // just for debugging purposes, check for extra descriptors, and
    -00437         // dump them to dout if they exist
    -00438         if( interface->extra ) {
    -00439                 dout("while parsing endpoints, found a block of extra descriptors:");
    -00440                 Barry::Data data(interface->extra, interface->extralen);
    -00441                 dout(data);
    -00442         }
    -00443 
    -00444         return m_valid = true;
    -00445 }
    -00446 
    -00447 
    -00448 ///////////////////////////////////////////////////////////////////////////////
    -00449 // InterfaceDiscovery
    -00450 
    -00451 bool InterfaceDiscovery::DiscoverInterface(struct usb_interface *interface)
    -00452 {
    -00453         if( !interface->altsetting ) {
    -00454                 dout("InterfaceDiscovery::DiscoverIterface: empty altsetting");
    -00455                 // some devices are buggy and return a higher bNumInterfaces
    -00456                 // than the number of interfaces available... in this case
    -00457                 // we just skip and continue
    -00458                 return true;
    -00459         }
    -00460 
    -00461         for( int i = 0; i < interface->num_altsetting; i++ ) {
    -00462                 // load descriptor
    -00463                 InterfaceDesc desc;
    -00464                 desc.desc = interface->altsetting[i];
    -00465                 dout("    interface_desc #" << i << " loaded"
    -00466                         << "\nbLength: " << (unsigned) desc.desc.bLength
    -00467                         << "\nbDescriptorType: " << (unsigned) desc.desc.bDescriptorType
    -00468                         << "\nbInterfaceNumber: " << (unsigned) desc.desc.bInterfaceNumber
    -00469                         << "\nbAlternateSetting: " << (unsigned) desc.desc.bAlternateSetting
    -00470                         << "\nbNumEndpoints: " << (unsigned) desc.desc.bNumEndpoints
    -00471                         << "\nbInterfaceClass: " << (unsigned) desc.desc.bInterfaceClass
    -00472                         << "\nbInterfaceSubClass: " << (unsigned) desc.desc.bInterfaceSubClass
    -00473                         << "\nbInterfaceProtocol: " << (unsigned) desc.desc.bInterfaceProtocol
    -00474                         << "\niInterface: " << (unsigned) desc.desc.iInterface
    -00475                         << "\n"
    -00476                         );
    -00477 
    -00478                 // load all endpoints on this interface
    -00479                 if( !desc.endpoints.Discover(&desc.desc, desc.desc.bNumEndpoints) ) {
    -00480                         dout("    endpoint discovery failed for bInterfaceNumber: " << (unsigned int)desc.desc.bInterfaceNumber << ", not added to map.");
    -00481                         return false;
    -00482                 }
    -00483 
    -00484                 // add to the map
    -00485                 (*this)[desc.desc.bInterfaceNumber] = desc;
    -00486                 dout("    interface added to map with bInterfaceNumber: " << (unsigned int)desc.desc.bInterfaceNumber);
    -00487         }
    -00488         return true;
    -00489 }
    -00490 
    -00491 bool InterfaceDiscovery::Discover(Usb::DeviceIDType devid, int cfgidx, int ifcount)
    -00492 {
    -00493         // start fresh
    -00494         clear();
    -00495         m_valid = false;
    -00496 
    -00497         if( !devid || !devid->config || !devid->config[cfgidx].interface ) {
    -00498                 dout("InterfaceDiscovery::Discover: empty devid/config/interface");
    -00499                 return false;
    -00500         }
    -00501 
    -00502         for( int i = 0; i < ifcount; i++ ) {
    -00503                 if( !DiscoverInterface(&devid->config[cfgidx].interface[i]) )
    -00504                         return false;
    -00505         }
    -00506 
    -00507         return m_valid = true;
    -00508 }
    -00509 
    -00510 
    -00511 ///////////////////////////////////////////////////////////////////////////////
    -00512 // ConfigDiscovery
    -00513 
    -00514 bool ConfigDiscovery::Discover(Usb::DeviceIDType devid, int cfgcount)
    -00515 {
    -00516         // start fresh
    -00517         clear();
    -00518         m_valid = false;
    -00519 
    -00520         for( int i = 0; i < cfgcount; i++ ) {
    -00521                 // load descriptor
    -00522                 ConfigDesc desc;
    -00523                 if( !devid || !devid->config ) {
    -00524                         dout("ConfigDiscovery::Discover: empty devid or config");
    -00525                         return false;
    -00526                 }
    -00527                 desc.desc = devid->config[i];
    -00528                 dout("  config_desc #" << i << " loaded"
    -00529                         << "\nbLength: " << (unsigned int) desc.desc.bLength
    -00530                         << "\nbDescriptorType: " << (unsigned int) desc.desc.bDescriptorType
    -00531                         << "\nwTotalLength: " << (unsigned int) desc.desc.wTotalLength
    -00532                         << "\nbNumInterfaces: " << (unsigned int) desc.desc.bNumInterfaces
    -00533                         << "\nbConfigurationValue: " << (unsigned int) desc.desc.bConfigurationValue
    -00534                         << "\niConfiguration: " << (unsigned int) desc.desc.iConfiguration
    -00535                         << "\nbmAttributes: " << (unsigned int) desc.desc.bmAttributes
    -00536                         << "\nMaxPower: " << (unsigned int) desc.desc.MaxPower
    -00537                         << "\n"
    -00538                         );
    -00539 
    -00540                 // just for debugging purposes, check for extra descriptors, and
    -00541                 // dump them to dout if they exist
    -00542                 if( desc.desc.extra ) {
    -00543                         dout("while parsing config descriptor, found a block of extra descriptors:");
    -00544                         Barry::Data data(desc.desc.extra, desc.desc.extralen);
    -00545                         dout(data);
    -00546                 }
    -00547 
    -00548                 // load all interfaces on this configuration
    -00549                 if( !desc.interfaces.Discover(devid, i, desc.desc.bNumInterfaces) ) {
    -00550                         dout("  config discovery failed for bConfigurationValue: " << (unsigned int)desc.desc.bConfigurationValue << ", not added to map.");
    -00551                         return false;
    -00552                 }
    -00553 
    -00554                 // add to the map
    -00555                 (*this)[desc.desc.bConfigurationValue] = desc;
    -00556                 dout("  config added to map with bConfigurationValue: " << (unsigned int)desc.desc.bConfigurationValue);
    -00557         }
    -00558 
    -00559         return m_valid = true;
    -00560 }
    -00561 
    -00562 
    -00563 ///////////////////////////////////////////////////////////////////////////////
    -00564 // DeviceDiscovery
    -00565 
    -00566 DeviceDiscovery::DeviceDiscovery(Usb::DeviceIDType devid)
    -00567         : m_valid(false)
    -00568 {
    -00569         Discover(devid);
    -00570 }
    -00571 
    -00572 bool DeviceDiscovery::Discover(Usb::DeviceIDType devid)
    -00573 {
    -00574         // start fresh
    -00575         configs.clear();
    -00576         m_valid = false;
    -00577 
    -00578         // copy the descriptor over to our memory
    -00579         if( !devid ) {
    -00580                 dout("DeviceDiscovery::Discover: empty devid");
    -00581                 return false;
    -00582         }
    -00583 
    -00584         desc = devid->descriptor;
    -00585         dout("device_desc loaded"
    -00586                 << "\nbLength: " << (unsigned int) desc.bLength
    -00587                 << "\nbDescriptorType: " << (unsigned int) desc.bDescriptorType
    -00588                 << "\nbcdUSB: " << (unsigned int) desc.bcdUSB
    -00589                 << "\nbDeviceClass: " << (unsigned int) desc.bDeviceClass
    -00590                 << "\nbDeviceSubClass: " << (unsigned int) desc.bDeviceSubClass
    -00591                 << "\nbDeviceProtocol: " << (unsigned int) desc.bDeviceProtocol
    -00592                 << "\nbMaxPacketSize0: " << (unsigned int) desc.bMaxPacketSize0
    -00593                 << "\nidVendor: " << (unsigned int) desc.idVendor
    -00594                 << "\nidProduct: " << (unsigned int) desc.idProduct
    -00595                 << "\nbcdDevice: " << (unsigned int) desc.bcdDevice
    -00596                 << "\niManufacturer: " << (unsigned int) desc.iManufacturer
    -00597                 << "\niProduct: " << (unsigned int) desc.iProduct
    -00598                 << "\niSerialNumber: " << (unsigned int) desc.iSerialNumber
    -00599                 << "\nbNumConfigurations: " << (unsigned int) desc.bNumConfigurations
    -00600                 << "\n"
    -00601         );
    -00602 
    -00603         m_valid = configs.Discover(devid, desc.bNumConfigurations);
    -00604         return m_valid;
    -00605 }
    -00606 
    -00607 } // namespace Usb
    -00608 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/usbwrap_8h.html barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8h.html --- barry-0.14/doc/www/doxygen/html/usbwrap_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ - - -Barry: usbwrap.h File Reference - - - - - - - -

    usbwrap.h File Reference


    Detailed Description

    -USB API wrapper. -

    - -

    -Definition in file usbwrap.h. -

    -#include "dll.h"
    -#include <usb.h>
    -#include <vector>
    -#include <map>
    -#include "error.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry
    namespace  Usb

    Classes

    class  Usb::Error
     Thrown on low level USB errors. More...
    class  Usb::Timeout
    class  Usb::Match
    class  Usb::Device
    class  Usb::Interface
    struct  Usb::EndpointPair
    class  Usb::EndpointDiscovery
    struct  Usb::InterfaceDesc
    class  Usb::InterfaceDiscovery
    struct  Usb::ConfigDesc
    class  Usb::ConfigDiscovery
    class  Usb::DeviceDiscovery

    Defines

    -#define USBWRAP_DEFAULT_TIMEOUT   30000

    Typedefs

    typedef usb_device * Usb::DeviceIDType
     Typedefs used by the wrapper class, in the hope to make it easier to switch from libusb stable to devel and back.
    -typedef usb_dev_handle * Usb::DeviceHandleType
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/usbwrap_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8h-source.html --- barry-0.14/doc/www/doxygen/html/usbwrap_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/usbwrap_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,290 +0,0 @@ - - -Barry: usbwrap.h Source File - - - - - - - -

    usbwrap.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       usbwrap.h
    -00003 ///             USB API wrapper
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2005-2008, Chris Frey
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 
    -00023 #ifndef __SB_USBWRAP_H__
    -00024 #define __SB_USBWRAP_H__
    -00025 
    -00026 #include "dll.h"
    -00027 #include <usb.h>
    -00028 #include <vector>
    -00029 #include <map>
    -00030 #include "error.h"
    -00031 
    -00032 #define USBWRAP_DEFAULT_TIMEOUT 30000
    -00033 
    -00034 namespace Barry { class Data; }
    -00035 
    -00036 /// Namespace for the libusb-related wrapper classes.  This namespace
    -00037 /// may change in the future.
    -00038 namespace Usb {
    -00039 
    -00040 /// \addtogroup exceptions
    -00041 /// @{
    -00042 
    -00043 /// Thrown on low level USB errors.
    -00044 class BXEXPORT Error : public Barry::Error
    -00045 {
    -00046         int m_libusb_errcode;
    -00047 
    -00048 public:
    -00049         Error(const std::string &str);
    -00050         Error(int libusb_errcode, const std::string &str);
    -00051 
    -00052         // can return 0 in some case, if unknown error code
    -00053         int libusb_errcode() const { return m_libusb_errcode; }
    -00054 };
    -00055 
    -00056 class BXEXPORT Timeout : public Error
    -00057 {
    -00058 public:
    -00059         Timeout(const std::string &str) : Error(str) {}
    -00060         Timeout(int libusb_errcode, const std::string &str)
    -00061                 : Error(libusb_errcode, str) {}
    -00062 };
    -00063 
    -00064 /// @}
    -00065 
    -00066 /// Typedefs used by the wrapper class, in the hope to make it
    -00067 /// easier to switch from libusb stable to devel and back.
    -00068 typedef struct usb_device*                      DeviceIDType;
    -00069 typedef struct usb_dev_handle*                  DeviceHandleType;
    -00070 
    -00071 class BXEXPORT Match
    -00072 {
    -00073 private:
    -00074         struct usb_bus *m_busses;
    -00075         struct usb_device *m_dev;
    -00076         int m_vendor, m_product;
    -00077         int m_lasterror;
    -00078         const char *m_busname;
    -00079         const char *m_devname;
    -00080 protected:
    -00081         static bool ToNum(const char *str, long &num);
    -00082         static bool NameCompare(const char *n1, const char *n2);
    -00083 public:
    -00084         Match(int vendor, int product,
    -00085                 const char *busname = 0, const char *devname = 0);
    -00086         ~Match();
    -00087 
    -00088         // searches for next match, and if found, fills devid with
    -00089         // something you can pass on to DeviceDiscover, etc
    -00090         // returns true if next is found, false if no more
    -00091         bool next_device(Usb::DeviceIDType *devid);
    -00092 };
    -00093 
    -00094 
    -00095 class BXEXPORT Device
    -00096 {
    -00097 private:
    -00098         Usb::DeviceIDType m_id;
    -00099         Usb::DeviceHandleType m_handle;
    -00100 
    -00101         int m_timeout;
    -00102         int m_lasterror;
    -00103 
    -00104 public:
    -00105         Device(Usb::DeviceIDType id, int timeout = USBWRAP_DEFAULT_TIMEOUT);
    -00106         ~Device();
    -00107 
    -00108         /////////////////////////////
    -00109         // Data access
    -00110 
    -00111         Usb::DeviceIDType GetID() const { return m_id; }
    -00112         Usb::DeviceHandleType GetHandle() const { return m_handle; }
    -00113         int GetLastError() const { return m_lasterror; } //< not thread safe...
    -00114                 //< use the error code stored in the exceptions to track
    -00115                 //< errors in threaded usage
    -00116 
    -00117 
    -00118         /////////////////////////////
    -00119         // Device manipulation
    -00120 
    -00121         bool SetConfiguration(unsigned char cfg);
    -00122         bool ClearHalt(int ep);
    -00123         bool Reset();
    -00124 
    -00125 
    -00126         /////////////////////////////
    -00127         // IO functions
    -00128 
    -00129         bool BulkRead(int ep, Barry::Data &data, int timeout = -1);
    -00130         bool BulkWrite(int ep, const Barry::Data &data, int timeout = -1);
    -00131         bool BulkWrite(int ep, const void *data, size_t size, int timeout = -1);
    -00132         bool InterruptRead(int ep, Barry::Data &data, int timeout = -1);
    -00133         bool InterruptWrite(int ep, const Barry::Data &data, int timeout = -1);
    -00134 
    -00135         void BulkDrain(int ep, int timeout = 100);
    -00136 
    -00137 
    -00138         /////////////////////////////
    -00139         // Combo functions
    -00140 
    -00141         bool GetConfiguration(unsigned char &cfg);
    -00142 };
    -00143 
    -00144 class BXEXPORT Interface
    -00145 {
    -00146         Device &m_dev;
    -00147         int m_iface;
    -00148 public:
    -00149         Interface(Device &dev, int iface);
    -00150         ~Interface();
    -00151 };
    -00152 
    -00153 
    -00154 
    -00155 
    -00156 // Map of Endpoint numbers (not indexes) to endpoint descriptors
    -00157 struct BXEXPORT EndpointPair
    -00158 {
    -00159         unsigned char read;
    -00160         unsigned char write;
    -00161         unsigned char type;
    -00162 
    -00163         EndpointPair() : read(0), write(0), type(0xff) {}
    -00164         bool IsTypeSet() const { return type != 0xff; }
    -00165         bool IsComplete() const { return read && write && IsTypeSet(); }
    -00166 };
    -00167 
    -00168 class BXEXPORT EndpointDiscovery : public std::map<unsigned char, usb_endpoint_descriptor>
    -00169 {
    -00170         friend class InterfaceDiscovery;
    -00171 
    -00172 public:
    -00173         typedef std::map<unsigned char, usb_endpoint_descriptor>base_type;
    -00174         typedef std::vector<EndpointPair>                       endpoint_array_type;
    -00175 
    -00176 private:
    -00177         bool m_valid;
    -00178         endpoint_array_type m_endpoints;
    -00179 
    -00180         BXLOCAL bool Discover(struct usb_interface_descriptor *interface, int epcount);
    -00181 
    -00182 public:
    -00183         EndpointDiscovery() : m_valid(false) {}
    -00184 
    -00185         bool IsValid() const { return m_valid; }
    -00186 
    -00187         const endpoint_array_type & GetEndpointPairs() const { return m_endpoints; }
    -00188 };
    -00189 
    -00190 
    -00191 
    -00192 // Map of Interface numbers (not indexes) to interface descriptors and endpoint map
    -00193 struct BXEXPORT InterfaceDesc
    -00194 {
    -00195         usb_interface_descriptor desc;
    -00196         EndpointDiscovery endpoints;
    -00197 };
    -00198 
    -00199 class BXEXPORT InterfaceDiscovery : public std::map<int, InterfaceDesc>
    -00200 {
    -00201 public:
    -00202         typedef std::map<int, InterfaceDesc>                    base_type;
    -00203 
    -00204 private:
    -00205         bool m_valid;
    -00206 
    -00207         BXLOCAL bool DiscoverInterface(struct usb_interface *interface);
    -00208 
    -00209 public:
    -00210         InterfaceDiscovery() : m_valid(false) {}
    -00211 
    -00212         bool Discover(Usb::DeviceIDType devid, int cfgidx, int ifcount);
    -00213         bool IsValid() const { return m_valid; }
    -00214 };
    -00215 
    -00216 
    -00217 
    -00218 
    -00219 // Map of Config numbers (not indexes) to config descriptors and interface map
    -00220 struct BXEXPORT ConfigDesc
    -00221 {
    -00222         usb_config_descriptor desc;
    -00223         InterfaceDiscovery interfaces;
    -00224 };
    -00225 
    -00226 class BXEXPORT ConfigDiscovery : public std::map<unsigned char, ConfigDesc>
    -00227 {
    -00228 public:
    -00229         typedef std::map<unsigned char, ConfigDesc>             base_type;
    -00230 
    -00231 private:
    -00232         bool m_valid;
    -00233 
    -00234 public:
    -00235         ConfigDiscovery() : m_valid(false) {}
    -00236 
    -00237         bool Discover(Usb::DeviceIDType devid, int cfgcount);
    -00238         bool IsValid() const { return m_valid; }
    -00239 };
    -00240 
    -00241 
    -00242 
    -00243 // Discovers all configurations, interfaces, and endpoints for a given device
    -00244 class BXEXPORT DeviceDiscovery
    -00245 {
    -00246         bool m_valid;
    -00247 
    -00248 public:
    -00249         usb_device_descriptor desc;
    -00250         ConfigDiscovery configs;
    -00251 
    -00252 public:
    -00253         DeviceDiscovery(Usb::DeviceIDType devid);
    -00254 
    -00255         bool Discover(Usb::DeviceIDType devid);
    -00256         bool IsValid() const { return m_valid; }
    -00257 };
    -00258 
    -00259 } // namespace Usb
    -00260 
    -00261 #endif
    -00262 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/version_8cc.html barry-0.0.20110506/doc/www/doxygen/html/version_8cc.html --- barry-0.14/doc/www/doxygen/html/version_8cc.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/version_8cc.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ - - -Barry: version.cc File Reference - - - - - - - -

    version.cc File Reference


    Detailed Description

    -Provide access to library version information. -

    - -

    -Definition in file version.cc. -

    -#include "version.h"
    -#include "config.h"
    - -

    -Go to the source code of this file. - - - - - - - - - - - - - - - -

    Namespaces

    namespace  Barry

    Defines

    -#define BARRY_VERSION_STRING   "Barry library version 0.14 (little endian)"
    -#define BARRY_VERSION_MAJOR   0
    -#define BARRY_VERSION_MINOR   14

    Functions

    const char * Barry::Version (int &major, int &minor)
     Fills major and minor with integer version numbers, and returns a string containing human readable version information in English.
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/version_8cc-source.html barry-0.0.20110506/doc/www/doxygen/html/version_8cc-source.html --- barry-0.14/doc/www/doxygen/html/version_8cc-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/version_8cc-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ - - -Barry: version.cc Source File - - - - - - - -

    version.cc

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       version.cc
    -00003 ///             Provide access to library version information
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #include "version.h"
    -00023 #include "config.h"
    -00024 
    -00025 #ifdef WORDS_BIGENDIAN
    -00026 #define BARRY_VERSION_STRING    "Barry library version 0.14 (big endian)"
    -00027 #else
    -00028 #define BARRY_VERSION_STRING    "Barry library version 0.14 (little endian)"
    -00029 #endif
    -00030 
    -00031 #define BARRY_VERSION_MAJOR     0
    -00032 #define BARRY_VERSION_MINOR     14
    -00033 
    -00034 namespace Barry {
    -00035 
    -00036 /// Fills major and minor with integer version numbers, and
    -00037 /// returns a string containing human readable version
    -00038 /// information in English.
    -00039 const char* Version(int &major, int &minor)
    -00040 {
    -00041         major = BARRY_VERSION_MAJOR;
    -00042         minor = BARRY_VERSION_MINOR;
    -00043         return BARRY_VERSION_STRING;
    -00044 }
    -00045 
    -00046 } // namespace Barry
    -00047 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/version_8h.html barry-0.0.20110506/doc/www/doxygen/html/version_8h.html --- barry-0.14/doc/www/doxygen/html/version_8h.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/version_8h.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ - - -Barry: version.h File Reference - - - - - - - -

    version.h File Reference


    Detailed Description

    -Provide access to library version information. -

    - -

    -Definition in file version.h. -

    -#include "dll.h"
    - -

    -Go to the source code of this file. - - - - - - - - -

    Namespaces

    namespace  Barry

    Functions

    const char * Barry::Version (int &major, int &minor)
     Fills major and minor with integer version numbers, and returns a string containing human readable version information in English.
    -


    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/doxygen/html/version_8h-source.html barry-0.0.20110506/doc/www/doxygen/html/version_8h-source.html --- barry-0.14/doc/www/doxygen/html/version_8h-source.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/doxygen/html/version_8h-source.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - - -Barry: version.h Source File - - - - - - - -

    version.h

    Go to the documentation of this file.
    00001 ///
    -00002 /// \file       version.h
    -00003 ///             Provide access to library version information
    -00004 ///
    -00005 
    -00006 /*
    -00007     Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)
    -00008 
    -00009     This program is free software; you can redistribute it and/or modify
    -00010     it under the terms of the GNU General Public License as published by
    -00011     the Free Software Foundation; either version 2 of the License, or
    -00012     (at your option) any later version.
    -00013 
    -00014     This program is distributed in the hope that it will be useful,
    -00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
    -00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    -00017 
    -00018     See the GNU General Public License in the COPYING file at the
    -00019     root directory of this project for more details.
    -00020 */
    -00021 
    -00022 #ifndef __BARRY_VERSION_H__
    -00023 #define __BARRY_VERSION_H__
    -00024 
    -00025 #include "dll.h"
    -00026 
    -00027 namespace Barry {
    -00028 
    -00029 BXEXPORT const char* Version(int &major, int &minor);
    -00030 
    -00031 } // namespace Barry
    -00032 
    -00033 #endif
    -00034 
    -

    Generated on Wed Sep 24 21:27:32 2008 for Barry by  - -doxygen 1.5.1
    - - diff -Nru barry-0.14/doc/www/hacking.html barry-0.0.20110506/doc/www/hacking.html --- barry-0.14/doc/www/hacking.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/hacking.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,200 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - -
    BlackBerry protocol
    - -

    No BlackBerry-related protocol project would be complete without referencing -the fine documentation from the Cassis project, which tackled the earlier -serial protocol. You can find this documentation at: - -

    - -

    There were some major and minor differences found between the serial -protocol and the USB protocol. Some of the new handheld devices use new -database record access commands, and in these cases the record format changes. -See the code for more detailed information.

    - -

    Further documentation on the USB protocol is planned. Stay tuned.

    - - -
    Playing with the protocol
    - -

    The USB captures were performed on a Windows XP Pro system running UsbSnoop -from http://benoit.papillault.free.fr/usbsnoop/index.php

    - -

    You can use the convo.awk and btranslate.cc tools to turn these very verbose -logs into something more manageable. Other than the normal USB control -commands at the beginning of each conversation, it was found that only -USB Bulk Transfers were used.

    - -

    The btool utility is at the stage where it can be used instead of UsbSnoop, -for database operations. You can use the -v switch to turn on data packet -dumping, which will display the sent and received packets in canonical hex -format as btool talks to the device. You can use this in combination with -the -d switch to capture new database records to reverse engineer.

    - -

    If you reverse engineer some of the unimplemented packet formats, please -send patches and/or documentation to the -mailing list!

    - -

    See the doc/Hacking file for more information on getting started reverse -engineering the protocol.

    - - -
    Some notes on code architecture
    - -

    Note: this is currently out of date.

    - -

    Lowest level: -

      - Lowest level is the libusb software. -
    - -

    USB layer: -

      - - - - - - - - - - -
      usbwrap.{h,cc}C++ wrapper for libusb
      data.{h,cc}C++ data class for buffer management and hex log file input and output
      debug.hgeneral debugging output support
      -
    - - -

    Barry low level layer: -

      - - - - - - - - - - -
      packet.{h,cc}low level packet builder class, having knowledge of - specific protocol commands in order to hide protocol details - behind an API
      protostructs.hlow level, packed structs representing the USB protocol
      time.{h,cc}time conversions between 1900-based minutes and C's 1970-based time_t
      -
    - - -

    Barry API layer: -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      base64.{h,cc}base64 encoding and decoding (for LDIF)
      builder.hC++ virtual wrappers to connect record and controller in a generic way
      endian.hbig/little endian defines... only used for compiling - the library, never installed
      error.{h,cc}common exception classes for Barry layer
      probe.{h,cc}USB probe class to find Blackberry devices
      protocol.{h,cc}structs and defines for packets seen on wire
      common.{h,cc}general API and utilities
      socket.{h,cc}socket class encapsulating the Blackberry logical socket
      record.{h,cc}programmer-friendly record classes
      parser.{h,cc}C++ virtual wrappers to connect record and controller in a generic way
      controller.{h,cc}, controllertmpl.hhigh level API class
      version.hlibrary version information and API
      s11n-boost.hserialization functions for record.h classes
      barry.happlication header (only one needed)
      cbarry.hC application header (incomplete)
      -
    - -

    Misc utilities: -

      - - - - - - - - - - - - - - - - - - - - - - - -
      btool.cccommand line testing utility
      bcharge.ccset device to use 500mA, and also enables database access for Blackberry Pearl devices
      breset.ccdoes a USB level software reset on all Blackberry devices found
      convo.awkscript to convert UsbSnoop log files into trimmed-down request/response conversations
      ktrans.ccturns USB kernel capture logs from 2.6 kernels into hex+ascii dumps
      translate.cctranslate UsbSnoop log file data into hex+ascii dumps
      upldif.cctakes an ldap LDIF file on stdin and uploads contact data to the Blackberry, overwriting existing contacts
      -
    - -

    Example code: -

      - - - - - -
      addcontact.ccexample for adding a contact record to the device
      -
    - - -

    Enjoy!

    - - - - - - - diff -Nru barry-0.14/doc/www/hacking.php barry-0.0.20110506/doc/www/hacking.php --- barry-0.14/doc/www/hacking.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/hacking.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,8 @@ - - -
    BlackBerry protocol
    + + +

    No BlackBerry-related protocol project would be complete without referencing the fine documentation from the Cassis project, which tackled the earlier @@ -20,7 +20,7 @@

    Further documentation on the USB protocol is planned. Stay tuned.

    -
    Playing with the protocol
    +

    The USB captures were performed on a Windows XP Pro system running UsbSnoop from http://benoit.papillault.free.fr/usbsnoop/index.php

    @@ -43,8 +43,9 @@

    See the doc/Hacking file for more information on getting started reverse engineering the protocol.

    +

    Enjoy!

    diff -Nru barry-0.14/doc/www/index.html barry-0.0.20110506/doc/www/index.html --- barry-0.14/doc/www/index.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/index.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - -
    Overview
    - -

    Linux users who also use a BlackBerry ™ now have an option for -managing their BlackBerry directly from Linux.

    - -

    Barry is an Open Source application that will provide synchronization, -backup, restore and program management for BlackBerry ™ devices. -Barry is primarily developed on Linux, but is intended as a cross platform -library and application set, targeting Linux, BSD, 32/64bit, and big/little -endian systems. -

    - -

    The Barry project began in October 2005 and has steadily added features -and polish to Blackberry usage on Linux ever since. We were the first to -reverse engineer the battery charging handshake via USB.

    - -

    Today, it is possible to: - -

      -
    • charge your Blackberry's battery from your USB port
    • -
    • retrieve Address Book, Email, Calendar, Service Book, Memos, - Tasks, PIN Messages, Saved Email, and Folders
    • -
    • export Address Book contacts in text or LDAP LDIF format
    • -
    • make full data backups and restores of your device using - a GUI
    • -
    • synchronize contacts and calendar items using the - OpenSync - framework
    • -
    • use the Blackberry as a modem
    • -
    -

    - -
    Status
    - -

    -

      -
    • Latest release: 0.14
    • -
    • Download source and binary packages from - Sourceforge or the OpenSUSE Build Service
    • -
    • General Sourceforge project page
    • -
    • Barry git repo
    • -
    • Known Issues: -
        -
      • Restoring backups for some databases on newer Blackberries doesn't work (for example, on the 8120, 8700g)
      • -
      • Syncing is not supported on Fedora Core 9, since they packaged the OpenSync 0.3x devel tree
      • -
      • Password support when using Blackberry as modem is experimental
      • -
      • Accessing the database (such as during a backup) while copying files using the usb_storage kernel module may cause some Blackberries to spontaneously reboot
      • -
      • The opensync plugin does not handle international characters well.
      • -
      -
    • -
    -

    - -
    Getting Started
    - -

    How do I... -

    -

    - -

    Some helpful lists: -

    -

    - - -
    How to Help
    - -

    If you are a C++ programmer, grab the source from -CVS - and take a look at the TODO file. -Post a message to the -mailing list -when you start working on any of the listed features, so you can connect -with other developers, and avoid duplicating effort.

    - -

    If you are a Python programmer, contact the mailing list, since we -would like to create and test a Python interface to the Barry library.

    - -

    If you are not a programmer, but have a Blackberry, we can always use -help in testing. Install Barry on your system, and -report any bugs - you find.

    - -

    If you prefer writing documentation, grab the source from -CVS - and look under the doc/www directory. -Documentation is currently in html form, as well as doxygen-generated -API documentation found in the comments of the source code itself. -Patches updating either set of documentation are welcome.

    - -

    There are dozens of databases that need to be documented and supported -in the library. If you have a BlackBerry ™ device and are interested -in helping decipher data, we have a -Barry hacking document - that will help you. -

    - -
    Design
    - -

    If you are interested in helping out or just interested in how it works, -check out our design notes -. - -

    Roadmap
    - -

    We have put together a document that describes where we are and where we -want to take Barry. Check out our roadmap -to see what's happening.

    - -
    External Links
    - -

    Barry users and others have contributed documentation and have -put these howto's on the web. Below is a list of some of these pages. -These sites are not associated with NetDirect, and some of the information -may be out of date, but they may still be helpful to new users.

    - -

    -

    -

    - - - - - - - diff -Nru barry-0.14/doc/www/index.php barry-0.0.20110506/doc/www/index.php --- barry-0.14/doc/www/index.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/index.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,8 @@ - - -
    Overview
    + + +

    Linux users who also use a BlackBerry ™ now have an option for managing their BlackBerry directly from Linux.

    @@ -22,15 +22,45 @@
    • charge your Blackberry's battery from your USB port
    • -
    • retrieve Address Book, Email, Calendar, Service Book, Memos, - Tasks, PIN Messages, Saved Email, and Folders
    • -
    • export Address Book contacts in text or LDAP LDIF format
    • +
    • parse the following database records: + Address Book, + Browser Bookmarks, + Calendar, + Content Store, + Folders, + Memos, + Messages (Email), + Phone Call Logs, + PIN Messages, + Saved Email, + Service Book, + SMS messages, + Tasks, + Time Zones +
    • +
    • create the following database records: + Address Book, + Calendar, + Content Store, + Memos, + Tasks +
    • +
    • export Address Book contacts in text, LDAP LDIF format, or + as MIME vCards
    • +
    • import data in MIME vCard, vEvent, vJournal, and vTodo formats
    • make full data backups and restores of your device using a GUI
    • -
    • synchronize contacts and calendar items using the +
    • synchronize contact, calendar, memo, and task items using the OpenSync - framework
    • + framework (memos and tasks require the development OpenSync + libraries)
    • use the Blackberry as a modem
    • +
    • install and manage Java applications from the command line
    • +
    • take screenshots of your device
    • +
    • set the device time from the command line
    • +
    • use raw channel support to communicate with BlackBerry + applications
    • +
    • ... and more

    @@ -38,32 +68,41 @@

      -
    • Latest release: 0.14
    • -
    • Download source and binary packages from - Sourceforge or the OpenSUSE Build Service
    • +
    • Latest release: 0.17, released on 2011/02/10
    • +
    • License: GPL v2 or later
    • +
    • Download official source and binary packages from + Sourceforge
    • General Sourceforge project page
    • Barry git repo
    • +
    • Additional binary packages for the following distributions are available from various volunteers. Note that these packages may already be available in your distro of choice, using the normal package managers. + +
    • Known Issues:
        +
      • International characters in calendar and contact records + cause some devices to switch to a different low-level + protocol, which Barry does not yet support.
      • Restoring backups for some databases on newer Blackberries doesn't work (for example, on the 8120, 8700g)
      • -
      • Syncing is not supported on Fedora Core 9, since they packaged the OpenSync 0.3x devel tree
      • -
      • Password support when using Blackberry as modem is experimental
      • -
      • Accessing the database (such as during a backup) while copying files using the usb_storage kernel module may cause some Blackberries to spontaneously reboot
      • -
      • The opensync plugin does not handle international characters well.
      • +
      • Syncing is not supported on Fedora Core 9 or 10, since they packaged the OpenSync 0.3x devel tree (experimental support for the latest opensync SVN tree is included with a new plugin). This has been fixed in Fedora 11, as they returned to version 0.22.

    -
    Getting Started
    +

    How do I...

    • -
    • +
    • +
    • @@ -71,18 +110,20 @@

    -

    Some helpful lists: +

    Some helpful pages:

    • +
    • +

    -
    How to Help
    +

    If you are a C++ programmer, grab the source from - and take a look at the TODO file. + and take a look at the TODO file. Post a message to the mailing list when you start working on any of the listed features, so you can connect @@ -96,7 +137,7 @@ you find.

    If you prefer writing documentation, grab the source from - and look under the doc/www directory. + and look under the doc/www directory. Documentation is currently in html form, as well as doxygen-generated API documentation found in the comments of the source code itself. Patches updating either set of documentation are welcome.

    @@ -107,18 +148,25 @@ that will help you.

    -
    Design
    +

    If you are interested in the low level USB protocol, you can download, +or contribute, USB logs to the +.

    + + +

    If you are interested in helping out or just interested in how it works, check out our . -

    Roadmap
    + +

    We have put together a document that describes where we are and where we want to take Barry. Check out our to see what's happening.

    -
    External Links
    + +

    Barry users and others have contributed documentation and have put these howto's on the web. Below is a list of some of these pages. @@ -127,8 +175,17 @@

    + + + + diff -Nru barry-0.14/doc/www/install.html barry-0.0.20110506/doc/www/install.html --- barry-0.14/doc/www/install.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/install.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - - -
    Dependencies
    - -

    See the software dependencies - page for -detailed information on the software that Barry needs.

    - - -
    Binary Packages
    - -

    Download the matching packages for your system from the -Sourceforge download page or the OpenSUSE Build Service page.

    - -

    On Sourceforge, packages are available for multiple distros, and are -indicated by the filenames: -

      -
    • ubuntu710 - Ubuntu Gutsy Gibbon, 7.10
    • -
    • ubuntu804 - Ubuntu Hardy Heron, 8.04
    • -
    • fc7 - Fedora Core 7
    • -
    • fc8 - Fedora Core 8
    • -
    • fc9 - Fedora Core 9
    • -
    • suse10 - OpenSuSE 10.2
    • -
    • the non-tagged deb files are for Debian Stable, 4.0
    • -
    -

    - -

    On OBS, packages are located in subdirectories per distro. Be sure to -select the correct platform, whether 32 bit or 64 bit.

    - -

    Barry is split up into multiple binary packages. For example, -if you want the GUI backup program, you will also need the Barry library. -For non-development systems, you will need: -

      -
    • libbarry0
    • -
    • barry-util
    • -
    • barrybackup-gui
    • -
    • barry-opensync (libopensync-plugin-barry on Debian systems)
    • -
    -

    - -

    For development systems, you will need the following additional -packages: -

      -
    • libbarry-dev
    • -
    -

    - -

    You will also notice on the above Sourceforge download site, that there -is a separate section for debug packages. These packages are only -necessary if you run into a bug that causes one of the above programs -to crash, and you wish to help developers in tracking down the error.

    - - - - - - - diff -Nru barry-0.14/doc/www/install.php barry-0.0.20110506/doc/www/install.php --- barry-0.14/doc/www/install.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/install.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,35 +1,32 @@ - - + -
    Dependencies
    +

    See the page for detailed information on the software that Barry needs.

    -
    Binary Packages
    +

    Download the matching packages for your system from the -Sourceforge download page or the OpenSUSE Build Service page.

    +Sourceforge download page.

    On Sourceforge, packages are available for multiple distros, and are indicated by the filenames:

    • ubuntu710 - Ubuntu Gutsy Gibbon, 7.10
    • ubuntu804 - Ubuntu Hardy Heron, 8.04
    • +
    • ubuntu904 - Ubuntu Jaunty, 9.04
    • fc7 - Fedora Core 7
    • fc8 - Fedora Core 8
    • fc9 - Fedora Core 9
    • -
    • suse10 - OpenSuSE 10.2
    • -
    • the non-tagged deb files are for Debian Stable, 4.0
    • +
    • f11 - Fedora Core 11
    • +
    • the non-tagged deb files are for Debian Stable 5.0, Lenny

    -

    On OBS, packages are located in subdirectories per distro. Be sure to -select the correct platform, whether 32 bit or 64 bit.

    -

    Barry is split up into multiple binary packages. For example, if you want the GUI backup program, you will also need the Barry library. For non-development systems, you will need: @@ -48,6 +45,9 @@

+

Note that there are only binary packages available for opensync 0.22, +since opensync 0.4x is not yet officially released.

+

You will also notice on the above Sourceforge download site, that there is a separate section for debug packages. These packages are only necessary if you run into a bug that causes one of the above programs Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/label.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/label.png differ diff -Nru barry-0.14/doc/www/logs.php barry-0.0.20110506/doc/www/logs.php --- barry-0.14/doc/www/logs.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/logs.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,97 @@ + + + + + + +

Volunteers have contributed USB logs to help with reverse engineering +the low level protocol. If you would like to contribute a log that is +not already available here, please +.

+ +
+ +

Please note: These logs are very dense and highly +technical, and are not intended for end users, but instead intended +for developers who want to help reverse engineer the low level +USB protocol.

+ +
+ +

Some of the following log contributors are active on the +barry-devel mailing list, +in case you wish to get in touch with them. + +

Contributors in alphabetical order by last name: +

    + +
  • Josh Kropf

    +
      +

      Josh notes: The following captures where retreived using + SniffUsb.exe on Windows XP. For each capture I allowed the device + to settle for a few seconds before executing the single javaloader + command. Then after copying the log file I trimmed the initial + USB IO leading up to the request for javaloader mode. This should + get rid of any unrelated noise from the head of the log file.

      + +

      To create the files below I ran each log through the awk + script in barry called convo.awk, and then through btranslate + tool:

      + +

      awk -f convo.awk raw.log | btranslate > filtered.usb

      +
    + +
      +
    • - device info
    • +
    • - output from device info command
    • +
    • - erase module
    • +
    • - attempt to erase module that is in use resulting in an error
    • +
    • - forcefully erase module in use
    • +
    • - annotated portion of the javaloader USB dump relating to device reset with descriptions of the various packets
    • +
    • - load module
    • +
    • - load and replace in use module
    • +
    • - save module
    • +
    • - save large module (107748 bytes) with siblings
    • +
    • - save very large module (655796 bytes) with siblings
    • +
    • - dump eventlog
    • +
    • - dump eventlog that contains an uncaught exception
    • +
    • - clear eventlog
    • +
    • - save screenshot as bmp
    • +
    + +
      +

      Full firmware load:

      +
    + +
      +
    • - (large! about 33MB) USB logs generated by VMWare Fusion as per the instructions in this tutorial.
    • + +
    • - CFP info output before the OS install.
    • +
    • - CFP info output after the OS install.
    • +
    + +
  • + +
  • Robert Yaklin

    +
      +
    • +
    • +
    • +
    • +
    • (5MB)
    • +
    • +
    • +
    • +
    • +
    • +
    • (large! about 20MB)
    • +
    • +
    • +
    • +
    • +
    +
  • + +
+

+ diff -Nru barry-0.14/doc/www/modem.html barry-0.0.20110506/doc/www/modem.html --- barry-0.14/doc/www/modem.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/modem.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Introduction
- -

The Blackberry has the ability to act like a Hayes compatible modem, -complete with AT commands.

- -

In order to make use of this feature you will need the Barry command line -tools installed on your system. See the Install -page for more details.

- -

You will need three components to connect to the internet: -

    -
  • a working Barry install, version 0.13 or later
  • -
  • a working pppd and matching kernel
  • -
  • an options file and chatscript for your Blackberry provider
  • -
-

- - -
If You Installed Barry's Binary Packages...
- -

If you installed Barry's binary packages, specifically barry-util, -then default ppp options and chat scripts are installed automatically -for you. Currently there are scripts available for the following -providers: -

    -
  • O2 Ireland
  • -
  • Rogers
  • -
  • Sprint
  • -
  • T-Mobile US
  • -
  • Verizon
  • -
-

- -

For example, to run the default Rogers connection script, use the -following command as root:

-
-	pppd call barry-rogers
-
- -

If none of the default script work, see the Troubleshooting section -below.

- - -
If You Installed Barry From Source...
- -

Configuring PPPD

- -

Sample configurations are provided in the source tarball, and if you are -using a binary package, they should already be installed for you under -/etc/ppp/peers and (depending on your system) /etc/chatscripts.

- -

Copy the desired options file to /etc/ppp/peers and edit the file, -making sure that the paths are referencing the correct files. -

    -
  • pty - must point to the location you installed Barry's - pppob program.
  • -
  • connect - must use the correct chatscript
  • -
-

- - -

Establishing a Connection

- -

If you named your options file "barry-rogers", then to connect to the -internet, run:

-
-	pppd call barry-rogers
-
- -

Some systems may provide wrapper scripts for running pppd. For example, -Debian uses "pon" and "poff".

- - - -
If Your Device Needs a Password...
- -

If your device requires a password, you can specify this on the pppob -command line. For example, if you are using the barry-rogers -PPP script, edit your /etc/ppp/peers/barry-rogers file, so that the -pty option says something like this: -

-
-	pty "/usr/sbin/pppob -P password"
-
- - -
Testing Your Connection
- -

PPP will display some messages on stdout as it connects. On success, -you should see IP address negotiation and the resulting IP address for your -machine. PPP will then just wait for network activity.

- -

When testing to see if this works, use your web browser. The usual -method of using ping does not work reliably, and some providers -may have this blocked.

- -

Check your routing table to make sure that the new default gateway -is there.

-
-	/sbin/route -n
-
- - -
Security Concerns
- -

Depending on your provider, you may or may not have a firewall installed -when you connect to the internet through a tethered modem. Keep an eye on -your open ports, and remember that connecting to the internet this way -may not be the same as the network you are used to.

- -

Also keep in mind that if your system is configured to forward packets -and you have pppd setup to replace your current default route, and you -are still connected to an internal network (say, via ethernet), this could -allow outside connections to be routed to your internal network. The -default pppd options files installed by Barry do not use the -replacedefaultroute setting for this reason. Contact your -network administrator for assistance on configuring your mobile -network setups.

- - - -
Troubleshooting
- -

Some devices don't respond to the PPP commands at first, but after -the battery is removed and reinserted, modem functionality works. This is -likely due to the protocol not being completely understood, but resetting -the device in this manner is enough of a workaround to get it working.

- -

If you still run into trouble, the first task is to increase debug output -and to log it. PPPD supports increased logging if you add the following -lines to the options file:

-
-	debug
-	nodetach
-
- -

Barry's pppob program also supports verbose protocol logging. -Change your options file and edit the pppob command line. For example, -if your pppob is installed in /usr/sbin, set the pty option to:

- -
-	pty "/usr/sbin/pppob -l /tmp/pppob.log -v"
-
- -

Be sure to remove these options once you have your connection working, -as the above causes your entire internet traffic to be logged to the -output file.

- -

If your provider is not yet supported by the sample options files, -you will need to do a little digging on your own. If you are able to -tether your Blackberry using a Windows system, you can duplicate the -login information in your chat script.

- -

You may also find example configurations for your provider on the -various Blackberry forums available online.

- -

If you are still having trouble, please send an email to the -mailing list, -including: -

    -
  • the version of Barry you are using
  • -
  • the output from pppd
  • -
  • the log output from pppob
  • -
  • the ppp options file and chatscript you used
  • -
-

- -

The logs from pppob can be fairly large, so limit the size to a single -run.

- - - - - - - diff -Nru barry-0.14/doc/www/modem.php barry-0.0.20110506/doc/www/modem.php --- barry-0.14/doc/www/modem.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/modem.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
Introduction
+

The Blackberry has the ability to act like a Hayes compatible modem, complete with AT commands.

@@ -21,18 +20,27 @@

-
If You Installed Barry's Binary Packages...
+

If you installed Barry's binary packages, specifically barry-util, then default ppp options and chat scripts are installed automatically for you. Currently there are scripts available for the following providers:

    +
  • AT&T Cingular
  • +
  • China Mobile
  • +
  • Fido
  • +
  • KPN Nederland
  • O2 Ireland
  • +
  • Optus AU
  • +
  • Orange Spain
  • Rogers
  • Sprint
  • +
  • Telus
  • T-Mobile US
  • Verizon
  • +
  • Vodafone AU
  • +
  • and a minimalist script for debugging

@@ -42,11 +50,11 @@ pppd call barry-rogers -

If none of the default script work, see the Troubleshooting section +

If none of the default scripts work, see the Troubleshooting section below.

-
If You Installed Barry From Source...
+

Configuring PPPD

@@ -77,7 +85,7 @@ -
If Your Device Needs a Password...
+

If your device requires a password, you can specify this on the pppob command line. For example, if you are using the barry-rogers @@ -89,7 +97,7 @@ -

Testing Your Connection
+

PPP will display some messages on stdout as it connects. On success, you should see IP address negotiation and the resulting IP address for your @@ -106,7 +114,7 @@ -

Security Concerns
+

Depending on your provider, you may or may not have a firewall installed when you connect to the internet through a tethered modem. Keep an eye on @@ -124,7 +132,7 @@ -

Troubleshooting
+

Some devices don't respond to the PPP commands at first, but after the battery is removed and reinserted, modem functionality works. This is @@ -173,3 +181,49 @@

The logs from pppob can be fairly large, so limit the size to a single run.

+ + + +

If your device has Bluetooth support, it is also possible to tether +using Linux's own native Bluetooth serial drivers. There are probably +better tutorials on this already on the net, but here are a few notes +from Michael Brown to help you get started.

+ +

Bluetooth Config

+ +

Put the following in your /etc/bluetooth/rfcomm.conf file, replacing +the X's with your Bluetooth BADDR.

+ +
+rfcomm0 {
+	bind yes;
+	device XX:XX:XX:XX:XX:XX;
+	channel 1;
+	comment "Blackberry Dialup";
+}
+
+ +

PPP Config

+ +

Use the same peer file that you would use for the USB tethering above, +but remove the pty line that points to /usr/sbin/pppob. Since you are +using the Bluetooth serial port, you don't need pppob. Replace that +line with the line of your newly configured rfcomm device. You may +also need to specify the baud rate.

+ +
+/dev/rfcomm0
+115200
+
+ +

Chatscript Config

+ +

No change is required. Use the same chatscript you would use for +USB above.

+ +

Run as usual. For example:

+ +
+	pppd call barry-rogers
+
+ diff -Nru barry-0.14/doc/www/patches.html barry-0.0.20110506/doc/www/patches.html --- barry-0.14/doc/www/patches.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/patches.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ - - - - Barry Documentation - - - - - - - -
- - - - -
Coding Guidelines
- -

If you are submitting code, please have a look at the -Coding Guidelines page -.

- -

Please keep some things in mind when preparing your patches -for submission: -

    -
  • use one patch per logical change
  • -
  • test all coding changes
  • -
      -
    • If it is a change to the build system, make sure that - the test/buildtest.sh script still works.
    • -
    -
  • include some commentary above your patch in your email
  • -
  • when mailing patches, try to keep one patch per email
  • -
  • do not cut and paste patches... either read them in - directly to your mail body (preferred), - or send as an attachment
  • -
  • add a [PATCH] prefix to your subject line
  • -
- - -
Generating Patches
- -

Generating patches depends on the method you used to get the source code. -

    -
  • If you are using a tarball, expand the tarball once into - a pristine directory, and again into your "working - directory." When you are finished and - ready to patch, do: -
    -	cd barry-work
    -	./buildgen.sh cleanall
    -	cd ..
    -	diff -ruN barry-orig barry-work > patchfile
    -
    -
  • - -
  • If you are using CVS, make your changes in your working - directory, and then do: -
    -	cd barry-cvs
    -	./buildgen.sh cleanall
    -	cvs diff -u > patchfile
    -	grep ^? patchfile
    -
    - Any new files that you've added to your tree will need - to be attached to your patch email, as CVS has no - way to add files without write access to the repository. -

  • - -
  • If you are using the git tree, you can make your changes - in your own branch, and then create patches for each - commit you've made: -
    -	cd barry-git
    -	git format-patch origin/master
    -
    - -
  • - -
- - -
Methods for Submitting Patches
- -

Submitting changes can happen in one of three methods: - -

    -
  • Send a patch to the - mailing list. -
  • - -
  • Publish your own git repository (perhaps on - repo.or.cz) - and notify the mailing list, indicating the - branch you want people to pull from when - you're ready.
  • - -
  • Use the "mob" branch on - Barry's git repository, and.... - send a notification to the mailing list.
  • -
-

- - -
Using the Mob Branch
- -

The public git repository service at repo.or.cz provides an interesting -feature, which allows anyone to push to a "mob" branch of a repository, -if so configured by the admin.

- -

It would go something like this: -

-        # clone with mob user
-        git clone git+ssh://mob@repo.or.cz/srv/git/barry.git barry
-
-        cd barry
-        git checkout -b mob origin/mob
-        git diff origin/master..mob             # make sure master == mob
-        <make changes>
-        git add ... && git commit
-        git push origin mob
-        <send email to the list, include the SHA1 sum of the commit>
-
-

- -

This is a novel idea, as well as a security risk for anyone who blindly -runs whatever is in the mob branch. Hence the recommended diff check -above, to make sure you're working on an official branch.

- -

The mob user can only push to the mob branch, so all other branches -are read-only, and have been reviewed at least once by the project -maintainer.

- -

But the mob branch frees people up to use git, who may not have -their own hosting, or who may not want to bother setting up their -own git repo. People can use it to collaborate on a feature as well. -Let your imagination run wild.

- -

You can read more about the ideas behind the mob branch at -the repo.or.cz mob page

- - - - - - - diff -Nru barry-0.14/doc/www/patches.php barry-0.0.20110506/doc/www/patches.php --- barry-0.14/doc/www/patches.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/patches.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
Coding Guidelines
+

If you are submitting code, please have a look at the .

@@ -24,9 +23,40 @@ or send as an attachment
  • add a [PATCH] prefix to your subject line
  • +

    + + + + +

    Submitting your changes via patch is a good thing. It may seem like +an extra bit of work to create a patch and post it to the mailing list, +or to make your work available in a public git repo, but there are good +reasons why Open Source works that way:

    + +
      +
    • Patches tell the maintainer that you want your change + to be added to the tree. It is often too easy for busy + programmers to misunderstand someone's intentions if + they just send a random file. If intentions are not + clear, work gets dropped on the floor.
    • +
    • Patches show that you have worked with the source code, + and hopefully have tested your change.
    • +
    • Patches show that you have given some thought to where + your changes should go in the tree.
    • +
    • Patches to a public mailing list encourage peer review, and show + that you are ok with your code being included in a public + project.
    • +
    • Patches to a public mailing list or a public repository become + part of history, showing who did what, and when.
    • +
    • Patches usually get top priority from developers.
    • +
    • Patches make life easier for the developers, freeing up their + time for more features and bug fixes.
    • +
    • Patches turn you into a developer. Your name can be added + to the AUTHORS file.
    • +
    -
    Generating Patches
    +

    Generating patches depends on the method you used to get the source code.

      @@ -68,7 +98,7 @@
    -
    Methods for Submitting Patches
    +

    Submitting changes can happen in one of three methods: @@ -77,7 +107,8 @@ mailing list. -

  • Publish your own git repository (perhaps on +
  • Publish your own git repository (perhaps by creating a + forked tree on repo.or.cz) and notify the mailing list, indicating the branch you want people to pull from when @@ -90,7 +121,21 @@

    -
    Using the Mob Branch
    + + +

    The git repo site repo.or.cz lets anyone create a forked tree based +off the official Barry repo. This saves space on repo.or.cz, and +adds your fork to a list at the bottom of the official Barry page.

    + +

    This way, users and developers can look at everyone's changes and +test and mix them as needed.

    + +

    To create a forked tree, visit the +Barry repo and click "fork" at the top.

    + + + +

    The public git repository service at repo.or.cz provides an interesting feature, which allows anyone to push to a "mob" branch of a repository, @@ -125,5 +170,5 @@ Let your imagination run wild.

    You can read more about the ideas behind the mob branch at -the repo.or.cz mob page

    +the repo.or.cz mob page

    diff -Nru barry-0.14/doc/www/php_conf1.php barry-0.0.20110506/doc/www/php_conf1.php --- barry-0.14/doc/www/php_conf1.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/php_conf1.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,14 @@ + diff -Nru barry-0.14/doc/www/php_conf2.php barry-0.0.20110506/doc/www/php_conf2.php --- barry-0.14/doc/www/php_conf2.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/php_conf2.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,14 @@ + diff -Nru barry-0.14/doc/www/php_conf3.php barry-0.0.20110506/doc/www/php_conf3.php --- barry-0.14/doc/www/php_conf3.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/php_conf3.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,14 @@ + diff -Nru barry-0.14/doc/www/prepend.php barry-0.0.20110506/doc/www/prepend.php --- barry-0.14/doc/www/prepend.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/prepend.php 2011-05-06 12:20:16.000000000 +0000 @@ -4,21 +4,6 @@ Barry Documentation -$title
  • "; - echo "
    "; - echo "
    "; -} - -?> - diff -Nru barry-0.14/doc/www/rawchannel.php barry-0.0.20110506/doc/www/rawchannel.php --- barry-0.14/doc/www/rawchannel.php 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/doc/www/rawchannel.php 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,121 @@ + + + + + + +

    The Blackberry provides the ability for programs to send and receive data over the USB port via named channels. +On device there are two APIs which provide access to these channels: +

    +

    + +

    Barry provides APIs and tools to access the PC side of these USB +channels. The Barry APIs provide similar functionality to the Blackberry +Desktop Manager API.

    + +

    To use USB channels with Barry you will also need the following: +

      +
    • a working Barry install, version 0.17 or later
    • +
    • a program which uses USB channels installed on your Blackberry
    • +
    +

    + + + +

    As part of the examples provided with the Blackberry JDEs there is a demo +application called 'USB Demo' which can be found in samples/com/rim/samples/device/usbdemo in the +installation folder of the JDE. You should build this and install it on your Blackberry.

    + +

    The Blackberry JDEs come with an example application for the Blackberry Desktop Manager API in +samples/usbclient in the installation folder. The equivalent PC side usbclient can be +found in the Barry source in examples/usbclient.cc

    + +

    Once the example is compiled it should be used by first running the +'USB Demo' application on the Blackberry and selecting one of the +'Connect' options from the menu. Once the 'USB Demo' application is +waiting then it's possible to run the usbclient example to +communicate with the Blackberry application. + + + +

    The raw channel API provided by Barry exposes the channel interface +as sending and receiving of packets of data. While this closely +reflects the USB channel protocol, it can be unhelpful for +applications which are designed with streams as +their communication mechanisms. To accommodate this Barry provides +a tool called brawchannel. This tool redirects the named +channel over STDIN and STDOUT, allowing easy communication with +pre-existing tools.

    + +

    For example the following shows an example of using +brawchannel to talk to the 'USB Demo' application mentioned +in the previous section.

    + +

    First it's necessary to run 'USB Demo' on the Blackberry and select +the 'Connect (low level)' menu option. With that running it's then +possible to run brawchannel by supplying the channel name on +the command line. For the 'USB Demo' application this channel name is +JDE_USBClient.

    + +
    user@machine:~$ brawchannel JDE_USBClient
    + +

    If all goes well then you should see nothing but a flashing +cursor. The 'USB Demo' application expects us to say hello, so +type:

    + +
    Hello from Barry.<RET>
    + +

    You should then see two things, firstly your terminal should now +look like the following:

    + +
    user@machine:~$ brawchannel JDE_USBClient
    +Hello from Barry.
    +Hello from Device
    + +

    Secondly the message you typed should appear on the device (along +with the demo application complaining that it's not the expected +text). Next we need to say goodbye to the device, so type:

    + +
    Goodbye from Barry.<RET>
    + +

    The device should then say goodbye back, followed by it closing the connection.

    + +

    It's also possible to use other programs, such as socat to +use the brawchannel tool to communicate with the USB channel +via other mechanisms such as TCP/IP sockets.

    + +

    For further information please see the man page for brawchannel. + + + +

    It is also possible to use USB channels directly in your +application by linking to the Barry library. To make use of these USB +channels you will need to create an instance of the +Barry::Mode::RawChannel class. The Barry source code +demonstrates creation of a RawChannel in +examples/usbclient.cc and tools/brawchannel.cc.

    + +

    In it's most basic form this can be done with the following code:

    +
    Barry::Init();
    +Barry::Probe probe;
    +if( probe.GetCount() <= 0 ) {
    +    // No blackberry found
    +    return 1;
    +}
    +
    +auto_ptr router;
    +router.reset(new SocketRoutingQueue());
    +router->SpinoffSimpleReadThread();
    +
    +Barry::Controller con(probe.Get(0), *router);
    +
    +Barry::Mode::RawChannel rawChannel(con);
    +
    +rawChannel.Open("", CHANNEL_NAME);
    + +

    With data then sent and received using rawChannel.Send() and rawChannel.Receive().

    diff -Nru barry-0.14/doc/www/requirements.html barry-0.0.20110506/doc/www/requirements.html --- barry-0.14/doc/www/requirements.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/requirements.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - -
    ::::::: Linux ::::::::::::::
    - -
    Charging and the Kernel
    - -

    One of the main features of Barry is the ability to control the charging -modes of the Blackberry, as well as changing configuration modes on -Pearl-like devices.

    - -

    In order to achieve proper charging, udev is setup to run the bcharge -program every time you plug in your Blackberry.

    - -

    Recent kernels have a module called berry_charge, which does similar -things from the kernel level. These two methods can conflict if both -run at the same time.

    - -

    Due to this conflict, the binary packages are setup to install -a blacklist file under /etc/modprobe.d, which will disable berry_charge -as long as you have the barry-util package installed.

    - -

    If you are not using the binary packages, you can use the sample -blacklist file that comes with the source tarball.

    - - - - -
    Power and the Kernel
    - -

    Recent kernels also have the ability to put the USB bus and its devices -into suspend mode. Kernels included in Ubuntu 7.04 and -Fedora 7 have this turned on by default.

    - -

    When bcharge runs, it successfully changes the Blackberry to use 500mA -(its normal power level for charging), but then the kernel puts the device -into suspend mode. This can have various undefined effects, such as -the charge icon disappearing on the device, or having your device lose -its charge in an accelerated manner.

    - -

    Bcharge attempts to work around this by writing to the -control files under /sys/class/usb_device/.../device/power/ -to turn autosuspend off. Depending on your kernel version or kernel -config, these files may not be available, but in most cases at -least one of the needed files are there.

    - -

    If you continue to experience trouble charging your Blackberry: -

      -
    • consider upgrading your kernel (Ubuntu 7.10 Gutsy - patches their 2.6.22 kernel to fix this, - for example)
    • -
    • recompile your kernel with CONFIG_USB_SUSPEND disabled
    • -
    -

    - - -
    Device Ownership and Permissions
    - -

    The Barry toolset performs all its actions through the /proc and/or -/sysfs filesystems, using the libusb library. This requires that you -have permissions to write to the USB device files setup by the kernel.

    - -

    This is handled differently on various systems:

    - -
      -
    • On Debian based systems, there is a group called plugdev, which - is used to control permissions for pluggable devices. - When the barry-util deb package is installed, udev is - configured to set Blackberry device permissions to - the plugdev group. Make sure your user is in the plugdev - group.
    • -
    • On Fedora based systems, ownership is controlled by the - ConsoleKit package. This changes ownership of pluggable - devices to the user currently logged into the console, - on the theory that anyone at the console should have - control of the devices he plugs in. No special - support is needed by Barry if you have this package - installed.
    • -
    - - - -
    ::::::: OpenBSD ::::::::::::::
    - -
    Uberry Module and Ugen
    - -

    The uberry kernel module conflicts with the ugen interface that -libusb uses to talk to the device. To work around this, you will -need to boot your kernel with "boot -c" and disable the uberry module.

    - -

    Suggestions for better ways to work around this conflict are welcome.

    - - - - - - - diff -Nru barry-0.14/doc/www/requirements.php barry-0.0.20110506/doc/www/requirements.php --- barry-0.14/doc/www/requirements.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/requirements.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,10 +1,10 @@ - - -
    ::::::: Linux ::::::::::::::
    + + + -
    Charging and the Kernel
    +

    One of the main features of Barry is the ability to control the charging modes of the Blackberry, as well as changing configuration modes on @@ -13,8 +13,8 @@

    In order to achieve proper charging, udev is setup to run the bcharge program every time you plug in your Blackberry.

    -

    Recent kernels have a module called berry_charge, which does similar -things from the kernel level. These two methods can conflict if both +

    Kernels older than 2.6.34 have a module called berry_charge, which does +similar things from the kernel level. These two methods can conflict if both run at the same time.

    Due to this conflict, the binary packages are setup to install @@ -27,11 +27,10 @@ -

    Power and the Kernel
    +

    Recent kernels also have the ability to put the USB bus and its devices -into suspend mode. Kernels included in Ubuntu 7.04 and -Fedora 7 have this turned on by default.

    +into suspend mode. Distros often have this turned on by default.

    When bcharge runs, it successfully changes the Blackberry to use 500mA (its normal power level for charging), but then the kernel puts the device @@ -55,7 +54,7 @@

    -
    Device Ownership and Permissions
    +

    The Barry toolset performs all its actions through the /proc and/or /sysfs filesystems, using the libusb library. This requires that you @@ -74,16 +73,14 @@ ConsoleKit package. This changes ownership of pluggable devices to the user currently logged into the console, on the theory that anyone at the console should have - control of the devices he plugs in. No special - support is needed by Barry if you have this package - installed. + control of the devices he plugs in. -

    ::::::: OpenBSD ::::::::::::::
    + -
    Uberry Module and Ugen
    +

    The uberry kernel module conflicts with the ugen interface that libusb uses to talk to the device. To work around this, you will Binary files /tmp/hrabAk_zAl/barry-0.14/doc/www/restore.png and /tmp/ehd5lCCenv/barry-0.0.20110506/doc/www/restore.png differ diff -Nru barry-0.14/doc/www/roadmap.html barry-0.0.20110506/doc/www/roadmap.html --- barry-0.14/doc/www/roadmap.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/roadmap.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ - - - - Barry Documentation - - - - - - - -


    - - - -
    Milestone 1 - mostly complete
    -
      -
    • autoconf the project -
    • handle USB interface and configuration numbers dynamically -
    • handle USB endpoint numbers dynamically (appears to use the endpoint numbers in ascending order: 1 read, 1 write) -
    • make the old/new DBDB commands dynamic -
    • flesh out LDIF support (should read/import them as well) -
    • reverse engineer email header data -
    • use SWIG to make the API available in Python -
    - -
    Milestone 2 - complete for all but email
    -
      -
    • reliable command line backup and restore of: -
        -
      • Contacts / Address Book -
      • Calendar -
      • Email -
      -
    - -
    Milestone 3 - complete
    -
      -
    • reliable backup and restore of all databases
    • -
    - -
    Milestone 4
    -
      -
    • reliable command line backup and restore of Java program modules -
    - -
    Milestone 5 - currently implemented through OpenSync
    -
      -
    • design and implement sync functionality (must support data from any external data source) -
    • command line sync tool -
    - -
    Milestone 6 - currently implemented through OpenSync
    -
      -
    • GUI sync tool -
    - -
    Milestone 7 - currently implemented through OpenSync
    -
      -
    • Evolution sync -
    - -
    Milestone 8 - currently implemented through OpenSync
    -
      -
    • Mozilla sync -
    - -
    Milestone 9 - currently implemented through OpenSync
    -
      -
    • LDAP sync -
    - - - - - - - diff -Nru barry-0.14/doc/www/roadmap.php barry-0.0.20110506/doc/www/roadmap.php --- barry-0.14/doc/www/roadmap.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/roadmap.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,61 +1,8 @@ - - -
    Milestone 1 - mostly complete
    -
      -
    • autoconf the project -
    • handle USB interface and configuration numbers dynamically -
    • handle USB endpoint numbers dynamically (appears to use the endpoint numbers in ascending order: 1 read, 1 write) -
    • make the old/new DBDB commands dynamic -
    • flesh out LDIF support (should read/import them as well) -
    • reverse engineer email header data -
    • use SWIG to make the API available in Python -
    - -
    Milestone 2 - complete for all but email
    -
      -
    • reliable command line backup and restore of: -
        -
      • Contacts / Address Book -
      • Calendar -
      • Email -
      -
    - -
    Milestone 3 - complete
    -
      -
    • reliable backup and restore of all databases
    • -
    - -
    Milestone 4
    -
      -
    • reliable command line backup and restore of Java program modules -
    - -
    Milestone 5 - currently implemented through OpenSync
    -
      -
    • design and implement sync functionality (must support data from any external data source) -
    • command line sync tool -
    - -
    Milestone 6 - currently implemented through OpenSync
    -
      -
    • GUI sync tool -
    - -
    Milestone 7 - currently implemented through OpenSync
    -
      -
    • Evolution sync -
    - -
    Milestone 8 - currently implemented through OpenSync
    -
      -
    • Mozilla sync -
    + -
    Milestone 9 - currently implemented through OpenSync
    -
      -
    • LDAP sync -
    +

    To view the latest roadmap, please see the +TODO file +in the source tree.

    diff -Nru barry-0.14/doc/www/static.sh barry-0.0.20110506/doc/www/static.sh --- barry-0.14/doc/www/static.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/static.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,7 +1,29 @@ #!/bin/sh -for f in `cat content_list` ; do - echo "Generating $f.html" - cat prepend.php $f.php append.php | php > $f.html -done +if [ -z "$1" ] ; then + echo "Using Barry default web doc config..." + for f in `cat content_list` ; do + echo "Generating $f.html" + cat prepend.php php_conf1.php $f.php append.php | php > $f.html + done +elif [ "$1" = "netdirect" ] ; then + echo "Using NetDirect web doc config..." + mkdir -p www.netdirect.ca/sites/www.netdirect.ca/files/barry/doxygen + mkdir -p www.netdirect.ca/sites/www.netdirect.ca/files/images/barry + cp *.png www.netdirect.ca/sites/www.netdirect.ca/files/images/barry + + mkdir -p www.netdirect.ca/pastefiles + + echo "For index files..." + for f in `cat content_list | grep index` ; do + echo "Generating $f.html" + cat php_conf2.php $f.php | php > www.netdirect.ca/pastefiles/$f.html + done + + echo "For non-index files..." + for f in `cat content_list | grep -v index` ; do + echo "Generating $f.html" + cat php_conf3.php $f.php | php > www.netdirect.ca/pastefiles/$f.html + done +fi diff -Nru barry-0.14/doc/www/sync.html barry-0.0.20110506/doc/www/sync.html --- barry-0.14/doc/www/sync.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/sync.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ - - - - Barry Documentation - - - - - - - -
    - - - - -
    Introduction
    - -

    This document describes the steps needed to sync your Blackberry with -Evolution, using OpenSync version 0.22 and the command line tool -msynctool. The concepts are similar with other Opensync plugins, -and should be relatively straightforward to sync with other data sources.

    - - -
    Overview
    - -

    The first sync requires the following steps: -

      -
    • Run Evolution and make sure it has created its local databases
    • -
    • Create a sync group with msynctool, and configure each member
    • -
    • Shutdown Evolution servers
    • -
    • Run the sync
    • -
    -

    - -

    Future syncs only require the following steps: -

      -
    • Shutdown Evolution servers
    • -
    • Run the sync
    • -
    -

    - - -
    First Step
    - -

    First step is to always make a backup of your data. Use the GUI -backup tool that comes with Barry, or the RIM Windows Desktop software, -to make backups of your device data.

    - -

    Remember that your device data is not the only database being operated -on. Your Evolution data is also at risk, should something go wrong. -You should backup your Evolution data as well. -See -"How To Backup Evolution" (external link) -for step by step instructions on backing up your local Evolution data.

    - - -
    Preparing Evolution
    - -

    If you've never run Evolution before, start Evolution and follow its -initial configuration dialogs. Once it is running, click on each of the -available section buttons. These buttons include: Mail, Contacts, -Calendars, Memos, and Tasks. Clicking on each of these, causes Evolution -to open and create the matching databases.

    - -

    Each of these sections should have a "Personal" folder. This is -where data from your Blackberry will end up, and any data in these -databases will be synced to your Blackberry as well.

    - -

    Note: Only Contacts and Calendar items are currently supported -in the Barry Opensync plugin.

    - - -
    Preparing OpenSync
    - -

    Opensync organizes its sync configurations in the form of groups. Each -group contains two or more member plugins that will be synchronized.

    - -

    For example, using msynctool, you can create a group called EvoBarry -which will sync your Blackberry and Evolution like this:

    - -
    -	msynctool --delgroup EvoBarry
    -	msynctool --addgroup EvoBarry
    -	msynctool --addmember EvoBarry evo2-sync
    -	msynctool --addmember EvoBarry barry-sync
    -	msynctool --configure EvoBarry 1
    -	msynctool --configure EvoBarry 2
    -	msynctool --showgroup EvoBarry
    -
    - -

    Each configuration stage (1 and 2) will open an editor, where you can -edit the member plugin's configuration file. Evolution's plugin takes -its configuration in the form of XML. For example:

    - -
    -	<config>
    -	   <address_path>file:///home/cdfrey/.evolution/addressbook/local/system<address_path>
    -	   <calendar_path>file:///home/cdfrey/.evolution/calendar/local/system<calendar_path>
    -	   <tasks_path>file:///home/cdfrey/.evolution/tasks/local/system<tasks_path>
    -	<config>
    -
    - -

    Barry's plugin member takes a simple text file. The default configuration -that comes with Barry is shown below:

    - -
    -	#
    -	# This is the default configuration file for the barry-sync opensync plugin.
    -	# Comments are preceded by a '#' mark at the beginning of a line.
    -	# The config format is a set of lines of  .
    -	#
    -	# Keywords available:
    -	#
    -	# DebugMode        - If present, verbose USB debug output will be enabled
    -	#
    -	# Device           - If present, it is followed by the following values:
    -	#      PIN number    - PIN number of the device to sync with (in hex)
    -	#      sync calendar - 1 to sync calendar, 0 to skip
    -	#      sync contacts - 1 to sync contacts, 0 to skip
    -	#
    -	# Password secret  - If present, specifies the device's password in plaintext
    -	#
    -
    -	#DebugMode
    -
    -	Device 3009efe3 1 1
    -
    -	#Password secret
    -
    - -

    Edit the device's PIN number, and save. You're now ready to run your -first sync.

    - - -
    Syncing!
    - -

    It is recommended that Evolution's backend servers be shutdown before -the sync is performed. Therefore, make sure you've closed Evolution, -and run the following commands to sync, using the group you just configured:

    - -
    -	evolution --force-shutdown
    -	msynctool --sync EvoBarry
    -
    - -

    Status messages will appear at each stage of the sync: each plugin -fetches new records, the conflict resolution is performed by the Opensync -engine, and new records are written to each plugin.

    - - -
    Known Issues
    - -

    There is a known issue with international characters in contact names. -The name is truncated at the umlaut, or similar character. This is -probably a bug in the Barry plugin, and should be fixed shortly.

    - - -
    Troubleshooting
    - -

    There are a number of things that can go wrong during a sync: -

      -
    • One of the plugins may crash
    • -
    • Opensync may hang, or take a long time, while processing conflicts
    • -
    • Opensync may get confused and duplicate a lot of data
    • -
    -

    - -

    If one of the plugins crash...

    - -

    If one of the plugins crashes due to a segmentation fault, try to get -a sequence of steps that can reproduce the crash every time. At that -point, enable core dumps, and run it again:

    - -
    -	ulimit -c unlimited
    -	msynctool --sync EvoBarry
    -
    - -

    This will leave a core file somewhere on your filesystem. In order -to get a useful backtrace from it, you will need the debug packages -for Barry and OpenSync. The debug packages for Barry are available -at the -Sourceforge download page. -Debug packages for OpenSync should -come with your distribution.

    - -

    Once you have installed the matching debug packages, open the core -dump file like this, which will tell you which program was running when -the plugin crashed:

    - -
    -	gdb /bin/ls corefile
    -	[... lots of output ...]
    -	(gdb) quit
    -
    - -

    As gdb loads, it will print the name of the program that crashed. -Often this is /usr/lib/opensync/osplugin or something similar. -Load gdb again with the correct program, and use the backtrace (bt) -command:

    - -
    -	gdb /usr/lib/opensync/osplugin corefile
    -	[... lots of output ...]
    -	(gdb) bt
    -	[... useful output ...]
    -	(gdb) quit
    -
    - -

    Paste the "useful ouput" above into an email and -send it to us -.

    - - - -

    If OpenSync hangs...

    - -

    If the hang lasts only for about 30 seconds, then it is likely the -USB conversation that is timing out. Enable the DebugMode -keyword in the Barry plugin configuration above, and send the last -few screens of output to the -mailing list -.

    - -

    Otherwise, Opensync supports a detailed level of logging. If you set -the environment variable OSYNC_TRACE to the path of an empty -directory, Opensync will write detailed logs for every thread -used during the syncing process. These logs quickly get out of -hand, so delete them before each test run.

    - -

    Some of these logs may contain private data, so before posting -them on the mailing list, or on a website, you may wish to -double check. You can also -email them privately -to the lead developer.

    - - -

    If you get a load of duplicates...

    - -

    If the sync has crashed, note that OpenSync will know this and attempt -a slow-sync automatically the next time you run the sync. If there is -a mismatch in supported fields, this can cause duplicates to be created -on one or possibly both sides of the sync. For example, if your desktop -software supports a Speed field, which the Blackberry does not, then -with OpenSync 0.22, these records will look different, and duplicates will -be created.

    - -

    This bug should be fixed -in the upcoming OpenSync 0.40.

    - -

    In the meantime, it is much better to avoid slow-syncing, and re-create -your sync configuration from scratch, as documented above.

    - -

    If you know that one side is authoritative (for example, you may know -that your Blackberry has the most up to date set of data), delete all -the data from the opposite data source, reconfigure, and sync again.

    - -

    If all else fails, restore your backups and start fresh.

    - - - - - - - diff -Nru barry-0.14/doc/www/sync.php barry-0.0.20110506/doc/www/sync.php --- barry-0.14/doc/www/sync.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/sync.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,8 @@ - - + -
    Introduction
    +

    This document describes the steps needed to sync your Blackberry with Evolution, using OpenSync version 0.22 and the command line tool @@ -11,7 +10,7 @@ and should be relatively straightforward to sync with other data sources.

    -
    Overview
    +

    The first sync requires the following steps:

      @@ -30,7 +29,7 @@

      -
      First Step
      +

      First step is to always make a backup of your data. Use the GUI backup tool that comes with Barry, or the RIM Windows Desktop software, @@ -44,7 +43,7 @@ for step by step instructions on backing up your local Evolution data.

      -
      Preparing Evolution
      +

      If you've never run Evolution before, start Evolution and follow its initial configuration dialogs. Once it is running, click on each of the @@ -57,10 +56,10 @@ databases will be synced to your Blackberry as well.

      Note: Only Contacts and Calendar items are currently supported -in the Barry Opensync plugin.

      +in the Barry Opensync 0.22 plugin.

      -
      Preparing OpenSync
      +

      Opensync organizes its sync configurations in the form of groups. Each group contains two or more member plugins that will be synchronized.

      @@ -84,9 +83,9 @@
       	<config>
      -	   <address_path>file:///home/cdfrey/.evolution/addressbook/local/system<address_path>
      -	   <calendar_path>file:///home/cdfrey/.evolution/calendar/local/system<calendar_path>
      -	   <tasks_path>file:///home/cdfrey/.evolution/tasks/local/system<tasks_path>
      +	   <address_path>file:///home/cdfrey/.evolution/addressbook/local/system</address_path>
      +	   <calendar_path>file:///home/cdfrey/.evolution/calendar/local/system</calendar_path>
      +	   <tasks_path>file:///home/cdfrey/.evolution/tasks/local/system</tasks_path>
       	<config>
       
      @@ -122,7 +121,7 @@ first sync.

      -
      Syncing!
      +

      It is recommended that Evolution's backend servers be shutdown before the sync is performed. Therefore, make sure you've closed Evolution, @@ -138,14 +137,7 @@ engine, and new records are written to each plugin.

      -
      Known Issues
      - -

      There is a known issue with international characters in contact names. -The name is truncated at the umlaut, or similar character. This is -probably a bug in the Barry plugin, and should be fixed shortly.

      - - -
      Troubleshooting
      +

      There are a number of things that can go wrong during a sync:

        @@ -218,7 +210,7 @@

        Some of these logs may contain private data, so before posting them on the mailing list, or on a website, you may wish to -double check. You can also +double check. You can also to the lead developer.

        diff -Nru barry-0.14/doc/www/troubleshooting.html barry-0.0.20110506/doc/www/troubleshooting.html --- barry-0.14/doc/www/troubleshooting.html 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/troubleshooting.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ - - - - Barry Documentation - - - - - - - -
        - - - - -
        Common Issues When Working With Barry
        - - -

        Q: I have one of the newer Pearl devices, such as the 8120. -When I try to run a backup using the GUI, the device resets itself.

        - -

        A: This is a known problem, and is likely a bug in the -Blackberry firmware which gets triggered when both the usb_storage kernel -module and Barry access the device at the same time. When Barry closes -its USB connection, the device gets confused and resets itself.

        - -

        The only known workaround is to unload the usb_storage module when -accessing the database (such as when syncing or doing backups).

        - - -
        - - -

        Q: When I run btool, it hangs for 30 seconds and then times out on -the USB read call.

        - -

        A: From reports on the mailing list, this appears most likely to be -a bug in the BlackBerry firmware. Sometimes upgrading your -Blackberry will fix this issue.

        - -

        This is not conclusive, and may be a kernel issue as well.

        - -

        To verify that you are experiencing the right issue, run -"btool -vl" to get a verbose USB log. At the beginning -the USB configuration and endpoint information is printed. -If the last set of endpoints have 0's in the values, you are -experiencing the problem. The proper set of endpoints will not -be displayed with "lsusb -v" in this case either.

        - -

        One workaround is to run bcharge twice like this:

        - -
        -	bcharge
        -	bcharge -o
        -
        - -

        After the second bcharge, btool should work normally.

        - - -
        - - -

        Q: I've installed Barry, and bcharge is set to run automatically, -but as soon as I plug my device into the USB port, the device reboots.

        - -

        A:This is a bug in the udev script, which causes the bcharge program -to be run 7 to 10 times back to back. This confuses the BlackBerry -enough to reset it. As of 2007/07/28, there is a corrected -udev script example in Barry CVS. This corrected script -will be included in the Barry 0.8 release.

        - -

        Alternative issue: You may have the berry_charge kernel module -running, in which case you need to choose which method you wish -to use. Do not run both berry_charge and bcharge.

        - - -
        - - -

        Q: btool is giving me errors, saying it can't find my device, or -can't access it!

        - -

        A: If you have one of the newer BlackBerry devices, such as the Pearl -or the Curve, these devices default to USB Mass Storage mode -when you first plug them in. The Linux kernel detects this, -and on most systems loads the usb_storage module automatically, -sometimes mounting the device as a drive.

        - -

        If you are running an older version of Barry, please upgrade, as -this issue has been fixed so usb_storage and database access can -coexist in peace.

        - - -
        - - -

        Q: One of the Barry applications crashed, and now I keep getting -a Desktop error message in hex.

        - -

        A: If a Barry application crashes, that means the Desktop mode was -not shutdown properly. Your device will likely appear to still -be "busy" as well. Currently the only way to fix this is to -reset the device, either by unplugging/replugging it, or by -running the program "breset".

        - - -
        - - -

        Q: Everytime I restore a backup with the backup GUI, the database -I need does not get restored. What gives?

        - -

        A: Both the backup and the restore are filtered based on your -configuration. Check your Edit | Config... settings and make -sure the needed database is turned on in both backup and restore.

        - - -
        - - -

        Q: I ran the backup, but can't find my backup files! -Where did they go?

        - -

        A: The backup program saves all backup files as gzip'd tarballs -under your home directory: ~/.barry/backup/pin_number/

        - -

        Each backup session creates a new file, named with the -pin number, date, and time.

        - - - - - - - diff -Nru barry-0.14/doc/www/troubleshooting.php barry-0.0.20110506/doc/www/troubleshooting.php --- barry-0.14/doc/www/troubleshooting.php 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/doc/www/troubleshooting.php 2011-05-06 12:20:16.000000000 +0000 @@ -1,36 +1,14 @@ - - + -
        Common Issues When Working With Barry
        - - -

        Q: I have one of the newer Pearl devices, such as the 8120. -When I try to run a backup using the GUI, the device resets itself.

        - -

        A: This is a known problem, and is likely a bug in the -Blackberry firmware which gets triggered when both the usb_storage kernel -module and Barry access the device at the same time. When Barry closes -its USB connection, the device gets confused and resets itself.

        - -

        The only known workaround is to unload the usb_storage module when -accessing the database (such as when syncing or doing backups).

        - - -
        +

        Q: When I run btool, it hangs for 30 seconds and then times out on the USB read call.

        -

        A: From reports on the mailing list, this appears most likely to be -a bug in the BlackBerry firmware. Sometimes upgrading your -Blackberry will fix this issue.

        - -

        This is not conclusive, and may be a kernel issue as well.

        - -

        To verify that you are experiencing the right issue, run +

        A: To verify that you are experiencing the right issue, run "btool -vl" to get a verbose USB log. At the beginning the USB configuration and endpoint information is printed. If the last set of endpoints have 0's in the values, you are @@ -53,32 +31,12 @@

        Q: I've installed Barry, and bcharge is set to run automatically, but as soon as I plug my device into the USB port, the device reboots.

        -

        A:This is a bug in the udev script, which causes the bcharge program -to be run 7 to 10 times back to back. This confuses the BlackBerry -enough to reset it. As of 2007/07/28, there is a corrected -udev script example in Barry CVS. This corrected script -will be included in the Barry 0.8 release.

        - -

        Alternative issue: You may have the berry_charge kernel module -running, in which case you need to choose which method you wish -to use. Do not run both berry_charge and bcharge.

        - - -
        - - -

        Q: btool is giving me errors, saying it can't find my device, or -can't access it!

        +

        A:Make sure you're running a recent version of Barry, at least +0.16 or 0.17.

        -

        A: If you have one of the newer BlackBerry devices, such as the Pearl -or the Curve, these devices default to USB Mass Storage mode -when you first plug them in. The Linux kernel detects this, -and on most systems loads the usb_storage module automatically, -sometimes mounting the device as a drive.

        - -

        If you are running an older version of Barry, please upgrade, as -this issue has been fixed so usb_storage and database access can -coexist in peace.

        +

        Depending on the age of your kernel (older than 2.6.34?), you may have +the berry_charge kernel module running, in which case you need to choose +which method you wish to use. Do not run both berry_charge and bcharge.


        diff -Nru barry-0.14/Doxyfile barry-0.0.20110506/Doxyfile --- barry-0.14/Doxyfile 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/Doxyfile 2011-05-06 12:20:16.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.4.5 +# Doxyfile 1.5.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -23,7 +23,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.14 +PROJECT_NUMBER = 0.18.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -1089,7 +1089,7 @@ # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and @@ -1141,7 +1141,15 @@ # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. -CALL_GRAPH = NO +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. diff -Nru barry-0.14/examples/addcalendar.cc barry-0.0.20110506/examples/addcalendar.cc --- barry-0.14/examples/addcalendar.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/examples/addcalendar.cc 2011-05-06 12:20:16.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/examples/addcontact.cc barry-0.0.20110506/examples/addcontact.cc --- barry-0.14/examples/addcontact.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/examples/addcontact.cc 2011-05-06 12:20:16.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,6 +22,7 @@ #include #include +#include #include using namespace std; @@ -40,6 +41,12 @@ for( ;; ) { ReadLine(prompt, datestr); + if( !datestr.size() ) { + // blank + date.Clear(); + break; + } + if( date.FromYYYYMMDD(datestr) ) break; @@ -81,7 +88,22 @@ string categories; ReadLine("Categories", categories); - Contact::CategoryStr2List(categories, contact.Categories); + contact.Categories.CategoryStr2List(categories); + + string image_path; + ReadLine("Photo path", image_path); + if( image_path.size() ) { + ifstream in(image_path.c_str()); + char block[4096]; + + contact.Image.clear(); + while( in.read(block, sizeof(block)) ) { + contact.Image.append(block, in.gcount()); + } + } + else { + cout << "Can't open: " << image_path << endl; + } } void Upload(const Barry::ProbeResult &device, const Barry::Contact &contact) @@ -114,8 +136,8 @@ return 1; } else { - cout << "Using PIN: " << std::hex - << probe.Get(0).m_pin << endl; + cout << "Using PIN: " + << probe.Get(0).m_pin.Str() << endl; } diff -Nru barry-0.14/examples/addmemo.cc barry-0.0.20110506/examples/addmemo.cc --- barry-0.14/examples/addmemo.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/examples/addmemo.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,104 @@ +/// +/// \file addmemo.cc +/// Example code using the Barry library to add a memo +/// to a Blackberry device. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include + +using namespace std; +using namespace Barry; + + +void ReadLine(const char *prompt, std::string &data) +{ + cout << prompt << ": "; + getline(cin, data); +} + +void ReadInput(Barry::Memo &memo) +{ + ReadLine("Title", memo.Title); + + string body; + do { + ReadLine("Body line (blank to end)", body); + if( body.size() ) { + if( memo.Body.size() ) + memo.Body += "\n"; + memo.Body += body; + } + } while( body.size() ); + + string categories; + ReadLine("Categories", categories); + memo.Categories.CategoryStr2List(categories); +} + +void Upload(const Barry::ProbeResult &device, const Barry::Memo &memo) +{ + // connect to address book + Controller con(device); + Mode::Desktop desktop(con); + desktop.Open(); + unsigned int id = desktop.GetDBID(Barry::Memo::GetDBName()); + + // find out what records are already there, and make new record ID + RecordStateTable table; + desktop.GetRecordStateTable(id, table); + uint32_t recordId = table.MakeNewRecordId(); + + // add it + desktop.AddRecordByType(recordId, memo); + cout << "Added successfully." << endl; +} + +int main(int argc, char *argv[]) +{ + try { + + Barry::Init(); + + Barry::Probe probe; + if( probe.GetCount() == 0 ) { + cout << "No Blackberry found!" << endl; + return 1; + } + else { + cout << "Using PIN: " + << probe.Get(0).m_pin.Str() << endl; + } + + + Barry::Memo memo; + ReadInput(memo); + Upload(probe.Get(0), memo); + + } + catch( std::exception &e ) { + std::cerr << "Exception caught: " << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/examples/dbdump.cc barry-0.0.20110506/examples/dbdump.cc --- barry-0.14/examples/dbdump.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/examples/dbdump.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,66 @@ +/// +/// \file dbdump.cc +/// Example code using the Barry library to pull all +/// contacts out of the device and dump to stdout. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include + +using namespace std; +using namespace Barry; + +struct Callback +{ + // storage operator + void operator()(Contact &rec) + { + // do something with your record here + cout << rec << endl; + } +}; + +int main(int argc, char *argv[]) +{ + try { + + Barry::Init(); + Probe probe; + int i = probe.FindActive(); + if( i == -1 ) { + cout << "No PIN specified" << endl; + return 1; + } + + Controller con(probe.Get(i)); + Mode::Desktop desktop(con); + desktop.Open(); // specify password here if needed + + Callback storage; + desktop.LoadDatabaseByType(storage); + + } + catch( exception &e ) { + cerr << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/examples/Makefile.am barry-0.0.20110506/examples/Makefile.am --- barry-0.14/examples/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/examples/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,12 @@ #DEFAULT_INCLUDES = INCLUDES = $(LIBUSB_CFLAGS) -AM_CXXFLAGS = -ansi -Wall -g +AM_CXXFLAGS = -Wall -g -noinst_PROGRAMS = addcontact addcalendar +noinst_PROGRAMS = \ + addcontact addcalendar addmemo \ + dbdump pipedump \ + usbclient addcontact_SOURCES = addcontact.cc addcontact_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread @@ -11,3 +14,14 @@ addcalendar_SOURCES = addcalendar.cc addcalendar_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +addmemo_SOURCES = addmemo.cc +addmemo_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread + +dbdump_SOURCES = dbdump.cc +dbdump_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread + +pipedump_SOURCES = pipedump.cc +pipedump_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread + +usbclient_SOURCES = usbclient.cc +usbclient_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread diff -Nru barry-0.14/examples/Makefile.in barry-0.0.20110506/examples/Makefile.in --- barry-0.14/examples/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/examples/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,453 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -noinst_PROGRAMS = addcontact$(EXEEXT) addcalendar$(EXEEXT) -subdir = examples -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \ - $(top_srcdir)/m4/ax_cxx_check_flag.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 = -PROGRAMS = $(noinst_PROGRAMS) -am_addcalendar_OBJECTS = addcalendar.$(OBJEXT) -addcalendar_OBJECTS = $(am_addcalendar_OBJECTS) -am__DEPENDENCIES_1 = -addcalendar_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -am_addcontact_OBJECTS = addcontact.$(OBJEXT) -addcontact_OBJECTS = $(am_addcontact_OBJECTS) -addcontact_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(addcalendar_SOURCES) $(addcontact_SOURCES) -DIST_SOURCES = $(addcalendar_SOURCES) $(addcontact_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_INC_PATH = @BOOST_INC_PATH@ -BOOST_LIB_PATH = @BOOST_LIB_PATH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LIBS = @LIBUSB_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ -WITH_BOOST_PATHS_FALSE = @WITH_BOOST_PATHS_FALSE@ -WITH_BOOST_PATHS_TRUE = @WITH_BOOST_PATHS_TRUE@ -WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -#DEFAULT_INCLUDES = -INCLUDES = $(LIBUSB_CFLAGS) -AM_CXXFLAGS = -ansi -Wall -g -addcontact_SOURCES = addcontact.cc -addcontact_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -addcalendar_SOURCES = addcalendar.cc -addcalendar_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign examples/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 - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -addcalendar$(EXEEXT): $(addcalendar_OBJECTS) $(addcalendar_DEPENDENCIES) - @rm -f addcalendar$(EXEEXT) - $(CXXLINK) $(addcalendar_LDFLAGS) $(addcalendar_OBJECTS) $(addcalendar_LDADD) $(LIBS) -addcontact$(EXEEXT): $(addcontact_OBJECTS) $(addcontact_DEPENDENCIES) - @rm -f addcontact$(EXEEXT) - $(CXXLINK) $(addcontact_LDFLAGS) $(addcontact_OBJECTS) $(addcontact_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addcalendar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/addcontact.Po@am__quote@ - -.cc.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(PROGRAMS) -installdirs: -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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(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-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool 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-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - 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-info-am - -# 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 barry-0.14/examples/pipedump.cc barry-0.0.20110506/examples/pipedump.cc --- barry-0.14/examples/pipedump.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/examples/pipedump.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,129 @@ +/// +/// \file dumpall.cc +/// Example code using the Barry library to dump all +/// device databases to stdout, using all known parsers, +/// and hex dumps for the rest. +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +using namespace std; +using namespace Barry; + +template +class Store +{ +public: + void operator() (const RecordT &rec) + { + cout << RecordT::GetDBName() << ": " + << hex << rec.GetUniqueId() << endl; + } +}; + +class UnknownParser : public Parser +{ +public: + void ParseRecord(const DBData &data, const IConverter *ic) + { + cout << "Unknown record of " + << dec << data.GetData().GetSize() + << " bytes from: " + << data.GetDBName() + << endl; + } +}; + +int main(int argc, char *argv[]) +{ + try { + + Barry::Init(); + Probe probe; + int i = probe.FindActive(); + if( i == -1 ) { + cout << "No device available" << endl; + return 1; + } + + // open Desktop mode + Controller con(probe.Get(i)); + Mode::Desktop desktop(con); + desktop.Open(); // specify password here if needed + + // create builder object to extract records from the + // device, and add all database names to the builder + DeviceBuilder builder(desktop); + const DatabaseDatabase &dbdb = desktop.GetDBDB(); + DatabaseDatabase::DatabaseArrayType::const_iterator + b = dbdb.Databases.begin(), e = dbdb.Databases.end(); + for( ; b != e; ++b ) { + builder.Add( b->Name ); + } + + // create the parser, and use stdout dump objects for output + AllRecordParser parser(cout, + new HexDumpParser(cout), + new AllRecordDumpStore(cout)); + + // create the pipe to connect builder to parser and + // move the data + Pipe pipe(builder); + pipe.PumpFile(parser); + + cout << "\n\n\nStarting again....................." << endl; + + // run it again, but this time with custom set of + // record parsers and default parser + + MultiRecordParser mrp( new UnknownParser ); + + // add a few known record types... first, the manual way + mrp.Add( Contact::GetDBName(), + new RecordParser >( + new Store)); + // and with the template member (does the same thing) + mrp.Add( new Store ); + mrp.Add( new Store ); + mrp.Add( new Store ); + + builder.Restart(); + pipe.PumpFile(mrp); + + // and one more time, with a tee + cout << "\n\n\nStarting again with a tee............" << endl; + + TeeParser tee; + tee.Add( mrp ); + tee.Add( parser ); + + builder.Restart(); + pipe.PumpFile(tee); + + } + catch( exception &e ) { + cerr << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/examples/usbclient.cc barry-0.0.20110506/examples/usbclient.cc --- barry-0.14/examples/usbclient.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/examples/usbclient.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,130 @@ +/// +/// \file usbclient.cc +/// Example code using the Barry library to interface +/// with a custom USB channel on a Blackberry device. +/// + +/* + Copyright (C) 2010, RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include + +using namespace std; +using namespace Barry; + +// This example is intended to provide similar functionality to the 'usbclient' +// example provided as a sample with BlackBerry JDEs. It is intended to +// be run with the 'usbdemo' sample application running on the BlackBerry. The +// 'usbdemo' sample application is provided as a sample with BlackBerry JDEs. +// +// A more complex use of Barry::RawChannel can be found in tools/brawchannel.cc + +#define CHANNEL_NAME "JDE_USBClient" + +#define GCF_HEADER_SIZE 2 + +#define GCF_SIZE(buf) ((size_t)((buf[0] << 8) | (buf[1]))) + +#define HELLO_TO_BB "Hello from PC" +#define HELLO_FROM_BB "Hello from Device" +#define BYE_TO_BB "Goodbye from PC" +#define BYE_FROM_BB "Goodbye from Device" + +// Function to print the data read +static void printReply(Data &data) +{ + // Need to work out if it's a GCF wrapped reply or a USBPort based + // reply. + // To do this take the first two bytes as a length value and see + // if they match the data length. + string strdata; + if(data.GetSize() < GCF_HEADER_SIZE || + GCF_SIZE(data.GetData()) != (data.GetSize() - GCF_HEADER_SIZE) ) { + // USBPort data + strdata = string((const char*)data.GetData(), data.GetSize()); + } + else { + // GCF header present + strdata = string((const char*)data.GetData() + GCF_HEADER_SIZE, + data.GetSize() - GCF_HEADER_SIZE); + } + cout << "Received data: " << strdata << endl; + +} + +int main(int argc, char *argv[]) +{ + try { + Barry::Init(); + + Barry::Probe probe; + if( probe.GetCount() == 0 ) { + cout << "No Blackberry found!" << endl; + return 1; + } + else { + cout << "Using PIN: " + << probe.Get(0).m_pin.Str() << endl; + } + + // Create the router + auto_ptr router; + router.reset(new SocketRoutingQueue()); + router->SpinoffSimpleReadThread(); + + // Create our controller object + Barry::Controller con(probe.Get(0), *router); + + // Create the raw channel + Barry::Mode::RawChannel rawChannel(con); + + cout << "Connecting to device channel with an empty password" << endl; + rawChannel.Open("", CHANNEL_NAME); + + cout << "Sending hello to device: " << HELLO_TO_BB << endl; + Data data(HELLO_TO_BB, sizeof(HELLO_TO_BB) - 1); + rawChannel.Send(data); + + cout << "Waiting for reply from device" << endl; + rawChannel.Receive(data); + printReply(data); + + cout << "Sending bye bye to the device: " << BYE_TO_BB << endl; + data = Data(BYE_TO_BB, sizeof(BYE_TO_BB) - 1); + rawChannel.Send(data); + + cout << "Waiting for response from device" << endl; + rawChannel.Receive(data); + printReply(data); + + cout << "All send and received OK, exiting" << endl; + + } + catch( Barry::Error &e ) { + cerr << "Exception caught: " << e.what() << endl; + return 1; + } + catch( std::exception &e ) { + cerr << "Exception caught: " << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/gui/aclocal.m4 barry-0.0.20110506/gui/aclocal.m4 --- barry-0.14/gui/aclocal.m4 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,7377 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 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. - -# 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. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# 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 -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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 conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$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>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - 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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -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*) - 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 - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - 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 -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $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 .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != 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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[[123]]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -AC_MSG_RESULT([$dynamic_linker]) -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 -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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 -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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 <&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 - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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 &1 /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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -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 -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - 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 - 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]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f 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 -]) -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 - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = 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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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]].*|aix5*) - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) 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. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# 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. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi - -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[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. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 2002, 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. - -# 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. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 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. - -# 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 -# 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 7 - -# 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]) -AC_SUBST([$1_FALSE]) -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 -# 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 8 - -# 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], 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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 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 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 -# 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 - -# 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.58])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 -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -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 - 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) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -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 -]) -]) - - -# 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_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 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. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -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 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_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.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 -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 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 4 - -# 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 -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 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 3 - -# _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], -[AC_FOREACH([_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])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 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 4 - -# 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 -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# 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="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 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 - -# _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. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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 - diff -Nru barry-0.14/gui/buildgen.sh barry-0.0.20110506/gui/buildgen.sh --- barry-0.14/gui/buildgen.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/buildgen.sh 2011-05-06 12:20:16.000000000 +0000 @@ -10,7 +10,7 @@ configure depcomp install-sh ltmain.sh missing \ man/Makefile.in \ src/Makefile.in src/*.bak src/*.gladep INSTALL \ - config.h.in~ + config.h.in~ config.rpath else autoreconf -if #autoreconf -ifv diff -Nru barry-0.14/gui/config.h.in barry-0.0.20110506/gui/config.h.in --- barry-0.14/gui/config.h.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if the `closedir' function returns void instead of `int'. */ -#undef CLOSEDIR_VOID - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if `stat' has the bug that it succeeds when given the - zero-length file name argument. */ -#undef HAVE_STAT_EMPTY_STRING_BUG - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if `lstat' dereferences a symlink specified with a trailing - slash. */ -#undef LSTAT_FOLLOWS_SLASHED_SYMLINK - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to the type of arg 1 for `select'. */ -#undef SELECT_TYPE_ARG1 - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#undef SELECT_TYPE_ARG234 - -/* Define to the type of arg 5 for `select'. */ -#undef SELECT_TYPE_ARG5 - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc diff -Nru barry-0.14/gui/configure barry-0.0.20110506/gui/configure --- barry-0.14/gui/configure 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,23321 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for barry-backup 0.1. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -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 - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -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 - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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'" - - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, 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= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='barry-backup' -PACKAGE_TARNAME='barry-backup' -PACKAGE_VERSION='0.1' -PACKAGE_STRING='barry-backup 0.1' -PACKAGE_BUGREPORT='barry-devel@lists.sourceforge.net' - -ac_unique_file="src/main.cc" -# 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_header_list= -ac_func_list= -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -CXX -CXXFLAGS -ac_ct_CXX -CXXDEPMODE -am__fastdepCXX_TRUE -am__fastdepCXX_FALSE -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -GREP -EGREP -LN_S -ECHO -AR -RANLIB -CPP -CXXCPP -F77 -FFLAGS -ac_ct_F77 -LIBTOOL -LIBTAR_CFLAGS -LIBTAR_LIBS -LIBZ_CFLAGS -LIBZ_LIBS -PKG_CONFIG -BARRY_CFLAGS -BARRY_LIBS -GTKMM_CFLAGS -GTKMM_LIBS -TREE_BUILD_CXXFLAGS -TREE_BUILD_LDFLAGS -gladedir -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CXX -CXXFLAGS -CCC -CPP -CXXCPP -F77 -FFLAGS -PKG_CONFIG -BARRY_CFLAGS -BARRY_LIBS -GTKMM_CFLAGS -GTKMM_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=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 ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - 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'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -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 - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -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 - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -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 .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - 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 .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - 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 barry-backup 0.1 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/barry-backup] - --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 barry-backup 0.1:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-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) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] include additional configurations [automatic] - --with-libtar= root path of libtar install - --with-zlib= root path of zlib install - -Some influential environment variables: - 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 C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CPP C preprocessor - CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - PKG_CONFIG path to pkg-config utility - BARRY_CFLAGS - C compiler flags for BARRY, overriding pkg-config - BARRY_LIBS linker flags for BARRY, overriding pkg-config - GTKMM_CFLAGS - C compiler flags for GTKMM, overriding pkg-config - GTKMM_LIBS linker flags for GTKMM, overriding pkg-config - -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" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 - 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 -barry-backup configure 0.1 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 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 -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 barry-backup $as_me 0.1, which was -generated by GNU Autoconf 2.61. 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=. - 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - 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'; { (exit 1); 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 - -# 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 - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - 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. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -ac_header_list="$ac_header_list sys/time.h" -ac_header_list="$ac_header_list unistd.h" -ac_func_list="$ac_func_list alarm" -# 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,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -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 - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -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 - - -#AM_CONFIG_HEADER(config.h) - -ac_config_headers="$ac_config_headers config.h:config.h.in" - -am__api_version="1.9" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -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. - - -# 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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -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 -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$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' - -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# 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". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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 $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 - -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -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='barry-backup' - VERSION='0.1' - - -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"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -# Checks for programs. -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out 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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.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 - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_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='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -# 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 --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 - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_GREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_EGREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$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 - 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 - -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -aix4* | aix5*) - 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'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - 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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -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 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 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:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 4823 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - 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 -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - -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 -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f 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 -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_F77" && break -done - - if test "x$ac_ct_F77" = x; then - F77="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - F77=$ac_ct_F77 - fi -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_prog_f77_g=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } -else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_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 -f 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 - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi - -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no - -# 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 - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -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;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:7082: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:7086: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$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= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - 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*) - # 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' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - interix3*) - # 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 - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - hpux*) - # 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='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - 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 - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # 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' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - 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 - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$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:7350: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:7354: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } - -if test x"$lt_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 -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 - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:7454: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:7458: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$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 - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # 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_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = 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>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - 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 - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - - 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - 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 - ;; - - interix3*) - 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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs=no - 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 $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' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - 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 - ;; - - 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 - - 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 - ;; - - aix4* | aix5*) - 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 - 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")) && (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].*|aix5*) - 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_libdir_separator=':' - link_all_deplibs=yes - - 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 - hardcode_direct=yes - 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 - 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 - - # 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 echo "${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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - 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*) - 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 - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - 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 `echo "$deplibs" | $SED -e '\''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' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${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 - 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 -a "$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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${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' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - 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_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - 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 - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - 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 - ;; - - 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - 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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - 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' - 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 linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - 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*) - 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -# -# 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 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:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant 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_AC_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 -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } - -if test "$hardcode_action" = relink; 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 - -striplib= -old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac -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*) - 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 - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; 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 - - ;; - - *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* 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 (); -/* 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_shl_load || defined __stub___shl_load -choke me -#endif - -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* 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 (); -/* 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_dlopen || defined __stub___dlopen -choke me -#endif - -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_svld_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_dld_link=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -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" - - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$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\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$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 - - -# Report which library types will actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# 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 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# 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 and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# 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 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 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# 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 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_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 - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi - - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - 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 - 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].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = 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 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=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_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_CXX=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_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-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_CXX='-Bstatic' - fi - ;; - amigaos*) - # 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_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:12187: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:12191: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:12291: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:12295: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# 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_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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 -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-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_F77='-Bstatic' - fi - ;; - - amigaos*) - # 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_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - interix3*) - # 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_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # 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_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-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_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # 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:13852: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:13856: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:13956: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:13960: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # 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_F77="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = 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_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$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_F77='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_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${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_F77='$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_F77='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_F77=no - else - ld_shlibs_F77=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $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_F77=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$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_F77=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_F77=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$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].*|aix5*) - 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_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - 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 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=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_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_F77=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_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$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. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$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*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$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_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } - -if test "$hardcode_action_F77" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# 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_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - -old_archive_cmds_GCJ=$old_archive_cmds - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:16143: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:16147: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic' - fi - ;; - - amigaos*) - # 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_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - interix3*) - # 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_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # 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_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # 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:16411: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:16415: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:16515: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:16519: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # 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_GCJ="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = 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_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$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_GCJ='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_GCJ=no - fi - ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_GCJ=no - else - ld_shlibs_GCJ=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$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].*|aix5*) - 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_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - 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 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=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_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_GCJ=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_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$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*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$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_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - -if test "$hardcode_action_GCJ" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# 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_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - RC) - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# 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_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -# Check whether --with-libtar was given. -if test "${with_libtar+set}" = set; then - withval=$with_libtar; LIBTAR_CFLAGS="-I$with_libtar/include" - LIBTAR_LIBS="-L$with_libtar/lib -ltar" -else - echo "Guessing libtar location... may not compile..."; - LIBTAR_CFLAGS="" - LIBTAR_LIBS="-ltar" -fi - - - - - -# Check whether --with-libz was given. -if test "${with_libz+set}" = set; then - withval=$with_libz; LIBZ_CFLAGS="-I$with_libtar/include" - LIBZ_LIBS="-L$with_libtar/lib -ltar" -else - echo "Guessing zlib location... may not compile..."; - LIBZ_CFLAGS="" - LIBZ_LIBS="-lz" -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi - -fi - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for BARRY" >&5 -echo $ECHO_N "checking for BARRY... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$BARRY_CFLAGS"; then - pkg_cv_BARRY_CFLAGS="$BARRY_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libbarry-0 libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libbarry-0 libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_BARRY_CFLAGS=`$PKG_CONFIG --cflags "libbarry-0 libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$BARRY_LIBS"; then - pkg_cv_BARRY_LIBS="$BARRY_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libbarry-0 libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libbarry-0 libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_BARRY_LIBS=`$PKG_CONFIG --libs "libbarry-0 libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -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 - BARRY_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libbarry-0 libusb"` - else - BARRY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libbarry-0 libusb"` - fi - # Put the nasty error message in config.log where it belongs - echo "$BARRY_PKG_ERRORS" >&5 - - { { echo "$as_me:$LINENO: error: Package requirements (libbarry-0 libusb) were not met: - -$BARRY_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 BARRY_CFLAGS -and BARRY_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements (libbarry-0 libusb) were not met: - -$BARRY_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 BARRY_CFLAGS -and BARRY_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: 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 BARRY_CFLAGS -and BARRY_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." >&5 -echo "$as_me: 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 BARRY_CFLAGS -and BARRY_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." >&2;} - { (exit 1); exit 1; }; } -else - BARRY_CFLAGS=$pkg_cv_BARRY_CFLAGS - BARRY_LIBS=$pkg_cv_BARRY_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for GTKMM" >&5 -echo $ECHO_N "checking for GTKMM... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$GTKMM_CFLAGS"; then - pkg_cv_GTKMM_CFLAGS="$GTKMM_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 libglademm-2.4 gthread-2.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 libglademm-2.4 gthread-2.0") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.4 libglademm-2.4 gthread-2.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$GTKMM_LIBS"; then - pkg_cv_GTKMM_LIBS="$GTKMM_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 libglademm-2.4 gthread-2.0\"") >&5 - ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 libglademm-2.4 gthread-2.0") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.4 libglademm-2.4 gthread-2.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -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 - GTKMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtkmm-2.4 libglademm-2.4 gthread-2.0"` - else - GTKMM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtkmm-2.4 libglademm-2.4 gthread-2.0"` - fi - # Put the nasty error message in config.log where it belongs - echo "$GTKMM_PKG_ERRORS" >&5 - - { { echo "$as_me:$LINENO: error: Package requirements (gtkmm-2.4 libglademm-2.4 gthread-2.0) were not met: - -$GTKMM_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 GTKMM_CFLAGS -and GTKMM_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements (gtkmm-2.4 libglademm-2.4 gthread-2.0) were not met: - -$GTKMM_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 GTKMM_CFLAGS -and GTKMM_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: 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 GTKMM_CFLAGS -and GTKMM_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." >&5 -echo "$as_me: 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 GTKMM_CFLAGS -and GTKMM_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." >&2;} - { (exit 1); exit 1; }; } -else - GTKMM_CFLAGS=$pkg_cv_GTKMM_CFLAGS - GTKMM_LIBS=$pkg_cv_GTKMM_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi - -# Carry the special tree build environment variables from parent configure, -# just in case user is doing a complete tree build with --enable-gui - - - -# Setup gladedir, so src/Makefile.am can use it for the compile -# and for the glade file installations. (glade_DATA) -gladedir="$datadir/barry/glade/" - - -# Checks for libraries. -#AC_CHECK_LIB([IOKit], [main]) - -{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5 -echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; } -if test "${ac_cv_lib_pthread_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_pthread_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_main=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; } -if test $ac_cv_lib_pthread_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - -#AC_CHECK_LIB([libusb], [libusb_init]) - -# Checks for header files. - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `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 - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$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 - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$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 - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - - - -for ac_header in assert.h stdint.h time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -#AC_TYPE_SIZE_T -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } -if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_struct_tm=time.h -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_tm=sys/time.h -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - - -# Checks for library functions. -{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } -if test "${ac_cv_func_closedir_void+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_closedir_void=yes -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header_dirent> -#ifndef __cplusplus -int closedir (); -#endif - -int -main () -{ -return closedir (opendir (".")) != 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_closedir_void=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_closedir_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } -if test $ac_cv_func_closedir_void = yes; then - -cat >>confdefs.h <<\_ACEOF -#define CLOSEDIR_VOID 1 -_ACEOF - -fi - -if test $ac_cv_c_compiler_gnu = yes; then - { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_pattern="Autoconf.*'x'" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -else - ac_cv_prog_gcc_traditional=no -fi -rm -f conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1; then - ac_cv_prog_gcc_traditional=yes -fi -rm -f conftest* - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF - -fi - - - - - - - -for ac_header in $ac_header_list -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - -for ac_func in $ac_func_list -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - - - - - - - - - - - -{ echo "$as_me:$LINENO: checking for working mktime" >&5 -echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; } -if test "${ac_cv_func_working_mktime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_working_mktime=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Test program from Paul Eggert and Tony Leneis. */ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifndef HAVE_ALARM -# define alarm(X) /* empty */ -#endif - -/* Work around redefinition to rpl_putenv by other config tests. */ -#undef putenv - -static time_t time_t_max; -static time_t time_t_min; - -/* Values we'll use to set the TZ environment variable. */ -static char *tz_strings[] = { - (char *) 0, "TZ=GMT0", "TZ=JST-9", - "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" -}; -#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) - -/* Return 0 if mktime fails to convert a date in the spring-forward gap. - Based on a problem report from Andreas Jaeger. */ -static int -spring_forward_gap () -{ - /* glibc (up to about 1998-10-07) failed this test. */ - struct tm tm; - - /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" - instead of "TZ=America/Vancouver" in order to detect the bug even - on systems that don't support the Olson extension, or don't have the - full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); - - tm.tm_year = 98; - tm.tm_mon = 3; - tm.tm_mday = 5; - tm.tm_hour = 2; - tm.tm_min = 0; - tm.tm_sec = 0; - tm.tm_isdst = -1; - return mktime (&tm) != (time_t) -1; -} - -static int -mktime_test1 (now) - time_t now; -{ - struct tm *lt; - return ! (lt = localtime (&now)) || mktime (lt) == now; -} - -static int -mktime_test (now) - time_t now; -{ - return (mktime_test1 (now) - && mktime_test1 ((time_t) (time_t_max - now)) - && mktime_test1 ((time_t) (time_t_min + now))); -} - -static int -irix_6_4_bug () -{ - /* Based on code from Ariel Faigon. */ - struct tm tm; - tm.tm_year = 96; - tm.tm_mon = 3; - tm.tm_mday = 0; - tm.tm_hour = 0; - tm.tm_min = 0; - tm.tm_sec = 0; - tm.tm_isdst = -1; - mktime (&tm); - return tm.tm_mon == 2 && tm.tm_mday == 31; -} - -static int -bigtime_test (j) - int j; -{ - struct tm tm; - time_t now; - tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; - now = mktime (&tm); - if (now != (time_t) -1) - { - struct tm *lt = localtime (&now); - if (! (lt - && lt->tm_year == tm.tm_year - && lt->tm_mon == tm.tm_mon - && lt->tm_mday == tm.tm_mday - && lt->tm_hour == tm.tm_hour - && lt->tm_min == tm.tm_min - && lt->tm_sec == tm.tm_sec - && lt->tm_yday == tm.tm_yday - && lt->tm_wday == tm.tm_wday - && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) - == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - return 0; - } - return 1; -} - -static int -year_2050_test () -{ - /* The correct answer for 2050-02-01 00:00:00 in Pacific time, - ignoring leap seconds. */ - unsigned long int answer = 2527315200UL; - - struct tm tm; - time_t t; - tm.tm_year = 2050 - 1900; - tm.tm_mon = 2 - 1; - tm.tm_mday = 1; - tm.tm_hour = tm.tm_min = tm.tm_sec = 0; - tm.tm_isdst = -1; - - /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" - instead of "TZ=America/Vancouver" in order to detect the bug even - on systems that don't support the Olson extension, or don't have the - full zoneinfo tables installed. */ - putenv ("TZ=PST8PDT,M4.1.0,M10.5.0"); - - t = mktime (&tm); - - /* Check that the result is either a failure, or close enough - to the correct answer that we can assume the discrepancy is - due to leap seconds. */ - return (t == (time_t) -1 - || (0 < t && answer - 120 <= t && t <= answer + 120)); -} - -int -main () -{ - time_t t, delta; - int i, j; - - /* This test makes some buggy mktime implementations loop. - Give up after 60 seconds; a mktime slower than that - isn't worth using anyway. */ - alarm (60); - - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; - if ((time_t) -1 < 0) - for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2) - continue; - delta = time_t_max / 997; /* a suitable prime number */ - for (i = 0; i < N_STRINGS; i++) - { - if (tz_strings[i]) - putenv (tz_strings[i]); - - for (t = 0; t <= time_t_max - delta; t += delta) - if (! mktime_test (t)) - return 1; - if (! (mktime_test ((time_t) 1) - && mktime_test ((time_t) (60 * 60)) - && mktime_test ((time_t) (60 * 60 * 24)))) - return 1; - - for (j = 1; 0 < j; j *= 2) - if (! bigtime_test (j)) - return 1; - if (! bigtime_test (j - 1)) - return 1; - } - return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_working_mktime=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_working_mktime=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 -echo "${ECHO_T}$ac_cv_func_working_mktime" >&6; } -if test $ac_cv_func_working_mktime = no; then - case " $LIBOBJS " in - *" mktime.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mktime.$ac_objext" - ;; -esac - -fi - - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 -echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_realloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *realloc (); -#endif - -int -main () -{ -return ! realloc (0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_realloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_realloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 0 -_ACEOF - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<\_ACEOF -#define realloc rpl_realloc -_ACEOF - -fi - - - - - -for ac_header in sys/select.h sys/socket.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to barry-devel@lists.sourceforge.net ## -## ------------------------------------------------ ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 -echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } -if test "${ac_cv_func_select_args+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_arg234 in 'fd_set *' 'int *' 'void *'; do - for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do - for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif - -int -main () -{ -extern int select ($ac_arg1, - $ac_arg234, $ac_arg234, $ac_arg234, - $ac_arg5); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done -done -# Provide a safe default value. -: ${ac_cv_func_select_args='int,int *,struct timeval *'} - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 -echo "${ECHO_T}$ac_cv_func_select_args" >&6; } -ac_save_IFS=$IFS; IFS=',' -set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` -IFS=$ac_save_IFS -shift - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG1 $1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG234 ($2) -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define SELECT_TYPE_ARG5 ($3) -_ACEOF - -rm -f conftest* - -{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 -echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } -if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -f conftest.sym conftest.file -echo >conftest.file -if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then - if test "$cross_compiling" = yes; then - ac_cv_func_lstat_dereferences_slashed_symlink=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - /* Linux will dereference the symlink and fail. - That is better in the sense that it means we will not - have to compile and use the lstat wrapper. */ - return lstat ("conftest.sym/", &sbuf) == 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_lstat_dereferences_slashed_symlink=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -else - # If the `ln -s' command failed, then we probably don't even - # have an lstat function. - ac_cv_func_lstat_dereferences_slashed_symlink=no -fi -rm -f conftest.sym conftest.file - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } - -test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && - -cat >>confdefs.h <<_ACEOF -#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 -_ACEOF - - -if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - case " $LIBOBJS " in - *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" - ;; -esac - -fi - -{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 -echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; } -if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_stat_empty_string_bug=yes -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -struct stat sbuf; - return stat ("", &sbuf) == 0; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_stat_empty_string_bug=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_stat_empty_string_bug=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 -echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; } -if test $ac_cv_func_stat_empty_string_bug = yes; then - case " $LIBOBJS " in - *" stat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS stat.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<_ACEOF -#define HAVE_STAT_EMPTY_STRING_BUG 1 -_ACEOF - -fi - - - - - - - - - - -for ac_func in bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* 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 $ac_func (); -/* 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_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile" - -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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -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= -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=`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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 - -# 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 barry-backup $as_me 0.1, which was -generated by GNU Autoconf 2.61. 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 - -cat >>$CONFIG_STATUS <<_ACEOF -# 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_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet 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_cs_version="\\ -barry-backup config.status 0.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 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' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$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 ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - 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. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# 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:config.h.in" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$ac_delim -CPP!$CPP$ac_delim -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -LIBTAR_CFLAGS!$LIBTAR_CFLAGS$ac_delim -LIBTAR_LIBS!$LIBTAR_LIBS$ac_delim -LIBZ_CFLAGS!$LIBZ_CFLAGS$ac_delim -LIBZ_LIBS!$LIBZ_LIBS$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -BARRY_CFLAGS!$BARRY_CFLAGS$ac_delim -BARRY_LIBS!$BARRY_LIBS$ac_delim -GTKMM_CFLAGS!$GTKMM_CFLAGS$ac_delim -GTKMM_LIBS!$GTKMM_LIBS$ac_delim -TREE_BUILD_CXXFLAGS!$TREE_BUILD_CXXFLAGS$ac_delim -TREE_BUILD_LDFLAGS!$TREE_BUILD_LDFLAGS$ac_delim -gladedir!$gladedir$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[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="$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 || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - 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 || -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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# 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= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - 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 - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;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 -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then 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. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $ac_file | $ac_file:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $ac_file" >`$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 || -echo X$ac_file | - 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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 || -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 || -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 - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - - diff -Nru barry-0.14/gui/configure.ac barry-0.0.20110506/gui/configure.ac --- barry-0.14/gui/configure.ac 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/configure.ac 2011-05-06 12:20:16.000000000 +0000 @@ -1,13 +1,18 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ(2.59) -AC_INIT([barry-backup], [0.1], [barry-devel@lists.sourceforge.net]) +AC_PREREQ(2.61) +AC_INIT([barry-backup], [0.18.0], [barry-devel@lists.sourceforge.net]) #AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_HEADERS([config.h:config.h.in]) +AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.17]) + # Checks for programs. AC_PROG_CC AC_PROG_CXX @@ -16,27 +21,8 @@ AC_LANG([C++]) -AC_ARG_WITH(libtar, - [ --with-libtar= root path of libtar install], - [LIBTAR_CFLAGS="-I$with_libtar/include" - LIBTAR_LIBS="-L$with_libtar/lib -ltar"], - [echo "Guessing libtar location... may not compile..."; - LIBTAR_CFLAGS="" - LIBTAR_LIBS="-ltar"]) -AC_SUBST(LIBTAR_CFLAGS) -AC_SUBST(LIBTAR_LIBS) - -AC_ARG_WITH(libz, - [ --with-zlib= root path of zlib install], - [LIBZ_CFLAGS="-I$with_libtar/include" - LIBZ_LIBS="-L$with_libtar/lib -ltar"], - [echo "Guessing zlib location... may not compile..."; - LIBZ_CFLAGS="" - LIBZ_LIBS="-lz"]) -AC_SUBST(LIBZ_CFLAGS) -AC_SUBST(LIBZ_LIBS) - -PKG_CHECK_MODULES([BARRY], [libbarry-0 libusb]) +PKG_CHECK_MODULES([BARRY], [libbarry-0]) +PKG_CHECK_MODULES([BARRYBACKUP], [libbarrybackup-0]) PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 libglademm-2.4 gthread-2.0]) # Carry the special tree build environment variables from parent configure, @@ -74,7 +60,8 @@ AC_FUNC_STAT AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul]) -AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([Makefile + po/Makefile.in src/Makefile man/Makefile]) AC_OUTPUT diff -Nru barry-0.14/gui/Makefile.am barry-0.0.20110506/gui/Makefile.am --- barry-0.14/gui/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -1,5 +1,9 @@ +ACLOCAL_FLAGS = -I m4 -EXTRA_DIST = COPYING ChangeLog README buildgen.sh +EXTRA_DIST = COPYING ChangeLog README \ + buildgen.sh -SUBDIRS = . src man +SUBDIRS = po . src man + +ACLOCAL_AMFLAGS = -I m4 diff -Nru barry-0.14/gui/Makefile.in barry-0.0.20110506/gui/Makefile.in --- barry-0.14/gui/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,628 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/../config.guess \ - $(srcdir)/../config.sub $(srcdir)/../install-sh \ - $(srcdir)/../ltmain.sh $(srcdir)/../missing \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog NEWS TODO -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BARRY_CFLAGS = @BARRY_CFLAGS@ -BARRY_LIBS = @BARRY_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTKMM_CFLAGS = @GTKMM_CFLAGS@ -GTKMM_LIBS = @GTKMM_LIBS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTAR_CFLAGS = @LIBTAR_CFLAGS@ -LIBTAR_LIBS = @LIBTAR_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBZ_CFLAGS = @LIBZ_CFLAGS@ -LIBZ_LIBS = @LIBZ_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TREE_BUILD_CXXFLAGS = @TREE_BUILD_CXXFLAGS@ -TREE_BUILD_LDFLAGS = @TREE_BUILD_LDFLAGS@ -VERSION = @VERSION@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gladedir = @gladedir@ -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@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -EXTRA_DIST = COPYING ChangeLog README buildgen.sh -SUBDIRS = . src man -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) - -config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# 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): - @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; \ - (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" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @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; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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 || \ - tags="$$tags $$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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/.. - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__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 -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' -distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(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 - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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 - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am - -# 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 barry-0.14/gui/man/barrybackup.1 barry-0.0.20110506/gui/man/barrybackup.1 --- barry-0.14/gui/man/barrybackup.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/man/barrybackup.1 2011-05-06 12:20:16.000000000 +0000 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH BARRYBACKUP 1 "May 29, 2008" +.TH BARRYBACKUP 1 "July 28, 2009" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -19,7 +19,7 @@ .B barrybackup \- Barry Project's backup program for the BlackBerry handheld .SH SYNOPSIS -.B barrybackup +.B barrybackup [-?][-d] .SH DESCRIPTION .PP @@ -32,9 +32,11 @@ nor all restored. Backups and configuration files are stored by default in the user's -home directory, under ~/.barry/backup/PIN. The backup files are -compressed tarballs containing specially named files for each record -of the databases. +home directory, under ~/.barry/backup/PIN. This destination can be +changed in the config dialogs, per device. + +The backup files are compressed tarballs containing specially named +files for each record of the databases. .SH OPTIONS .TP .B \-d @@ -55,7 +57,9 @@ Backups are stored in tar format, compressed with gzip. Backup files are named with the following pattern: - PIN-YYYYMMDD-HHMMSS.tar.gz + PIN-YYYYMMDD-HHMMSS[-tag_name].tar.gz + +The tag name is optional and is used to name a particular backup. Each record is appended to the tar file using the following pattern for the filename: @@ -77,10 +81,10 @@ .SH AUTHOR .nh -.B barrybackup +.B barrybackup is part of the Barry project. This manual page was written by Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/gui/man/Makefile.in barry-0.0.20110506/gui/man/Makefile.in --- barry-0.14/gui/man/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/man/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,382 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -subdir = man -DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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 = -SOURCES = -DIST_SOURCES = -man1dir = $(mandir)/man1 -am__installdirs = "$(DESTDIR)$(man1dir)" -NROFF = nroff -MANS = $(dist_man_MANS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BARRY_CFLAGS = @BARRY_CFLAGS@ -BARRY_LIBS = @BARRY_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTKMM_CFLAGS = @GTKMM_CFLAGS@ -GTKMM_LIBS = @GTKMM_LIBS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTAR_CFLAGS = @LIBTAR_CFLAGS@ -LIBTAR_LIBS = @LIBTAR_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBZ_CFLAGS = @LIBZ_CFLAGS@ -LIBZ_LIBS = @LIBZ_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TREE_BUILD_CXXFLAGS = @TREE_BUILD_CXXFLAGS@ -TREE_BUILD_LDFLAGS = @TREE_BUILD_LDFLAGS@ -VERSION = @VERSION@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gladedir = @gladedir@ -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@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -dist_man_MANS = barrybackup.1 -all: all-am - -.SUFFIXES: -$(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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign man/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 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-man1: $(man1_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(MANS) -installdirs: - for dir in "$(DESTDIR)$(man1dir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-man - -install-exec-am: - -install-info: install-info-am - -install-man: install-man1 - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-man - -uninstall-man: uninstall-man1 - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-man1 \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-info-am uninstall-man \ - uninstall-man1 - -# 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 barry-0.14/gui/NEWS barry-0.0.20110506/gui/NEWS --- barry-0.14/gui/NEWS 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/NEWS 2011-05-06 12:20:16.000000000 +0000 @@ -1,3 +1,3 @@ -See http://sourceforge.net/projects/barry for the latest news. +See http://www.netdirect.ca/software/packages/barry for the latest news. diff -Nru barry-0.14/gui/po/barry-backup.pot barry-0.0.20110506/gui/po/barry-backup.pot --- barry-0.14/gui/po/barry-backup.pot 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/barry-backup.pot 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,431 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Net Direct, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: barry-backup 0.18.0\n" +"Report-Msgid-Bugs-To: http://netdirect.ca/barry\n" +"POT-Creation-Date: 2011-01-27 14:01-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/PasswordDlg.glade:8 +msgid "Password Required" +msgstr "" + +#: src/PasswordDlg.glade:99 +msgid "Please enter device password: (5 tries remaining)" +msgstr "" + +#: src/ConfigDlg.glade:7 +msgid "Configuration of Current PIN" +msgstr "" + +#: src/ConfigDlg.glade:33 +msgid "Backup path:" +msgstr "" + +#: src/ConfigDlg.glade:70 +msgid "Device name:" +msgstr "" + +#: src/ConfigDlg.glade:83 +msgid "Prompt for label on every backup." +msgstr "" + +#: src/ConfigDlg.glade:102 +msgid "" +"Database restore filter. Only databases selected in this list will be " +"restored, even if more exist in the backup." +msgstr "" + +#: src/ConfigDlg.glade:118 +msgid "Device database backup list:" +msgstr "" + +#: src/ConfigDlg.glade:138 src/ConfigDlg.glade:166 +msgid "Configure..." +msgstr "" + +#: src/DatabaseSelectDlg.glade:8 +msgid "Database Selection" +msgstr "" + +#: src/DatabaseSelectDlg.glade:100 src/ConfigDlg.cc:77 +msgid "Select the device databases you wish to backup:" +msgstr "" + +#: src/DatabaseSelectDlg.glade:150 +msgid "Select _All" +msgstr "" + +#: src/DatabaseSelectDlg.glade:162 +msgid "_Deselect All" +msgstr "" + +#: src/PromptDlg.glade:8 +msgid "Question" +msgstr "" + +#: src/PromptDlg.glade:101 +msgid "Nice detailed question for the user to answer..." +msgstr "" + +#: src/BackupWindow.glade:7 src/barry-gui.glade:8 src/barry-gui.glade:296 +#: src/barry-gui.glade:446 +msgid "Barry Backup" +msgstr "" + +#: src/BackupWindow.glade:18 src/barry-gui.glade:33 src/barry-gui.glade:321 +#: src/barry-gui.glade:471 +msgid "_File" +msgstr "" + +#: src/BackupWindow.glade:36 src/barry-gui.glade:110 src/barry-gui.glade:365 +#: src/barry-gui.glade:515 +msgid "_Help" +msgstr "" + +#: src/BackupWindow.glade:72 +msgid "Device:" +msgstr "" + +#: src/BackupWindow.glade:111 src/barry-gui.glade:684 +msgid "Backup" +msgstr "" + +#: src/BackupWindow.glade:124 src/Thread.cc:177 +msgid "Restore..." +msgstr "" + +#: src/BackupWindow.glade:137 +msgid "Config..." +msgstr "" + +#: src/BackupWindow.glade:150 +msgid "Disconnect" +msgstr "" + +#: src/BackupWindow.glade:163 +msgid "Rescan USB Bus" +msgstr "" + +#: src/BackupWindow.glade:178 +msgid "Disconnect All" +msgstr "" + +#: src/barry-gui.glade:55 +msgid "_Device" +msgstr "" + +#: src/barry-gui.glade:64 src/barry-gui.glade:147 +msgid "_Connect" +msgstr "" + +#: src/barry-gui.glade:73 src/barry-gui.glade:162 +msgid "_Disconnect" +msgstr "" + +#: src/barry-gui.glade:88 +msgid "_Backup..." +msgstr "" + +#: src/barry-gui.glade:97 +msgid "_Restore..." +msgstr "" + +#: src/barry-gui.glade:119 src/barry-gui.glade:374 src/barry-gui.glade:524 +msgid "_About" +msgstr "" + +#: src/barry-gui.glade:190 src/barry-gui.glade:403 +msgid "_Backup" +msgstr "" + +#: src/barry-gui.glade:205 src/barry-gui.glade:415 +msgid "_Restore" +msgstr "" + +#: src/barry-gui.glade:343 src/barry-gui.glade:493 +msgid "_Edit" +msgstr "" + +#: src/barry-gui.glade:352 src/barry-gui.glade:502 +msgid "_Config..." +msgstr "" + +#: src/barry-gui.glade:605 +msgid "Device PIN" +msgstr "" + +#: src/barry-gui.glade:627 src/BackupWindow.cc:83 +msgid "Progress" +msgstr "" + +#: src/barry-gui.glade:649 +msgid "Database" +msgstr "" + +#: src/barry-gui.glade:701 +msgid "Restore" +msgstr "" + +#: src/barry-gui.glade:736 +msgid "Device Selection" +msgstr "" + +#: src/barry-gui.glade:827 +msgid "" +"Multiple BlackBerry devices have been found. Please select the one to work " +"with:" +msgstr "" + +#: src/PasswordDlg.cc:41 +msgid "Please enter device password: (" +msgstr "" + +#: src/PasswordDlg.cc:41 +msgid " tries remaining)" +msgstr "" + +#: src/ConfigDlg.cc:86 +msgid "" +"Select the device databases you wish to recover. This selection acts like a " +"filter, in that only the databases you select here will be restored, even if " +"more exist in the backup data." +msgstr "" + +#: src/BackupWindow.cc:79 +msgid "PIN" +msgstr "" + +#: src/BackupWindow.cc:80 src/DatabaseSelectDlg.cc:77 +msgid "Name" +msgstr "" + +#: src/BackupWindow.cc:81 +msgid "Status" +msgstr "" + +#: src/BackupWindow.cc:121 src/BackupWindow.cc:138 +msgid "Scanning for devices..." +msgstr "" + +#: src/BackupWindow.cc:147 +msgid "No devices." +msgstr "" + +#: src/BackupWindow.cc:149 +msgid "1 device:" +msgstr "" + +#: src/BackupWindow.cc:153 +msgid " devices:" +msgstr "" + +#: src/BackupWindow.cc:169 +msgid "All devices loaded." +msgstr "" + +#: src/BackupWindow.cc:183 +msgid "Connecting to Device..." +msgstr "" + +#: src/BackupWindow.cc:197 +msgid "Connection cancelled." +msgstr "" + +#: src/BackupWindow.cc:205 src/BackupWindow.cc:220 src/BackupWindow.cc:227 +msgid "Cannot connect to " +msgstr "" + +#: src/BackupWindow.cc:232 +msgid "Connected to " +msgstr "" + +#: src/BackupWindow.cc:239 +msgid "" +" is working, disconnecting from it may cause data corruption, are you sure " +"to proceed?" +msgstr "" + +#: src/BackupWindow.cc:248 +msgid "Disconnected from " +msgstr "" + +#: src/BackupWindow.cc:251 +msgid "Not connected." +msgstr "" + +#: src/BackupWindow.cc:259 +msgid "Unnamed device found (PIN: " +msgstr "" + +#: src/BackupWindow.cc:259 +msgid "Please enter a name for it:" +msgstr "" + +#: src/BackupWindow.cc:267 src/BackupWindow.cc:543 +msgid "Error saving config: " +msgstr "" + +#: src/BackupWindow.cc:309 +msgid "" +"One or more devices are working, disconnecting now may cause data " +"corruption. Proceed anyway?" +msgstr "" + +#: src/BackupWindow.cc:368 +msgid "Backup on" +msgstr "" + +#: src/BackupWindow.cc:370 +msgid "Restore on" +msgstr "" + +#: src/BackupWindow.cc:372 +msgid "Operation on" +msgstr "" + +#: src/BackupWindow.cc:374 +msgid " finished!" +msgstr "" + +#: src/BackupWindow.cc:386 +msgid "" +"Warning\n" +"\n" +"Not all records were processed on device: " +msgstr "" + +#: src/BackupWindow.cc:387 +msgid "" +"\n" +"\n" +"Only " +msgstr "" + +#: src/BackupWindow.cc:387 +msgid " of " +msgstr "" + +#: src/BackupWindow.cc:388 +msgid "" +" records were backed up.\n" +"\n" +"It is suspected that due to international characters in these records, the " +"BlackBerry uses a different low-level protocol, which Barry Backup does not " +"yet support. Please contact the developers at http://netdirect.ca/barry if " +"you want to assist in debugging this issue." +msgstr "" + +#: src/BackupWindow.cc:405 src/BackupWindow.cc:483 +msgid "Thread already in progress." +msgstr "" + +#: src/BackupWindow.cc:412 +msgid "Could not create directory: " +msgstr "" + +#: src/BackupWindow.cc:419 +msgid "No databases selected in configuration." +msgstr "" + +#: src/BackupWindow.cc:428 +msgid "Please enter a label for this backup (blank is ok):" +msgstr "" + +#: src/BackupWindow.cc:440 +msgid "Error starting backup thread: " +msgstr "" + +#: src/BackupWindow.cc:445 +msgid "Backup of " +msgstr "" + +#: src/BackupWindow.cc:445 src/BackupWindow.cc:499 +msgid " in progress..." +msgstr "" + +#: src/BackupWindow.cc:459 +msgid "Select backup to restore from" +msgstr "" + +#: src/BackupWindow.cc:494 +msgid "Error starting restore thread: " +msgstr "" + +#: src/BackupWindow.cc:499 +msgid "Restore of " +msgstr "" + +#: src/BackupWindow.cc:546 +msgid "Config saved successfully." +msgstr "" + +#: src/BackupWindow.cc:584 +msgid "and Barry contributors. See AUTHORS file" +msgstr "" + +#: src/BackupWindow.cc:585 +msgid "for detailed contribution information." +msgstr "" + +#: src/BackupWindow.cc:593 +msgid "Using library: " +msgstr "" + +#: src/DeviceIface.cc:83 src/DeviceIface.cc:146 +msgid "Terminated by user." +msgstr "" + +#: src/DeviceIface.cc:121 +msgid "Error while restoring " +msgstr "" + +#: src/DeviceIface.cc:124 +msgid " Will continue processing." +msgstr "" + +#: src/DeviceIface.cc:130 +msgid "Error on database: " +msgstr "" + +#: src/DeviceIface.cc:312 src/DeviceIface.cc:337 +msgid "Thread already running." +msgstr "" + +#: src/DatabaseSelectDlg.cc:76 +msgid "Active" +msgstr "" + +#: src/Thread.cc:56 src/Thread.cc:124 +msgid "Ready" +msgstr "" + +#: src/Thread.cc:100 src/Thread.cc:115 src/Thread.cc:200 +msgid "Connected" +msgstr "" + +#: src/Thread.cc:154 +msgid "Backup..." +msgstr "" + +#: src/Thread.cc:193 +msgid " error: " +msgstr "" + +#: src/Thread.cc:210 +msgid "Erasing database: " +msgstr "" + +#: src/Thread.cc:216 +msgid "Restored database: " +msgstr "" diff -Nru barry-0.14/gui/po/boldquot.sed barry-0.0.20110506/gui/po/boldquot.sed --- barry-0.14/gui/po/boldquot.sed 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/boldquot.sed 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff -Nru barry-0.14/gui/po/ChangeLog barry-0.0.20110506/gui/po/ChangeLog --- barry-0.14/gui/po/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/ChangeLog 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,12 @@ +2009-12-02 gettextize + + * Makefile.in.in: New file, from gettext-0.17. + * boldquot.sed: New file, from gettext-0.17. + * en@boldquot.header: New file, from gettext-0.17. + * en@quot.header: New file, from gettext-0.17. + * insert-header.sin: New file, from gettext-0.17. + * quot.sed: New file, from gettext-0.17. + * remove-potcdate.sin: New file, from gettext-0.17. + * Rules-quot: New file, from gettext-0.17. + * POTFILES.in: New file. + diff -Nru barry-0.14/gui/po/en@boldquot.header barry-0.0.20110506/gui/po/en@boldquot.header --- barry-0.14/gui/po/en@boldquot.header 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/en@boldquot.header 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff -Nru barry-0.14/gui/po/en@quot.header barry-0.0.20110506/gui/po/en@quot.header --- barry-0.14/gui/po/en@quot.header 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/en@quot.header 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff -Nru barry-0.14/gui/po/fr.po barry-0.0.20110506/gui/po/fr.po --- barry-0.14/gui/po/fr.po 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/fr.po 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,464 @@ +# French translations for barry-backup package. +# Copyright (C) 2009-2011 Net Direct, Inc. +# This file is distributed under the same license as the barry-backup package. +# Nicolas , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: barry-backup 0.1\n" +"Report-Msgid-Bugs-To: http://netdirect.ca/barry\n" +"POT-Creation-Date: 2011-01-27 14:01-0500\n" +"PO-Revision-Date: 2011-01-07 20:45+0100\n" +"Last-Translator: Nicolas VIVIEN \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: /usr/local/src/barry/barry/gui\n" + +#: src/PasswordDlg.glade:8 +msgid "Password Required" +msgstr "Mot de passe requis" + +#: src/PasswordDlg.glade:99 +msgid "Please enter device password: (5 tries remaining)" +msgstr "Veuillez saisir le mot de passe: (5 tentatives)" + +#: src/ConfigDlg.glade:7 +msgid "Configuration of Current PIN" +msgstr "Configuration du PIN code" + +#: src/ConfigDlg.glade:33 +msgid "Backup path:" +msgstr "Dossier de sauvegarde:" + +#: src/ConfigDlg.glade:70 +msgid "Device name:" +msgstr "Nom du périphérique" + +#: src/ConfigDlg.glade:83 +msgid "Prompt for label on every backup." +msgstr "Demander un nom lors de chaque sauvegarde." + +#: src/ConfigDlg.glade:102 +msgid "" +"Database restore filter. Only databases selected in this list will be " +"restored, even if more exist in the backup." +msgstr "" +"Filtre des bases de données à restaurer. Si la sauvegarde contient plusieurs " +"bases, seules celles sélectionnées seront restaurées." + +#: src/ConfigDlg.glade:118 +msgid "Device database backup list:" +msgstr "Liste des bases de données à sauvegarder:" + +#: src/ConfigDlg.glade:138 src/ConfigDlg.glade:166 +msgid "Configure..." +msgstr "Configuration..." + +#: src/DatabaseSelectDlg.glade:8 +msgid "Database Selection" +msgstr "Sélection des bases de données" + +#: src/DatabaseSelectDlg.glade:100 src/ConfigDlg.cc:77 +msgid "Select the device databases you wish to backup:" +msgstr "Sélectionnez les bases de données que vous souhaitez sauvegarder:" + +#: src/DatabaseSelectDlg.glade:150 +msgid "Select _All" +msgstr "Tout _Sélectionner" + +#: src/DatabaseSelectDlg.glade:162 +msgid "_Deselect All" +msgstr "Tout _Déselectionner" + +#: src/PromptDlg.glade:8 +msgid "Question" +msgstr "Question" + +#: src/PromptDlg.glade:101 +msgid "Nice detailed question for the user to answer..." +msgstr "" + +#: src/BackupWindow.glade:7 src/barry-gui.glade:8 src/barry-gui.glade:296 +#: src/barry-gui.glade:446 +msgid "Barry Backup" +msgstr "Barry Backup" + +#: src/BackupWindow.glade:18 src/barry-gui.glade:33 src/barry-gui.glade:321 +#: src/barry-gui.glade:471 +msgid "_File" +msgstr "_Fichier" + +#: src/BackupWindow.glade:36 src/barry-gui.glade:110 src/barry-gui.glade:365 +#: src/barry-gui.glade:515 +msgid "_Help" +msgstr "_Aide" + +#: src/BackupWindow.glade:72 +msgid "Device:" +msgstr "Périphérique:" + +#: src/BackupWindow.glade:111 src/barry-gui.glade:684 +msgid "Backup" +msgstr "Sauvegarder" + +#: src/BackupWindow.glade:124 src/Thread.cc:177 +msgid "Restore..." +msgstr "Restauration..." + +#: src/BackupWindow.glade:137 +msgid "Config..." +msgstr "Configuration..." + +#: src/BackupWindow.glade:150 +msgid "Disconnect" +msgstr "Déconnexion" + +#: src/BackupWindow.glade:163 +msgid "Rescan USB Bus" +msgstr "Scanner le bus USB" + +#: src/BackupWindow.glade:178 +msgid "Disconnect All" +msgstr "Tout Déconnecter" + +#: src/barry-gui.glade:55 +msgid "_Device" +msgstr "_Périphérique" + +#: src/barry-gui.glade:64 src/barry-gui.glade:147 +msgid "_Connect" +msgstr "_Connexion" + +#: src/barry-gui.glade:73 src/barry-gui.glade:162 +msgid "_Disconnect" +msgstr "_Déconnexion" + +#: src/barry-gui.glade:88 +msgid "_Backup..." +msgstr "_Sauvegarde..." + +#: src/barry-gui.glade:97 +msgid "_Restore..." +msgstr "_Restauration..." + +#: src/barry-gui.glade:119 src/barry-gui.glade:374 src/barry-gui.glade:524 +msgid "_About" +msgstr "_A propos" + +#: src/barry-gui.glade:190 src/barry-gui.glade:403 +msgid "_Backup" +msgstr "_Sauvegarde" + +#: src/barry-gui.glade:205 src/barry-gui.glade:415 +msgid "_Restore" +msgstr "_Restauration" + +#: src/barry-gui.glade:343 src/barry-gui.glade:493 +msgid "_Edit" +msgstr "_Edition" + +#: src/barry-gui.glade:352 src/barry-gui.glade:502 +msgid "_Config..." +msgstr "_Configuration..." + +#: src/barry-gui.glade:605 +msgid "Device PIN" +msgstr "Code PIN" + +#: src/barry-gui.glade:627 src/BackupWindow.cc:83 +msgid "Progress" +msgstr "Avancement" + +#: src/barry-gui.glade:649 +msgid "Database" +msgstr "Base de données" + +#: src/barry-gui.glade:701 +msgid "Restore" +msgstr "Restauration" + +#: src/barry-gui.glade:736 +msgid "Device Selection" +msgstr "Sélection du périphérique" + +#: src/barry-gui.glade:827 +msgid "" +"Multiple BlackBerry devices have been found. Please select the one to work " +"with:" +msgstr "Plusieurs BlackBerry ont été trouvés. Veuillez en sélectionner un:" + +#: src/PasswordDlg.cc:41 +msgid "Please enter device password: (" +msgstr "Veuillez saisir le mot de passe: (" + +#: src/PasswordDlg.cc:41 +msgid " tries remaining)" +msgstr " essais restants)" + +#: src/ConfigDlg.cc:86 +msgid "" +"Select the device databases you wish to recover. This selection acts like a " +"filter, in that only the databases you select here will be restored, even if " +"more exist in the backup data." +msgstr "" +"Filtre des bases de données à restaurer. Si la sauvegarde contient plusieurs " +"bases, seules celles sélectionnées seront restaurées." + +#: src/BackupWindow.cc:79 +msgid "PIN" +msgstr "PIN" + +#: src/BackupWindow.cc:80 src/DatabaseSelectDlg.cc:77 +msgid "Name" +msgstr "Nom" + +#: src/BackupWindow.cc:81 +msgid "Status" +msgstr "Statut" + +#: src/BackupWindow.cc:121 src/BackupWindow.cc:138 +msgid "Scanning for devices..." +msgstr "Recherche des périphériques en cours..." + +#: src/BackupWindow.cc:147 +msgid "No devices." +msgstr "Aucun périphérique." + +#: src/BackupWindow.cc:149 +msgid "1 device:" +msgstr "1 périphérique:" + +#: src/BackupWindow.cc:153 +msgid " devices:" +msgstr " périphériques:" + +#: src/BackupWindow.cc:169 +msgid "All devices loaded." +msgstr "Détection des périphériques terminée." + +#: src/BackupWindow.cc:183 +msgid "Connecting to Device..." +msgstr "Connexion au périphérique..." + +#: src/BackupWindow.cc:197 +msgid "Connection cancelled." +msgstr "Connexion annulée." + +#: src/BackupWindow.cc:205 src/BackupWindow.cc:220 src/BackupWindow.cc:227 +msgid "Cannot connect to " +msgstr "Impossible de se connecter à " + +#: src/BackupWindow.cc:232 +msgid "Connected to " +msgstr "Connecté à " + +#: src/BackupWindow.cc:239 +msgid "" +" is working, disconnecting from it may cause data corruption, are you sure " +"to proceed?" +msgstr "" +" est en cours d'utilisation, une déconnexion pourrait corrompre vos données, " +"êtes-vous sûr de vouloir continuer?" + +#: src/BackupWindow.cc:248 +msgid "Disconnected from " +msgstr "Déconnexion de " + +#: src/BackupWindow.cc:251 +msgid "Not connected." +msgstr "Non connecté." + +#: src/BackupWindow.cc:259 +msgid "Unnamed device found (PIN: " +msgstr "Périphérique inconnu trouvé (PIN: " + +#: src/BackupWindow.cc:259 +msgid "Please enter a name for it:" +msgstr "Veuillez saisir un nom:" + +#: src/BackupWindow.cc:267 src/BackupWindow.cc:543 +msgid "Error saving config: " +msgstr "Erreur lors de la sauvegarde de la configuration" + +#: src/BackupWindow.cc:309 +msgid "" +"One or more devices are working, disconnecting now may cause data " +"corruption. Proceed anyway?" +msgstr "" +"Un ou plusieurs périphériques sont en cours d'utilisation, une déconnexion " +"pourrait corrompre vos données.Continuer?" + +#: src/BackupWindow.cc:368 +msgid "Backup on" +msgstr "Sauvegarde du " + +#: src/BackupWindow.cc:370 +msgid "Restore on" +msgstr "Restauration du " + +#: src/BackupWindow.cc:372 +msgid "Operation on" +msgstr "Opération sur " + +#: src/BackupWindow.cc:374 +msgid " finished!" +msgstr " terminée!" + +#: src/BackupWindow.cc:386 +msgid "" +"Warning\n" +"\n" +"Not all records were processed on device: " +msgstr "" +"Attention\n" +"\n" +"Toutes les données n'ont pu être traitées sur: " + +#: src/BackupWindow.cc:387 +msgid "" +"\n" +"\n" +"Only " +msgstr "" +"\n" +"\n" +"Seulement " + +#: src/BackupWindow.cc:387 +msgid " of " +msgstr " parmi " + +#: src/BackupWindow.cc:388 +msgid "" +" records were backed up.\n" +"\n" +"It is suspected that due to international characters in these records, the " +"BlackBerry uses a different low-level protocol, which Barry Backup does not " +"yet support. Please contact the developers at http://netdirect.ca/barry if " +"you want to assist in debugging this issue." +msgstr "" +" données ont été traitées.\n" +"\n" +"Cela peut être du au fait que ces données contiennent des caractères " +"spéciaux, votre BlackBerry utilise différents protocoles, qui ne sont pas " +"encore tous supportés par Barry. Merci de contacter les développeurs à " +"l'adresse http://netdirect.ca/barry si vous souhaitez aider à fixer ce " +"problème." + +#: src/BackupWindow.cc:405 src/BackupWindow.cc:483 +msgid "Thread already in progress." +msgstr "Traitement déjà en cours." + +#: src/BackupWindow.cc:412 +msgid "Could not create directory: " +msgstr "Impossible de créer le dossier: " + +#: src/BackupWindow.cc:419 +msgid "No databases selected in configuration." +msgstr "Aucune base de données n'a été sélectionnée." + +#: src/BackupWindow.cc:428 +msgid "Please enter a label for this backup (blank is ok):" +msgstr "Veuillez saisir un nom pour cette sauvegarde (vide est accepté):" + +#: src/BackupWindow.cc:440 +msgid "Error starting backup thread: " +msgstr "Erreur lors du lancement de la sauvegarde: " + +#: src/BackupWindow.cc:445 +msgid "Backup of " +msgstr "Sauvegarde du " + +#: src/BackupWindow.cc:445 src/BackupWindow.cc:499 +msgid " in progress..." +msgstr " en cours..." + +#: src/BackupWindow.cc:459 +msgid "Select backup to restore from" +msgstr "Sélectionner la sauvegarde en restaurer" + +#: src/BackupWindow.cc:494 +msgid "Error starting restore thread: " +msgstr "Erreur lors du lancement de la restauration: " + +#: src/BackupWindow.cc:499 +msgid "Restore of " +msgstr "Restauration du " + +#: src/BackupWindow.cc:546 +msgid "Config saved successfully." +msgstr "Configuration enregistrée avec succès." + +#: src/BackupWindow.cc:584 +msgid "and Barry contributors. See AUTHORS file" +msgstr "et les contributeurs du projet Barry. Voir le fichier AUTHORS" + +#: src/BackupWindow.cc:585 +msgid "for detailed contribution information." +msgstr "pour davantage d'informations." + +#: src/BackupWindow.cc:593 +msgid "Using library: " +msgstr "Librairie utilisée: " + +#: src/DeviceIface.cc:83 src/DeviceIface.cc:146 +msgid "Terminated by user." +msgstr "Interrompu par l'utilisateur." + +#: src/DeviceIface.cc:121 +msgid "Error while restoring " +msgstr "Erreur pendant la restauration " + +#: src/DeviceIface.cc:124 +msgid " Will continue processing." +msgstr " Poursuite du traitement." + +#: src/DeviceIface.cc:130 +msgid "Error on database: " +msgstr " Erreur concernant la base de données: " + +#: src/DeviceIface.cc:312 src/DeviceIface.cc:337 +msgid "Thread already running." +msgstr "Traitement déjà en cours." + +#: src/DatabaseSelectDlg.cc:76 +msgid "Active" +msgstr "Actif" + +#: src/Thread.cc:56 src/Thread.cc:124 +msgid "Ready" +msgstr "Prêt" + +#: src/Thread.cc:100 src/Thread.cc:115 src/Thread.cc:200 +msgid "Connected" +msgstr "Connecté" + +#: src/Thread.cc:154 +msgid "Backup..." +msgstr "Sauvegarde..." + +#: src/Thread.cc:193 +msgid " error: " +msgstr " erreur: " + +#: src/Thread.cc:210 +msgid "Erasing database: " +msgstr "Suppression de la base de données: " + +#: src/Thread.cc:216 +msgid "Restored database: " +msgstr "Base de données restaurée: " + +#~ msgid "No unique ID available!" +#~ msgstr "Pas d'ID unique disponible!" + +#~ msgid "Skipping invalid tar record: " +#~ msgstr "Ignore les entrées invalides de l'archive: " + +#~ msgid "Skipping: " +#~ msgstr "Ignore: " diff -Nru barry-0.14/gui/po/insert-header.sin barry-0.0.20110506/gui/po/insert-header.sin --- barry-0.14/gui/po/insert-header.sin 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/insert-header.sin 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff -Nru barry-0.14/gui/po/LINGUAS barry-0.0.20110506/gui/po/LINGUAS --- barry-0.14/gui/po/LINGUAS 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/LINGUAS 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ +# Set of available languages. +fr diff -Nru barry-0.14/gui/po/Makevars barry-0.0.20110506/gui/po/Makevars --- barry-0.14/gui/po/Makevars 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/Makevars 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,44 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Net Direct, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +# +# See the "contact" page from the URL below: +MSGID_BUGS_ADDRESS = http://netdirect.ca/barry + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + diff -Nru barry-0.14/gui/po/POTFILES.in barry-0.0.20110506/gui/po/POTFILES.in --- barry-0.14/gui/po/POTFILES.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/POTFILES.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,19 @@ +# List of source files which contain translatable strings. +src/PasswordDlg.glade +src/ConfigDlg.glade +src/DatabaseSelectDlg.glade +src/PromptDlg.glade +src/BackupWindow.glade +src/barry-gui.glade + +src/PasswordDlg.cc +src/ConfigDlg.cc +src/main.cc +src/PromptDlg.cc +src/BackupWindow.cc +src/DeviceIface.cc +src/util.cc +src/DeviceBus.cc +src/DatabaseSelectDlg.cc +src/Thread.cc + diff -Nru barry-0.14/gui/po/quot.sed barry-0.0.20110506/gui/po/quot.sed --- barry-0.14/gui/po/quot.sed 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/quot.sed 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff -Nru barry-0.14/gui/po/README barry-0.0.20110506/gui/po/README --- barry-0.14/gui/po/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,26 @@ +HOWTO to add a new language or update translation +================================================= + +To add a new language +--------------------- + +Sample to add spanish language + + $ cd /po + $ msginit --locale=es --input=barry-backup.pot + $ echo "es" >> LINGUAS + $ make update-po + +Then, send to barry team your work. + +To update translation +--------------------- + +You have to only edit a ".po" file. + + $ cd /po + $ vi es.po + $ make update-po + +Then, send to barry team your work. + diff -Nru barry-0.14/gui/po/remove-potcdate.sin barry-0.0.20110506/gui/po/remove-potcdate.sin --- barry-0.14/gui/po/remove-potcdate.sin 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/remove-potcdate.sin 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff -Nru barry-0.14/gui/po/Rules-quot barry-0.0.20110506/gui/po/Rules-quot --- barry-0.14/gui/po/Rules-quot 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/po/Rules-quot 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,47 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff -Nru barry-0.14/gui/src/BackupWindow.cc barry-0.0.20110506/gui/src/BackupWindow.cc --- barry-0.14/gui/src/BackupWindow.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/BackupWindow.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,76 +20,105 @@ */ #include "BackupWindow.h" -#include "DeviceSelectDlg.h" #include "PasswordDlg.h" #include "PromptDlg.h" #include "ConfigDlg.h" #include "util.h" +#include "i18n.h" #include #include #include #include +#include #include BackupWindow::BackupWindow(BaseObjectType *cobject, const Glib::RefPtr &xml) : Gtk::Window(cobject) , m_xml(xml) - , m_recordTotal(0) - , m_finishedRecords(0) - , m_pProgressBar(0) - , m_pStatusBar(0) + , m_pStatusbar(0) , m_pBackupButton(0) , m_pRestoreButton(0) - , m_pDeviceNameLabel(0) + , m_pDisconnectButton(0) + , m_pReloadButton(0) + , m_pDeviceLabel(0) + , m_pDeviceList(0) + , m_device_count(0) + , m_pActive(0) , m_scanned(false) - , m_working(false) + , m_last_status_id(0) { + m_signal_update.connect( + sigc::mem_fun(*this, &BackupWindow::treeview_update)); + // setup menu signals Gtk::MenuItem *pItem = 0; m_xml->get_widget("menu_file_quit", pItem); pItem->signal_activate().connect( sigc::mem_fun(*this, &BackupWindow::on_file_quit)); - m_xml->get_widget("menu_edit_config", pItem); - pItem->signal_activate().connect( - sigc::mem_fun(*this, &BackupWindow::on_edit_config)); - m_xml->get_widget("menu_help_about", pItem); pItem->signal_activate().connect( sigc::mem_fun(*this, &BackupWindow::on_help_about)); // get various widget pointers we will use later + m_xml->get_widget("DeviceLabel", m_pDeviceLabel); + m_xml->get_widget("DeviceList", m_pDeviceList); m_xml->get_widget("BackupButton", m_pBackupButton); m_xml->get_widget("RestoreButton", m_pRestoreButton); - m_xml->get_widget("progressbar1", m_pProgressBar); - m_xml->get_widget("statusbar1", m_pStatusBar); - m_xml->get_widget("entry1", m_pPINEntry); - m_xml->get_widget("entry2", m_pDatabaseEntry); - m_xml->get_widget("DeviceNameLabel", m_pDeviceNameLabel); + m_xml->get_widget("ConfigButton", m_pConfigButton); + m_xml->get_widget("DisconnectButton", m_pDisconnectButton); + m_xml->get_widget("DisconnectAllButton", m_pDisconnectAllButton); + m_xml->get_widget("ReloadButton", m_pReloadButton); + m_xml->get_widget("Statusbar", m_pStatusbar); + + // set up device list + m_pListStore = Gtk::ListStore::create(m_columns); + m_pDeviceList->set_model(m_pListStore); + + m_pDeviceList->append_column(_("PIN"), m_columns.m_pin); + m_pDeviceList->append_column(_("Name"), m_columns.m_name); + m_pDeviceList->append_column(_("Status"), m_columns.m_status); + Gtk::CellRendererProgress* cell = new Gtk::CellRendererProgress; + m_pDeviceList->append_column(_("Progress"), *cell); + Gtk::TreeViewColumn* pColumn = m_pDeviceList->get_column(3); + pColumn->add_attribute(cell->property_value(), m_columns.m_percentage); + + m_pDeviceList->get_column(0)->set_min_width(60); + m_pDeviceList->get_column(1)->set_min_width(100); + m_pDeviceList->get_column(2)->set_min_width(75); + + for( unsigned int i = 0; i < 4; ++i ) + m_pDeviceList->get_column(i)->set_resizable(); + + // set up device list selection + m_pDeviceSelection = m_pDeviceList->get_selection(); // setup widget signals m_pBackupButton->signal_clicked().connect( sigc::mem_fun(*this, &BackupWindow::on_backup)); m_pRestoreButton->signal_clicked().connect( sigc::mem_fun(*this, &BackupWindow::on_restore)); - - // setup thread dispatcher signals - m_signal_progress.connect( - sigc::mem_fun(*this, &BackupWindow::on_thread_progress)); - m_signal_error.connect( - sigc::mem_fun(*this, &BackupWindow::on_thread_error)); - m_signal_done.connect( - sigc::mem_fun(*this, &BackupWindow::on_thread_done)); - m_signal_erase_db.connect( - sigc::mem_fun(*this, &BackupWindow::on_thread_erase_db)); + m_pConfigButton->signal_clicked().connect( + sigc::mem_fun(*this, &BackupWindow::on_config)); + m_pDisconnectButton->signal_clicked().connect( + sigc::mem_fun(*this, &BackupWindow::on_disconnect)); + m_pDisconnectAllButton->signal_clicked().connect( + sigc::mem_fun(*this, &BackupWindow::on_disconnect_all)); + m_pReloadButton->signal_clicked().connect( + sigc::mem_fun(*this, &BackupWindow::on_reload)); + m_pDeviceSelection->signal_changed().connect( + sigc::mem_fun(*this, &BackupWindow::on_device_change)); // setup startup device scan Glib::signal_timeout().connect( sigc::mem_fun(*this, &BackupWindow::on_startup), 500); - m_pStatusBar->push("Ready"); - m_pProgressBar->set_fraction(0.00); + // workaround: normally this should say "Ready" but since + // the initial Scan() happens right away, and the statusbar + // doesn't seem to update the screen until the handler is + // finished, we update the status bar here instead + StatusbarSet(_("Scanning for devices...")); // do this last so that any exceptions in the constructor // won't cause a connected signal handler to a non-object @@ -104,204 +133,198 @@ m_signal_handler_connection.disconnect(); } -void BackupWindow::ScanAndConnect() +void BackupWindow::Scan() { - m_pStatusBar->push("Scanning for devices..."); - m_pStatusBar->show_now(); + StatusbarSet(_("Scanning for devices...")); - int tries = 0; + m_pListStore->clear(); + m_threads.clear(); -sac_retry: - tries++; - Barry::Probe probe; - uint32_t pin = 0; - int nSelection = -1; + m_bus.Probe(); + m_device_count = m_bus.ProbeCount(); - if( probe.GetCount() > 1 ) { - DeviceSelectDlg dlg(probe); - if( dlg.run() == Gtk::RESPONSE_OK ) { - pin = dlg.GetPIN(); - nSelection = probe.FindActive(pin); - } - else { - // no selection, exit - hide(); - return; - } - } - else if( probe.GetCount() == 1 ) { - // default to first - pin = probe.Get(0).m_pin; - nSelection = 0; - } - else { - Gtk::MessageDialog msg("No BlackBerry devices found."); - msg.run(); - hide(); - return; + if( m_device_count == 0 ) + m_pDeviceLabel->set_label(_("No devices.")); + else if( m_device_count == 1 ) + m_pDeviceLabel->set_label(_("1 device:")); + else + { + std::ostringstream oss; + oss << m_device_count << _(" devices:"); + m_pDeviceLabel->set_label(oss.str()); } - if( nSelection == -1 ) { - Gtk::MessageDialog msg("Internal error: unable to find pin."); - msg.run(); - hide(); - return; - } + m_threads.resize(m_device_count); + for( unsigned int id = 0; id < m_device_count; ++id ) { + Device dev = m_bus.Get(id); + Gtk::TreeModel::iterator row = m_pListStore->append(); + (*row)[m_columns.m_id] = id; - bool out_of_tries = false, password_required = false; - int remaining_tries = 0; - try { - if( !m_dev.Connect(probe.Get(nSelection)) ) { - Gtk::MessageDialog msg(m_dev.get_last_error()); - msg.run(); - hide(); - return; - } - } - catch( Barry::BadPassword &bp ) { - out_of_tries = bp.out_of_tries(); - remaining_tries = bp.remaining_tries(); - password_required = true; - } - catch( Barry::BadSize &bs ) { - std::cerr << "Barry::BadSize caught in ScanAndConnect: " - << bs.what() << std::endl; - if( tries < 2 ) { - // BadSize during connect at startup usually means - // the device didn't shutdown properly, so try - // a reset or two before we give up - Usb::Device dev(probe.Get(nSelection).m_dev); - dev.Reset(); - sleep(2); - goto sac_retry; - } - else { - Gtk::MessageDialog msg(bs.what()); - msg.run(); - hide(); - return; - } + m_threads[id].reset(new Thread(dev, &m_signal_update)); } - if( password_required ) { - // try password repeatedly until out of tries or - // the user cancels... or success :-) - - bool connected = false; - while( !connected && !out_of_tries ) try { - PasswordDlg dlg(remaining_tries); - if( dlg.run() == Gtk::RESPONSE_OK ) { - connected = m_dev.Password(dlg.GetPassword()); - if( !connected ) { - Gtk::MessageDialog msg(m_dev.get_last_error()); - msg.run(); - hide(); - return; + // all devices loaded + m_scanned = true; + + StatusbarSet(_("All devices loaded.")); + + // if one or more device plugged in, + // activate the first one + Gtk::TreeModel::iterator iter = m_pListStore->children().begin(); + if( iter ) + m_pDeviceSelection->select(iter); +} + +bool BackupWindow::Connect(Thread *thread) +{ + if( thread->Connected() ) + return true; + + StatusbarSet(_("Connecting to Device...")); + static int tries(0); + + CheckDeviceName(thread); + + if( !thread->Connect() ) { + if( thread->PasswordRequired() ) { + bool connected = false; + while( !connected && !thread->PasswordOutOfTries() ) { + PasswordDlg dlg(thread->PasswordRemainingTries()); + if( dlg.run() == Gtk::RESPONSE_OK ) { + connected = thread->Connect(dlg.GetPassword()); + if( !connected ) { + // low level error + Gtk::MessageDialog msg(thread->LastInterfaceError()); + msg.run(); + StatusbarSet(_("Cannot connect to ") + thread->GetFullname() + "."); + return false; + } + } + else { // user cancelled + thread->Reset(); + StatusbarSet(_("Connection cancelled.")); + return false; } } - else { - // user cancelled - hide(); - return; + if( thread->PasswordOutOfTries() ) + { + Gtk::MessageDialog msg(thread->BadPasswordError()); + msg.run(); + StatusbarSet(_("Cannot connect to ") + thread->GetFullname() + "."); + return false; } } - catch( Barry::BadPassword &bp ) { - out_of_tries = bp.out_of_tries(); - remaining_tries = bp.remaining_tries(); - if( out_of_tries ) { - Gtk::MessageDialog msg(bp.what()); + else if( thread->BadSize() ) { + ++tries; + if( tries < 3 ) { + std::cerr << thread->BadSizeError() << std::endl; + thread->Reset(); + sleep(2); + return Connect(thread); + } + else { + Gtk::MessageDialog msg(thread->BadSizeError()); msg.run(); - hide(); - return; + StatusbarSet(_("Cannot connect to ") + thread->GetFullname() + "."); + return false; } } - - if( !connected ) { - hide(); - return; + else { + Gtk::MessageDialog msg(thread->LastInterfaceError()); + msg.run(); + StatusbarSet(_("Cannot connect to ") + thread->GetFullname() + "."); + return false; } } + tries = 0; + StatusbarSet(_("Connected to ") + thread->GetFullname() + "."); + return true; +} - std::ostringstream oss; - oss << std::hex << pin; - m_pPINEntry->set_text(oss.str()); - - // open configuration now that we know which device we're talking to - m_pConfig.reset( new ConfigFile(oss.str(), m_dev.GetDBDB()) ); - CheckDeviceName(); - SetDeviceName(m_pConfig->GetDeviceName()); +void BackupWindow::Disconnect(Thread *thread) +{ + if( thread->Working() ) { + Gtk::MessageDialog dialog(*this, thread->GetFullname() + _(" is working, " + "disconnecting from it may cause data corruption, are you sure to proceed?"), + false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_OK_CANCEL); + if( dialog.run() == Gtk::RESPONSE_CANCEL ) + return; + } - m_pStatusBar->pop(); + if( thread->Connected() ) { + thread->Disconnect(); + StatusbarSet(_("Disconnected from ") + thread->GetFullname() + "."); + } + else { + StatusbarSet(_("Not connected.")); + } } -void BackupWindow::CheckDeviceName() +void BackupWindow::CheckDeviceName(Thread *thread) { - if( !m_pConfig->HasDeviceName() ) { + if( !thread->HasDeviceName() ) { PromptDlg dlg; - dlg.SetPrompt("Unnamed device found. Please enter a name for it:"); + dlg.SetPrompt(_("Unnamed device found (PIN: ") + thread->GetPIN().Str() + ").\r\n " + _("Please enter a name for it:")); if( dlg.run() == Gtk::RESPONSE_OK ) { - m_pConfig->SetDeviceName(dlg.GetAnswer()); + thread->SetDeviceName(dlg.GetAnswer()); } else { - m_pConfig->SetDeviceName(" "); + thread->SetDeviceName(" "); } - if( !m_pConfig->Save() ) { - Gtk::MessageDialog msg("Error saving config: " + - m_pConfig->get_last_error()); + if( !thread->Save() ) { + Gtk::MessageDialog msg(_("Error saving config: ") + + thread->LastConfigError()); msg.run(); } } } -void BackupWindow::SetDeviceName(const std::string &name) +Thread *BackupWindow::GetActive() { - // format the device name prompt - std::ostringstream dn; - dn << "Device: " << m_pConfig->GetDeviceName() << ""; - m_pDeviceNameLabel->set_label(dn.str()); - + Gtk::TreeModel::iterator row = m_pDeviceSelection->get_selected(); + if( row ) { + unsigned int id = (*row)[m_columns.m_id]; + return m_threads[id].get(); + } + else { + return 0; + } } -void BackupWindow::SetWorkingMode(const std::string &taskname) +void BackupWindow::StatusbarSet(const Glib::ustring& text) { - m_working = true; - m_thread_error = false; - m_pBackupButton->set_sensitive(false); - m_pRestoreButton->set_sensitive(false); - m_pStatusBar->push(taskname + " in progress..."); - m_pProgressBar->set_fraction(0.00); + guint remove_id = m_last_status_id; + if( m_pStatusbar ) { + m_last_status_id = m_pStatusbar->push(text); + if( remove_id ) + m_pStatusbar->remove_message(remove_id); + } } -void BackupWindow::ClearWorkingMode() +/// Returns true if ok to proceed (either nothing is currently 'working', +/// or the user confirmed to do it anyway) +bool BackupWindow::CheckWorking() { - m_working = false; - m_pBackupButton->set_sensitive(true); - m_pRestoreButton->set_sensitive(true); - m_pStatusBar->pop(); - if( m_finishedRecords >= m_recordTotal ) { - // only reset the progress bar on success - m_pProgressBar->set_fraction(0.00); + bool working(false); + for( unsigned int i = 0; i < m_device_count; ++i) { + if( m_threads[i]->Working() ) { + working = true; + break; + } } - std::ostringstream oss; - oss << m_finishedRecords << " total records processed."; - m_pDatabaseEntry->set_text(oss.str()); -} - -void BackupWindow::UpdateProgress() -{ - double done = (double)m_finishedRecords / m_recordTotal; - // never say 100% unless really done - if( done >= 1.0 && m_finishedRecords < m_recordTotal ) { - done = 0.99; + if( working ) { + Gtk::MessageDialog dialog(*this, _("One or more devices are working, " + "disconnecting now may cause data corruption. " + "Proceed anyway?"), + false, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_OK_CANCEL); + if( dialog.run() != Gtk::RESPONSE_OK ) + return false; } - m_pProgressBar->set_fraction(done); - m_pDatabaseEntry->set_text(m_dev.GetThreadDBName()); + return true; } - - void BackupWindow::signal_exception_handler() { try { @@ -327,46 +350,90 @@ ////////////////////////////////////////////////////////////////////////////// // signal handlers +void BackupWindow::treeview_update() +{ + for( Gtk::TreeModel::iterator i = m_pListStore->children().begin(); + i != m_pListStore->children().end(); ++i ) { + unsigned int id = (*i)[m_columns.m_id]; + Thread *thread = m_threads[id].get(); + (*i)[m_columns.m_pin] = thread->GetPIN().Str(); + (*i)[m_columns.m_name] = thread->GetDeviceName(); + (*i)[m_columns.m_status] = thread->Status(); + unsigned int finished(thread->GetRecordFinished()), total(thread->GetRecordTotal()); + unsigned int percentage(0); + if( total == 0 || finished == total ) + percentage = 100; + else { + percentage = 100 * finished / total; + if( percentage == 100 ) // never say 100% unless finished + percentage = 99; + } + (*i)[m_columns.m_percentage] = percentage; + if( thread->CheckFinishedMarker() ) { + std::string op; + + if( thread->GetThreadState() & THREAD_STATE_BACKUP ) + op = _("Backup on"); + else if( thread->GetThreadState() & THREAD_STATE_RESTORE ) + op = _("Restore on"); + else + op = _("Operation on"); + + StatusbarSet(op + thread->GetFullname() + _(" finished!")); + if( (thread->GetThreadState() & THREAD_STATE_BACKUP) && + finished != total ) + { + // in some cases, not all records are backed + // up, possibly due to international chars + // in the Blackberry data which somehow + // forces the device to use a different + // low level protocol... here we need to + // warn the user that not all data was + // included in the backup + std::ostringstream oss; + oss << _("Warning\n\nNot all records were processed on device: ") << thread->GetFullname() + << _("\n\nOnly ") << finished << _(" of ") << total + << _(" records were backed up.\n\nIt is suspected that due to international characters in these records, the BlackBerry uses a different low-level protocol, which Barry Backup does not yet support. Alternatively, there may be hidden records that cannot be edited in your device. If this occurs in a database such as Address Book, sometimes a restore of just that database may fix the issue."); + Gtk::MessageDialog msg(oss.str()); + msg.run(); + } + } + } +} + void BackupWindow::on_backup() { - // already working? - if( m_working ) { - Gtk::MessageDialog msg("Thread already in progress."); - msg.run(); + Thread *thread = GetActive(); + + if( !thread || !Connect(thread) ) return; - } - // make sure our target directory exists - if( !::CheckPath(m_pConfig->GetPath()) ) { - Gtk::MessageDialog msg("Could not create directory: " + m_pConfig->GetPath()); + // already working? + if( thread->Working() ) { + Gtk::MessageDialog msg(_("Thread already in progress.")); msg.run(); return; } - // anything to do? - if( m_pConfig->GetBackupList().size() == 0 ) { - Gtk::MessageDialog msg("No databases selected in configuration."); + // make sure our target directory exists + if( !Barry::ConfigFile::CheckPath(thread->GetPath()) ) { + Gtk::MessageDialog msg(_("Could not create directory: ") + thread->GetPath()); msg.run(); return; } - // prepare for the progress bar - m_recordTotal = m_dev.GetDeviceRecordTotal(m_pConfig->GetBackupList()); - m_finishedRecords = 0; - m_modeName = "Backup"; - // anything to do? - if( m_recordTotal == 0 ) { - Gtk::MessageDialog msg("There are no records available in the selected databases."); + if( thread->GetBackupList().size() == 0 ) { + Gtk::MessageDialog msg(_("No databases selected in configuration.")); msg.run(); return; } // prompt for a backup label, if so configured std::string backupLabel; - if( m_pConfig->PromptBackupLabel() ) { + if( thread->PromptBackupLabel() ) { PromptDlg dlg; - dlg.SetPrompt("Please enter a label for this backup (blank is ok):"); + dlg.SetPrompt(_("Please enter a label for this backup (blank is ok):")); if( dlg.run() == Gtk::RESPONSE_OK ) { backupLabel = dlg.GetAnswer(); } @@ -377,21 +444,14 @@ } // start the thread - m_working = m_dev.StartBackup( - DeviceInterface::AppComm(&m_signal_progress, - &m_signal_error, - &m_signal_done, - &m_signal_erase_db), - m_pConfig->GetBackupList(), m_pConfig->GetPath(), - m_pConfig->GetPIN(), backupLabel); - if( !m_working ) { - Gtk::MessageDialog msg("Error starting backup thread: " + - m_dev.get_last_error()); + if( !thread->Backup(backupLabel) ) { + Gtk::MessageDialog msg(_("Error starting backup thread: ") + + thread->LastInterfaceError()); msg.run(); } - - // update the GUI - SetWorkingMode("Backup"); + else { + StatusbarSet(_("Backup of ") + thread->GetFullname() + _(" in progress...")); + } } bool BackupWindow::PromptForRestoreTarball(std::string &restoreFilename, @@ -402,15 +462,15 @@ // start at the base path given... if it fails, just open // the dialog where we are - chdir(start_path.c_str()); + (void)chdir(start_path.c_str()); - Gtk::FileChooserDialog dlg(*this, "Select backup to restore from"); + Gtk::FileChooserDialog dlg(*this, _("Select backup to restore from")); dlg.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); dlg.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); int result = dlg.run(); if( buf ) - chdir(buf); + (void)chdir(buf); if( result != Gtk::RESPONSE_OK ) return false; @@ -421,75 +481,99 @@ void BackupWindow::on_restore() { + Thread *thread = GetActive(); + + if( !thread || !Connect(thread) ) + return; + // already working? - if( m_working ) { - Gtk::MessageDialog msg("Thread already in progress."); + if( thread->Working() ) { + Gtk::MessageDialog msg(_("Thread already in progress.")); msg.run(); return; } std::string restoreFilename; - if( !PromptForRestoreTarball(restoreFilename, m_pConfig->GetPath()) ) + if( !PromptForRestoreTarball(restoreFilename, thread->GetPath()) ) return; // nothing to do - // prepare for the progress bar - m_finishedRecords = 0; - m_modeName = "Restore"; - // start the thread - m_working = m_dev.StartRestore( - DeviceInterface::AppComm(&m_signal_progress, - &m_signal_error, - &m_signal_done, - &m_signal_erase_db), - m_pConfig->GetRestoreList(), restoreFilename, &m_recordTotal); -// m_working = m_dev.StartRestoreAndBackup( -// DeviceInterface::AppComm(&m_signal_progress, -// &m_signal_error, -// &m_signal_done, -// &m_signal_erase_db), -// m_pConfig->GetRestoreList(), restoreFilename, -// m_pConfig->GetPath(), m_pConfig->GetPIN(), -// &m_recordTotal); - if( !m_working ) { - Gtk::MessageDialog msg("Error starting restore thread: " + - m_dev.get_last_error()); + if( !thread->Restore(restoreFilename) ) { + Gtk::MessageDialog msg(_("Error starting restore thread: ") + + thread->LastInterfaceError()); msg.run(); } + else { + StatusbarSet(_("Restore of ") + thread->GetFullname() + _(" in progress...")); + } +} -std::cerr << "m_recordTotal for restore: " << m_recordTotal << std::endl; +void BackupWindow::on_disconnect() +{ + Thread *thread = GetActive(); + if( thread ) + Disconnect(thread); +} - // update the GUI - SetWorkingMode("Restore"); +void BackupWindow::on_disconnect_all() +{ + for( unsigned int i = 0; i < m_device_count; ++i ) + Disconnect(m_threads[i].get()); } -void BackupWindow::on_file_quit() +void BackupWindow::on_device_change() { - m_dev.Disconnect(); - hide(); + Thread *thread = GetActive(); + if( m_pActive ) + m_pActive->UnsetActive(); + m_pActive = thread; + if( thread && Connect(thread) ) + thread->SetActive(); } -void BackupWindow::on_edit_config() +void BackupWindow::on_config() { - ConfigDlg dlg(m_dev.GetDBDB(), *m_pConfig); + Thread *thread = GetActive(); + + if( !thread || !Connect(thread) ) + return; + + thread->LoadConfig(); + + ConfigDlg dlg(thread->GetDBDB(), *thread); if( dlg.run() == Gtk::RESPONSE_OK ) { - m_pConfig->SetBackupList(dlg.GetBackupList()); - m_pConfig->SetRestoreList(dlg.GetRestoreList()); - m_pConfig->SetDeviceName(dlg.GetDeviceName()); - m_pConfig->SetPromptBackupLabel(dlg.GetPromptBackupLabel()); - if( !m_pConfig->Save() ) { - Gtk::MessageDialog msg("Error saving config: " + - m_pConfig->get_last_error()); - msg.run(); - } - SetDeviceName(m_pConfig->GetDeviceName()); + thread->SetBackupList(dlg.GetBackupList()); + thread->SetRestoreList(dlg.GetRestoreList()); + thread->SetDeviceName(dlg.GetDeviceName()); + thread->SetBackupPath(dlg.GetBackupPath()); + thread->SetPromptBackupLabel(dlg.GetPromptBackupLabel()); + if( !thread->Save() ) + StatusbarSet(_("Error saving config: ") + + thread->LastConfigError()); + else + StatusbarSet(_("Config saved successfully.")); + } + thread->LoadConfig(); +} + +void BackupWindow::on_reload() +{ + if( CheckWorking() ) { + Scan(); + } +} + +void BackupWindow::on_file_quit() +{ + if( CheckWorking() ) { + hide(); } } void BackupWindow::on_help_about() { Gtk::AboutDialog dlg; - dlg.set_copyright("Copyright (C) 2007-2008, Net Direct Inc."); + dlg.set_copyright("Copyright (C) 2007-2011, Net Direct Inc."); dlg.set_license( " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" @@ -505,76 +589,31 @@ std::vector authors; authors.push_back("Chris Frey "); + authors.push_back(_("and Barry contributors. See AUTHORS file")); + authors.push_back(_("for detailed contribution information.")); dlg.set_authors(authors); - int major, minor; - const char *BarryVersion = Barry::Version(major, minor); + int logical, major, minor; + const char *BarryVersion = Barry::Version(logical, major, minor); dlg.set_name("Barry Backup"); - dlg.set_version("0.14"); - dlg.set_comments(std::string("Using library: ") + BarryVersion); - dlg.set_website("http://www.netdirect.ca/software/packages/barry/"); + dlg.set_version("0.18.0"); + dlg.set_comments(std::string(_("Using library: ")) + BarryVersion); + dlg.set_website("http://netdirect.ca/barry"); dlg.run(); } bool BackupWindow::on_startup() { - if( !m_scanned ) { - ScanAndConnect(); - m_scanned = true; - } + Scan(); return false; } -void BackupWindow::on_thread_progress() +bool BackupWindow::on_delete_event(GdkEventAny *) { - m_finishedRecords++; - UpdateProgress(); + if( CheckWorking() ) + return false; // allow closing of window via window manager + else + return true; // stop the close } -void BackupWindow::on_thread_error() -{ - m_thread_error = true; - - Gtk::MessageDialog msg(m_modeName + " error: " + m_dev.get_last_thread_error()); - msg.run(); -} - -void BackupWindow::on_thread_done() -{ - if( !m_thread_error ) { - Gtk::MessageDialog msg(m_modeName + " complete!"); - msg.run(); - } - - // done! - ClearWorkingMode(); - m_working = false; -} - -void BackupWindow::on_thread_erase_db() -{ - std::string name = m_dev.GetThreadDBName(); - m_pDatabaseEntry->set_text("Erasing database: " + name); -} - - - -/* -void on_showtext() -{ - Glib::ustring text = pEntry->get_text(); - Gtk::MessageDialog dialog("This is the text entered: " + text); -// dialog.set_secondary_text(text); - dialog.run(); -} - -void on_close() -{ -// response(Gtk::RESPONSE_CLOSE); -// signal_delete_event().emit(); -// Gtk::Main::quit(); - hide(); -} -*/ - diff -Nru barry-0.14/gui/src/BackupWindow.glade barry-0.0.20110506/gui/src/BackupWindow.glade --- barry-0.14/gui/src/BackupWindow.glade 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/BackupWindow.glade 2011-05-06 12:20:16.000000000 +0000 @@ -1,338 +1,230 @@ - - - + - - - True - Barry Backup - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 275 - 230 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - - True - _File - True - - - - - - - True - gtk-quit - True - - - - - - - - - - True - _Edit - True - - - - - - - True - _Config... - True - - - - - - - - - - True - _Help - True - - - - - - - True - _About - True - - - - - - - - - 0 - False - False - - - - - - True - - - - 88 - 20 - True - True - False - True - 0 - - True - * - False - - - 16 - 32 - - - - - - 239 - 20 - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - PANGO_ELLIPSIZE_NONE - - - 16 - 112 - - - - - - 239 - 20 - True - True - False - True - 0 - - True - * - False - - - 16 - 152 - - - - - - 60 - 27 - True - True - Restore... - True - GTK_RELIEF_NORMAL - True - - - 200 - 24 - - - - - - 256 - 16 - True - - - 8 - 80 - - - - - - 56 - 16 - True - Progress - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 8 - 96 - - - - - - 64 - 16 - True - Database - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 8 - 136 - - - - - - 72 - 16 - True - Device PIN - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 8 - 16 - - - - - - 60 - 27 - True - True - Backup - True - GTK_RELIEF_NORMAL - True - - - 128 - 24 - - - - - - 256 - 16 - True - - False - True - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 8 - 64 - - - - - 0 - True - True - - - - - - True - True - - - 0 - False - False - - - - - - + + + + True + Barry Backup + + + True + vertical + + + True + + + True + _File + True + + + + + gtk-quit + True + True + + + + + + + + + True + _Help + True + + + + + gtk-about + True + True + + + + + + + + + False + False + 0 + + + + + True + vertical + + + True + vertical + + + True + 0 + 5 + 5 + Device: + + + False + False + 3 + 0 + + + + + True + + + True + True + automatic + automatic + + + 350 + 200 + True + True + + + + + 3 + 0 + + + + + True + vertical + start + + + Backup + True + True + True + + + False + False + 0 + + + + + Restore... + True + True + True + + + False + False + 1 + + + + + Config... + True + True + True + + + False + False + 2 + + + + + Disconnect + True + True + True + + + False + False + 3 + + + + + Rescan USB Bus + True + True + True + + + False + False + end + 5 + True + + + + + Disconnect All + True + True + True + + + False + False + end + 4 + True + + + + + False + False + 3 + 1 + + + + + 1 + + + + + 0 + + + + + True + 2 + + + False + False + 3 + end + 1 + + + + + 1 + + + + + diff -Nru barry-0.14/gui/src/BackupWindow.h barry-0.0.20110506/gui/src/BackupWindow.h --- barry-0.14/gui/src/BackupWindow.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/BackupWindow.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,51 +22,80 @@ #include #include #include -#include "DeviceIface.h" -#include "ConfigFile.h" +#include +#include "DeviceBus.h" +#include "Thread.h" class BackupWindow : public Gtk::Window { // external data const Glib::RefPtr &m_xml; - // Interface to Blackberry - DeviceInterface m_dev; + // dispatcher for updating thread info + Glib::Dispatcher m_signal_update; + + // Bus of Blackberry devices + DeviceBus m_bus; + + // vector for storing Threads + std::vector > m_threads; // signal exception handling connection sigc::connection m_signal_handler_connection; - // data - std::auto_ptr m_pConfig; - Glib::Dispatcher m_signal_progress; - Glib::Dispatcher m_signal_error; - Glib::Dispatcher m_signal_done; - Glib::Dispatcher m_signal_erase_db; - int m_recordTotal; - int m_finishedRecords; - std::string m_modeName; - // Widget objects - Gtk::ProgressBar *m_pProgressBar; - Gtk::Statusbar *m_pStatusBar; - Gtk::Entry *m_pPINEntry, *m_pDatabaseEntry; - Gtk::Button *m_pBackupButton, *m_pRestoreButton; - Gtk::Label *m_pDeviceNameLabel; + Gtk::Statusbar *m_pStatusbar; + Gtk::Button *m_pBackupButton, *m_pRestoreButton, + *m_pConfigButton, *m_pDisconnectButton, + *m_pDisconnectAllButton, *m_pReloadButton; + Gtk::Label *m_pDeviceLabel; + Gtk::TreeView *m_pDeviceList; + + // objects used by DeviceList + class Columns : public Gtk::TreeModel::ColumnRecord + { + public: + Gtk::TreeModelColumn m_id; + Gtk::TreeModelColumn m_pin; + Gtk::TreeModelColumn m_name; + Gtk::TreeModelColumn m_status; + Gtk::TreeModelColumn m_percentage; + + Columns() + { + add(m_id); + add(m_pin); + add(m_name); + add(m_status); + add(m_percentage); + } + }; + Columns m_columns; + Glib::RefPtr m_pListStore; + Glib::RefPtr m_pDeviceSelection; + + // number of devices + unsigned int m_device_count; - // state + // pointer to active Thread; + Thread *m_pActive; + + // whether scanned bool m_scanned; - bool m_working; // true if backup or restore in progress - bool m_thread_error; + + // statusbar message ID's + guint m_last_status_id; protected: - void ScanAndConnect(); - void CheckDeviceName(); - void SetDeviceName(const std::string &name); - void SetWorkingMode(const std::string &taskname); - void ClearWorkingMode(); - void UpdateProgress(); + void Scan(); + bool Connect(Thread *); + void Disconnect(Thread *); + void CheckDeviceName(Thread *); bool PromptForRestoreTarball(std::string &restoreFilename, const std::string &start_path); + Thread *GetActive(); + void StatusbarSet(const Glib::ustring& text); + bool CheckWorking(); // returns true if ok to proceed public: BackupWindow(BaseObjectType *cobject, const Glib::RefPtr &xml); @@ -75,16 +104,22 @@ // handler for exceptions that happen in signal calls void signal_exception_handler(); + // handler for treeview update requests + void treeview_update(); + // signal handlers void on_backup(); void on_restore(); + void on_config(); + void on_disconnect(); + void on_disconnect_all(); + void on_reload(); + void on_device_change(); void on_file_quit(); - void on_edit_config(); void on_help_about(); bool on_startup(); - void on_thread_progress(); - void on_thread_error(); - void on_thread_done(); - void on_thread_erase_db(); + + // virtual overrides + virtual bool on_delete_event(GdkEventAny *event); }; diff -Nru barry-0.14/gui/src/ConfigDlg.cc barry-0.0.20110506/gui/src/ConfigDlg.cc --- barry-0.14/gui/src/ConfigDlg.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/ConfigDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,13 +22,15 @@ #include "ConfigDlg.h" #include "DatabaseSelectDlg.h" #include "util.h" +#include "i18n.h" #include ConfigDlg::ConfigDlg(const Barry::DatabaseDatabase &dbdb, - const ConfigFile &config) + const Barry::ConfigFile &config) : m_dbdb(dbdb) , m_backupList(config.GetBackupList()) , m_restoreList(config.GetRestoreList()) + , m_backupPath(config.GetPath()) { Glib::RefPtr xml = LoadXml("ConfigDlg.glade"); @@ -39,6 +41,9 @@ xml->get_widget("DeviceName", m_pDeviceNameEntry); m_pDeviceNameEntry->set_text(config.GetDeviceName()); + xml->get_widget("BackupPath", m_pBackupPath); + m_pBackupPath->set_filename(config.GetPath()); + xml->get_widget("PromptBackupLabel", m_pPromptBackupLabelCheck); m_pPromptBackupLabelCheck->set_active(config.PromptBackupLabel()); @@ -61,6 +66,7 @@ { int r_val = m_pDialog->run(); m_deviceName = m_pDeviceNameEntry->get_text(); + m_backupPath = m_pBackupPath->get_filename(); m_promptBackupLabel = m_pPromptBackupLabelCheck->get_active(); return r_val; } @@ -68,7 +74,7 @@ void ConfigDlg::on_configure_backup() { DatabaseSelectDlg dlg(m_dbdb, m_backupList, - "Select the device databases you wish to backup:"); + _("Select the device databases you wish to backup:")); if( dlg.run() == Gtk::RESPONSE_OK ) { m_backupList = dlg.GetSelections(); } @@ -77,10 +83,10 @@ void ConfigDlg::on_configure_restore() { DatabaseSelectDlg dlg(m_dbdb, m_restoreList, - "Select the device databases you wish to recover. " + _("Select the device databases you wish to recover. " "This selection acts like a filter, in that only the databases " "you select here will be restored, even if more exist in the " - "backup data."); + "backup data.")); if( dlg.run() == Gtk::RESPONSE_OK ) { m_restoreList = dlg.GetSelections(); } diff -Nru barry-0.14/gui/src/ConfigDlg.glade barry-0.0.20110506/gui/src/ConfigDlg.glade --- barry-0.14/gui/src/ConfigDlg.glade 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/ConfigDlg.glade 2011-05-06 12:20:16.000000000 +0000 @@ -1,293 +1,232 @@ - - - + + + - - - True - Configuration of Current PIN - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - 4 - 3 - False - 0 - 0 - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure... - True - GTK_RELIEF_NORMAL - True - - - - - 2 - 3 - 1 - 2 - 5 - 5 - - - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 0 - - - - True - True - True - Configure... - True - GTK_RELIEF_NORMAL - True - - - - - 2 - 3 - 2 - 3 - 5 - 5 - fill - - - - - - True - Device database backup list: - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Database restore filter. Only databases selected in this list will be restored, even if more exist in the backup. - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - True - True - Prompt for label on every backup. - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 3 - 3 - 4 - 8 - fill - - - - - - - True - Device name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 2 - 3 - 0 - 1 - - - - - - - True - gtk-execute - 6 - 0.5 - 0.5 - 0 - 0 - - - 0 - 1 - 0 - 4 - 5 - 5 - fill - - - - - 0 - True - True - - - - - - + + True + Configuration of Current PIN + GDK_WINDOW_TYPE_HINT_DIALOG + + + True + + + True + 5 + 3 + + + True + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + + + 2 + 3 + 1 + 2 + + + + + True + 0 + Backup path: + + + 1 + 2 + 1 + 2 + + + + + True + gtk-execute + 6 + + + 5 + GTK_FILL + 5 + 5 + + + + + True + True + + + 2 + 3 + + + + + + True + 0 + Device name: + + + 1 + 2 + GTK_FILL + + + + + + True + True + Prompt for label on every backup. + True + 0 + True + + + 1 + 3 + 4 + 5 + GTK_FILL + + 8 + + + + + True + 0 + Database restore filter. Only databases selected in this list will be restored, even if more exist in the backup. + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + + True + 0 + Device database backup list: + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + + True + + + True + True + True + Configure... + True + 0 + + + False + False + + + + + 2 + 3 + 3 + 4 + GTK_FILL + 5 + 5 + + + + + True + + + True + True + True + Configure... + True + 0 + + + False + False + + + + + 2 + 3 + 2 + 3 + 5 + 5 + + + + + 2 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-ok + True + -5 + + + False + False + + + + + True + True + True + gtk-cancel + True + -6 + + + False + False + 1 + + + + + False + GTK_PACK_END + + + + + diff -Nru barry-0.14/gui/src/ConfigDlg.h barry-0.0.20110506/gui/src/ConfigDlg.h --- barry-0.14/gui/src/ConfigDlg.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/ConfigDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,7 +24,7 @@ #include #include -#include "ConfigFile.h" +#include namespace Barry { class DatabaseDatabase; @@ -39,21 +39,24 @@ std::auto_ptr m_pDialog; Gtk::Entry *m_pDeviceNameEntry; Gtk::CheckButton *m_pPromptBackupLabelCheck; + Gtk::FileChooserButton *m_pBackupPath; // config data - ConfigFile::DBListType m_backupList; - ConfigFile::DBListType m_restoreList; + Barry::ConfigFile::DBListType m_backupList; + Barry::ConfigFile::DBListType m_restoreList; std::string m_deviceName; + std::string m_backupPath; bool m_promptBackupLabel; public: ConfigDlg(const Barry::DatabaseDatabase &dbdb, - const ConfigFile &config); + const Barry::ConfigFile &config); ~ConfigDlg(); - const ConfigFile::DBListType& GetBackupList() const { return m_backupList; } - const ConfigFile::DBListType& GetRestoreList() const { return m_restoreList; } + const Barry::ConfigFile::DBListType& GetBackupList() const { return m_backupList; } + const Barry::ConfigFile::DBListType& GetRestoreList() const { return m_restoreList; } const std::string& GetDeviceName() const { return m_deviceName; } + const std::string& GetBackupPath() const { return m_backupPath; } bool GetPromptBackupLabel() const { return m_promptBackupLabel; } int run(); diff -Nru barry-0.14/gui/src/ConfigFile.cc barry-0.0.20110506/gui/src/ConfigFile.cc --- barry-0.14/gui/src/ConfigFile.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/ConfigFile.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,261 +0,0 @@ -/// -/// \file ConfigFile.cc -/// BarryBackup GUI configuraion class -/// - -/* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "ConfigFile.h" -#include "util.h" -#include -#include -#include -#include -#include -#include - -bool ConfigFile::DBListType::IsSelected(const std::string &dbname) const -{ - const_iterator i = begin(); - for( ; i != end(); ++i ) { - if( *i == dbname ) { - return true; - } - } - return false; -} - -ConfigFile::ConfigFileError::ConfigFileError(const char *msg, int err) - : std::runtime_error(std::string(msg) + ": " + strerror(err)) -{ -} - - -////////////////////////////////////////////////////////////////////////////// -// ConfigFile class members - -/// Loads config file for the given pin, and ends up in an -/// unenlightened state. Throws ConfigFileError on error, -/// but it is not an error if the config does not exist. -/// Never use this if you have a DatabaseDatabase object! -/// This ctor is only for temporary loading of config data. -ConfigFile::ConfigFile(const std::string &pin) - : m_pin(pin) - , m_loaded(false) - , m_promptBackupLabel(false) -{ - if( m_pin.size() == 0 ) - throw ConfigFileError("Configfile: empty pin"); - - BuildFilename(); - Load(); -} - -/// Opens and loads config file for given pin, and calls Enlighten -/// Throws ConfigFileError on error. Should never fail unless -/// passed a bad pin. -ConfigFile::ConfigFile(const std::string &pin, - const Barry::DatabaseDatabase &db) - : m_pin(pin) - , m_loaded(false) - , m_promptBackupLabel(false) -{ - if( m_pin.size() == 0 ) - throw ConfigFileError("Configfile: empty pin"); - - BuildFilename(); - Load(); - Enlighten(db); -} - -ConfigFile::~ConfigFile() -{ -} - - -void ConfigFile::BuildFilename() -{ - struct passwd *pw = getpwuid(getuid()); - if( !pw ) - throw ConfigFileError("BuildFilename: getpwuid failed", errno); - - m_path = pw->pw_dir; - m_path += "/.barry/backup/"; - m_path += m_pin; - m_filename = m_path + "/config"; -} - -void ConfigFile::Clear() -{ - m_loaded = false; - m_backupList.clear(); - m_restoreList.clear(); -} - -/// Attempt to load the configuration file, but do not fail if not available -void ConfigFile::Load() -{ - // start fresh - Clear(); - - // open input file - std::ifstream in(m_filename.c_str(), std::ios::in | std::ios::binary); - if( !in ) - return; - - std::string line; - DBListType *pList = 0; - - while( std::getline(in, line) ) { - std::string keyword; - std::istringstream iss(line); - iss >> keyword; - - if( keyword == "backup_list" ) { - pList = &m_backupList; - } - else if( keyword == "restore_list" ) { - pList = &m_restoreList; - } - else if( line[0] == ' ' && pList ) { - pList->push_back(line.c_str() + 1); - } - else { - pList = 0; - - // add all remaining keyword checks here - if( keyword == "device_name" ) { - iss >> std::ws; - std::getline(iss, m_deviceName); - if( m_deviceName.size() == 0 ) { - // if there is a device_name setting, - // then this value must hold something, - // so that the user can ignore this - // field, and not get pestered all - // the time - m_deviceName = " "; - } - } - else if( keyword == "prompt_backup_label" ) { - int flag; - iss >> flag; - m_promptBackupLabel = flag; - } - } - } - - m_loaded = true; -} - -/// Checks that the path in m_path exists, and if not, creates it. -/// Returns false if unable to create path, true if ok. -bool ConfigFile::CheckPath() -{ - return ::CheckPath(m_path, &m_last_error); -} - -/// Saves current config, overwriting or creating a config file -bool ConfigFile::Save() -{ - if( !CheckPath() ) - return false; - - std::ofstream out(m_filename.c_str(), std::ios::out | std::ios::binary); - if( !out ) { - m_last_error = "Unable to open " + m_filename + " for writing."; - return false; - } - - out << "backup_list" << std::endl; - for( DBListType::iterator i = m_backupList.begin(); i != m_backupList.end(); ++i ) { - out << " " << *i << std::endl; - } - - out << "restore_list" << std::endl; - for( DBListType::iterator i = m_restoreList.begin(); i != m_restoreList.end(); ++i ) { - out << " " << *i << std::endl; - } - - if( m_deviceName.size() ) { - out << "device_name " << m_deviceName << std::endl; - } - - out << "prompt_backup_label " << (m_promptBackupLabel ? 1 : 0) << std::endl; - - if( !out ) { - m_last_error = "Error during write. Config may be incomplete."; - return false; - } - return true; -} - -/// Compares a given databasedatabase from a real device with the -/// current config. If not yet configured, initialize with valid -/// defaults. -void ConfigFile::Enlighten(const Barry::DatabaseDatabase &db) -{ - if( !m_loaded ) { - // if not fully loaded, we use db as our default list - // our defaults are: backup everything, restore everything - // except email - - m_backupList.clear(); - m_restoreList.clear(); - - Barry::DatabaseDatabase::DatabaseArrayType::const_iterator i = - db.Databases.begin(); - for( ; i != db.Databases.end(); ++i ) { - // backup everything - m_backupList.push_back(i->Name); - - // restore everything except email (which could take ages) - // and Handheld Agent (which seems write protected) - if( i->Name != Barry::Message::GetDBName() && - i->Name != "Handheld Agent" ) - { - m_restoreList.push_back(i->Name); - } - } - } -} - -/// Sets list with new config -void ConfigFile::SetBackupList(const DBListType &list) -{ - m_backupList = list; - m_loaded = true; -} - -void ConfigFile::SetRestoreList(const DBListType &list) -{ - m_restoreList = list; - m_loaded = true; -} - -void ConfigFile::SetDeviceName(const std::string &name) -{ - if( name.size() ) - m_deviceName = name; - else - m_deviceName = " "; -} - -void ConfigFile::SetPromptBackupLabel(bool prompt) -{ - m_promptBackupLabel = prompt; -} - diff -Nru barry-0.14/gui/src/ConfigFile.h barry-0.0.20110506/gui/src/ConfigFile.h --- barry-0.14/gui/src/ConfigFile.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/ConfigFile.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/// -/// \file ConfigFile.h -/// BarryBackup GUI configuraion class -/// - -/* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#ifndef __BARRYBACKUP_CONFIGFILE_H__ -#define __BARRYBACKUP_CONFIGFILE_H__ - -#include -#include -#include - -class ConfigFile -{ -public: - class DBListType : public std::vector - { - public: - bool IsSelected(const std::string &dbname) const; - }; - - class ConfigFileError : public std::runtime_error - { - public: - ConfigFileError(const char *msg) : std::runtime_error(msg) {} - ConfigFileError(const char *msg, int err); - }; - -private: - // meta data - std::string m_pin; - std::string m_path; // /path/to/config/dir without trailing slash - std::string m_filename; // /path/to/config/dir/filename - bool m_loaded; - std::string m_last_error; - - // configuration data - DBListType m_backupList; - DBListType m_restoreList; - std::string m_deviceName; - bool m_promptBackupLabel; // if true, prompt the user on every - // backup for a string to label the - // backup file with - -protected: - void BuildFilename(); - void Clear(); - void Load(); - bool CheckPath(); - -public: - /// Loads config file for the given pin, and ends up in an - /// unenlightened state. Throws ConfigFileError on error, - /// but it is not an error if the config does not exist. - /// Never use this if you have a DatabaseDatabase object! - /// This ctor is only for temporary loading of config data. - explicit ConfigFile(const std::string &pin); - - /// Opens and loads config file for given pin, and calls Enlighten - /// Throws ConfigFileError on error. Should never fail unless - /// passed a bad pin, or if unable to get current user info. - ConfigFile(const std::string &pin, const Barry::DatabaseDatabase &db); - - ~ConfigFile(); - - // - // data access - // - - const std::string& get_last_error() const { return m_last_error; } - - const std::string& GetPIN() const { return m_pin; } - const std::string& GetPath() const { return m_path; } - const std::string& GetFilename() const { return m_filename; } - const DBListType& GetBackupList() const { return m_backupList; } - const DBListType& GetRestoreList() const { return m_restoreList; } - const std::string& GetDeviceName() const { return m_deviceName; } - bool HasDeviceName() const { return m_deviceName.size(); } - bool PromptBackupLabel() const { return m_promptBackupLabel; } - - // - // operations - // - - /// Saves current config, overwriting or creating a config file - bool Save(); - - /// Compares a given databasedatabase from a real device with the - /// current config. If not yet configured, initialize with valid - /// defaults. - void Enlighten(const Barry::DatabaseDatabase &db); - - /// Sets list with new config - void SetBackupList(const DBListType &list); - void SetRestoreList(const DBListType &list); - - void SetDeviceName(const std::string &name); - void SetPromptBackupLabel(bool prompt = true); -}; - -#endif - diff -Nru barry-0.14/gui/src/DatabaseSelectDlg.cc barry-0.0.20110506/gui/src/DatabaseSelectDlg.cc --- barry-0.14/gui/src/DatabaseSelectDlg.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DatabaseSelectDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -21,11 +21,12 @@ #include "DatabaseSelectDlg.h" #include "util.h" +#include "i18n.h" #include #include DatabaseSelectDlg::DatabaseSelectDlg(const Barry::DatabaseDatabase &dbdb, - const ConfigFile::DBListType &selections, + const Barry::ConfigFile::DBListType &selections, const Glib::ustring &label) : m_pTopLabel(0), m_pTree(0), @@ -72,8 +73,8 @@ (*row)[m_Columns.m_name] = i->Name; } m_pTree->set_model(m_pListStore); - m_pTree->append_column_editable("Active", m_Columns.m_selected); - m_pTree->append_column("Name", m_Columns.m_name); + m_pTree->append_column_editable(_("Active"), m_Columns.m_selected); + m_pTree->append_column(_("Name"), m_Columns.m_name); } bool DatabaseSelectDlg::IsSelected(const std::string &dbname) diff -Nru barry-0.14/gui/src/DatabaseSelectDlg.h barry-0.0.20110506/gui/src/DatabaseSelectDlg.h --- barry-0.14/gui/src/DatabaseSelectDlg.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DatabaseSelectDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,7 +24,7 @@ #include #include -#include "ConfigFile.h" +#include namespace Barry { class DatabaseDatabase; @@ -53,7 +53,7 @@ Glib::RefPtr m_pListStore; // data - ConfigFile::DBListType m_selections; + Barry::ConfigFile::DBListType m_selections; protected: void LoadTree(const Barry::DatabaseDatabase &dbdb); @@ -62,11 +62,11 @@ public: DatabaseSelectDlg(const Barry::DatabaseDatabase &dbdb, - const ConfigFile::DBListType &selections, + const Barry::ConfigFile::DBListType &selections, const Glib::ustring &label); ~DatabaseSelectDlg(); - const ConfigFile::DBListType& GetSelections() const { return m_selections; } + const Barry::ConfigFile::DBListType& GetSelections() const { return m_selections; } int run(); diff -Nru barry-0.14/gui/src/DeviceBus.cc barry-0.0.20110506/gui/src/DeviceBus.cc --- barry-0.14/gui/src/DeviceBus.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceBus.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,48 @@ +/// +/// \file DeviceBus.cc +/// Bus for manipulating devices +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "DeviceBus.h" + +DeviceBus::DeviceBus() +{ +} + +DeviceBus::~DeviceBus() +{ +} + +////////////////////////////////////////////////////////////////////////////// +// Public API + +void DeviceBus::Probe() +{ + m_probe.reset(new Barry::Probe); +} + +unsigned int DeviceBus::ProbeCount() +{ + return m_probe->GetCount(); +} + +Device DeviceBus::Get(unsigned int i) +{ + return Device(m_probe->Get(i)); +} diff -Nru barry-0.14/gui/src/DeviceBus.h barry-0.0.20110506/gui/src/DeviceBus.h --- barry-0.14/gui/src/DeviceBus.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceBus.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,42 @@ +/// +/// \file DeviceBus.h +/// Bus for manipulating devices +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYBACKUP_DEVICEBUS_H__ +#define __BARRYBACKUP_DEVICEBUS_H__ + +#include +#include "DeviceIface.h" + +class DeviceBus +{ +private: + std::auto_ptr m_probe; + +public: + DeviceBus(); + ~DeviceBus(); + + void Probe(); + unsigned int ProbeCount(); + Device Get(unsigned int index); +}; + +#endif diff -Nru barry-0.14/gui/src/DeviceIface.cc barry-0.0.20110506/gui/src/DeviceIface.cc --- barry-0.14/gui/src/DeviceIface.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceIface.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -21,6 +21,7 @@ #include "DeviceIface.h" #include "util.h" +#include "i18n.h" #include #include #include @@ -29,22 +30,20 @@ #include #include -DeviceInterface::DeviceInterface() - : m_con(0) +DeviceInterface::DeviceInterface(Device *dev) + : m_dev(dev) + , m_con(0) , m_desktop(0) , m_dbnameMutex(new Glib::Mutex) // this is just in an effort to // avoid gtkmm headers in // DeviceIface.h - , m_end_of_tar(false) - , m_tar_record_loaded(false) , m_thread_quit(false) { } DeviceInterface::~DeviceInterface() { - delete m_desktop; - delete m_con; + Disconnect(); delete m_dbnameMutex; } @@ -61,19 +60,16 @@ m_last_thread_error = ""; try { - // cycle through all database names in the dbList // and store them all - ConfigFile::DBListType::const_iterator name = m_dbList.begin(); - for( ; name != m_dbList.end(); ++name ) { + Barry::ConfigFile::DBListType::const_iterator name = m_dbBackupList.begin(); + for( ; name != m_dbBackupList.end(); ++name ) { // save current db name SetThreadDBName(*name); - // call the controller to do the work unsigned int dbId = m_desktop->GetDBID(*name); m_desktop->LoadDatabase(dbId, *this); } - } catch( Glib::Exception &e ) { m_last_thread_error = e.what(); @@ -84,11 +80,10 @@ error = true; } catch( Quit &q ) { - m_last_thread_error = "Terminated by user."; + m_last_thread_error = _("Terminated by user."); } - m_tarback->Close(); - m_tarback.reset(); + m_backup.reset(); if( error ) m_AppComm.m_error->emit(); @@ -108,90 +103,34 @@ try { // cycle until m_end_of_tar - while( !m_end_of_tar ) { - try { - // call the controller to do the work - unsigned int dbId = m_desktop->GetDBID(m_current_dbname); - m_AppComm.m_erase_db->emit(); - m_desktop->SaveDatabase(dbId, *this); - } - catch( Barry::Error &be ) { - // save thread error - m_last_thread_error = "Error while restoring "; - m_last_thread_error += m_current_dbname + ". "; - m_last_thread_error += be.what(); - m_last_thread_error += " Will continue processing."; - - // notify host thread - m_AppComm.m_error->emit(); - - // skip over records from this db - std::cerr << "Error on database: " - << m_current_dbname << std::endl; - SkipCurrentDB(); - } - } - - } - catch( Glib::Exception &e ) { - m_last_thread_error = e.what(); - m_AppComm.m_error->emit(); - } - catch( std::exception &e ) { - m_last_thread_error = e.what(); - m_AppComm.m_error->emit(); - } - catch( Quit &q ) { - m_last_thread_error = "Terminated by user."; - } - - m_tar->Close(); - m_tar.reset(); - - // signal host thread that we're done - m_AppComm.m_done->emit(); - - // done! - m_AppComm.Invalidate(); -} - -void DeviceInterface::RestoreAndBackupThread() -{ - m_thread_quit = false; - m_last_thread_error = ""; - - try { - - // cycle until m_end_of_tar - while( !m_end_of_tar ) { - unsigned int dbId = m_desktop->GetDBID(m_current_dbname); - + Barry::DBData meta; + while( !m_restore->EndOfFile() ) { try { - - // do restore first - m_AppComm.m_erase_db->emit(); - m_desktop->SaveDatabase(dbId, *this); - + if( m_restore->GetNextMeta(meta) ) { + // save current db name + SetThreadDBName(meta.GetDBName()); + // call the controller to do the work + unsigned int dbId = m_desktop->GetDBID(meta.GetDBName()); + m_AppComm.m_erase_db->emit(); + m_desktop->SaveDatabase(dbId, *this); + m_AppComm.m_restored_db->emit(); + } } catch( Barry::Error &be ) { // save thread error - m_last_thread_error = "Error while restoring "; - m_last_thread_error += m_current_dbname + ". "; + m_last_thread_error = _("Error while restoring "); + m_last_thread_error += meta.GetDBName() + ". "; m_last_thread_error += be.what(); - m_last_thread_error += " Will continue processing."; + m_last_thread_error += _(" Will continue processing."); // notify host thread m_AppComm.m_error->emit(); // skip over records from this db - std::cerr << "Error on database: " - << m_current_dbname << std::endl; - SkipCurrentDB(); + std::cerr << _("Error on database: ") + << meta.GetDBName() << std::endl; + m_restore->SkipCurrentDB(); } - - // then the backup, even if restore fails - m_desktop->LoadDatabase(dbId, *this); - } } @@ -204,13 +143,10 @@ m_AppComm.m_error->emit(); } catch( Quit &q ) { - m_last_thread_error = "Terminated by user."; + m_last_thread_error = _("Terminated by user."); } - m_tar->Close(); - m_tar.reset(); - m_tarback->Close(); - m_tarback.reset(); + m_restore.reset(); // signal host thread that we're done m_AppComm.m_done->emit(); @@ -219,8 +155,7 @@ m_AppComm.Invalidate(); } -std::string DeviceInterface::MakeFilename(const std::string &pin, - const std::string &label) +std::string DeviceInterface::MakeFilename(const std::string &label) const { time_t t = time(NULL); struct tm *lt = localtime(&t); @@ -238,7 +173,7 @@ } std::ostringstream tarfilename; - tarfilename << pin << "-" + tarfilename << m_dev->GetPIN().Str() << "-" << std::setw(4) << std::setfill('0') << (lt->tm_year + 1900) << std::setw(2) << std::setfill('0') << (lt->tm_mon + 1) << std::setw(2) << std::setfill('0') << lt->tm_mday @@ -251,36 +186,13 @@ return tarfilename.str(); } -int DeviceInterface::CountFiles(reuse::TarFile &tar, - const ConfigFile::DBListType &restoreList) -{ - int count = 0; - std::string name, last_name; - bool good = false; - - while( tar.ReadNextFilenameOnly(name) ) { - std::string::size_type pos = name.rfind('/'); - if( pos == std::string::npos ) - continue; // bad name - std::string dbname = name.substr(0, pos); - - if( dbname != last_name ) { - last_name = dbname; - good = restoreList.IsSelected(dbname); - } - if( good ) - count++; - } - return count; -} - /// Splits a tarpath of the form "DBName/DBID" into separate string values. /// Returns true if successful, false if tarpath is a bad name. bool DeviceInterface::SplitTarPath(const std::string &tarpath, std::string &dbname, std::string &dbid_text, uint8_t &dbrectype, - uint32_t &dbid) + uint32_t &dbid) const { std::string::size_type pos = tarpath.rfind('/'); if( pos == std::string::npos ) @@ -302,19 +214,23 @@ void DeviceInterface::SetThreadDBName(const std::string &dbname) { Glib::Mutex::Lock lock(*m_dbnameMutex); - m_current_dbname_not_thread_safe = dbname; m_current_dbname = dbname; } - ////////////////////////////////////////////////////////////////////////////// // Public API -bool DeviceInterface::Connect(const Barry::ProbeResult &dev) +void DeviceInterface::Reset() +{ + Usb::Device dev(m_dev->result.m_dev); + dev.Reset(); +} + +bool DeviceInterface::Connect() { try { Disconnect(); - m_con = new Barry::Controller(dev); + m_con = new Barry::Controller(m_dev->result); m_desktop = new Barry::Mode::Desktop(*m_con); m_desktop->Open(); return true; @@ -361,9 +277,9 @@ // cycle through controller's DBDB and count the records in all the // databases selected in the backupList -int DeviceInterface::GetDeviceRecordTotal(const ConfigFile::DBListType &backupList) const +unsigned int DeviceInterface::GetRecordTotal(const Barry::ConfigFile::DBListType &backupList) const { - int count = 0; + unsigned int count = 0; Barry::DatabaseDatabase::DatabaseArrayType::const_iterator i = m_desktop->GetDBDB().Databases.begin(); @@ -375,35 +291,38 @@ return count; } +unsigned int DeviceInterface::GetRecordTotal(const Barry::ConfigFile::DBListType &restoreList, const std::string &filename) const +{ + return Barry::Restore::GetRecordTotal(filename, restoreList, false); +} + /// returns name of database the thread is currently working on std::string DeviceInterface::GetThreadDBName() const { Glib::Mutex::Lock lock(*m_dbnameMutex); - return m_current_dbname_not_thread_safe; + return m_current_dbname; } bool DeviceInterface::StartBackup(AppComm comm, - const ConfigFile::DBListType &backupList, + const Barry::ConfigFile::DBListType &backupList, const std::string &directory, - const std::string &pin, const std::string &backupLabel) { if( m_AppComm.IsValid() ) - return False("Thread already running."); + return False(_("Thread already running.")); try { - - std::string filename = directory + "/" + MakeFilename(pin, backupLabel); - m_tarback.reset( new reuse::TarFile(filename.c_str(), true, &reuse::gztar_ops_nonthread, true) ); - + std::string filename = directory + "/" + MakeFilename(backupLabel); + m_backup.reset( new Barry::Backup(filename.c_str()) ); } - catch( reuse::TarFile::TarError &te ) { - return False(te.what()); + catch( Barry::BackupError &be ) { + return False(be.what()); } // setup m_AppComm = comm; - m_dbList = backupList; + m_dbBackupList = backupList; + SetThreadDBName(""); // start the thread Glib::Thread::create(sigc::mem_fun(*this, &DeviceInterface::BackupThread), false); @@ -411,124 +330,37 @@ } bool DeviceInterface::StartRestore(AppComm comm, - const ConfigFile::DBListType &restoreList, - const std::string &filename, - int *pRecordCount) + const Barry::ConfigFile::DBListType &restoreList, + const std::string &filename) { if( m_AppComm.IsValid() ) - return False("Thread already running."); + return False(_("Thread already running.")); try { - if( pRecordCount ) { - // caller is asking for a total, so we do a quick - // scan through the tar file first - m_tar.reset( new reuse::TarFile(filename.c_str(), false, &reuse::gztar_ops_nonthread, true) ); - *pRecordCount = CountFiles(*m_tar, restoreList); - - // close for next open - m_tar.reset(); - } - - // open for the main restore - m_tar.reset( new reuse::TarFile(filename.c_str(), false, &reuse::gztar_ops_nonthread, true) ); - + m_restore.reset( new Barry::Restore(filename.c_str(), false) ); } - catch( reuse::TarFile::TarError &te ) { - return False(te.what()); + catch( Barry::BackupError &be ) { + return False(be.what()); } // setup m_AppComm = comm; - m_dbList = restoreList; - m_current_dbname_not_thread_safe = ""; - m_current_dbname = ""; - m_unique_id = 0; - m_end_of_tar = false; - m_tar_record_loaded = false; - - // get first tar record - Retrieve(0); + m_restore->Add(restoreList); + SetThreadDBName(""); // start the thread Glib::Thread::create(sigc::mem_fun(*this, &DeviceInterface::RestoreThread), false); return true; } -bool DeviceInterface::StartRestoreAndBackup(AppComm comm, - const ConfigFile::DBListType &restoreAndBackupList, - const std::string &filename, - const std::string &directory, const std::string &pin, - int *pRecordCount) -{ - if( m_AppComm.IsValid() ) - return False("Thread already running."); - - try { - if( pRecordCount ) { - // caller is asking for a total, so we do a quick - // scan through the tar file first - m_tar.reset( new reuse::TarFile(filename.c_str(), false, &reuse::gztar_ops_nonthread, true) ); - *pRecordCount = CountFiles(*m_tar, restoreAndBackupList); - - // close for next open - m_tar.reset(); - } - - // open for the main restore - m_tar.reset( new reuse::TarFile(filename.c_str(), false, &reuse::gztar_ops_nonthread, true) ); - - // open for secondary backup - std::string back = directory + "/" + MakeFilename(pin); - m_tarback.reset( new reuse::TarFile(back.c_str(), true, &reuse::gztar_ops_nonthread, true) ); - - } - catch( reuse::TarFile::TarError &te ) { - return False(te.what()); - } - - // setup - m_AppComm = comm; - m_dbList = restoreAndBackupList; - m_current_dbname_not_thread_safe = ""; - m_current_dbname = ""; - m_unique_id = 0; - m_end_of_tar = false; - m_tar_record_loaded = false; - - // get first tar record - Retrieve(0); - - // start the thread - Glib::Thread::create(sigc::mem_fun(*this, &DeviceInterface::RestoreAndBackupThread), false); - return true; -} - - ////////////////////////////////////////////////////////////////////////////// // Barry::Parser overrides -void DeviceInterface::SetIds(uint8_t RecType, uint32_t UniqueId) +void DeviceInterface::ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic) { - m_rec_type = RecType; - m_unique_id = UniqueId; - std::ostringstream oss; - oss << std::hex << m_unique_id << " " << (unsigned int)m_rec_type; - m_tar_id_text = oss.str(); - if( m_tar_id_text.size() == 0 ) - throw std::runtime_error("No unique ID available!"); -} - -void DeviceInterface::ParseFields(const Barry::Data &data, size_t &offset) -{ - m_record_data.assign((const char*)data.GetData() + offset, data.GetSize() - offset); -} - -void DeviceInterface::Store() -{ - std::string tarname = m_current_dbname + "/" + m_tar_id_text; - m_tarback->AppendFile(tarname.c_str(), m_record_data); - + m_backup->ParseRecord(data, ic); m_AppComm.m_progress->emit(); // check quit flag @@ -541,109 +373,32 @@ ////////////////////////////////////////////////////////////////////////////// // Barry::Builder overrides -bool DeviceInterface::Retrieve(unsigned int dbId) +bool DeviceInterface::BuildRecord(Barry::DBData &data, size_t &offset, + const Barry::IConverter *ic) { - if( m_end_of_tar ) - return false; + // check quit flag + if( m_thread_quit ) { + throw Quit(); + } - // if loaded, we are likely on a database - // boundary, and the last read crossed it, so don't load again - if( m_tar_record_loaded ) + if( m_restore->BuildRecord(data, offset, ic) ) { + m_AppComm.m_progress->emit(); return true; - - // search for a valid record - for(;;) { - // load record data from tar file - std::string filename; - if( !m_tar->ReadNextFile(filename, m_record_data) ) { - // assume end of file - m_end_of_tar = true; - return false; - } - m_tar_record_loaded = true; - - // split record filename into dbname and ID - std::string dbname; - if( !SplitTarPath(filename, dbname, m_tar_id_text, m_rec_type, m_unique_id) ) { - // invalid filename, skip it - std::cerr << "Skipping invalid tar record: " << filename << std::endl; - continue; - } - - // are we working on the same dbname as last time? if so, go ahead! - if( m_current_dbname == dbname ) { - return true; - } - - // DIFFERENT DBNAME from here on down! - - // does the filter allow this record? if not, skip it and continue - // looking - if( !m_dbList.IsSelected(dbname) ) { - continue; - } - - // all checks pass, load the new dbname, and return false - // if we are on a dbname boundary - bool r_val = false; - if( m_current_dbname.size() == 0 ) { - // this is the first time through Retrieve, so ok - r_val = true; - } - - SetThreadDBName(dbname); - return r_val; + } + else { + return false; } } -uint8_t DeviceInterface::GetRecType() const -{ - return m_rec_type; -} - -uint32_t DeviceInterface::GetUniqueId() const -{ - return m_unique_id; -} - -void DeviceInterface::BuildHeader(Barry::Data &data, size_t &offset) -{ - // nothing to do -} - -void DeviceInterface::BuildFields(Barry::Data &data, size_t &offset) +bool DeviceInterface::FetchRecord(Barry::DBData &data, + const Barry::IConverter *ic) { - int packet_size = offset + m_record_data.size(); - unsigned char *buf = data.GetBuffer(packet_size); - memcpy(buf + offset, m_record_data.data(), m_record_data.size()); - offset += m_record_data.size(); - data.ReleaseBuffer(packet_size); - - // clear loaded flag, as it has now been used - m_tar_record_loaded = false; - - m_AppComm.m_progress->emit(); + size_t offset = 0; + return BuildRecord(data, offset, ic); } -// helper function for halding restore errors -void DeviceInterface::SkipCurrentDB() throw() +Device::Device(const Barry::ProbeResult &result) + : result(result) { - // skip all records until next DB - try { - while( Retrieve(0) ) { - std::cerr << "Skipping: " - << m_current_dbname << "/" - << m_tar_id_text << std::endl; - m_tar_record_loaded = false; - } - } - catch( reuse::TarFile::TarError & ) { - m_end_of_tar = true; - } - catch( ... ) { - // swallow all other exceptions - std::cerr << "EXCEPTION IN SkipCurrentDB()! " - "Please report to Barry mailing list." << std::endl; - } } diff -Nru barry-0.14/gui/src/DeviceIface.h barry-0.0.20110506/gui/src/DeviceIface.h --- barry-0.14/gui/src/DeviceIface.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceIface.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,11 +23,10 @@ #define __BARRYBACKUP_DEVICEIFACE_H__ #include +#include #include #include #include -#include "ConfigFile.h" -#include "tarfile.h" #define DI_THREAD_DONE 100 #define DI_THREAD_PROGRESS 101 @@ -37,6 +36,18 @@ class Mutex; } +class Device +{ + Barry::ProbeResult result; + +public: + Device(const Barry::ProbeResult &result); + + Barry::Pin GetPIN() const { return Barry::Pin(result.m_pin); }; + + friend class DeviceInterface; +}; + class DeviceInterface : public Barry::Parser, public Barry::Builder @@ -46,12 +57,18 @@ { Glib::Dispatcher *m_erase_db; // to notify the app about the // db erase stage of restore + Glib::Dispatcher *m_restored_db;// to notify the app that the + // previous erase_db was + // restored... do not rely + // on the current db name == + // the name found at erase time Glib::Dispatcher *m_progress; Glib::Dispatcher *m_error; Glib::Dispatcher *m_done; AppComm() : m_erase_db(0), + m_restored_db(0), m_progress(0), m_error(0), m_done(0) @@ -59,16 +76,18 @@ AppComm(Glib::Dispatcher *progress, Glib::Dispatcher *error, Glib::Dispatcher *done, - Glib::Dispatcher *erase_db) : + Glib::Dispatcher *erase_db, + Glib::Dispatcher *restored_db) : m_erase_db(erase_db), + m_restored_db(restored_db), m_progress(progress), m_error(error), m_done(done) {} bool IsValid() const - { return m_erase_db && m_progress && m_error && m_done; } + { return m_erase_db && m_restored_db && m_progress && m_error && m_done; } void Invalidate() - { m_erase_db = m_progress = m_error = m_done = 0; } + { m_erase_db = m_restored_db = m_progress = m_error = m_done = 0; } }; class Quit // quit exception to break out of upload/download @@ -76,25 +95,21 @@ }; private: + Device *m_dev; Barry::Controller *m_con; Barry::Mode::Desktop *m_desktop; std::string m_last_error; std::string m_last_thread_error; AppComm m_AppComm; - std::auto_ptr m_tar, m_tarback; - // parser and builder data (only one side uses these at a time) - ConfigFile::DBListType m_dbList; + std::auto_ptr m_backup; + std::auto_ptr m_restore; + + // parser and builder data + Barry::ConfigFile::DBListType m_dbBackupList; mutable Glib::Mutex *m_dbnameMutex; - std::string m_current_dbname_not_thread_safe; std::string m_current_dbname; - uint8_t m_rec_type; - uint32_t m_unique_id; - std::string m_tar_id_text; - std::string m_record_data; - bool m_end_of_tar; - bool m_tar_record_loaded; // thread quit flag... not locked, only a byte volatile bool m_thread_quit; @@ -105,30 +120,30 @@ // threads void BackupThread(); void RestoreThread(); - void RestoreAndBackupThread(); // helpers - std::string MakeFilename(const std::string &pin, const std::string &label = ""); - int CountFiles(reuse::TarFile &tar, const ConfigFile::DBListType &restoreList); + std::string MakeFilename(const std::string &label = "") const; bool SplitTarPath(const std::string &tarpath, std::string &dbname, - std::string &dbid_text, uint8_t &dbrectype, uint32_t &dbid); + std::string &dbid_text, uint8_t &dbrectype, uint32_t &dbid) const; // Sets the name of the database the thread is currently working on void SetThreadDBName(const std::string &dbname); public: - DeviceInterface(); + DeviceInterface(Device *dev = 0); ~DeviceInterface(); const std::string& get_last_error() const { return m_last_error; } const std::string& get_last_thread_error() const { return m_last_thread_error; } - bool Connect(const Barry::ProbeResult &dev); + void Reset(); + bool Connect(); bool Password(const char *password); void Disconnect(); const Barry::DatabaseDatabase& GetDBDB() const { return m_desktop->GetDBDB(); } - int GetDeviceRecordTotal(const ConfigFile::DBListType &backupList) const; + unsigned int GetRecordTotal(const Barry::ConfigFile::DBListType &backupList) const; + unsigned int GetRecordTotal(const Barry::ConfigFile::DBListType &restoreList, const std::string &filename) const; void QuitThread() { m_thread_quit = true; } @@ -136,31 +151,20 @@ std::string GetThreadDBName() const; bool StartBackup(AppComm comm, - const ConfigFile::DBListType &backupList, - const std::string &directory, const std::string &pin, - const std::string &backupLabel); + const Barry::ConfigFile::DBListType &backupList, + const std::string &directory, const std::string &backupLabel); bool StartRestore(AppComm comm, - const ConfigFile::DBListType &restoreList, - const std::string &tarfilename, int *pRecordCount = 0); - // this is for debugging... starts a restore, and then does an - // immediate backup of the same DB before moving on to the next - bool StartRestoreAndBackup(AppComm comm, - const ConfigFile::DBListType &restoreAndBackupList, - const std::string &tarfilename, - const std::string &directory, const std::string &pin, - int *pRecordCount = 0); + const Barry::ConfigFile::DBListType &restoreList, + const std::string &tarfilename); // Barry::Parser overrides - virtual void SetIds(uint8_t RecType, uint32_t UniqueId); - virtual void ParseFields(const Barry::Data &data, size_t &offset); - virtual void Store(); + virtual void ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic); // Barry::Builder overrides - virtual bool Retrieve(unsigned int dbId); - virtual uint8_t GetRecType() const; - virtual uint32_t GetUniqueId() const; - virtual void BuildHeader(Barry::Data &data, size_t &offset); - virtual void BuildFields(Barry::Data &data, size_t &offset); + virtual bool BuildRecord(Barry::DBData &data, size_t &offset, const Barry::IConverter *ic); + virtual bool FetchRecord(Barry::DBData &data, const Barry::IConverter *ic); + virtual bool EndOfFile() const { return false; } // not used void SkipCurrentDB() throw(); // helper function for halding restore errors }; diff -Nru barry-0.14/gui/src/DeviceSelectDlg.cc barry-0.0.20110506/gui/src/DeviceSelectDlg.cc --- barry-0.14/gui/src/DeviceSelectDlg.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceSelectDlg.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/// -/// \file DeviceSelectDlg.cc -/// Dialog wrapper class for user selection of multiple -/// BlackBerry devices on a USB bus. -/// - -/* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "DeviceSelectDlg.h" -#include "ConfigFile.h" -#include "util.h" -#include -#include -#include -#include - -DeviceSelectDlg::DeviceSelectDlg(const Barry::Probe &probe) - : m_pTree(0) -{ - Glib::RefPtr xml = LoadXml("DeviceSelectDlg.glade"); - - Gtk::Dialog *pD = 0; - xml->get_widget("DeviceSelectDlg", pD); - m_pDialog.reset(pD); - - xml->get_widget("treeview1", m_pTree); - - m_pListStore = Gtk::ListStore::create(m_Columns); - LoadTree(probe); -} - -DeviceSelectDlg::~DeviceSelectDlg() -{ -} - -void DeviceSelectDlg::LoadTree(const Barry::Probe &probe) -{ - for( int i = 0; i < probe.GetCount(); i++ ) { - Gtk::TreeModel::iterator row = m_pListStore->append(); - (*row)[m_Columns.m_pin] = probe.Get(i).m_pin; - - std::ostringstream oss; - oss << std::hex << probe.Get(i).m_pin; - - // temporarily load the config for the given pin - // and append device name to oss stream - try { - ConfigFile config(oss.str()); - if( config.GetDeviceName().size() ) - oss << " - " << config.GetDeviceName(); - } - catch( ConfigFile::ConfigFileError & ) { - // just throw it away - } - - (*row)[m_Columns.m_pin_text] = oss.str(); - } - m_pTree->set_model(m_pListStore); - m_pTree->append_column("Device PIN", m_Columns.m_pin_text); -} - -int DeviceSelectDlg::run() -{ - for(;;) { - int ret = m_pDialog->run(); - if( ret == Gtk::RESPONSE_OK ) { - if( m_pTree->get_selection()->get_selected() ) { - m_pin = (*m_pTree->get_selection()->get_selected())[m_Columns.m_pin]; - return ret; - } - - m_pin = 0; - Gtk::MessageDialog msg("Please select a device."); - msg.run(); - } - else { - return ret; - } - } -} - diff -Nru barry-0.14/gui/src/DeviceSelectDlg.glade barry-0.0.20110506/gui/src/DeviceSelectDlg.glade --- barry-0.14/gui/src/DeviceSelectDlg.glade 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceSelectDlg.glade 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ - - - - - - - True - Device Selection - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - 75 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - gtk-dialog-question - 6 - 0.5 - 0.10000000149 - 0 - 0 - - - 7 - False - False - - - - - - True - False - 0 - - - - True - Multiple BlackBerry devices have been found. Please select the one to work with: - False - False - GTK_JUSTIFY_LEFT - True - False - 0.5 - 0.5 - 0 - 0 - - - 12 - False - False - - - - - - 162 - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff -Nru barry-0.14/gui/src/DeviceSelectDlg.h barry-0.0.20110506/gui/src/DeviceSelectDlg.h --- barry-0.14/gui/src/DeviceSelectDlg.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/DeviceSelectDlg.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/// -/// \file DeviceSelectDlg.h -/// Dialog wrapper class for user selection of multiple -/// BlackBerry devices on a USB bus. -/// - -/* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#ifndef __BARRYBACKUP_DEVICESELECTDLG_H__ -#define __BARRYBACKUP_DEVICESELECTDLG_H__ - -#include -#include -#include - -namespace Barry { - class Probe; -} - -class DeviceSelectDlg -{ - class Columns : public Gtk::TreeModelColumnRecord - { - public: - Gtk::TreeModelColumn m_pin_text; - Gtk::TreeModelColumn m_pin; - - Columns() - { - add(m_pin_text); - add(m_pin); - } - }; - - // Widgets - std::auto_ptr m_pDialog; - Gtk::TreeView *m_pTree; - Columns m_Columns; - Glib::RefPtr m_pListStore; - - // data - uint32_t m_pin; - -protected: - void LoadTree(const Barry::Probe &probe); - -public: - DeviceSelectDlg(const Barry::Probe &probe); - ~DeviceSelectDlg(); - - uint32_t GetPIN() const { return m_pin; } - - int run(); -}; - -#endif - diff -Nru barry-0.14/gui/src/gettext.h barry-0.0.20110506/gui/src/gettext.h --- barry-0.14/gui/src/gettext.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/gettext.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,271 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include + +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (translation != msg_ctxt_id) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + +#endif /* _LIBGETTEXT_H */ diff -Nru barry-0.14/gui/src/i18n.h barry-0.0.20110506/gui/src/i18n.h --- barry-0.14/gui/src/i18n.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/i18n.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,41 @@ +/// +/// \file i18n.h +/// Common internationalization defines, via gettext +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_I18N_H__ +#define __BARRY_I18N_H__ + +#include +#include +#include "gettext.h" + +#define _(String) gettext (String) +#define N_(String) String + +#define INIT_I18N(package) { \ + setlocale(LC_ALL, ""); \ + bindtextdomain(package, LOCALEDIR); \ + bind_textdomain_codeset(package, "UTF-8"); \ + textdomain(package); \ + } + +#endif + diff -Nru barry-0.14/gui/src/main.cc barry-0.0.20110506/gui/src/main.cc --- barry-0.14/gui/src/main.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/main.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,6 +27,7 @@ #include #include "BackupWindow.h" #include "util.h" +#include "i18n.h" // // The catch-all handler for exceptions that occur inside signals @@ -91,6 +92,8 @@ int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + old_unexpected_handler = std::set_unexpected(&unexpected_handler); old_terminate_handler = std::set_terminate(&terminate_handler); diff -Nru barry-0.14/gui/src/Makefile.am barry-0.0.20110506/gui/src/Makefile.am --- barry-0.14/gui/src/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -1,14 +1,18 @@ ##DEFAULT_INCLUDES = -INCLUDES = $(TREE_BUILD_CXXFLAGS) $(BARRY_CFLAGS) $(GTKMM_CFLAGS) $(LIBTAR_CFLAGS) $(LIBZ_CFLAGS) -LIBS = $(TREE_BUILD_LDFLAGS) $(BARRY_LIBS) $(GTKMM_LIBS) $(LIBTAR_LIBS) $(LIBZ_LIBS) +INCLUDES = $(TREE_BUILD_CXXFLAGS) $(BARRY_CFLAGS) $(BARRYBACKUP_CFLAGS) $(GTKMM_CFLAGS) +LIBS = $(TREE_BUILD_LDFLAGS) $(BARRY_LIBS) $(BARRYBACKUP_LIBS) $(GTKMM_LIBS) -AM_CXXFLAGS = -ansi -Wall -g +AM_CXXFLAGS = -Wall -g AM_CPPFLAGS = -DBARRYBACKUP_GLADEDIR='"$(gladedir)"' +# To use gettext +datadir = @datadir@ +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + dist_glade_DATA = \ BackupWindow.glade \ - DeviceSelectDlg.glade \ DatabaseSelectDlg.glade \ PasswordDlg.glade \ PromptDlg.glade \ @@ -19,28 +23,27 @@ barrybackup_SOURCES = \ main.cc \ BackupWindow.cc \ - DeviceSelectDlg.cc \ DatabaseSelectDlg.cc \ PasswordDlg.cc \ PromptDlg.cc \ ConfigDlg.cc \ - ConfigFile.cc \ + DeviceBus.cc \ DeviceIface.cc \ - tarfile.cc \ - tarfile-ops-nt.cc \ + Thread.cc \ util.cc noinst_HEADERS= \ BackupWindow.h \ ConfigDlg.h \ - ConfigFile.h \ DatabaseSelectDlg.h \ + DeviceBus.h \ DeviceIface.h \ - DeviceSelectDlg.h \ PasswordDlg.h \ PromptDlg.h \ - tarfile.h \ - util.h + Thread.h \ + util.h \ + i18n.h \ + gettext.h EXTRA_DIST = barry-gui.glade diff -Nru barry-0.14/gui/src/Makefile.in barry-0.0.20110506/gui/src/Makefile.in --- barry-0.14/gui/src/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,542 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -bin_PROGRAMS = barrybackup$(EXEEXT) -subdir = src -DIST_COMMON = $(dist_glade_DATA) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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 = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gladedir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_barrybackup_OBJECTS = main.$(OBJEXT) BackupWindow.$(OBJEXT) \ - DeviceSelectDlg.$(OBJEXT) DatabaseSelectDlg.$(OBJEXT) \ - PasswordDlg.$(OBJEXT) PromptDlg.$(OBJEXT) ConfigDlg.$(OBJEXT) \ - ConfigFile.$(OBJEXT) DeviceIface.$(OBJEXT) tarfile.$(OBJEXT) \ - tarfile-ops-nt.$(OBJEXT) util.$(OBJEXT) -barrybackup_OBJECTS = $(am_barrybackup_OBJECTS) -barrybackup_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/../depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(barrybackup_SOURCES) -DIST_SOURCES = $(barrybackup_SOURCES) -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 = `echo $$p | sed -e 's|^.*/||'`; -dist_gladeDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dist_glade_DATA) -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BARRY_CFLAGS = @BARRY_CFLAGS@ -BARRY_LIBS = @BARRY_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTKMM_CFLAGS = @GTKMM_CFLAGS@ -GTKMM_LIBS = @GTKMM_LIBS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = $(TREE_BUILD_LDFLAGS) $(BARRY_LIBS) $(GTKMM_LIBS) $(LIBTAR_LIBS) $(LIBZ_LIBS) -LIBTAR_CFLAGS = @LIBTAR_CFLAGS@ -LIBTAR_LIBS = @LIBTAR_LIBS@ -LIBTOOL = @LIBTOOL@ -LIBZ_CFLAGS = @LIBZ_CFLAGS@ -LIBZ_LIBS = @LIBZ_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TREE_BUILD_CXXFLAGS = @TREE_BUILD_CXXFLAGS@ -TREE_BUILD_LDFLAGS = @TREE_BUILD_LDFLAGS@ -VERSION = @VERSION@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gladedir = @gladedir@ -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@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -INCLUDES = $(TREE_BUILD_CXXFLAGS) $(BARRY_CFLAGS) $(GTKMM_CFLAGS) $(LIBTAR_CFLAGS) $(LIBZ_CFLAGS) -AM_CXXFLAGS = -ansi -Wall -g -AM_CPPFLAGS = -DBARRYBACKUP_GLADEDIR='"$(gladedir)"' -dist_glade_DATA = \ - BackupWindow.glade \ - DeviceSelectDlg.glade \ - DatabaseSelectDlg.glade \ - PasswordDlg.glade \ - PromptDlg.glade \ - ConfigDlg.glade - -barrybackup_SOURCES = \ - main.cc \ - BackupWindow.cc \ - DeviceSelectDlg.cc \ - DatabaseSelectDlg.cc \ - PasswordDlg.cc \ - PromptDlg.cc \ - ConfigDlg.cc \ - ConfigFile.cc \ - DeviceIface.cc \ - tarfile.cc \ - tarfile-ops-nt.cc \ - util.cc - -noinst_HEADERS = \ - BackupWindow.h \ - ConfigDlg.h \ - ConfigFile.h \ - DatabaseSelectDlg.h \ - DeviceIface.h \ - DeviceSelectDlg.h \ - PasswordDlg.h \ - PromptDlg.h \ - tarfile.h \ - util.h - -EXTRA_DIST = barry-gui.glade -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - 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 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -barrybackup$(EXEEXT): $(barrybackup_OBJECTS) $(barrybackup_DEPENDENCIES) - @rm -f barrybackup$(EXEEXT) - $(CXXLINK) $(barrybackup_LDFLAGS) $(barrybackup_OBJECTS) $(barrybackup_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BackupWindow.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigDlg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigFile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DatabaseSelectDlg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeviceIface.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DeviceSelectDlg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PasswordDlg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PromptDlg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tarfile-ops-nt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tarfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ - -.cc.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-dist_gladeDATA: $(dist_glade_DATA) - @$(NORMAL_INSTALL) - test -z "$(gladedir)" || $(mkdir_p) "$(DESTDIR)$(gladedir)" - @list='$(dist_glade_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_gladeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gladedir)/$$f'"; \ - $(dist_gladeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gladedir)/$$f"; \ - done - -uninstall-dist_gladeDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_glade_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(gladedir)/$$f'"; \ - rm -f "$(DESTDIR)$(gladedir)/$$f"; \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(gladedir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-dist_gladeDATA - -install-exec-am: install-binPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(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-dist_gladeDATA \ - uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am \ - install-dist_gladeDATA install-exec install-exec-am \ - install-info install-info-am install-man 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-dist_gladeDATA uninstall-info-am - -# 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 barry-0.14/gui/src/PasswordDlg.cc barry-0.0.20110506/gui/src/PasswordDlg.cc --- barry-0.14/gui/src/PasswordDlg.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/PasswordDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -21,6 +21,7 @@ #include "PasswordDlg.h" #include "util.h" +#include "i18n.h" #include PasswordDlg::PasswordDlg(int remaining_tries) @@ -37,7 +38,7 @@ xml->get_widget("password_entry", m_pPasswordEntry); std::ostringstream oss; - oss << "Please enter device password: (" << remaining_tries << " tries remaining)"; + oss << _("Please enter device password: (") << remaining_tries << _(" tries remaining)"); m_pPromptLabel->set_text(oss.str()); } diff -Nru barry-0.14/gui/src/PasswordDlg.h barry-0.0.20110506/gui/src/PasswordDlg.h --- barry-0.14/gui/src/PasswordDlg.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/PasswordDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/gui/src/PromptDlg.cc barry-0.0.20110506/gui/src/PromptDlg.cc --- barry-0.14/gui/src/PromptDlg.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/PromptDlg.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/gui/src/PromptDlg.h barry-0.0.20110506/gui/src/PromptDlg.h --- barry-0.14/gui/src/PromptDlg.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/PromptDlg.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/gui/src/tarfile.cc barry-0.0.20110506/gui/src/tarfile.cc --- barry-0.14/gui/src/tarfile.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/tarfile.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,254 +0,0 @@ -/// -/// \file tarfile.cc -/// API for reading and writing sequentially from compressed -/// tar files. - -/* - Copyright (C) 2007-2008, Chris Frey - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "tarfile.h" - -#include -#include -#include - -namespace reuse { - -TarFile::TarFile(const char *filename, - bool create, - tartype_t *compress_ops, - bool always_throw) - : m_tar(0), - m_throw(always_throw), - m_writemode(create) -{ - // figure out how to handle the file flags/modes - int flags = 0; - mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - - if( m_writemode ) { - flags = O_WRONLY | O_CREAT | O_EXCL; - } - else { - flags = O_RDONLY; - } - - // open... throw on error, as we are in the constructor - if( tar_open(&m_tar, const_cast(filename), - compress_ops, flags, mode, TAR_VERBOSE | TAR_GNU) == -1 ) { - throw TarError(std::string("Unable to open tar file: ") + strerror(errno)); - } -} - -TarFile::~TarFile() -{ - try { - Close(); - } catch( TarError &te ) {} -} - -bool TarFile::False(const char *msg) -{ - m_last_error = msg; - if( m_throw ) - throw TarError(msg); - else - return false; -} - -bool TarFile::False(const std::string &msg, int err) -{ - std::string str = msg; - str += ": "; - str += strerror(err); - return False(str); -} - -bool TarFile::Close() -{ - if( m_tar ) { - if( m_writemode ) { - if( tar_append_eof(m_tar) != 0 ) - return False("Unable to write eof", errno); - } - - if( tar_close(m_tar) != 0 ) { - return False("Unable to close file", errno); - } - m_tar = 0; - } - return true; -} - -/// Appends a new file to the current tarfile, using tarpath as -/// its internal filename, and data as the complete file contents. -/// Uses current date and time as file mtime. -bool TarFile::AppendFile(const char *tarpath, const std::string &data) -{ - // write standard file header - th_set_type(m_tar, REGTYPE); - th_set_mode(m_tar, 0644); - th_set_path(m_tar, const_cast(tarpath)); - th_set_user(m_tar, 0); - th_set_group(m_tar, 0); - th_set_size(m_tar, data.size()); - th_set_mtime(m_tar, time(NULL)); - if( th_write(m_tar) != 0 ) { - return False("Unable to write tar header", errno); - } - - // write the data in blocks until finished - char block[T_BLOCKSIZE]; - for( size_t pos = 0; pos < data.size(); pos += T_BLOCKSIZE ) { - memset(block, 0, T_BLOCKSIZE); - - size_t size = T_BLOCKSIZE; - if( data.size() - pos < T_BLOCKSIZE ) - size = data.size() - pos; - - memcpy(block, data.data() + pos, size); - - if( tar_block_write(m_tar, block) != T_BLOCKSIZE ) { - return False("Unable to write block", errno); - } - } - - return true; -} - -/// Reads next available file into data, filling tarpath with -/// internal filename from tarball. -bool TarFile::ReadNextFile(std::string &tarpath, std::string &data) -{ - // start fresh - tarpath.clear(); - data.clear(); - - // read next tar file header - if( th_read(m_tar) != 0 ) { - // this is not necessarily an error, as it could just - // be the end of file, so a simple false is good here, - // don't throw an exception - m_last_error = ""; - return false; - } - - // write standard file header - if( !TH_ISREG(m_tar) ) { - return False("Only regular files are supported inside a tarball."); - } - - tarpath = th_get_pathname(m_tar); - size_t size = th_get_size(m_tar); - - // read the data in blocks until finished - char block[T_BLOCKSIZE]; - for( size_t pos = 0; pos < size; pos += T_BLOCKSIZE ) { - memset(block, 0, T_BLOCKSIZE); - - size_t readsize = T_BLOCKSIZE; - if( size - pos < T_BLOCKSIZE ) - readsize = size - pos; - - if( tar_block_read(m_tar, block) != T_BLOCKSIZE ) { - return False("Unable to read block", errno); - } - - data.append(block, readsize); - } - - return true; -} - -/// Read next available filename, skipping the data if it is -/// a regular file -bool TarFile::ReadNextFilenameOnly(std::string &tarpath) -{ - // start fresh - tarpath.clear(); - - // read next tar file header - if( th_read(m_tar) != 0 ) { - // this is not necessarily an error, as it could just - // be the end of file, so a simple false is good here, - // don't throw an exception - m_last_error = ""; - return false; - } - - // write standard file header - if( !TH_ISREG(m_tar) ) { - return False("Only regular files are supported inside a tarball."); - } - - tarpath = th_get_pathname(m_tar); - - if( tar_skip_regfile(m_tar) != 0 ) { - return False("Unable to skip tar file", errno); - } - - return true; -} - - -} // namespace reuse - - -#ifdef __TEST_MODE__ - -#include -#include - -using namespace std; - -int main() -{ - try { - cout << "Writing test file..." << endl; - reuse::TarFile output("tartest.tar.gz", true, true, true); - std::string data; - for( int i = 0; i < 60; i++ ) { - data.append("0123456789", 10); - } - - output.AppendFile("path1/test1.txt", data); - output.AppendFile("path2/test2.txt", data); - output.Close(); - - - cout << "Reading test file..." << endl; - reuse::TarFile input("tartest.tar.gz", false, true, true); - std::string path, incoming; - - while( input.ReadNextFile(path, incoming) ) { - cout << "Read: " << path - << " Data: " - << (( data == incoming ) ? "equal" : "different") - << endl; - } - - input.Close(); - - unlink("tartest.tar.gz"); - - } catch( reuse::TarFile::TarError &te ) { - cerr << te.what() << endl; - return 1; - } -} - -#endif - diff -Nru barry-0.14/gui/src/tarfile.h barry-0.0.20110506/gui/src/tarfile.h --- barry-0.14/gui/src/tarfile.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/tarfile.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/// -/// \file tarfile.h -/// API for reading and writing sequentially from compressed -/// tar files. - -/* - Copyright (C) 2007-2008, Chris Frey - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#ifndef __REUSE_TARFILE_H__ -#define __REUSE_TARFILE_H__ - -#include -#include -#include - -namespace reuse { - -// -// Compression options... more op sets can be added based on -// threading needs, or threading library support. -// - -/// Compression op set for zlib, non-threadsafe. -extern tartype_t gztar_ops_nonthread; - -class TarFile -{ - TAR *m_tar; - bool m_throw; - bool m_writemode; - std::string m_last_error; - -private: - bool False(const char *msg); - bool False(const std::string &str) { return False(str.c_str()); } - bool False(const std::string &msg, int err); - -public: - class TarError : public std::runtime_error - { - public: - TarError(const std::string &msg) : std::runtime_error(msg) {} - }; - -public: - explicit TarFile(const char *filename, bool write = false, - tartype_t *compress_ops = 0, bool always_throw = false); - ~TarFile(); - - const std::string& get_last_error() const { return m_last_error; } - - bool Close(); - - /// Appends a new file to the current tarfile, using tarpath as - /// its internal filename, and data as the complete file contents. - /// Uses current date and time as file mtime. - bool AppendFile(const char *tarpath, const std::string &data); - - /// Reads next available file into data, filling tarpath with - /// internal filename from tarball. - /// Returns false on end of archive. - bool ReadNextFile(std::string &tarpath, std::string &data); - - /// Read next available filename, skipping the data if it is - /// a regular file - bool ReadNextFilenameOnly(std::string &tarpath); -}; - -} - -#endif - diff -Nru barry-0.14/gui/src/tarfile-ops-nt.cc barry-0.0.20110506/gui/src/tarfile-ops-nt.cc --- barry-0.14/gui/src/tarfile-ops-nt.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/tarfile-ops-nt.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/// -/// \file tarfile-ops-nt.cc -/// Non-thread safe operation functions for a libtar-compatible -/// zlib compression interface. - -/* - Copyright (C) 2007-2008, Chris Frey - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "tarfile.h" - -#include -#include -#include -#include - -#include - -#include - -namespace reuse { - -namespace gztar_nonthread { - - namespace { - // array of compressed file handles... needed for architectures - // where sizeof(int) != sizeof(gzFile) - gzFile *gzHandles = 0; - unsigned int gzArraySize = 0; - } - - int open_compressed(const char *file, int flags, mode_t mode) - { - unsigned int index = 0; - for( ; index < gzArraySize; index++ ) { - if( gzHandles[index] == 0 ) - break; - } - if( index >= gzArraySize ) { - gzFile *h = (gzFile*) realloc(gzHandles, - (gzArraySize + 100) * sizeof(gzFile)); - if( h ) { - gzHandles = h; - gzArraySize += 100; - } - else { - return -1; - } - } - - int fd = open(file, flags, mode); - if( fd == -1 ) - return -1; - - gzFile gfd = gzdopen(fd, (flags & O_WRONLY) ? "wb9" : "rb"); - if( gfd == NULL ) { - close(fd); - return -1; - } - - gzHandles[index] = gfd; - return index; - } - - int close_compressed(int fd) - { - unsigned int ufd = fd; - assert( ufd < gzArraySize ); - int ret = gzclose(gzHandles[ufd]); - gzHandles[ufd] = 0; - return ret; - } - - ssize_t read_compressed(int fd, void *buf, size_t size) - { - unsigned int ufd = fd; - assert( ufd < gzArraySize ); - return gzread(gzHandles[ufd], buf, size); - } - - ssize_t write_compressed(int fd, const void *buf, size_t size) - { - unsigned int ufd = fd; - assert( ufd < gzArraySize ); - return gzwrite(gzHandles[ufd], buf, size); - } - -} // namespace gztar_nonthread - - -tartype_t gztar_ops_nonthread = { - (openfunc_t) gztar_nonthread::open_compressed, - gztar_nonthread::close_compressed, - gztar_nonthread::read_compressed, - gztar_nonthread::write_compressed -}; - - -} // namespace reuse - diff -Nru barry-0.14/gui/src/Thread.cc barry-0.0.20110506/gui/src/Thread.cc --- barry-0.14/gui/src/Thread.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/Thread.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,223 @@ +/// +/// \file Thread.cc +/// Thread class for device manipulation +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2009, Ryan Li (ryan@ryanium.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "Thread.h" +#include "util.h" +#include "i18n.h" + +void Thread::SetStatus(std::string mode) +{ + m_status = mode; + m_update->emit(); +} + +Thread::Thread(Device dev, Glib::Dispatcher *update_signal) + : ConfigFile(dev.GetPIN()) + , m_dev(dev) + , m_interface(&m_dev) + , m_update(update_signal) + , m_status("") + , m_recordFinished(0) + , m_recordTotal(0) + , m_connected(false) + , m_error(false) + , m_thread_state(THREAD_STATE_IDLE) +{ + m_signal_progress.connect( + sigc::mem_fun(*this, &Thread::on_thread_progress)); + m_signal_error.connect( + sigc::mem_fun(*this, &Thread::on_thread_error)); + m_signal_done.connect( + sigc::mem_fun(*this, &Thread::on_thread_done)); + m_signal_erase_db.connect( + sigc::mem_fun(*this, &Thread::on_thread_erase_db)); + m_signal_restored_db.connect( + sigc::mem_fun(*this, &Thread::on_thread_restored_db)); + + SetStatus(_("Ready")); +} + +void Thread::LoadConfig() +{ + ConfigFile::Load(); + if( m_connected ) + Enlighten(m_interface.GetDBDB()); + m_update->emit(); +} + +bool Thread::CheckFinishedMarker() +{ + if( !m_finished_marker ) + return false; + m_finished_marker = false; + return true; +} + +std::string Thread::GetFullname() +{ + std::string ret = GetPIN().Str() + " (" + GetDeviceName() + ")"; + return ret; +} + +bool Thread::Connect() +{ + password_required = false; + bad_size = false; + try { + if( !m_interface.Connect() ) + return (m_connected = false); + } + catch( Barry::BadPassword &bp ) { + password_out_of_tries = bp.out_of_tries(); + password_remaining_tries = bp.remaining_tries(); + password_required = true; + return (m_connected = false); + } + catch( Barry::BadSize &bs ) { + bad_size_error = std::string("Barry::BadSize caught in Connect: ") + bs.what(); + bad_size = true; + return (m_connected = false); + } + SetStatus(_("Connected")); + return (m_connected = true); +} + +bool Thread::Connect(const std::string &password) +{ + try { + if( !m_interface.Password(password.c_str()) ) { + // low level error, not a password failure + return (m_connected = false); + } + } + catch( Barry::BadPassword &bp ) { + password_out_of_tries = bp.out_of_tries(); + password_remaining_tries = bp.remaining_tries(); + bad_password_error = bp.what(); + return (m_connected = false); + } + SetStatus(_("Connected")); + return (m_connected = true); +} + +void Thread::Disconnect() +{ + if( m_connected ) + { + m_interface.Disconnect(); + SetStatus(_("Ready")); + m_connected = false; + } +} + +void Thread::UnsetActive() +{ + m_active = false; + if( !Working() ) + Disconnect(); +} + +bool Thread::Backup(std::string label) +{ + // only start a backup if currently idle + if( Working() ) + return false; + + m_recordTotal = m_interface.GetRecordTotal(GetBackupList()); + m_recordFinished = 0; + + bool started = m_interface.StartBackup( + DeviceInterface::AppComm(&m_signal_progress, + &m_signal_error, + &m_signal_done, + &m_signal_erase_db, + &m_signal_restored_db), + GetBackupList(), GetPath(), label); + if( started ) { + m_thread_state = THREAD_STATE_BACKUP; + SetStatus(_("Backup...")); + } + return started; +} + +bool Thread::Restore(std::string filename) +{ + // only start a restore if currently idle + if( Working() ) + return false; + + m_recordTotal = m_interface.GetRecordTotal(GetRestoreList(), filename); + m_recordFinished = 0; + + bool started = m_interface.StartRestore( + DeviceInterface::AppComm(&m_signal_progress, + &m_signal_error, + &m_signal_done, + &m_signal_erase_db, + &m_signal_restored_db), + GetRestoreList(), filename); + if( started ) { + m_thread_state = THREAD_STATE_RESTORE; + SetStatus(_("Restore...")); + } + return started; +} + +void Thread::on_thread_progress() +{ + ++m_recordFinished; + m_update->emit(); +} + +void Thread::on_thread_error() +{ + m_error = true; + m_thread_state |= THREAD_STATE_IDLE; + + Gtk::MessageDialog msg(m_status + _(" error: ") + m_interface.get_last_thread_error()); + msg.run(); +} + +void Thread::on_thread_done() +{ + if( m_active ) + SetStatus(_("Connected")); + else + Disconnect(); + m_thread_state |= THREAD_STATE_IDLE; + m_finished_marker = true; +} + +void Thread::on_thread_erase_db() +{ + m_erasing_db_name = m_interface.GetThreadDBName(); + std::cerr << _("Erasing database: ") << m_erasing_db_name << std::endl; +} + +void Thread::on_thread_restored_db() +{ + if( m_erasing_db_name.size() ) { + std::cerr << _("Restored database: ") << m_erasing_db_name << std::endl; + m_erasing_db_name.clear(); + } +} + diff -Nru barry-0.14/gui/src/Thread.h barry-0.0.20110506/gui/src/Thread.h --- barry-0.14/gui/src/Thread.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/gui/src/Thread.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,134 @@ +/// +/// \file Thread.h +/// Thread class for device manipulation +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2009, Ryan Li (ryan@ryanium.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYBACKUP_THREAD_H__ +#define __BARRYBACKUP_THREAD_H__ + +#include +#include "DeviceIface.h" + +// bit masks for various thread state +#define THREAD_STATE_IDLE 0x01 // currently idle +#define THREAD_STATE_BACKUP 0x02 // last operation requested + // was backup... if idle bit + // is 0, backup is still going +#define THREAD_STATE_RESTORE 0x04 // last op was restore... same + // as backup + + +class Thread : public Barry::ConfigFile +{ +private: + Glib::Dispatcher m_signal_progress; + Glib::Dispatcher m_signal_error; + Glib::Dispatcher m_signal_done; + Glib::Dispatcher m_signal_erase_db; + Glib::Dispatcher m_signal_restored_db; + + Device m_dev; + DeviceInterface m_interface; + + Glib::Dispatcher *m_update; + + std::string m_status; + + unsigned int m_recordFinished; + unsigned int m_recordTotal; + + // Barry::BadPassword related variables + bool password_out_of_tries; + unsigned int password_remaining_tries; + bool password_required; + std::string bad_password_error; + + // Barry::BadSize related variables + bool bad_size; + std::string bad_size_error; + + // whether the device is active in Gtk::TreeView + bool m_active; + + // marked as true after thread finished, + // and false when the value is retrieved. + bool m_finished_marker; + + // states + bool m_connected; + bool m_error; + unsigned int m_thread_state; + std::string m_erasing_db_name; + +protected: + void SetStatus(std::string); + +public: + Thread(Device, Glib::Dispatcher *); + ~Thread() {} + + std::string LastInterfaceError() { return m_interface.get_last_error(); } + std::string LastConfigError() { return ConfigFile::get_last_error(); } + + const Barry::DatabaseDatabase &GetDBDB() { return m_interface.GetDBDB(); } + + void LoadConfig(); + + Barry::Pin GetPIN() { return m_dev.GetPIN(); } + std::string GetFullname(); + + std::string Status() const { return m_status; } + bool CheckFinishedMarker(); + unsigned int GetRecordFinished() const { return m_recordFinished; } + unsigned int GetRecordTotal() const { return m_recordTotal; } + unsigned int GetThreadState() const { return m_thread_state; } + + void Reset() { m_interface.Reset(); } + bool Connect(); + bool Connect(const std::string &password); + void Disconnect(); + + void SetActive() { m_active = true; } + void UnsetActive(); + + bool Connected() const { return m_connected; } + bool Working() const { return !(m_thread_state & THREAD_STATE_IDLE); } + bool Error() const { return m_error; } + + bool PasswordRequired() const { return password_required; } + bool PasswordOutOfTries() const { return password_out_of_tries; } + unsigned int PasswordRemainingTries() const { return password_remaining_tries; } + std::string BadPasswordError() const { return bad_password_error; } + + bool BadSize() const { return bad_size; } + std::string BadSizeError() const { return bad_size_error; } + + bool Backup(std::string label); + bool Restore(std::string filename); + + void on_thread_progress(); + void on_thread_error(); + void on_thread_done(); + void on_thread_erase_db(); + void on_thread_restored_db(); +}; + +#endif + diff -Nru barry-0.14/gui/src/util.cc barry-0.0.20110506/gui/src/util.cc --- barry-0.14/gui/src/util.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/util.cc 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,8 +20,6 @@ */ #include "util.h" -#include -#include #include #include #include @@ -45,50 +43,3 @@ return Gnome::Glade::Xml::create(filename); } -/// Checks that the path in path exists, and if not, creates it. -/// Returns false if unable to create path, true if ok. -bool CheckPath(const std::string &path, std::string *perr) -{ - if( path.size() == 0 ) { - if( perr ) - *perr = "path is empty!"; - return false; - } - - if( access(path.c_str(), F_OK) == 0 ) - return true; - - std::string base; - std::string::size_type slash = 0; - while( (slash = path.find('/', slash + 1)) != std::string::npos ) { - base = path.substr(0, slash); - if( access(base.c_str(), F_OK) != 0 ) { - if( mkdir(base.c_str(), 0755) == -1 ) { - if( perr ) { - *perr = "mkdir(" + base + ") failed: "; - *perr += strerror(errno); - } - return false; - } - } - } - if( mkdir(path.c_str(), 0755) == -1 ) { - if( perr ) { - *perr = "last mkdir(" + path + ") failed: "; - *perr += strerror(errno); - } - return false; - } - return true; -} - -std::string GetPath(const std::string &filename) -{ - std::string path; - std::string::size_type pos = filename.rfind('/'); - if( pos != std::string::npos ) { - path = filename.substr(0, pos); - } - return path; -} - diff -Nru barry-0.14/gui/src/util.h barry-0.0.20110506/gui/src/util.h --- barry-0.14/gui/src/util.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/src/util.h 2011-05-06 12:20:16.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,8 +26,6 @@ #include Glib::RefPtr LoadXml(const char *filename); -std::string GetPath(const std::string &filename); -bool CheckPath(const std::string &path, std::string *perr = 0); #endif diff -Nru barry-0.14/gui/TODO barry-0.0.20110506/gui/TODO --- barry-0.14/gui/TODO 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/gui/TODO 2011-05-06 12:20:16.000000000 +0000 @@ -23,7 +23,7 @@ Save... file chooser box in that directory. If there are '/' chars in the filename, attempt to chdir() there and open Save... file chooser there. -- add option in config dialog to set a different default backup ++ add option in config dialog to set a different default backup directory instead of ~/.barry/backup// - add code to detect when user is trying to quit or close window with X while a backup/restore is still running and give them the diff -Nru barry-0.14/hal/fdi/information/10freedesktop/10-blackberry.fdi barry-0.0.20110506/hal/fdi/information/10freedesktop/10-blackberry.fdi --- barry-0.14/hal/fdi/information/10freedesktop/10-blackberry.fdi 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/hal/fdi/information/10freedesktop/10-blackberry.fdi 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,36 @@ + + + + + + + + + sync + Blackberry Data Provider + phone + rim-blackberry + + hal-blackberry + + + + + + sync + Blackberry Data Provider + phone + rim-blackberry + + hal-blackberry + + + + + + + diff -Nru barry-0.14/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi barry-0.0.20110506/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi --- barry-0.14/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,17 @@ + + + + + + + + + access_control + linux.device_file + pda + + + + + + diff -Nru barry-0.14/hal/hal-blackberry barry-0.0.20110506/hal/hal-blackberry --- barry-0.14/hal/hal-blackberry 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/hal/hal-blackberry 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,43 @@ +#!/usr/bin/python + +import sys, os +import dbus, dbus.glib +import commands + +class HalBlackberry: + def __init__(self): + self._dbus = dbus.SystemBus() + self._serv = self._dbus.get_object( 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager' ) + self._hal = dbus.Interface( self._serv, 'org.freedesktop.Hal.Manager' ) + self._device = None + self.get_properties() + self.gatherInfo() + + def get_properties(self): + self.udi = os.getenv("UDI", "") + self.busnum = self.get_property( 'usb.bus_number' ) + self.devnum = self.get_property( 'usb.linux.device_number' ) + + def get_property(self, name): + return self.device().GetProperty(name, dbus_interface="org.freedesktop.Hal.Device") + + def gatherInfo(self): + text = commands.getoutput("/usr/bin/bidentify -B %i -N %i" % (self.busnum, self.devnum)) + sys.stderr.write("Found '%s' at %s, %s\n" % (text, self.busnum, self.devnum)) + b = text.split(", ") + desc = b[1] + pin = b[0] + + self.set_property("sync.serial", pin) + self.set_property("info.product", desc) + + def set_property(self, name, value): + return self.device().SetPropertyString(name, value, dbus_interface="org.freedesktop.Hal.Device") + + def device(self): + if not self._device: + self._device = self._dbus.get_object("org.freedesktop.Hal", self.udi) + return self._device + +h = HalBlackberry() + diff -Nru barry-0.14/install-sh barry-0.0.20110506/install-sh --- barry-0.14/install-sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/install-sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,323 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2005-05-14.22 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# 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 -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru barry-0.14/libbarryalx-0.pc.in barry-0.0.20110506/libbarryalx-0.pc.in --- barry-0.14/libbarryalx-0.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/libbarryalx-0.pc.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Barry +Description: C++ library for using the BlackBerry ALX parser +URL: http://sourceforge.net/projects/barry +Version: @VERSION@ +Libs: -L${libdir} -lbarryalx +Cflags: -I${includedir} + diff -Nru barry-0.14/libbarrybackup-0.pc.in barry-0.0.20110506/libbarrybackup-0.pc.in --- barry-0.14/libbarrybackup-0.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/libbarrybackup-0.pc.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Barry +Description: C++ library for reading and writing Barry backup files +URL: http://sourceforge.net/projects/barry +Version: @VERSION@ +Requires: libbarry-0 +Libs: -L${libdir} -lbarrybackup +Cflags: -I${includedir} + diff -Nru barry-0.14/libbarrydp-0.pc.in barry-0.0.20110506/libbarrydp-0.pc.in --- barry-0.14/libbarrydp-0.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/libbarrydp-0.pc.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Barry +Description: C++ library for .debug parsing +URL: http://sourceforge.net/projects/barry +Version: @VERSION@ +Libs: -L${libdir} -lbarrydp +Cflags: -I${includedir} + diff -Nru barry-0.14/libbarryjdwp-0.pc.in barry-0.0.20110506/libbarryjdwp-0.pc.in --- barry-0.14/libbarryjdwp-0.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/libbarryjdwp-0.pc.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Barry +Description: C++ library for using the BlackBerry Java debugger +URL: http://sourceforge.net/projects/barry +Version: @VERSION@ +Requires: libbarrydp-0 +Libs: -L${libdir} -lbarryjdwp +Cflags: -I${includedir} + diff -Nru barry-0.14/libbarrysync-0.pc.in barry-0.0.20110506/libbarrysync-0.pc.in --- barry-0.14/libbarrysync-0.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/libbarrysync-0.pc.in 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Barry +Description: C++ library for sync and vformat parsing +URL: http://sourceforge.net/projects/barry +Version: @VERSION@ +Requires: glib-2.0 libbarry-0 +Libs: -L${libdir} -lbarrysync +Cflags: -I${includedir} + Binary files /tmp/hrabAk_zAl/barry-0.14/logo/barry_logo_icon.png and /tmp/ehd5lCCenv/barry-0.0.20110506/logo/barry_logo_icon.png differ diff -Nru barry-0.14/logo/barry_logo_icon.svg barry-0.0.20110506/logo/barry_logo_icon.svg --- barry-0.14/logo/barry_logo_icon.svg 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/logo/barry_logo_icon.svg 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,906 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru barry-0.14/logo/barry_logo.svg barry-0.0.20110506/logo/barry_logo.svg --- barry-0.14/logo/barry_logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/logo/barry_logo.svg 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,977 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + Barry + Barry + + + Open SourceMobile Access + Open SourceMobile Access + + + netdirect.ca/barry + netdirect.ca/barry + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru barry-0.14/logo/new_barry_icon_128.svg barry-0.0.20110506/logo/new_barry_icon_128.svg --- barry-0.14/logo/new_barry_icon_128.svg 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/logo/new_barry_icon_128.svg 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,862 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru barry-0.14/logo/README barry-0.0.20110506/logo/README --- barry-0.14/logo/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/logo/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,13 @@ +These logos were originally designed by Martin Owens +and made available at the following URL: + + http://doctormo.deviantart.com/art/Barry-Project-Branding-127863514 + +for the Barry project, under the Creative Commons BY-SA license. +The license can be found here: + + http://creativecommons.org/licenses/by-sa/3.0/ + +The logo #1 available at the above site is not included here, since it +uses the trademarked term "Blackberry" owned by RIM. + diff -Nru barry-0.14/ltmain.sh barry-0.0.20110506/ltmain.sh --- barry-0.14/ltmain.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,6871 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -basename="s,^.*/,,g" - -# 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" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="1.5.22 Debian 1.5.22-4" -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# 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 - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# 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 "$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" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# 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. -func_win32_libid () -{ - 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 - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $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_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 () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # 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. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # 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 - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - 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 - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - 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 have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --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 $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# 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= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # 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= - - 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) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$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,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$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. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # 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 - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - 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 "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - 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 $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "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." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </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." - - $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 - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </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." - - $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 - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - fi - 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 - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$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 - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - 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 - dlfiles="$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. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$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 - non_pic_objects="$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" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - 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 - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - 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 - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - 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*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$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*) - # 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 - deplibs="$deplibs -framework System" - 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 - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - 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*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # 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 - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - 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 - dlfiles="$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. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$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 - non_pic_objects="$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" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - 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. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'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\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - 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 test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$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 test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$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 - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - 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 - 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 "$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) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; 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 (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - 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 - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - 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 - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - 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 - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - 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 used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - 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. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # 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 - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$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 - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - 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. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$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 - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$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 - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - 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 - newlib_search_path="$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*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - 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 test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$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 -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 - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$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 - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if 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 "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; 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*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - 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 "$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 module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; 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 - 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; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$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 - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$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:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; 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:"*) ;; - *) finalize_shlibpath="$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 - [\\/]*) - add_dir="$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*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$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" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - 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 "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - 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 "*) ;; - *) lib_search_path="$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 "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$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 - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - 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 - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # 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="$2" - number_minor="$3" - number_revision="$4" - # - # 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 - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - 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]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - 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]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - 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]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - 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 - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - 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 - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - 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 - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - 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 - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$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) - ;; - $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 - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e "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 - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$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 "*) ;; - *) dlfiles="$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 "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-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 - deplibs="$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. - $rm conftest.c - cat > conftest.c </dev/null` - 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 "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$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 - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$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 - newdeplibs="$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 - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e '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 "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $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 - fi - ;; - 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 is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - 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 - - - # 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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$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 - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$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 - 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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$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" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$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 "$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 - realname="$2" - shift; 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 - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "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"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $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:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # 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 - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$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. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - 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~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "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" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - 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\" - 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 - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(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 "$mode" = relink; then - $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 - $show "${rm}r $gentop" - $run ${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 - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run 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 "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $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 - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${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" - # $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" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - 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 "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$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 "*) ;; - *) finalize_rpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$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"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$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 "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # 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/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - 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*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - else - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - 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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - 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 - rpath="$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 - rpath="$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 "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - 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" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e '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 "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "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}\" || 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 - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - 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 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#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 -# 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 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -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; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - 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 ("getcwd failed"); - 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 ("getcwd failed"); - 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 * -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; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# 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. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# 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 variable: - 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 - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e '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 \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - 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 >> $output "\ - - # 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 $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - 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 $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - 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" - 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" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$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 - # 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 - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_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 - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$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= - 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 - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "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}\" || 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 - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - 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) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# 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' - -# Libraries that this one depends upon. -dependency_libs='$dependency_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 - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # 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. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - 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. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$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 "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. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - 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 - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run 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 - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$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 - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run 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 - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - 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 - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo 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. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo 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. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "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) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $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" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - 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 - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # 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 - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - 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) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - 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 (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$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 - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [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 - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -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. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [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: $modename [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 - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -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: $modename [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: $modename [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: $modename [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 rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [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 - -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 - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -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: $modename [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." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# 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 -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff -Nru barry-0.14/m4/ax_c_check_flag.m4 barry-0.0.20110506/m4/ax_c_check_flag.m4 --- barry-0.14/m4/ax_c_check_flag.m4 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/m4/ax_c_check_flag.m4 2011-05-06 12:20:16.000000000 +0000 @@ -34,8 +34,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # As a special exception, the respective Autoconf Macro's copyright # owner gives unlimited permission to copy, distribute and modify the diff -Nru barry-0.14/m4/ax_cxx_check_flag.m4 barry-0.0.20110506/m4/ax_cxx_check_flag.m4 --- barry-0.14/m4/ax_cxx_check_flag.m4 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/m4/ax_cxx_check_flag.m4 2011-05-06 12:20:16.000000000 +0000 @@ -34,8 +34,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # # As a special exception, the respective Autoconf Macro's copyright # owner gives unlimited permission to copy, distribute and modify the diff -Nru barry-0.14/m4/pkg.m4 barry-0.0.20110506/m4/pkg.m4 --- barry-0.14/m4/pkg.m4 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/m4/pkg.m4 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,157 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# 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. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[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. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff -Nru barry-0.14/maintainer/abi/0.16.xml barry-0.0.20110506/maintainer/abi/0.16.xml --- barry-0.14/maintainer/abi/0.16.xml 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/abi/0.16.xml 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,12 @@ + + 0.16 + + + + /tmp/0.16/rootdir/include + + + + /tmp/0.16/rootdir/lib/libbarry.so + + diff -Nru barry-0.14/maintainer/abi/0.17.0.xml barry-0.0.20110506/maintainer/abi/0.17.0.xml --- barry-0.14/maintainer/abi/0.17.0.xml 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/abi/0.17.0.xml 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,16 @@ + + 0.17.0 + + + + /tmp/0.17.0/rootdir/include + + + + /tmp/0.17.0/rootdir/lib/libbarry.so + /tmp/0.17.0/rootdir/lib/libbarrydp.so + /tmp/0.17.0/rootdir/lib/libbarryjdwp.so + /tmp/0.17.0/rootdir/lib/libbarrysync.so + /tmp/0.17.0/rootdir/lib/libbarrybackup.so + + diff -Nru barry-0.14/maintainer/abi/abi-prepare.sh barry-0.0.20110506/maintainer/abi/abi-prepare.sh --- barry-0.14/maintainer/abi/abi-prepare.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/abi/abi-prepare.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,36 @@ +#!/bin/sh + +fullpath() { + cd "$(dirname "$1")" + echo "$(pwd)/$(basename "$1")" +} + +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then + echo "Usage: abi-prepare.sh tarball abi.xml configure.sh" + exit 1 +fi + +TARBALL="$1" +XML="$2" +CONFIG="$3" +VERSION="$(grep -A 1 '' "$XML" | grep -v version | sed "s/^[ ]//")" + +FULLXML="$(fullpath "$XML")" +FULLCONFIG="$(fullpath "$CONFIG")" + +# enable errors +set -e + +# create target playspace +echo "Creating source tree..." +mkdir "/tmp/$VERSION" # make sure it doesn't already exist +mkdir -p "/tmp/$VERSION/rootdir" +tar -C "/tmp/$VERSION" -xjf "$TARBALL" + +# build and install +echo "Installing to: /tmp/$VERSION/rootdir..." +cd "/tmp/$VERSION/barry-$VERSION" +"$FULLCONFIG" --prefix="/tmp/$VERSION/rootdir" +make -j2 +make install + diff -Nru barry-0.14/maintainer/abi/configure-lib.sh barry-0.0.20110506/maintainer/abi/configure-lib.sh --- barry-0.14/maintainer/abi/configure-lib.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/abi/configure-lib.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,10 @@ +#!/bin/sh + +# +# accepts a parameter for --prefix +# + +export CXXFLAGS="-Wall -Werror -O0 -g" + +./configure --enable-boost --enable-nls --with-zlib "$1" + diff -Nru barry-0.14/maintainer/abi/README barry-0.0.20110506/maintainer/abi/README --- barry-0.14/maintainer/abi/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/abi/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,23 @@ +This directory contains support files for ABI compatibility checking +using the tool found at: + + http://ispras.linuxfoundation.org/index.php/ABI_compliance_checker + +There are two scritps: + + abi-prepare.sh - takes a Barry tarball, extracts it into /tmp + and builds and installs it + configure-lib.sh - support script used by abi-prepare.sh + +For example, to prepare version 0.16 and 0.17.0 for comparison, run: + + ./abi-prepare.sh barry-0.16.tar.bz2 0.16.xml ./configure-lib.sh + ./abi-prepare.sh barry-0.17.0.tar.bz2 0.17.0.xml ./configure-lib.sh + +To compare, run: + + abi-compliance-checker.pl -l barry -d1 0.16.xml -d2 0.17.0.xml + +Note that there are other libraries in Barry that may also need to be +checked: libbarry, libbarrydp, libbarryjdwp, libbarrybackup, etc. + diff -Nru barry-0.14/maintainer/barrychroots barry-0.0.20110506/maintainer/barrychroots --- barry-0.14/maintainer/barrychroots 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/barrychroots 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,28 @@ +# +# The user account on the chroot system to build in +# +export CHROOTUSER=cdfrey + +# +# Build the DEB's +# +# ./deb.sh +# +./deb.sh /var/chroot/ubuntu1004 ubuntu1004 "binary os22-binary" +./deb.sh /var/chroot/ubuntu804 ubuntu804 "binary os22-binary" + + +# +# Build the Fedora RPM's +# +# ./rpm.sh +# +./rpm.sh /var/chroot/fedora14 f14 +./rpm.sh /var/chroot/fedora13 f13 +./rpm.sh /var/chroot/fedora12 f12 +./rpm.sh /var/chroot/fedora11 f11 +#if [ "$THEMODE" = "release" ] ; then +# # Fedora 9 has no opensync, so don't test-build on it, only release +# ./rpmroot.sh /var/chroot/fedora9 fc9 +#fi + diff -Nru barry-0.14/maintainer/barrylocal barry-0.0.20110506/maintainer/barrylocal --- barry-0.14/maintainer/barrylocal 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/barrylocal 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,12 @@ +# +# The user account on the chroot system to build in +# +export CHROOTUSER=cdfrey + +# +# Build the local DEB's +# +# ./deblocal.sh +# +./deblocal.sh debian "binary os22-binary" + diff -Nru barry-0.14/maintainer/deblocal.sh barry-0.0.20110506/maintainer/deblocal.sh --- barry-0.14/maintainer/deblocal.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/deblocal.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$BARRYTARBALL" ] ; then + echo + echo "Do not call deblocal.sh directly. Call release.sh instead." + echo + exit 1 +fi + +TAG="$1" +DEBTARGETS="$2" + +if [ "$THEMODE" = "release" ] ; then + ./make-deb-local.sh "$BARRYTARBALL" "$TAG" "$DEBTARGETS" +elif [ "$THEMODE" = "test" ] ; then + ./test-build-local.sh "$BARRYTARBALL" +else + echo + echo "Mode not set. Call release.sh or test.sh instead." + echo + exit 1 +fi + diff -Nru barry-0.14/maintainer/deb.sh barry-0.0.20110506/maintainer/deb.sh --- barry-0.14/maintainer/deb.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/deb.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$BARRYTARBALL" ] ; then + echo + echo "Do not call deb.sh directly. Call release.sh instead." + echo + exit 1 +fi + +CHROOTTARGET="$1" +TAG="$2" +DEBTARGETS="$3" + +if [ "$THEMODE" = "release" ] ; then + ./make-deb.sh "$BARRYTARBALL" "$CHROOTTARGET" "$TAG" "$DEBTARGETS" +elif [ "$THEMODE" = "test" ] ; then + ./test-build.sh "$BARRYTARBALL" "$CHROOTTARGET" +else + echo + echo "Mode not set. Call release.sh or test.sh instead." + echo + exit 1 +fi + diff -Nru barry-0.14/maintainer/deb-src-create.sh barry-0.0.20110506/maintainer/deb-src-create.sh --- barry-0.14/maintainer/deb-src-create.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/deb-src-create.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,35 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then + echo + echo "Usage: ./deb-src-create.sh LOGICAL MAJOR MINOR" + echo + echo "LOGICAL is the desired logical version number" + echo "MAJOR is the desired libmajor version number" + echo "MINOR is the desired libminor version number" + echo + echo "This script expects a barry-\$LOGICAL.\$MAJOR.\$MINOR directory" + echo "to exist in the directory it is run in." + echo + exit 1 +fi + +DIRNAME="barry-$1.$2.$3" +LOGICAL="$1" +MAJOR="$2" +MINOR="$3" + +set -e + +# Create Debian source package, by creating a patched and "orig" set of trees. +# +# The following dance is to keep the .orig.tar.gz containing barry-0.17.0/ +# as the directory, and not something like barry-0.17.0.orig/ which gets +# corrected by Debian tools. If there is a better way, please send a patch. +cp -a $DIRNAME $DIRNAME.patched +rm -rf $DIRNAME/debian +tar -cf - $DIRNAME | gzip -9c > barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz +rm -rf $DIRNAME +mv $DIRNAME.patched $DIRNAME +dpkg-source -b $DIRNAME barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz + diff -Nru barry-0.14/maintainer/depscripts/fedora14.sh barry-0.0.20110506/maintainer/depscripts/fedora14.sh --- barry-0.14/maintainer/depscripts/fedora14.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/depscripts/fedora14.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,28 @@ +yum install \ + git \ + pkgconfig \ + rpmdevtools \ + rpm-build \ + desktop-file-utils \ + autoconf \ + automake \ + libtool \ + gcc-c++ \ + make \ + libusb-devel \ + boost-devel \ + boost-serialization \ + libtar-devel \ + gtkmm24-devel \ + glibmm24-devel \ + libglademm24-devel \ + fuse-devel \ + libxml++-devel \ + zlib-devel \ + gettext-devel \ + ccache \ + doxygen \ + wxGTK-devel \ + libgcal-devel \ + libopensync-devel + diff -Nru barry-0.14/maintainer/depscripts/ubuntu-maverick.sh barry-0.0.20110506/maintainer/depscripts/ubuntu-maverick.sh --- barry-0.14/maintainer/depscripts/ubuntu-maverick.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/depscripts/ubuntu-maverick.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,28 @@ +apt-get install \ + git \ + pkg-config \ + fakeroot \ + cdbs \ + autoconf \ + automake \ + libtool \ + libusb-dev \ + libboost-serialization-dev \ + libtar-dev \ + libgtkmm-2.4-dev \ + libglibmm-2.4-dev \ + libglademm-2.4-dev \ + libfuse-dev \ + libxml++2.6-dev \ + libwxgtk2.8-dev \ + wx-common \ + libgcal-dev \ + zlib1g-dev \ + gettext \ + ccache \ + doxygen \ + autopoint \ + php5-cli + +# depending on the system: libopensync0-dev + diff -Nru barry-0.14/maintainer/git-extract.sh barry-0.0.20110506/maintainer/git-extract.sh --- barry-0.14/maintainer/git-extract.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/git-extract.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,11 +1,12 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then echo - echo "Usage: ./git-extract.sh MAJOR MINOR commit" + echo "Usage: ./git-extract.sh LOGICAL MAJOR MINOR commit" echo - echo "MAJOR is the desired major version number" - echo "MINOR is the desired minor version number" + echo "LOGICAL is the desired logical version number" + echo "MAJOR is the desired libmajor version number" + echo "MINOR is the desired libminor version number" echo "commit is a git commit tag to use for the extraction" echo echo "A build directory, containing the packaged results," @@ -25,10 +26,11 @@ exit 1 fi -DIRNAME="barry-$1.$2" -MAJOR="$1" -MINOR="$2" -COMMIT="$3" +DIRNAME="barry-$1.$2.$3" +LOGICAL="$1" +MAJOR="$2" +MINOR="$3" +COMMIT="$4" RUNDIR="$(dirname "$0")/.." set -e diff -Nru barry-0.14/maintainer/git-release-tar.sh barry-0.0.20110506/maintainer/git-release-tar.sh --- barry-0.14/maintainer/git-release-tar.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/git-release-tar.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,11 +1,12 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then echo - echo "Usage: ./git-release-tar.sh MAJOR MINOR commit" + echo "Usage: ./git-release-tar.sh LOGICAL MAJOR MINOR commit" echo - echo "MAJOR is the desired major version number" - echo "MINOR is the desired minor version number" + echo "LOGICAL is the desired logical version number" + echo "MAJOR is the desired libmajor version number" + echo "MINOR is the desired libminor version number" echo "commit is a git commit tag to use for the extraction" echo echo "A build directory, containing the packaged results," @@ -25,16 +26,18 @@ exit 1 fi -DIRNAME="barry-$1.$2" -TAGNAME="barry-$1_$2" -MAJOR="$1" -MINOR="$2" -COMMIT="$3" +DIRNAME="barry-$1.$2.$3" +TAGNAME="barry-$1_$2_$3" +LOGICAL="$1" +MAJOR="$2" +MINOR="$3" +COMMIT="$4" RUNDIR="$(cd "$(dirname "$0")" && pwd)" set -e -"$RUNDIR/git-extract.sh" $MAJOR $MINOR $COMMIT +"$RUNDIR/git-extract.sh" $LOGICAL $MAJOR $MINOR $COMMIT (cd build/$DIRNAME && "$RUNDIR/tar-prepare.sh") -(cd build && "$RUNDIR/tar-create.sh" $MAJOR $MINOR) +(cd build && "$RUNDIR/tar-create.sh" $LOGICAL $MAJOR $MINOR) +(cd build && "$RUNDIR/deb-src-create.sh" $LOGICAL $MAJOR $MINOR) diff -Nru barry-0.14/maintainer/git-tagged-release.sh barry-0.0.20110506/maintainer/git-tagged-release.sh --- barry-0.14/maintainer/git-tagged-release.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/git-tagged-release.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,22 +1,23 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo - echo "Usage: ./git-tagged-tar.sh MAJOR MINOR" + echo "Usage: ./git-tagged-tar.sh LOGICAL MAJOR MINOR" echo - echo "MAJOR is the desired major version number" - echo "MINOR is the desired minor version number" + echo "LOGICAL is the desired logical version number" + echo "MAJOR is the desired libmajor version number" + echo "MINOR is the desired libminor version number" echo echo "This script is an alternative to git-release-tar.sh, and" echo "produces the same output, with the additional side effect of" echo "having 2 pristine tar deltas available to generate the" echo "debian and the tar.bz2 tarballs directly from the repository." echo - echo "This script assumes that a tag called 'barry-MAJOR.MINOR' already" + echo "This script assumes that a tag called 'barry-LOGICAL.MAJOR.MINOR' already" echo "exists. This script will create two more tags:" echo - echo " barry-MAJOR.MINOR.tar.bz2" - echo " barry_MAJOR.MINOR.orig.tar.gz" + echo " barry-LOGICAL.MAJOR.MINOR.tar.bz2" + echo " barry_LOGICAL.MAJOR.MINOR.orig.tar.gz" echo echo "Both tags will contain trees with the same contents as the" echo "tarballs of the same name." @@ -29,16 +30,17 @@ echo "git repository you wish to use." echo echo "Example: cd barry-repo" - echo " git tag barry-0.14" - echo " maintainer/git-tagged-tar.sh 0 14" + echo " git tag barry-0.17.0" + echo " maintainer/git-tagged-tar.sh 0 17 0" echo exit 1 fi -DIRNAME="barry-$1.$2" -MAJOR="$1" -MINOR="$2" -COMMIT="barry-$1.$2" +DIRNAME="barry-$1.$2.$3" +LOGICAL="$1" +MAJOR="$2" +MINOR="$3" +COMMIT="barry-$1.$2.$3" # make sure that git has its tar.umask set to 0022 GITUMASK=$(git config tar.umask) @@ -68,31 +70,31 @@ git checkout -b git-tagged-tar "$COMMIT" maintainer/tar-prepare.sh git add . -git commit -m "Tarball tree for barry-$MAJOR.$MINOR.tar.bz2" -git tag "barry-$MAJOR.$MINOR.tar.bz2" +git commit -m "Tarball tree for barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" +git tag -s "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" git rm -r debian -git commit -m "Tarball tree for barry_$MAJOR.$MINOR.orig.tar.gz" -git tag "barry_$MAJOR.$MINOR.orig.tar.gz" +git commit -m "Tarball tree for barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" +git tag -s "barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" # generate bzip2 tarball -git archive --prefix="$DIRNAME/" "barry-$MAJOR.$MINOR.tar.bz2" | \ - bzip2 -9c > "maintainer/build/barry-$MAJOR.$MINOR.tar.bz2" +git archive --prefix="$DIRNAME/" "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" | \ + bzip2 -9c > "maintainer/build/barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" # generate debian source package... create tar.gz without debian/, and # a tree with debian, and then run dpkg-source to bundle it up -git archive --prefix="$DIRNAME/" "barry_$MAJOR.$MINOR.orig.tar.gz" | \ - gzip -9c > "maintainer/build/barry_$MAJOR.$MINOR.orig.tar.gz" -git archive --prefix="$DIRNAME/" "barry-$MAJOR.$MINOR.tar.bz2" | \ +git archive --prefix="$DIRNAME/" "barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" | \ + gzip -9c > "maintainer/build/barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" +git archive --prefix="$DIRNAME/" "barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" | \ (cd maintainer/build && tar xf -) -(cd maintainer/build && dpkg-source -b $DIRNAME barry_$MAJOR.$MINOR.orig.tar.gz) +(cd maintainer/build && dpkg-source -b $DIRNAME barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz) # finally, generate pristine-tar deltas -pristine-tar -m "Release tarball barry-$MAJOR.$MINOR.tar.bz2" commit \ - maintainer/build/barry-$MAJOR.$MINOR.tar.bz2 \ - barry-$MAJOR.$MINOR.tar.bz2 -pristine-tar -m "Release tarball barry_$MAJOR.$MINOR.orig.tar.gz" commit \ - maintainer/build/barry_$MAJOR.$MINOR.orig.tar.gz \ - barry_$MAJOR.$MINOR.orig.tar.gz +pristine-tar -m "Release tarball barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2" commit \ + maintainer/build/barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2 \ + barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2 +pristine-tar -m "Release tarball barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz" commit \ + maintainer/build/barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz \ + barry_$LOGICAL.$MAJOR.$MINOR.orig.tar.gz # cleanup git checkout master diff -Nru barry-0.14/maintainer/make-deb-local.sh barry-0.0.20110506/maintainer/make-deb-local.sh --- barry-0.14/maintainer/make-deb-local.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/make-deb-local.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,14 +1,14 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo - echo "Usage: ./make-deb-local-root.sh tarball MAJOR MINOR target_name" + echo "Usage: ./make-deb-local-root.sh tarball tag targets" echo echo "Extracts tarball in temporary directory and builds Debian" echo "packages based on the internal debian scripts. Assumes" echo "that it is running on a development Debian system." echo - echo "target_name is the directory under build/ that the .deb" + echo "tag is the directory under build/ that the .deb" echo "files will be placed into." echo exit 1 @@ -16,17 +16,29 @@ TARPATH="$1" TARNAME=`basename "$TARPATH"` -MAJOR="$2" -MINOR="$3" -TARGET="$4" +TAG="$2" +DEBTARGETS="$3" + +BUILDDIR="/usr/src/barry-build" set -e # Build package in /usr/src so that the dbg packages refer to the source # code in a user-friendly place. -tar -C /usr/src -xjvf "$TARPATH" -(cd "/usr/src/barry-$MAJOR.$MINOR" && fakeroot -- debian/rules binary) -mkdir "build/$TARGET" -mv /usr/src/*barry*deb "build/$TARGET" -rm -rf "/usr/src/barry-$MAJOR.$MINOR" + +# start clean +rm -rf "$BUILDDIR" +mkdir "$BUILDDIR" + +# extract from tarball +tar -C "$BUILDDIR" -xjvf "$TARPATH" + +# build base debs +(cd "$BUILDDIR"/barry* && fakeroot -- debian/rules $DEBTARGETS) +mkdir -p "build/$TAG" +mv "$BUILDDIR"/*barry*deb "build/$TAG" +mv "$BUILDDIR"/barry*/*.deb "build/$TAG" || echo "No plugin packages found" + +# end clean +rm -rf "$BUILDDIR" diff -Nru barry-0.14/maintainer/make-deb.sh barry-0.0.20110506/maintainer/make-deb.sh --- barry-0.14/maintainer/make-deb.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/make-deb.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,12 +1,8 @@ #!/bin/sh -CHROOT="/var/chroot" -CHOWNUSER="cdfrey:cdfrey" -CHROOTUSER="cdfrey" - -if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$CHROOTUSER" -o -z "$CHOWNUSER" ] ; then echo - echo "Usage: ./make-rpm.sh tarball chroot_target short_form" + echo "Usage: ./make-rpm.sh tarball chroot_target short_form [deb_targets]" echo echo "Copies the tarball to the chroot target's /home/$CHROOTUSER/binarybuild dir," echo "then enters the chroot system and runs the build." @@ -14,8 +10,11 @@ echo "short_form is the tag to rename the resulting DEB's with," echo "such as ubuntu710, etc." echo - echo "Available chroot targets:" - find $CHROOT -maxdepth 1 -type d -print | sed "s/^.*\// /" + echo "deb_targets is a set of additional debian/rules makefile targets" + echo "that you wish to build on this round, such as os22-binary or" + echo "os4x-binary." + echo + echo "Expects CHROOTUSER to be set appropriately in the environment." echo exit 1 fi @@ -24,25 +23,32 @@ TARNAME=`basename "$TARPATH"` TARGET="$2" TAG="$3" +DEBTARGETS="$4" set -e -cp "$TARPATH" "$CHROOT/$TARGET/home/$CHROOTUSER" +cp "$TARPATH" "$TARGET/home/$CHROOTUSER" -chroot "$CHROOT/$TARGET" su - "$CHROOTUSER" -c /bin/sh -lc "rm -rf binarybuild && mkdir binarybuild && cd binarybuild && tar xjvf ../$TARNAME && cd * && fakeroot -- debian/rules binary" +chroot "$TARGET" su - "$CHROOTUSER" -c /bin/sh -lc "rm -rf binarybuild && mkdir binarybuild && cd binarybuild && tar xjvf ../$TARNAME && cd * && fakeroot -- debian/rules $DEBTARGETS" -mkdir -p "build/$TARGET" -cp "$CHROOT/$TARGET/home/$CHROOTUSER/binarybuild/"*.deb "build/$TARGET" -rm "$CHROOT/$TARGET/home/$CHROOTUSER/$TARNAME" +mkdir -p "build/$TAG" +cp "$TARGET/home/$CHROOTUSER/binarybuild/"*.deb "build/$TAG" +# this may fail, if no sub debtargets are set, so avoid set -e issues +if cp "$TARGET/home/$CHROOTUSER/binarybuild/"barry*/*.deb "build/$TAG" ; then + echo "make-deb.sh: Copied subtarget packages" +else + echo "make-deb.sh: No subtarget packages available" +fi +rm "$TARGET/home/$CHROOTUSER/$TARNAME" # We do this manually in a for loop, since the rename command is # not the same across various linux distros... ( - cd "build/$TARGET" + cd "build/$TAG" for f in *_i386.deb ; do mv "$f" "$(echo $f | sed "s/_i386.deb$/_${TAG}_i386.deb/")" done ) -chown -R $CHOWNUSER "build/$TARGET" +chown -R "$CHOWNUSER" "build/$TAG" diff -Nru barry-0.14/maintainer/make-rpm.sh barry-0.0.20110506/maintainer/make-rpm.sh --- barry-0.14/maintainer/make-rpm.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/make-rpm.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,6 @@ #!/bin/sh -CHROOT="/var/chroot" -CHOWNUSER="cdfrey:cdfrey" - -if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$CHROOTUSER" -o -z "$CHOWNUSER" ] ; then echo echo "Usage: ./make-rpm.sh tarball specfile chroot_target short_form" echo @@ -14,8 +11,7 @@ echo "short_form is the tag to rename the resulting RPM's with," echo "such as fc5 or fc6." echo - echo "Available chroot targets:" - find $CHROOT -maxdepth 1 -type d -print | sed "s/^.*\// /" + echo "Expects CHROOTUSER to be set appropriately in the environment." echo exit 1 fi @@ -28,17 +24,17 @@ set -e -cp "$TARPATH" "$CHROOT/$TARGET/usr/src/redhat/SOURCES" -cp "$SPECPATH" "$CHROOT/$TARGET/usr/src/redhat/SPECS/barry.spec" -chroot "$CHROOT/$TARGET" /bin/sh -lc "rm -f /usr/src/redhat/RPMS/i386/* /usr/src/redhat/SRPMS/* && cd /usr/src/redhat/SPECS && rpmbuild --target i386 -ba barry.spec --with gui --with opensync && cd /usr/src/redhat/RPMS/i386" -mkdir -p "build/$TARGET" -cp "$CHROOT/$TARGET/usr/src/redhat/RPMS/i386/"* "build/$TARGET" -cp "$CHROOT/$TARGET/usr/src/redhat/SRPMS/"* "build/$TARGET" +cp "$TARPATH" "$TARGET/usr/src/redhat/SOURCES" +cp "$SPECPATH" "$TARGET/usr/src/redhat/SPECS/barry.spec" +chroot "$TARGET" /bin/sh -lc "rm -f /usr/src/redhat/RPMS/i386/* /usr/src/redhat/SRPMS/* && cd /usr/src/redhat/SPECS && rpmbuild --target i386 -ba barry.spec --with gui --with opensync && cd /usr/src/redhat/RPMS/i386" +mkdir -p "build/$TAG" +cp "$TARGET/usr/src/redhat/RPMS/i386/"* "build/$TAG" +cp "$TARGET/usr/src/redhat/SRPMS/"* "build/$TAG" # We do this manually in a for loop, since the rename command is # not the same across various linux distros... ( - cd "build/$TARGET" + cd "build/$TAG" for f in *.src.rpm ; do mv "$f" "$(echo $f | sed "s/.src.rpm$/.$TAG.src.rpm/")" done @@ -47,5 +43,5 @@ done ) -chown -R $CHOWNUSER "build/$TARGET" +chown -R "$CHOWNUSER" "build/$TAG" diff -Nru barry-0.14/maintainer/make-user-rpm.sh barry-0.0.20110506/maintainer/make-user-rpm.sh --- barry-0.14/maintainer/make-user-rpm.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/make-user-rpm.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$CHROOTUSER" -o -z "$CHOWNUSER" ] ; then + echo + echo "Usage: ./make-rpm.sh tarball specfile chroot_target short_form" + echo + echo "Copies the tarball to the chroot target's user rpmbuild SOURCES dir, and" + echo "the spec file to SPEC dir, then enters the chroot system" + echo "and runs rpmbuild as the default user." + echo + echo "short_form is the tag to rename the resulting RPM's with," + echo "such as fc5 or fc6." + echo + echo "Expects CHROOTUSER to be set appropriately in the environment." + echo + exit 1 +fi + +TARPATH="$1" +SPECPATH="$2" +TARNAME=`basename "$TARPATH"` +TARGET="$3" +TAG="$4" + +set -e + +cp "$TARPATH" "$TARGET/home/$CHROOTUSER/rpmbuild/SOURCES" +cp "$SPECPATH" "$TARGET/home/$CHROOTUSER/rpmbuild/SPECS/barry.spec" +USERCMD="rm -f /home/$CHROOTUSER/rpmbuild/RPMS/i386/* /home/$CHROOTUSER/rpmbuild/SRPMS/* && cd /home/$CHROOTUSER/rpmbuild/SPECS && rpmbuild --target i386 -ba barry.spec --with gui --with opensync && cd /home/$CHROOTUSER/rpmbuild/RPMS/i386" +chroot "$TARGET" su -c "$USERCMD" - $CHROOTUSER +mkdir -p "build/$TAG" +cp "$TARGET/home/$CHROOTUSER/rpmbuild/RPMS/i386/"* "build/$TAG" +cp "$TARGET/home/$CHROOTUSER/rpmbuild/SRPMS/"* "build/$TAG" + +# We do this manually in a for loop, since the rename command is +# not the same across various linux distros... +( + cd "build/$TAG" + for f in *.src.rpm ; do + mv "$f" "$(echo $f | sed "s/.src.rpm$/.$TAG.src.rpm/")" + done + for f in *.i386.rpm ; do + mv "$f" "$(echo $f | sed "s/.i386.rpm$/.$TAG.i386.rpm/")" + done +) + +chown -R "$CHOWNUSER" "build/$TAG" + diff -Nru barry-0.14/maintainer/README barry-0.0.20110506/maintainer/README --- barry-0.14/maintainer/README 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/README 2011-05-06 12:20:16.000000000 +0000 @@ -1,6 +1,22 @@ Most of the build or test build scripts in this directory assume a system with a number of chroot installs, in the directory /var/chroot. +The file ~/.barrychroots is a shell script containing commands for each +chroot system you wish to build for. The format of the commands is: + + ./type.sh directory tag + +For example, it might contain a list like this: + + export CHROOTUSER=cdfrey + ./rpm.sh /var/chroot/fedora13 f13 + ./deb.sh /var/chroot/ubuntu1004 ubuntu1004 + +In release mode, this would build Fedora 13 packages in the fedora13 +chroot system, and tag all resulting binary packages with "f13". +It would also use the /home/cdfrey directory for building. +Then it would do the same on the ubuntu 10.04 chroot system. + The top level scripts are: release.sh - builds all tar, deb, and rpm packages @@ -14,3 +30,50 @@ this script, which also updates the git repo with official tarball data. + +Miscellaneous scripts: +---------------------- + + ppa_build.sh - used by Martin Owens for the PPA snapshots + + +Script hierarchy for the hackers: +--------------------------------- + + release.sh + git-release-tar.sh + release-root.sh + barrychroots + ./dep.sh + ./make-deb.sh + ./rpm.sh + ./make-user-rpm.sh + ./rpmroot.sh + ./make-rpm.sh + ./make-deb-local.sh + test.sh + git-release-tar.sh + test-build-local.sh + test-root.sh + barrychroots + ./dep.sh + ./test-build.sh + ./rpm.sh + ./test-build.sh + ./rpmroot.sh + ./test-build.sh + + git-release-tar.sh + git-extract.sh + tar-prepare.sh + tar-create.sh + deb-src-create.sh + + tagged-release.sh + git-tagged-release.sh + lots of git commands, including signed tags + tar-prepare.sh + pristine-tar + release-root.sh + make-deb-local.sh + diff -Nru barry-0.14/maintainer/release-root.sh barry-0.0.20110506/maintainer/release-root.sh --- barry-0.14/maintainer/release-root.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/release-root.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,32 +1,22 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then echo - echo "Do not call this script directly. Call release.sh instead." + echo "Do not call release-root.sh directly. Call release.sh instead." echo exit 1 fi set -e -# -# Build the DEB's -# -./make-deb.sh build/barry-$1.$2.tar.bz2 ubuntu804 ubuntu804 -./make-deb.sh build/barry-$1.$2.tar.bz2 ubuntu710 ubuntu710 - - -# -# Build the Fedora RPM's -# -./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora9 fc9 -./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora8 fc8 -./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora7 fc7 -#./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora6 fc6 -#./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora5 fc5 - -# -# Build the OpenSUSE RPM's -# -./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec opensuse10.2 suse10 +export BARRYTARBALL=build/barry-$1.$2.$3.tar.bz2 +export THESPEC=build/barry-$1.$2.$3/rpm/barry.spec +export THEMODE=release +export CHOWNUSER="$4" + +if [ -f ~/.barrychroots ] ; then + . ~/.barrychroots +else + . barrychroots +fi diff -Nru barry-0.14/maintainer/release.sh barry-0.0.20110506/maintainer/release.sh --- barry-0.14/maintainer/release.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/release.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,8 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then echo - echo "Usage: ./release.sh MAJOR MINOR commit" + echo "Usage: ./release.sh LOGICAL MAJOR MINOR commit" echo echo "Creates the release tarball from git sources, tests the compile" echo "on local machine, fedora4, fedora5, fedora6." @@ -10,18 +10,33 @@ echo "Note: You may wish to direct the output to a file, for" echo " later examination." echo + echo "Example: ./release.sh 0 17 0 master" + echo exit 1 fi set -e +export CHOWNUSER="$(whoami)" + # Create the tarball -./git-release-tar.sh $1 $2 $3 +./git-release-tar.sh $1 $2 $3 $4 # Build as root first, so all prompts are finished at the start, # for the chroot systems... -su - -c "cd $(pwd) && ./release-root.sh $1 $2" +su - -c "cd $(pwd) && ./release-root.sh $1 $2 $3 '$CHOWNUSER'" + +# Build local packages +export BARRYTARBALL=build/barry-$1.$2.$3.tar.bz2 +export THESPEC=build/barry-$1.$2.$3/rpm/barry.spec +export THEMODE=release + +if [ -f ~/.barrylocal ] ; then + . ~/.barrylocal +else + . barrylocal +fi -# Build Debian packages in /usr/src/barry-version -./make-deb-local.sh build/barry-$1.$2.tar.bz2 $1 $2 debian +ls build +echo "Binary packages successfully built" diff -Nru barry-0.14/maintainer/rpmroot.sh barry-0.0.20110506/maintainer/rpmroot.sh --- barry-0.14/maintainer/rpmroot.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/rpmroot.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$BARRYTARBALL" -o -z "$THESPEC" ] ; then + echo + echo "Do not call rpmroot.sh directly. Call release.sh instead." + echo + exit 1 +fi + +CHROOTTARGET="$1" +TAG="$2" + +if [ "$THEMODE" = "release" ] ; then + ./make-rpm.sh "$BARRYTARBALL" "$THESPEC" "$CHROOTTARGET" "$TAG" +elif [ "$THEMODE" = "test" ] ; then + ./test-build.sh "$BARRYTARBALL" "$CHROOTTARGET" +else + echo + echo "Mode not set. Call release.sh or test.sh instead." + echo + exit 1 +fi + diff -Nru barry-0.14/maintainer/rpm.sh barry-0.0.20110506/maintainer/rpm.sh --- barry-0.14/maintainer/rpm.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/maintainer/rpm.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ -z "$1" -o -z "$2" -o -z "$BARRYTARBALL" -o -z "$THESPEC" ] ; then + echo + echo "Do not call rpm.sh directly. Call release.sh instead." + echo + exit 1 +fi + +CHROOTTARGET="$1" +TAG="$2" + +if [ "$THEMODE" = "release" ] ; then + ./make-user-rpm.sh "$BARRYTARBALL" "$THESPEC" "$CHROOTTARGET" "$TAG" +elif [ "$THEMODE" = "test" ] ; then + ./test-build.sh "$BARRYTARBALL" "$CHROOTTARGET" +else + echo + echo "Mode not set. Call release.sh or test.sh instead." + echo + exit 1 +fi + diff -Nru barry-0.14/maintainer/tagged-release.sh barry-0.0.20110506/maintainer/tagged-release.sh --- barry-0.14/maintainer/tagged-release.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/tagged-release.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,9 +1,9 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo echo "Usage: (from inside root of git repo)" - echo " maintainer/tagged-release.sh MAJOR MINOR" + echo " maintainer/tagged-release.sh LOGICAL MAJOR MINOR" echo echo "Creates the release tarball from git sources, tests the compile" echo "on local machine, and available chroots." @@ -18,18 +18,24 @@ set -e +export CHOWNUSER="$(whoami)" + +echo "WARNING: make sure you have the appropriate libopensync0-dev" +echo " installed on the local system, for the local deb build." +read + # Create the tarball -maintainer/git-tagged-release.sh $1 $2 +maintainer/git-tagged-release.sh $1 $2 $3 # Checkout the tag we're building with -git checkout barry-$1.$2 +git checkout barry-$1.$2.$3 cd maintainer # Build as root first, so all prompts are finished at the start, # for the chroot systems... -su - -c "cd $(pwd) && ./release-root.sh $1 $2" +su - -c "cd $(pwd) && ./release-root.sh $1 $2 $3 '$CHOWNUSER'" # Build Debian packages in /usr/src/barry-version -./make-deb-local.sh build/barry-$1.$2.tar.bz2 $1 $2 debian +./make-deb-local.sh build/barry-$1.$2.$3.tar.bz2 $1 $2 $3 debian diff -Nru barry-0.14/maintainer/tar-create.sh barry-0.0.20110506/maintainer/tar-create.sh --- barry-0.14/maintainer/tar-create.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/tar-create.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,36 +1,26 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo - echo "Usage: ./tar-create.sh MAJOR MINOR" + echo "Usage: ./tar-create.sh LOGICAL MAJOR MINOR" echo - echo "MAJOR is the desired major version number" - echo "MINOR is the desired minor version number" + echo "LOGICAL is the desired logical version number" + echo "MAJOR is the desired libmajor version number" + echo "MINOR is the desired libminor version number" echo - echo "This script expects a barry-\$MAJOR.\$MINOR directory" + echo "This script expects a barry-\$LOGICAL.\$MAJOR.\$MINOR directory" echo "to exist in the directory it is run in." echo exit 1 fi -DIRNAME="barry-$1.$2" -MAJOR="$1" -MINOR="$2" +DIRNAME="barry-$1.$2.$3" +LOGICAL="$1" +MAJOR="$2" +MINOR="$3" set -e # Create official release tarball -tar -cvf - $DIRNAME | bzip2 -9c > barry-$MAJOR.$MINOR.tar.bz2 - -# Create Debian source package, by creating a patched and "orig" set of trees. -# -# The following dance is to keep the .orig.tar.gz containing barry-0.12/ -# as the directory, and not something like barry-0.12.orig/ which gets -# corrected by Debian tools. If there is a better way, please send a patch. -cp -a $DIRNAME $DIRNAME.patched -rm -rf $DIRNAME/debian -tar -cf - $DIRNAME | gzip -9c > barry_$MAJOR.$MINOR.orig.tar.gz -rm -rf $DIRNAME -mv $DIRNAME.patched $DIRNAME -dpkg-source -b $DIRNAME barry_$MAJOR.$MINOR.orig.tar.gz +tar -cvf - $DIRNAME | bzip2 -9c > barry-$LOGICAL.$MAJOR.$MINOR.tar.bz2 diff -Nru barry-0.14/maintainer/tar-prepare.sh barry-0.0.20110506/maintainer/tar-prepare.sh --- barry-0.14/maintainer/tar-prepare.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/tar-prepare.sh 2011-05-06 12:20:16.000000000 +0000 @@ -29,5 +29,10 @@ ./buildgen.sh # Clean up the extraneous autoconf clutter -rm -rf autom4te.cache gui/autom4te.cache opensync-plugin/autom4te.cache +rm -rf \ + autom4te.cache \ + gui/autom4te.cache \ + opensync-plugin/autom4te.cache \ + opensync-plugin-0.4x/autom4te.cache \ + desktop/autom4te.cache diff -Nru barry-0.14/maintainer/test-build-local.sh barry-0.0.20110506/maintainer/test-build-local.sh --- barry-0.14/maintainer/test-build-local.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/test-build-local.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,6 +1,5 @@ #!/bin/sh -CHROOT="/var/chroot" BUILDUSER="cdfrey" if [ -z "$1" ] ; then diff -Nru barry-0.14/maintainer/test-build.sh barry-0.0.20110506/maintainer/test-build.sh --- barry-0.14/maintainer/test-build.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/test-build.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,17 +1,13 @@ #!/bin/sh -CHROOT="/var/chroot" -BUILDUSER="cdfrey" - -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$CHROOTUSER" ] ; then echo echo "Usage: ./test-build.sh tarball chroot_target" echo echo "Copies the tarball to the chroot target's tmp dir, then" echo "enters the chroot system as the build user and builds everything." echo - echo "Available chroot targets:" - find $CHROOT -type d -maxdepth 1 -print | sed "s/^.*\// /" + echo "Expects CHROOTUSER to be set properly in the environment." echo exit 1 fi @@ -22,6 +18,6 @@ set -e -cp "$TARPATH" "$CHROOT/$TARGET/tmp" -chroot "$CHROOT/$TARGET" su - "$BUILDUSER" -c /bin/sh -lc "rm -rf testbuild && mkdir testbuild && cd testbuild && tar xjvf \"/tmp/$TARNAME\" && cd * && ./configure --prefix=/home/$BUILDUSER/testbuild/rootdir && make install && cd gui && export PKG_CONFIG_PATH=/home/$BUILDUSER/testbuild/rootdir/lib/pkgconfig:\$PKG_CONFIG_PATH && ./configure --prefix=/home/$BUILDUSER/testbuild/rootdir && make install && cd ../opensync-plugin && ./configure --prefix=/home/$BUILDUSER/testbuild/rootdir && make && cd ../../rootdir && find && echo \"Press enter to continue...\" && read && cd ../.. && rm -rf testbuild" +cp "$TARPATH" "$TARGET/tmp" +chroot "$TARGET" su - "$CHROOTUSER" -c /bin/sh -lc "rm -rf testbuild && mkdir testbuild && cd testbuild && tar xjvf \"/tmp/$TARNAME\" && cd * && ./configure --prefix=/home/$CHROOTUSER/testbuild/rootdir && make install && cd gui && export PKG_CONFIG_PATH=/home/$CHROOTUSER/testbuild/rootdir/lib/pkgconfig:\$PKG_CONFIG_PATH && ./configure --prefix=/home/$CHROOTUSER/testbuild/rootdir && make install && cd ../opensync-plugin && ./configure --prefix=/home/$CHROOTUSER/testbuild/rootdir && make && cd ../../rootdir && find && echo \"Press enter to continue...\" && read && cd ../.. && rm -rf testbuild" diff -Nru barry-0.14/maintainer/test-root.sh barry-0.0.20110506/maintainer/test-root.sh --- barry-0.14/maintainer/test-root.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/test-root.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,19 +1,22 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then echo - echo "Do not call this script directly. Call test.sh instead." + echo "Do not call test-root.sh directly. Call test.sh instead." echo exit 1 fi set -e +export BARRYTARBALL=build/barry-$1.$2.$3.tar.bz2 +export THESPEC=build/barry-$1.$2.$3/rpm/barry.spec +export THEMODE=test + # Make sure it compiles cleanly on all handy systems -#./test-build.sh build/barry-$1.$2.tar.bz2 fedora4 -#./test-build.sh build/barry-$1.$2.tar.bz2 fedora5 -./test-build.sh build/barry-$1.$2.tar.bz2 ubuntu710 -./test-build.sh build/barry-$1.$2.tar.bz2 fedora7 -./test-build.sh build/barry-$1.$2.tar.bz2 opensuse10.2 -./test-build.sh build/barry-$1.$2.tar.bz2 fedora6 +if [ -f ~/.barrychroots ] ; then + . ~/.barrychroots +else + . barrychroots +fi diff -Nru barry-0.14/maintainer/test.sh barry-0.0.20110506/maintainer/test.sh --- barry-0.14/maintainer/test.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/maintainer/test.sh 2011-05-06 12:20:16.000000000 +0000 @@ -1,11 +1,11 @@ #!/bin/sh -if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then +if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" ] ; then echo - echo "Usage: ./test.sh MAJOR MINOR commit" + echo "Usage: ./test.sh LOGICAL MAJOR MINOR commit" echo echo "Creates the release tarball from git sources, tests the compile" - echo "on local machine, fedora 5, 6, and 7, and opensuse 10.2." + echo "on local machine's chroot systems." echo exit 1 fi @@ -13,12 +13,12 @@ set -e # Create the tarball -./git-release-tar.sh $1 $2 $3 +./git-release-tar.sh $1 $2 $3 $4 # Make sure it compiles cleanly on all handy systems # Local first... -./test-build-local.sh build/barry-$1.$2.tar.bz2 +./test-build-local.sh build/barry-$1.$2.$3.tar.bz2 # Then as root, for the chroot systems... -su - -c "cd $(pwd) && ./test-root.sh $1 $2" +su - -c "cd $(pwd) && ./test-root.sh $1 $2 $3" diff -Nru barry-0.14/Makefile.am barry-0.0.20110506/Makefile.am --- barry-0.14/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -1,8 +1,9 @@ -DISTCHECK_CONFIGURE_FLAGS = --enable-gui --enable-opensync-plugin +DISTCHECK_CONFIGURE_FLAGS = --enable-gui --enable-opensync-plugin --enable-opensync-plugin-4x --enable-desktop ACLOCAL_FLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = COPYING ChangeLog README Doxyfile \ +EXTRA_DIST = COPYING ChangeLog README Doxyfile AUTHORS DEPUTY \ buildgen.sh \ data \ doc \ @@ -11,14 +12,30 @@ modprobe \ ppp \ rpm \ - test \ - udev + udev \ + bash \ + zsh \ + hal \ + logo \ + contrib \ + menu \ + usbmon-6 \ + .gitignore -SUBDIRS = . src tools examples man +SUBDIRS = po . src tools examples man test # conditionally configured nested subdirectories are listed in $(subdirs) SUBDIRS += $(subdirs) -pkgconfig_DATA = libbarry-0.pc +pkgconfig_DATA = libbarry-0.pc libbarrydp-0.pc libbarryjdwp-0.pc +if WITH_SYNC +pkgconfig_DATA += libbarrysync-0.pc +endif +if WITH_BACKUP +pkgconfig_DATA += libbarrybackup-0.pc +endif +if WITH_ALX +pkgconfig_DATA += libbarryalx-0.pc +endif all-local: rm -f $(top_builddir)/barry @@ -29,7 +46,7 @@ # these directories will be tested for during make dist to warn if they are # missing - a new nested package should be added both here and in configure.ac -CONDITIONAL_SUBDIRS = gui opensync-plugin +CONDITIONAL_SUBDIRS = gui opensync-plugin opensync-plugin-0.4x desktop dist-hook: rm -rf `find $(distdir) -name CVS` @for subdir in $(CONDITIONAL_SUBDIRS); do \ diff -Nru barry-0.14/Makefile.in barry-0.0.20110506/Makefile.in --- barry-0.14/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,713 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/libbarry-0.pc.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog NEWS TODO config.guess config.sub depcomp \ - install-sh ltmain.sh missing -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \ - $(top_srcdir)/m4/ax_cxx_check_flag.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libbarry-0.pc -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -pkgconfigDATA_INSTALL = $(INSTALL_DATA) -DATA = $(pkgconfig_DATA) -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_INC_PATH = @BOOST_INC_PATH@ -BOOST_LIB_PATH = @BOOST_LIB_PATH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LIBS = @LIBUSB_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ -WITH_BOOST_PATHS_FALSE = @WITH_BOOST_PATHS_FALSE@ -WITH_BOOST_PATHS_TRUE = @WITH_BOOST_PATHS_TRUE@ -WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -DISTCHECK_CONFIGURE_FLAGS = --enable-gui --enable-opensync-plugin -ACLOCAL_FLAGS = -I m4 -EXTRA_DIST = COPYING ChangeLog README Doxyfile \ - buildgen.sh \ - data \ - doc \ - hotplug \ - maintainer \ - modprobe \ - ppp \ - rpm \ - test \ - udev - -# conditionally configured nested subdirectories are listed in $(subdirs) -SUBDIRS = . src tools examples man $(subdirs) -pkgconfig_DATA = libbarry-0.pc - -# these directories will be tested for during make dist to warn if they are -# missing - a new nested package should be added both here and in configure.ac -CONDITIONAL_SUBDIRS = gui opensync-plugin -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) - -config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -libbarry-0.pc: $(top_builddir)/config.status $(srcdir)/libbarry-0.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)" - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ - 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): - @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; \ - (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" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @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; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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 || \ - tags="$$tags $$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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/. $(distdir)/m4 - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__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 -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' -distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile $(DATA) config.h all-local -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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 - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: install-pkgconfigDATA - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am uninstall-pkgconfigDATA - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \ - am--refresh check check-am clean clean-generic clean-libtool \ - clean-local clean-recursive ctags ctags-recursive dist \ - dist-all dist-bzip2 dist-gzip dist-hook dist-shar dist-tarZ \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-recursive distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-pkgconfigDATA \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am \ - uninstall-pkgconfigDATA - - -all-local: - rm -f $(top_builddir)/barry - ln -s $(top_srcdir)/src $(top_builddir)/barry - -clean-local: - rm -f $(top_builddir)/barry -dist-hook: - rm -rf `find $(distdir) -name CVS` - @for subdir in $(CONDITIONAL_SUBDIRS); do \ - if test ! -d $(distdir)/$$subdir; then \ - if test -z "$$MISSING_DIRS"; then \ - echo "###############################################################################"; \ - MISSING_DIRS="--enable-$$subdir"; \ - else \ - MISSING_DIRS="$$MISSING_DIRS --enable-$$subdir"; \ - fi; \ - echo "ERROR: The $$subdir subdirectory has been omitted!"; \ - else :; fi; \ - done; \ - if test -n "$$MISSING_DIRS"; then \ - echo ; \ - echo "rerun configure with $$MISSING_DIRS before running make dist"; \ - echo "###############################################################################"; \ - exit 1; \ - else :; fi; -# 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 barry-0.14/man/balxparse.1 barry-0.0.20110506/man/balxparse.1 --- barry-0.14/man/balxparse.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/balxparse.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,56 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BALXPARSE 1 "December 9, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B balxparse +\- Barry Project's program to parse firmware ALX files. +.SH SYNOPSIS +.B balxparse [-h][-i lang][-d path][-o file] [ALX files...] + +.SH DESCRIPTION +.PP +.B balxparse +is a tool for loading XML data from the ALX files included with +BlackBerry firmware updates. It is able to parse this data in multiple +charsets / languages, as well as parsing the entire directory of ALX +files. + +.SH OPTIONS +.TP +.B \-h +Display a command help summary. +.TP +.B \-i lang +Specify the internationalization charset/language to use. By running +.B balxparse +with the -h option, a list of available languages is displayed. +.TP +.B \-d path +Specify the path to find all ALX files. +.TP +.B \-o file +Specify an OS filename (Platform.alx) to parse, without loading application +and library dependencies. +.SH AUTHOR +.nh +.B balxparse +was initially written for the Barry project by Nicolas Vivien, with +additional contributions from others over time. +.SH SEE ALSO +.PP +http://www.netdirect.ca/barry + diff -Nru barry-0.14/man/bcharge.1 barry-0.0.20110506/man/bcharge.1 --- barry-0.14/man/bcharge.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/bcharge.1 2011-05-06 12:20:16.000000000 +0000 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH BCHARGE 1 "August 17, 2007" +.TH BCHARGE 1 "October 7, 2010" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -22,7 +22,7 @@ .SH DESCRIPTION .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBbcharge\fP is a program that sends a special handshake to all BlackBerry devices it finds on the USB bus. This handshake causes the device to reset @@ -30,13 +30,14 @@ proper charging on Linux. .PP It is safe to run this command multiple times, as it only changes devices -that are not already set to 500mA. +that are not already set to 500mA, or are not in the desired mode. .SH OPTIONS .TP .B \-o For Blackberry Pearl devices, using this switch causes bcharge to set the -Product ID to 0001. Otherwise, the default is to use Product ID 0004. +Product ID to 0001. + When the Pearl is in 0004 mode, two USB interfaces are presented: one for database access and one for mass storage. In 0001 mode, only the database access is available. @@ -46,11 +47,17 @@ for the Pearl before using btool. .TP .B \-d -Again, this switch is for the Blackberry Pearl to switch it back to -0004 dual mode after having run bcharge with the -o option. Since -a Pearl in mode 0001 is practically indistinguishable from a classic -Blackberry, the -d switch is needed to tell bcharge that you really -are working with a Pearl. +This switch is for the Blackberry Pearl to switch it back to +0004 dual mode after having run bcharge with the -o option. Alternately, +newer devices (such as Storm with product ID of 8007) will be switched +to 0004. Since a Pearl in mode 0001 is practically indistinguishable +from a classic Blackberry, the -d switch is needed to tell bcharge +that you really are working with a Pearl. +.TP +.B \-g +Guess whether Dual mode is needed. If USB Interface Class 255 is not +found on the device (the class used for database access), then dual +mode is set. Otherwise, the device is left as-is. .TP .B \-h Help summary. @@ -73,5 +80,5 @@ bcharge and this manual page were written by Chris Frey for the Barry project. .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/bfuse.1 barry-0.0.20110506/man/bfuse.1 --- barry-0.14/man/bfuse.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/bfuse.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,75 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BFUSE 1 "August 17, 2009" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B bfuse +\- Create a FUSE filesystem out of BlackBerry databases. +.SH SYNOPSIS +.B bfuse +mountpoint [options] +.SH DESCRIPTION +.PP +.B bfuse +connects to your BlackBerry and turns its databases into +a mounted filesystem using the FUSE filesystem library. As such, +it has a few basic arguments, and a list of common options supported +by FUSE. +.PP +The device will remain in Desktop mode for as long as bfuse runs. +.PP +For more information on FUSE options, see +http://fuse.sourceforge.net/ + +.SH BARRY OPTIONS +.TP +.B \--p pin +Specify the PIN of the device you want to mount. Default is to mount +all available devices. +.TP +.B \--P password +Simplistic method to specify the device password on the command line. + +.SH FUSE OPTIONS +.TP +.B \--o opt +FUSE mount options. +.TP +.B \-h +Display a command help summary. +.TP +.B \-V +Display version information, including Barry library, FUSE library, and +kernel interface. +.TP +.B \-d +Enable debug output. Implies '-f'. +.TP +.B \-f +Operate in the foreground. +.TP +.B \-s +Disable multi-threaded operation. + +.SH AUTHOR +.nh +.B bfuse +is part of the Barry project and was written Chris Frey, as was +this manual page. +.SH SEE ALSO +.PP +http://www.netdirect.ca/software/packages/barry + diff -Nru barry-0.14/man/bidentify.1 barry-0.0.20110506/man/bidentify.1 --- barry-0.14/man/bidentify.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/bidentify.1 2011-05-06 12:20:16.000000000 +0000 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH BIDENTIFY 1 "November 30, 2007" +.TH BIDENTIFY 1 "February 24, 2011" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -19,7 +19,7 @@ .B bidentify \- Barry Project's program to identify BlackBerry handhelds .SH SYNOPSIS -.B bidentify +.B bidentify [-B busname][-N devname][-h][-v] .SH DESCRIPTION .PP @@ -41,6 +41,16 @@ output from the lsusb command, such as 005. If the device name is numeric on your system, 5 and 005 are equal. See also the \-B option. .TP +.B \-c +If used with the -m option, ESN numbers will be displayed in both hex and +decimal formats where possible. If -m is not used, this option has +no effect. +.TP +.B \-m +Also show the device's ESN / MEID / IMEI number. This requires desktop +database access, so is an option. It will only work on devices that have +no password. +.TP .B \-v Dump verbose protocol data during operation. .TP @@ -63,10 +73,10 @@ .SH AUTHOR .nh -.B bidentify +.B bidentify is part of the Barry project. This manual page was written by Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/bio.1 barry-0.0.20110506/man/bio.1 --- barry-0.14/man/bio.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/bio.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,278 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BIO 1 "December 21, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B bio +\- Barry Input / Output +.SH SYNOPSIS +.B bio -i -o [-o ...] +.SH DESCRIPTION +.PP +.B bio +is a command line tool that treats devices, backups, and data streams +as input and output. +.B bio +supports the following types of IO (actual type name shown in bold): + +.IP +.B device + +.B tar +(backup files) + +.B boost +(serialization files and streams) + +.B mime +streams + +.B ldif +streams + +human readable and hex text +.B dump + +.B sha1 +sum output + +.B cstore +for extracting Content Store records + +.PP +Each command line consists of at least one input and output option, +along with their switches. More than one output can be used, as long +as they do not conflict with each other. For example, it is not possible +to read and write from the same device PIN. + +.PP +This tool combines a lot of the functionality of +.B btool, btardump, brecsum, +and +.B bs11nread, +but does it more flexibly, and improves functionality in some cases, +such as Boost archives being able to contain more than one database. + +.SH DEVICE TYPE OPTIONS +.PP +The +.B device +type is used to read or write from a device connected via USB. +Some of the options below are valid only in one input or output +mode, some in both. +.TP +.B \-d db +Name of database to load, when using the +.B device +type as input. Can be used multiple times. See +.B btool \-t +for a list of databases on the device. +.TP +.B \-A +Selects all databases found on the device, instead of adding them +manually via the \-d option. +.TP +.B \-p pin +PIN of device to talk to. Valid for both input and output. +Only needed if you have more than one Blackberry connected at once. +.TP +.B \-P password +Simplistic method to specify device password. In a real application, this +would be done using a more secure prompt. +.TP +.B \-w mode +Set write mode when using the +.B device +type in output mode. This must be specified, or nothing will be written. +Can be one of: +.B erase, overwrite, addonly, addnew. + +.\".SH DATABASE COMMAND MODIFIERS (DEVICE) +.\"The following options modify the -d command option above, and can be used +.\"multiple times for more than one record. +.\".TP +.\".B \-r # +.\"Fetch specific record, given a record index number as seen in the -T state table. +.\"Can be used multiple times to fetch specific records from a single database. +.\".TP +.\".B \-R # +.\"Same as -r, but also clears the record's dirty flags. +.\".TP +.\".B \-D # +.\"Delete the specified record using the index number as seen in the -T state table. + +.SH TAR TYPE OPTIONS +.PP +The +.B tar +type is used to read or write from a backup file created by btool or +the backup GUI. +.TP +.B \-d db +Name of database to load, when using the +.B tar +type as input. Can be used multiple times. +.B Note +that if no \-d options are specified, +.B bio +defaults to reading all available databases. +.TP +.B \-f file +The tar backup file to read or write from. +.B Bio +uses gzip compressed tar files, so suitable extensions would be .tgz +and .tar.gz. Unfortunately, due to internal limitations, +an actual file must be specified here, and not \- for stdin / stdout. + +.SH BOOST TYPE OPTIONS +.PP +The +.B boost +type is used to read and write parsable records in Boost Serialization +format. These files were historically written and read by +.B btool +and +.B bs11nread. +.B Bio +is more flexible, in that it can contain multiple databases in one +serialization archive. +.TP +.B \-f file +Filename to read from or write to. Use \- to specify stdin or stdout. +If not specified for input, defaults to stdin, but since output can +contain non-ASCII chars, you must use \-f \- if you want to write +to stdout. + +.SH LDIF TYPE OPTIONS +.PP +The +.B ldif +type is used to read or write ldif output, like the output of the +LDAP command line tool +.B ldapsearch. +.TP +.B \-c dn +When using ldif as output, specify the base DN. +.TP +.B \-C dnattr +Again, for output, specify the attribute name to use when building the FQDN. + +.SH MIME TYPE OPTIONS +.PP +The +.B mime +type is used to read or write VCARD, VEVENT, VTODO, or VJOURNAL records +based on the Address Book, Calendar, Tasks, or Memos databases respectively. +.TP +.B \-f file +Filename to read from or write to. Defaults to \- for stdin or stdout. + +.SH DUMP TYPE OPTIONS +.PP +The +.B dump +type is used only for output, and sends human readable record data to +stdout. Parsable records are parsed; unknown records are dumped in hex +format. +.TP +.B \-n +Use hex format for all records. + +.SH SHA1 TYPE OPTIONS +.PP +The +.B sha1 +type is used to mimic the behaviour of the +.B brecsum +command. It calculates a SHA1 sum on the raw record data and sends +the sum to stdout. +.TP +.B \-t +Include the DB Name, Type, and Unique record ID in the checksum for each +record. + +.SH CSTORE TYPE OPTIONS +.PP +The +.B cstore +type is used to parse Content Store records. +.TP +.B \-l +List the filenames and folders found in the Content Store database. +.TP +.B \-f file +Select a filename from the above list to extract and save locally. +Specify the entire path as shown in the \-l list. +If the file is found in the device, it will be written to the current +directory, using the base filename as the name. If a file by that name +exists already, the filename will be modified to avoid overwriting local +files. + +.SH STANDALONE OPTIONS +.TP +.B \-h +Displays a detailed summary of command line options. +.TP +.B \-I cs +Set the international charset for string conversions. Valid values here +are available with +.B iconv \-\-list +.TP +.B \-S +Show list of supported database parsers and builders. +.TP +.B \-v +Dump verbose low level protocol data during USB operations, to stdout. + + + + +.SH EXAMPLES +.TP +1) Backup a full device to tar backup: +.IP +bio -i device -A -o tar -f mybackup.tar.gz +.TP +2) Read a backup file and convert the Address Book to MIME +.IP +bio -i tar -f mybackup.tar.gz -d "Address Book" -o mime +.TP +3) Copy the Calendar from one device to another, and dump +the records to stdout in human readable format at the same time +.IP +bio -i device -p 3009efe3 -d Calendar -o device -p 204062f3 -w erase -o dump +.TP +4) Read LDIF input and convert the contacts to MIME format +.IP +ldapsearch -x | bio -i ldif -o mime +.TP +5) Test the record code by running the Tasks database through +the Boost storage and back to human readable +.IP +bio -i device -d Tasks -o dump + +vs. + +bio -i device -d Tasks -o boost -f - | bio -i boost -f - -o dump + +.SH AUTHOR +.nh +.B bio +is part of the Barry project. +.SH SEE ALSO +.PP +http://www.netdirect.ca/barry + diff -Nru barry-0.14/man/bjavaloader.1 barry-0.0.20110506/man/bjavaloader.1 --- barry-0.14/man/bjavaloader.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/bjavaloader.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,140 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BJAVALOADER 1 "September 11, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B bjavaloader +\- Barry Project's program to manage BlackBerry applications +.SH SYNOPSIS +.B bjavaloader [-h][-p pin][-P pass][-v] +.TP +.B bjavaloader dir [-s] +.TP +.B bjavaloader deviceinfo +.TP +.B bjavaloader load <.codfile> +.TP +.B bjavaloader save [-A] +.TP +.B bjavaloader wipe [-a | -i] +.TP +.B bjavaloader erase [-f] +.TP +.B bjavaloader eventlog +.TP +.B bjavaloader cleareventlog +.TP +.B bjavaloader logstacktraces +.TP +.B bjavaloader screenshot <.bmp file> +.TP +.B bjavaloader settime [yyyy-mm-dd HH:MM:SS] +.SH DESCRIPTION +.PP +.B bjavaloader +is a tool for loading, listing, and deleting applications on a BlackBerry +device. It has a few other features as well, not pertaining to application +management. The command syntax is intentionally similar to the Windows +program 'javaloader.exe' provided by Research In Motion, in order +to make it easy to use the same build scripts on Linux and Windows. +.SH OPTIONS +.TP +.B \-A +Used with the 'save' command to save all available modules. +.TP +.B \-a +Used with the 'wipe' command to only wipe the applications. +.TP +.B \-i +Used with the 'wipe' command to only wipe the filesystem. +.TP +.B \-f +Used with the 'erase' command to force the erasure of an application +that is currently in use in the device. Experimental. +.TP +.B \-h +Display a command help summary. +.TP +.B \-s +When using the 'dir' command, list the submodules as well. +.TP +.B \-p pin +Specifies the PIN number of the device with which you wish to communicate, +when multiple devices are connected. +.TP +.B \-P password +A simplistic method to specify the device password. +.TP +.B \-v +Verbose debug output. This enables dumping of USB bus scanning, as +well as the protocol packets used during communication. + +.SH COMMANDS +.TP +.B dir [-s] +Fetch a list of all applications and display them on stdout. When used with +the -s option, submodules are included, and can take a long time to display. +.TP +.B deviceinfo +Provides information on the handheld. +.TP +.B load <.cod filename> ... +Loads one or more COD application files into the device. +.TP +.B save [-A] ... +Retrieves modules from the handheld and writes them to .cod files with the +same name as the module. Note that this will overwrite any existing .cod +file in the current directory. If the -A option is specified, a dir will +be done internally, and all available modules will be saved. +.TP +.B wipe [-a | -i] +Wipes the handheld, removing all data such as messages, contacts, etc. +and/or all .cod files, including OS .cod files. +By default, with no options specified, both applications and data are wiped. +Use the switches to specify only applications or data. +.TP +.B erase [-f] ... +Delete the specified application module(s). The module name can be determined +using the 'dir' command. When used with the -f option, the module is erased +even if in use, and the device will be reset. +.TP +.B eventlog +Retrives the handheld event log and prints it on stdout. +.TP +.B cleareventlog +Clears the handheld event log. +.TP +.B logstacktraces +Dumps the stack traces for all threads into the event log, which can then +be viewed with the 'eventlog' command. +.TP +.B screenshot <.bmp filename> +Capture current screen image and save in BMP format. +.TP +.B settime [yyyy-mm-dd HH:MM:SS] +Sets the time on the handheld to the current time, or the specified time. +If time is given as an argument, the current system timezone is assumed. + +.SH AUTHOR +.nh +.B bjavaloader +was initially written for the Barry project by Nicolas Vivien, with +additional contributions from others over time. This manual page was +written by Chris Frey. +.SH SEE ALSO +.PP +http://www.netdirect.ca/software/packages/barry + diff -Nru barry-0.14/man/bjdwp.1 barry-0.0.20110506/man/bjdwp.1 --- barry-0.14/man/bjdwp.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/bjdwp.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,79 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BJDWP 1 "September 29, 2009" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B bjdwp +\- Command line USB Blackberry Java Debug Wire Protocol +.SH SYNOPSIS +.B bjdwp +[-h][-p pin][-P password][-v] address port + +.SH DESCRIPTION +.PP +.B bjdwp +is a program that supports the Java Debug Wire Protocol over USB, +which enables debugging of Java programs directly on your Blackberry. + +Support is experimental, and development is focused primarily on the +BlackBerry Storm. + +.SH OPTIONS +.TP +.B \-p pin +PIN of device to talk with. Only needed if you have more than one Blackberry +connected at once. +.TP +.B \-P password +Simplistic method to specify device password. In a real application, this +would be done using a more secure prompt. +.TP +.B \-v +Dump verbose protocol data during operation. +.TP +.B \-h, \-\-help +Show summary of options. + +.SH ARGUMENTS +The following arguments are required, in order to provide a socket where +the JDWP server will listen for connections from the debugger. +.TP +.B address +Most often 'localhost' but can be any IP or hostname on the machine +running bjdwp. +.TP +.B port +Port to listen on. + +.SH EXAMPLES +Start the server and the USB connection to the device: + + bjdwp localhost 8000 + +Then start your java debugger: + + jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8000 + + +.SH AUTHOR +.nh +.B bjdwp +was initially written for the Barry project by Nicolas VIVIEN. +This manual page was written by Chris Frey. +.SH SEE ALSO +.PP +http://www.netdirect.ca/software/packages/barry + diff -Nru barry-0.14/man/brawchannel.1 barry-0.0.20110506/man/brawchannel.1 --- barry-0.14/man/brawchannel.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/brawchannel.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,64 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BRAWCHANNEL 1 "August 17, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B brawchannel +\- Barry Project's program to create a channel to a BlackBerry application +.SH SYNOPSIS +.B brawchannel [-h][-p pin][-P pass][-v] +.SH DESCRIPTION +.PP +.B brawchannel +is a tool for connecting to an application channel on a BlackBerry device, +as provided to on device programs by the +.B net.rim.device.api.system.USBPort +API. Data received on the channel will be output to STDOUT and any data +received on STDIN in will be sent over the channel. Any errors or verbose +output will be written to STDERR. +.BR +The +.B channel name +provided to this program should be the same as the channel name passed +to the call to +.B net.rim.device.api.system.USBPort.registerChannel +.SH OPTIONS +.TP +.B \-h +Display a command help summary. +.TP +.B \-p pin +Specifies the PIN number of the device with which you wish to communicate, +when multiple devices are connected. +.TP +.B \-P password +A simplistic method to specify the device password. +.TP +.B \-v +Verbose debug output. This enables dumping of USB bus scanning, as +well as the protocol packets used during communication. This will +cause libusb to output information on STDOUT, which will usually be +undesirable. Setting the environment variable USB_DEBUG to 0, 1 or 2 +should prevent any addition output on STDOUT. +.SH AUTHOR +.nh +.B brawchannel +was initially written for the Barry project by RealVNC Ltd., +based on bjavaloader by Nicolas Vivien. +.SH SEE ALSO +.PP +http://www.netdirect.ca/software/packages/barry + diff -Nru barry-0.14/man/brecsum.1 barry-0.0.20110506/man/brecsum.1 --- barry-0.14/man/brecsum.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/brecsum.1 2011-05-06 12:20:16.000000000 +0000 @@ -19,7 +19,7 @@ .B brecsum \- Generate SHA1 sums of raw Blackberry database records. .SH SYNOPSIS -.B brecsum +.B brecsum [-d db][-h][-p pin][-P pass][-v] .SH DESCRIPTION .PP @@ -36,6 +36,9 @@ multiple times to fetch more than one database. See btool's \-t option to retrieve a list of databases on your device. .TP +.B \-i +Include DB Name, Type, and Unique record IDs in the checksums. +.TP .B \-p pin Specify the PIN of the device to talk to. Only needed if there are multiple Blackberries plugged into your system at once. @@ -58,10 +61,10 @@ .SH AUTHOR .nh -.B brecsum +.B brecsum is part of the Barry project. This manual page was written by Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/breset.1 barry-0.0.20110506/man/breset.1 --- barry-0.14/man/breset.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/breset.1 2011-05-06 12:20:16.000000000 +0000 @@ -19,7 +19,7 @@ .B breset \- Reset Blackberry devices via software. .SH SYNOPSIS -.B breset +.B breset .SH DESCRIPTION .PP .B breset @@ -28,10 +28,10 @@ .SH AUTHOR .nh -.B breset +.B breset is part of the Barry project. This manual page was written by Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/bs11nread.1 barry-0.0.20110506/man/bs11nread.1 --- barry-0.14/man/bs11nread.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/bs11nread.1 2011-05-06 12:20:16.000000000 +0000 @@ -19,7 +19,7 @@ .B bs11nread \- Barry Project's program to read database serialization files. .SH SYNOPSIS -.B bs11nread +.B bs11nread [-f file][-h][-S] .SH DESCRIPTION .PP @@ -41,9 +41,9 @@ .SH AUTHOR .nh -.B bs11nread +.B bs11nread is part of the Barry project. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/btardump.1 barry-0.0.20110506/man/btardump.1 --- barry-0.14/man/btardump.1 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/man/btardump.1 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,60 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH BTARDUMP 1 "December 7, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +.B btardump +\- Command line parser for Barry backup files +.SH SYNOPSIS +.B btardump +[-d db][-h][-i charset][-V] filename [filenames...] +.SH DESCRIPTION +.PP +.B btardump +takes one or more Barry backup tar files on the command line, and +dumps parsed database records to stdout. By default, all records +are dumped, but this can be limited by the -d option. +.SH OPTIONS +.TP +.B \-d db +Name of database to dump to stdout. Can be used multiple times +to parse multiple databases at once. If not specified, all available +databases from the backup file are dumped. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-i charset +Specifies the iconv charset to use for converting international strings. +The Blackberry uses the WINDOWS-1252 charset, which is incompatible with +the more common code pages used in Linux. The most useful charset to use +with this option is UTF-8, and is highly recommended. Any other charset +available via 'iconv --list' can be used here too, but may not be +successful for some character conversions. +.TP +.B \-V +Enable vformat MIME output where available. Address Book gets printed +in vCard format, Calendar in vEvent format, Memos in vJournal, and +Tasks in vTodo, etc. + +.SH AUTHOR +.nh +.B btardump +is part of the Barry project. +.SH SEE ALSO +.PP +http://www.netdirect.ca/barry + diff -Nru barry-0.14/man/btool.1 barry-0.0.20110506/man/btool.1 --- barry-0.14/man/btool.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/btool.1 2011-05-06 12:20:16.000000000 +0000 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH BTOOL 1 "May 16, 2008" +.TH BTOOL 1 "December 7, 2010" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -19,17 +19,17 @@ .B btool \- Barry Project's program to interface with BlackBerry handheld .SH SYNOPSIS -.B btool -[-B busname][-N devname][-c dn][-C dnattr][-d db [-f file][-r#][-R#]-D#]][-h][-l][-L][-m cmd][-M][-p pin][-P password][-s db -f file][-S][-t][-v][-X][-z][-Z] +.B btool +[-B busname][-N devname][-a db][-c dn][-C dnattr][-d db [-f file][-r#][-R#]-D#]][-h][-i charset][-l][-L][-m cmd][-M][-p pin][-P password][-s db -f file][-S][-t][-v][-V][-X][-z][-Z] .SH DESCRIPTION .PP .B btool -is a very early version of a program that communicates with a +is a program that communicates with a BlackBerry device over USB; there is no intention to support ancient serial-port BlackBerries. -Since the protocols used by BlackBerry are not documented -by the manufacturer Research In Motion, this program is -experimental and you \fBuse at own risk\fP. +Since the protocols used by BlackBerry are not documented +by the manufacturer Research In Motion, this program is +experimental and you \fBuse at own risk\fP. Be sure your device is backed up by another program if it contains important data. .SH OPTIONS @@ -41,6 +41,10 @@ also the \-N option, which can be used together with this option to precisely select the device to work with. .TP +.B \-a db +Delete all records from specified database. This can be used multiple +times to clear multiple databases. +.TP .B \-c dn Convert address book database to LDIF format, using the specified dn as the baseDN. Sends LDIF output to stdout. @@ -68,7 +72,20 @@ .TP .B \-f file Filename to write or read handheld data to/from. Used in conjunction with -the -d and -s options, respectively. +the -d and -s options, respectively. Note: the file format of this file +is not backward compatible between devel releases. +.TP +.B \-i charset +Specifies the iconv charset to use for converting international strings. +The Blackberry uses the WINDOWS-1252 charset, which is incompatible with +the more common code pages used in Linux. The most useful charset to use +with this option is UTF-8, and is highly recommended. Any other charset +available via 'iconv --list' can be used here too, but may not be +successful for some character conversions. +.TP +.B \-I +Sort records before dumping them to stdout. This uses the default library +sorting order, which is specific to each database. .TP .B \-l Lists attached Blackberry devices, and their PIN numbers. @@ -130,8 +147,14 @@ .B \-v Dump verbose protocol data during operation. .TP +.B \-V +Enable vformat MIME output where available. Address Book gets printed +in vCard format, Calendar in vEvent format, Memos in vJournal, and +Tasks in vTodo, etc. +.TP .B \-X -Reset device. +Perform a USB reset on the device. Similar to the breset command, +and does a virtual "replug" of the device. .TP .B \-z Use non-threaded sockets when communicating with the device. This is @@ -164,12 +187,12 @@ .SH AUTHOR .nh -.B btool +.B btool is part of the Barry project. This manual page was written by Ian Darwin and Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry .br Especially the caveats, and the call for developers and others to help with the project. diff -Nru barry-0.14/man/Makefile.am barry-0.0.20110506/man/Makefile.am --- barry-0.14/man/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -1,10 +1,19 @@ +EXTRA_DIST = manpage.1.ex + dist_man_MANS = \ bcharge.1 \ btool.1 \ + btardump.1 \ + bfuse.1 \ + bjavaloader.1 \ + balxparse.1 \ + bjdwp.1 \ bs11nread.1 \ bidentify.1 \ breset.1 \ + brawchannel.1 \ pppob.1 \ brecsum.1 \ + bio.1 \ upldif.1 diff -Nru barry-0.14/man/Makefile.in barry-0.0.20110506/man/Makefile.in --- barry-0.14/man/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,395 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -subdir = man -DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \ - $(top_srcdir)/m4/ax_cxx_check_flag.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 = -SOURCES = -DIST_SOURCES = -man1dir = $(mandir)/man1 -am__installdirs = "$(DESTDIR)$(man1dir)" -NROFF = nroff -MANS = $(dist_man_MANS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_INC_PATH = @BOOST_INC_PATH@ -BOOST_LIB_PATH = @BOOST_LIB_PATH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LIBS = @LIBUSB_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ -WITH_BOOST_PATHS_FALSE = @WITH_BOOST_PATHS_FALSE@ -WITH_BOOST_PATHS_TRUE = @WITH_BOOST_PATHS_TRUE@ -WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -dist_man_MANS = \ - bcharge.1 \ - btool.1 \ - bs11nread.1 \ - bidentify.1 \ - breset.1 \ - pppob.1 \ - brecsum.1 \ - upldif.1 - -all: all-am - -.SUFFIXES: -$(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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign man/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 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-man1: $(man1_MANS) $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ - else file=$$i; fi; \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ - done -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ - l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ - for i in $$l2; do \ - case "$$i" in \ - *.1*) list="$$list $$i" ;; \ - esac; \ - done; \ - for i in $$list; do \ - ext=`echo $$i | sed -e 's/^.*\\.//'`; \ - case "$$ext" in \ - 1*) ;; \ - *) ext='1' ;; \ - esac; \ - inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ - inst=`echo $$inst | sed -e 's/^.*\///'`; \ - inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ - done -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(MANS) -installdirs: - for dir in "$(DESTDIR)$(man1dir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-man - -install-exec-am: - -install-info: install-info-am - -install-man: install-man1 - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-man - -uninstall-man: uninstall-man1 - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-man1 \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-info-am uninstall-man \ - uninstall-man1 - -# 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 barry-0.14/man/manpage.1.ex barry-0.0.20110506/man/manpage.1.ex --- barry-0.14/man/manpage.1.ex 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/manpage.1.ex 2011-05-06 12:20:16.000000000 +0000 @@ -31,7 +31,7 @@ commands. .PP .\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, +.\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBbarry\fP is a program that... .SH OPTIONS diff -Nru barry-0.14/man/pppob.1 barry-0.0.20110506/man/pppob.1 --- barry-0.14/man/pppob.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/pppob.1 2011-05-06 12:20:16.000000000 +0000 @@ -19,7 +19,7 @@ .B pppob \- Barry Project's program to access the Blackberry modem for pppd .SH SYNOPSIS -.B pppob +.B pppob [-l filename][-p pin][-P password][-s][-v] .SH DESCRIPTION .PP @@ -57,9 +57,9 @@ .SH AUTHOR .nh -.B pppob +.B pppob is part of the Barry project. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/man/upldif.1 barry-0.0.20110506/man/upldif.1 --- barry-0.14/man/upldif.1 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/man/upldif.1 2011-05-06 12:20:16.000000000 +0000 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH UPLDIF 1 "May 29, 2008" +.TH UPLDIF 1 "November 24, 2009" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -19,8 +19,8 @@ .B upldif \- Barry Project's LDIF contact uploader .SH SYNOPSIS -.B upldif -[-p pin][-u][-h][-v] +.B upldif +[-p pin][-P password][-u][-h][-v] .SH DESCRIPTION .PP .B upldif @@ -33,6 +33,9 @@ Specify the PIN of the device to talk to. Only needed if there are multiple Blackberries plugged into your system at once. .TP +.B \-P password +Simplistic method to specify device password. +.TP .B \-u Actually do the upload. If not specified, upldif only dumps the parsed LDIF data to stdout for verification. @@ -54,10 +57,10 @@ .SH AUTHOR .nh -.B upldif +.B upldif is part of the Barry project. This manual page was written by Chris Frey. .SH SEE ALSO .PP -http://www.netdirect.ca/software/packages/barry/index.php +http://www.netdirect.ca/software/packages/barry diff -Nru barry-0.14/MANIFEST barry-0.0.20110506/MANIFEST --- barry-0.14/MANIFEST 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/MANIFEST 2011-05-06 12:20:25.000000000 +0000 @@ -0,0 +1,706 @@ +AUTHORS +COPYING +ChangeLog +DEPUTY +Doxyfile +Makefile.am +NEWS +README +TODO +bash/README +bash/bjavaloader +bash/btool +buildgen.sh +config.rpath +configure.ac +contrib/barry-unbind-storage.sh +contrib/modemtest.rb +contrib/perlbarry/COPYING +contrib/perlbarry/README +contrib/perlbarry/TODO +contrib/perlbarry/barrybkup +contrib/perlbarry/bimages +contrib/perlbarry/ipd2tgz +contrib/perlbarry/misc/README +contrib/perlbarry/misc/backup +contrib/perlbarry/misc/convert-dumps +contrib/perlbarry/misc/deipd +contrib/perlbarry/misc/dump-simple +contrib/perlbarry/misc/reipd +contrib/perlbarry/misc/split-jpeg +data/dbsetup +data/init-get +desktop/AUTHORS +desktop/COPYING +desktop/ChangeLog +desktop/Makefile.am +desktop/NEWS +desktop/README +desktop/TODO +desktop/buildgen.sh +desktop/configure.ac +desktop/doc/DesktopPlan.txt +desktop/doc/apple-darwin9.txt +desktop/images/Makefile.am +desktop/images/README +desktop/images/apploader-focus.png +desktop/images/apploader-normal.png +desktop/images/apploader-pushed.png +desktop/images/background.png +desktop/images/backuprestore-focus.png +desktop/images/backuprestore-normal.png +desktop/images/backuprestore-pushed.png +desktop/images/barry_logo_icon.xpm +desktop/images/browsedatabases-focus.png +desktop/images/browsedatabases-normal.png +desktop/images/browsedatabases-pushed.png +desktop/images/deviceswitch-focus.png +desktop/images/deviceswitch-normal.png +desktop/images/deviceswitch-pushed.png +desktop/images/logo_NetDirect.xpm +desktop/images/media-focus.png +desktop/images/media-normal.png +desktop/images/media-pushed.png +desktop/images/misc-focus.png +desktop/images/misc-normal.png +desktop/images/misc-pushed.png +desktop/images/modem-focus.png +desktop/images/modem-normal.png +desktop/images/modem-pushed.png +desktop/images/scanning.png +desktop/images/sync-focus.png +desktop/images/sync-normal.png +desktop/images/sync-pushed.png +desktop/man/Makefile.am +desktop/man/barrydesktop.1 +desktop/src/0.22/Makefile.am +desktop/src/0.22/xmlmap +desktop/src/0.40/Makefile.am +desktop/src/0.40/xmlmap +desktop/src/BaseButtons.cc +desktop/src/BaseButtons.h +desktop/src/BaseFrame.cc +desktop/src/BaseFrame.h +desktop/src/CUI_Barry.cc +desktop/src/CUI_Barry.h +desktop/src/CUI_Evolution.cc +desktop/src/CUI_Evolution.h +desktop/src/CUI_Google.cc +desktop/src/CUI_Google.h +desktop/src/ClickImage.cc +desktop/src/ClickImage.h +desktop/src/ConflictDlg.cc +desktop/src/ConflictDlg.h +desktop/src/ContactEditDlg.cc +desktop/src/ContactEditDlg.h +desktop/src/ContactEditDlg.wxg +desktop/src/ContactPhotoWidget.cc +desktop/src/ContactPhotoWidget.h +desktop/src/GroupCfgDlg.cc +desktop/src/GroupCfgDlg.h +desktop/src/Makefile.am +desktop/src/Mode.h +desktop/src/Mode_Browse.cc +desktop/src/Mode_Browse.h +desktop/src/Mode_MainMenu.cc +desktop/src/Mode_MainMenu.h +desktop/src/Mode_Sync.cc +desktop/src/Mode_Sync.h +desktop/src/PNGButton.cc +desktop/src/PNGButton.h +desktop/src/StringSync.cc +desktop/src/StringSync.h +desktop/src/SyncStatusDlg.cc +desktop/src/SyncStatusDlg.h +desktop/src/barrydesktop.cc +desktop/src/barrydesktop.h +desktop/src/bsynccl.cc +desktop/src/bsyncjail.cc +desktop/src/configui.cc +desktop/src/configui.h +desktop/src/deviceset.cc +desktop/src/deviceset.h +desktop/src/dlopen.cc +desktop/src/dlopen.h +desktop/src/error.cc +desktop/src/error.h +desktop/src/exechelper.cc +desktop/src/exechelper.h +desktop/src/ipc.h +desktop/src/null-os22.cc +desktop/src/null-os40.cc +desktop/src/oextract.cc +desktop/src/optout.h +desktop/src/os22.cc +desktop/src/os22.h +desktop/src/os40.cc +desktop/src/os40.h +desktop/src/osbase.cc +desktop/src/osbase.h +desktop/src/osconfig.cc +desktop/src/osconfig.h +desktop/src/osconv22.cc +desktop/src/osconv22.h +desktop/src/osconv40.cc +desktop/src/osconv40.h +desktop/src/osprivatebase.h +desktop/src/ostest.cc +desktop/src/tempdir.cc +desktop/src/tempdir.h +desktop/src/util.cc +desktop/src/util.h +desktop/src/windowids.h +desktop/src/xmlcompactor.cc +desktop/src/xmlcompactor.h +desktop/src/xmlmap.cc +desktop/src/xmlmap.h +doc/0001-Snoop-limit-and-endpoint-patch.patch +doc/CommitPolicy.txt +doc/Exceptions +doc/Hacking +doc/ReleaseChecklist.txt +doc/TimeZones.txt +doc/USB-capture.txt +doc/VersionNotes +doc/autotext-format.txt +doc/barry-research.ods +doc/bb_sms_format.txt +doc/bb_task_format.txt +doc/bjdwp/README +doc/bjdwp/jdwp-class.txt +doc/bjdwp/jdwp-connection.txt +doc/bjdwp/jdwp-methods-and-fields.txt +doc/bjdwp/jdwp-protocol.txt +doc/bjdwp/jdwp-resume.txt +doc/bjdwp/jdwp-suspend.txt +doc/bjdwp/sample/BarryDemo.cod +doc/bjdwp/sample/BarryDemo.cso +doc/bjdwp/sample/BarryDemo.debug +doc/bjdwp/sample/BarryDemo.debug.txt +doc/bjdwp/sample/BarryDemo.jad +doc/bjdwp/sample/BarryDemo.jar +doc/bjdwp/sample/BarryDemo.java +doc/bjdwp/sample/BarryDemo.rapc +doc/bjdwp/sample/build.sh +doc/bjdwp/sample/test.txt +doc/bookmark.txt +doc/cod-format +doc/javaloader +doc/javaloader-reset.txt +doc/jdwp/usb-protocol.txt +doc/screenshot +doc/servicebook-notes.txt +doc/vsm/MyVSM-001 +doc/vsm/MyVSM-001.txt +doc/vsm/VSM_analysis.txt +doc/www/README +doc/www/append.php +doc/www/backup.png +doc/www/backups.php +doc/www/barry.inc +doc/www/bugs.php +doc/www/clean.sh +doc/www/codingguide.php +doc/www/config-backup.png +doc/www/config.png +doc/www/contact.php +doc/www/content_list +doc/www/cvs.php +doc/www/default.css +doc/www/dependencies.php +doc/www/design.php +doc/www/devices.php +doc/www/doxygen/README +doc/www/hacking.php +doc/www/index.php +doc/www/install.php +doc/www/label.png +doc/www/logs.php +doc/www/modem.php +doc/www/patches.php +doc/www/php_conf1.php +doc/www/php_conf2.php +doc/www/php_conf3.php +doc/www/prepend.php +doc/www/rawchannel.php +doc/www/requirements.php +doc/www/restore.png +doc/www/roadmap.php +doc/www/static.sh +doc/www/sync.php +doc/www/troubleshooting.php +examples/Makefile.am +examples/addcalendar.cc +examples/addcontact.cc +examples/addmemo.cc +examples/dbdump.cc +examples/pipedump.cc +examples/usbclient.cc +gui/AUTHORS +gui/COPYING +gui/ChangeLog +gui/Makefile.am +gui/NEWS +gui/README +gui/TODO +gui/buildgen.sh +gui/configure.ac +gui/man/Makefile.am +gui/man/barrybackup.1 +gui/po/ChangeLog +gui/po/LINGUAS +gui/po/Makevars +gui/po/POTFILES.in +gui/po/README +gui/po/Rules-quot +gui/po/barry-backup.pot +gui/po/boldquot.sed +gui/po/en@boldquot.header +gui/po/en@quot.header +gui/po/fr.po +gui/po/insert-header.sin +gui/po/quot.sed +gui/po/remove-potcdate.sin +gui/src/BackupWindow.cc +gui/src/BackupWindow.glade +gui/src/BackupWindow.h +gui/src/ConfigDlg.cc +gui/src/ConfigDlg.glade +gui/src/ConfigDlg.h +gui/src/DatabaseSelectDlg.cc +gui/src/DatabaseSelectDlg.glade +gui/src/DatabaseSelectDlg.h +gui/src/DeviceBus.cc +gui/src/DeviceBus.h +gui/src/DeviceIface.cc +gui/src/DeviceIface.h +gui/src/Makefile.am +gui/src/PasswordDlg.cc +gui/src/PasswordDlg.glade +gui/src/PasswordDlg.h +gui/src/PromptDlg.cc +gui/src/PromptDlg.glade +gui/src/PromptDlg.h +gui/src/Thread.cc +gui/src/Thread.h +gui/src/barry-gui.glade +gui/src/gettext.h +gui/src/i18n.h +gui/src/main.cc +gui/src/util.cc +gui/src/util.h +hal/fdi/information/10freedesktop/10-blackberry.fdi +hal/fdi/policy/10osvendor/19-blackberry-acl.fdi +hal/hal-blackberry +hotplug/README +hotplug/barry +hotplug/barry.usermap +libbarry-0.pc.in +libbarryalx-0.pc.in +libbarrybackup-0.pc.in +libbarrydp-0.pc.in +libbarryjdwp-0.pc.in +libbarrysync-0.pc.in +logo/README +logo/barry_logo.svg +logo/barry_logo_icon.png +logo/barry_logo_icon.svg +logo/new_barry_icon_128.svg +m4/ax_c_check_flag.m4 +m4/ax_cxx_check_flag.m4 +m4/pkg.m4 +maintainer/README +maintainer/abi/0.16.xml +maintainer/abi/0.17.0.xml +maintainer/abi/README +maintainer/abi/abi-prepare.sh +maintainer/abi/configure-lib.sh +maintainer/barrychroots +maintainer/barrylocal +maintainer/deb-src-create.sh +maintainer/deb.sh +maintainer/deblocal.sh +maintainer/depscripts/fedora14.sh +maintainer/depscripts/ubuntu-maverick.sh +maintainer/git-extract.sh +maintainer/git-release-tar.sh +maintainer/git-tagged-release.sh +maintainer/make-deb-local.sh +maintainer/make-deb.sh +maintainer/make-rpm.sh +maintainer/make-user-rpm.sh +maintainer/release-root.sh +maintainer/release.sh +maintainer/rpm.sh +maintainer/rpmroot.sh +maintainer/tagged-release.sh +maintainer/tar-create.sh +maintainer/tar-prepare.sh +maintainer/test-build-local.sh +maintainer/test-build.sh +maintainer/test-root.sh +maintainer/test.sh +man/Makefile.am +man/balxparse.1 +man/bcharge.1 +man/bfuse.1 +man/bidentify.1 +man/bio.1 +man/bjavaloader.1 +man/bjdwp.1 +man/brawchannel.1 +man/brecsum.1 +man/breset.1 +man/bs11nread.1 +man/btardump.1 +man/btool.1 +man/manpage.1.ex +man/pppob.1 +man/upldif.1 +menu/barrybackup.desktop +menu/barrydesktop.desktop +modprobe/blacklist-berry_charge.conf +opensync-plugin-0.4x/AUTHORS +opensync-plugin-0.4x/COPYING +opensync-plugin-0.4x/ChangeLog +opensync-plugin-0.4x/Makefile.am +opensync-plugin-0.4x/NEWS +opensync-plugin-0.4x/README +opensync-plugin-0.4x/buildgen.sh +opensync-plugin-0.4x/configure.ac +opensync-plugin-0.4x/debian/changelog +opensync-plugin-0.4x/debian/compat +opensync-plugin-0.4x/debian/control +opensync-plugin-0.4x/debian/copyright +opensync-plugin-0.4x/debian/docs +opensync-plugin-0.4x/debian/opensync-plugin-barry-4x-dbg.install +opensync-plugin-0.4x/debian/opensync-plugin-barry-4x.install +opensync-plugin-0.4x/debian/rules +opensync-plugin-0.4x/m4/ax_c_check_flag.m4 +opensync-plugin-0.4x/m4/ax_cxx_check_flag.m4 +opensync-plugin-0.4x/src/Makefile.am +opensync-plugin-0.4x/src/barry-sync +opensync-plugin-0.4x/src/barry_sync.cc +opensync-plugin-0.4x/src/barry_sync.h +opensync-plugin-0.4x/src/environment.cc +opensync-plugin-0.4x/src/environment.h +opensync-plugin-0.4x/src/format_check.h +opensync-plugin-0.4x/src/tosserror.h +opensync-plugin-0.4x/src/trace.h +opensync-plugin-0.4x/src/vcard.cc +opensync-plugin-0.4x/src/vcard.h +opensync-plugin-0.4x/src/vevent.cc +opensync-plugin-0.4x/src/vevent.h +opensync-plugin-0.4x/src/vjournal.cc +opensync-plugin-0.4x/src/vjournal.h +opensync-plugin-0.4x/src/vtodo.cc +opensync-plugin-0.4x/src/vtodo.h +opensync-plugin/AUTHORS +opensync-plugin/COPYING +opensync-plugin/ChangeLog +opensync-plugin/Makefile.am +opensync-plugin/NEWS +opensync-plugin/README +opensync-plugin/buildgen.sh +opensync-plugin/configure.ac +opensync-plugin/debian/changelog +opensync-plugin/debian/compat +opensync-plugin/debian/control +opensync-plugin/debian/copyright +opensync-plugin/debian/opensync-plugin-barry-dbg.install +opensync-plugin/debian/opensync-plugin-barry.install +opensync-plugin/debian/rules +opensync-plugin/m4/ax_c_check_flag.m4 +opensync-plugin/m4/ax_cxx_check_flag.m4 +opensync-plugin/patches/README +opensync-plugin/patches/kitchensync-svn-20070712-enable.patch +opensync-plugin/patches/libopensync-plugin-evolution2-0.22-file-path-fudge.patch +opensync-plugin/src/Makefile.am +opensync-plugin/src/barry-sync +opensync-plugin/src/barry_sync.cc +opensync-plugin/src/barry_sync.h +opensync-plugin/src/environment.cc +opensync-plugin/src/environment.h +opensync-plugin/src/idmap.cc +opensync-plugin/src/idmap.h +opensync-plugin/src/trace.h +opensync-plugin/src/vcard.cc +opensync-plugin/src/vcard.h +opensync-plugin/src/vevent.cc +opensync-plugin/src/vevent.h +po/ChangeLog +po/LINGUAS +po/Makevars +po/POTFILES.in +po/README +po/Rules-quot +po/barry.pot +po/boldquot.sed +po/en@boldquot.header +po/en@quot.header +po/fr.po +po/insert-header.sin +po/quot.sed +po/remove-potcdate.sin +ppp/README +ppp/barry-att_cingular +ppp/barry-att_cingular.chat +ppp/barry-chinamobile +ppp/barry-chinamobile.chat +ppp/barry-fido.chat +ppp/barry-kpn +ppp/barry-kpn.chat +ppp/barry-minimal +ppp/barry-minimal.chat +ppp/barry-o2ireland +ppp/barry-o2ireland.chat +ppp/barry-optus-au +ppp/barry-optus-au.chat +ppp/barry-orange-spain +ppp/barry-orange-spain.chat +ppp/barry-rogers +ppp/barry-rogers.chat +ppp/barry-sprint +ppp/barry-sprint.chat +ppp/barry-telus +ppp/barry-telus.chat +ppp/barry-tmobileus +ppp/barry-tmobileus.chat +ppp/barry-verizon +ppp/barry-verizon.chat +ppp/barry-vodafone-au +ppp/barry-vodafone-au.chat +rpm/barry.spec +src/Makefile.am +src/README +src/a_alxparser.cc +src/a_alxparser.h +src/a_application.cc +src/a_application.h +src/a_codsection.cc +src/a_codsection.h +src/a_common.h +src/a_library.cc +src/a_library.h +src/a_osloader.cc +src/a_osloader.h +src/backup.cc +src/backup.h +src/barry.h +src/barryalx.h +src/barrybackup.h +src/barrysync.h +src/base64.cc +src/base64.h +src/bmp-internal.h +src/bmp.cc +src/bmp.h +src/builder.cc +src/builder.h +src/cbarry.h +src/clog.h +src/cod-internal.h +src/cod.cc +src/cod.h +src/common.cc +src/common.h +src/configfile.cc +src/configfile.h +src/connector.cc +src/connector.h +src/controller.cc +src/controller.h +src/controllerpriv.h +src/convo.awk +src/data.cc +src/data.h +src/dataqueue.cc +src/dataqueue.h +src/debug.h +src/dll.h +src/dp_codinfo.cc +src/dp_codinfo.h +src/dp_parser.cc +src/dp_parser.h +src/endian.h +src/error.cc +src/error.h +src/iconv.cc +src/iconv.h +src/iconvwin.cc +src/j_jdwp.cc +src/j_jdwp.h +src/j_manager.cc +src/j_manager.h +src/j_message.cc +src/j_message.h +src/j_record.cc +src/j_server.cc +src/j_server.h +src/ldif.cc +src/ldif.h +src/ldifio.cc +src/ldifio.h +src/legal.txt +src/log.cc +src/log.h +src/m_desktop.cc +src/m_desktop.h +src/m_desktoptmpl.h +src/m_ipmodem.cc +src/m_ipmodem.h +src/m_javaloader.cc +src/m_javaloader.h +src/m_jvmdebug.cc +src/m_jvmdebug.h +src/m_mode_base.cc +src/m_mode_base.h +src/m_raw_channel.cc +src/m_raw_channel.h +src/m_serial.cc +src/m_serial.h +src/mimeio.cc +src/mimeio.h +src/modem.h +src/packet.cc +src/packet.h +src/parser.cc +src/parser.h +src/pin.cc +src/pin.h +src/pipe.cc +src/pipe.h +src/platform.h +src/pppfilter.cc +src/pppfilter.h +src/probe.cc +src/probe.h +src/protocol.cc +src/protocol.h +src/protostructs.h +src/publiccfg.h.in +src/r_bookmark.cc +src/r_bookmark.h +src/r_calendar.cc +src/r_calendar.h +src/r_calllog.cc +src/r_calllog.h +src/r_command.cc +src/r_contact.cc +src/r_contact.h +src/r_cstore.cc +src/r_cstore.h +src/r_dbdb.cc +src/r_folder.cc +src/r_folder.h +src/r_hhagent.cc +src/r_hhagent.h +src/r_memo.cc +src/r_memo.h +src/r_message.h +src/r_message_base.cc +src/r_message_base.h +src/r_pin_message.h +src/r_recordstate.cc +src/r_recur_base.cc +src/r_recur_base.h +src/r_saved_message.h +src/r_servicebook.cc +src/r_servicebook.h +src/r_sms.cc +src/r_sms.h +src/r_task.cc +src/r_task.h +src/r_timezone.cc +src/r_timezone.h +src/record-internal.h +src/record.cc +src/record.h +src/restore.cc +src/restore.h +src/router.cc +src/router.h +src/s11n-boost.h +src/scoped_lock.h +src/semaphore.h +src/sha1.cc +src/sha1.h +src/socket.cc +src/socket.h +src/strnlen.c +src/strnlen.h +src/tarfile-ops-nt.cc +src/tarfile.cc +src/tarfile.h +src/threadwrap.cc +src/threadwrap.h +src/time.cc +src/time.h +src/trim.h +src/tzwrapper.cc +src/tzwrapper.h +src/usbwrap.cc +src/usbwrap.h +src/vbase.cc +src/vbase.h +src/vcard.cc +src/vcard.h +src/version.cc +src/version.h +src/vevent.cc +src/vevent.h +src/vformat.c +src/vformat.h +src/vjournal.cc +src/vjournal.h +src/vsmartptr.h +src/vtodo.cc +src/vtodo.h +src/xmlparser.cc +src/xmlparser.h +test/Makefile.am +test/buildtest.sh +test/data.cc +test/date.cc +test/libtest.cc +test/libtest.h +tools/Makefile.am +tools/Makefile.plain +tools/balxparse.cc +tools/bcharge.cc +tools/bdptest.cc +tools/bfuse.cc +tools/bidentify.cc +tools/bio.cc +tools/bjavaloader.cc +tools/bjdwp.cc +tools/bjvmdebug.cc +tools/bktrans.cc +tools/brawchannel.cc +tools/brecsum.cc +tools/brecsum.h +tools/breset.cc +tools/brimtrans.cc +tools/bs11nread.cc +tools/btardump.cc +tools/btool.cc +tools/btranslate.cc +tools/gettext.h +tools/i18n.h +tools/mimedump.h +tools/platform.h +tools/pppob.cc +tools/upldif.cc +udev/10-blackberry.rules +udev/69-blackberry.rules +udev/99-blackberry-perms.rules +udev/README +usbmon-6/COPYING +usbmon-6/Makefile +usbmon-6/README +usbmon-6/usbmon.8 +usbmon-6/usbmon.c +zsh/README +zsh/_bjavaloader +zsh/_btardump +zsh/_btool diff -Nru barry-0.14/menu/barrybackup.desktop barry-0.0.20110506/menu/barrybackup.desktop --- barry-0.14/menu/barrybackup.desktop 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/menu/barrybackup.desktop 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Barry Backup +Comment=Backup and restore databases on the BlackBerry Handheld +Exec=barrybackup +Icon=barry_logo_icon +Terminal=false +Type=Application +StartupWMClass=barrybackup-gui +Categories=Utility; + diff -Nru barry-0.14/menu/barrydesktop.desktop barry-0.0.20110506/menu/barrydesktop.desktop --- barry-0.14/menu/barrydesktop.desktop 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/menu/barrydesktop.desktop 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Barry Desktop Panel +Comment=Manage BlackBerry devices from a central GUI. +Exec=barrydesktop +Icon=barry_desktop_icon +Terminal=false +Type=Application +StartupWMClass=barrydesktop +Categories=Utility; + diff -Nru barry-0.14/missing barry-0.0.20110506/missing --- barry-0.14/missing 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/missing 1970-01-01 00:00:00.000000000 +0000 @@ -1,360 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2005-06-08.21 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# 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. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# 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 - -msg="missing on your system" - -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 - ;; - - -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. - -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' - 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 - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# 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). -case "$1" in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - 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 "$1" in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - 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 [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -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 [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -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 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - 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 's/.*-o \([^ ]*\).*/\1/p'` - 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 - ;; - - tar) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - 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 - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff -Nru barry-0.14/modprobe/blacklist-berry_charge barry-0.0.20110506/modprobe/blacklist-berry_charge --- barry-0.14/modprobe/blacklist-berry_charge 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/modprobe/blacklist-berry_charge 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# conflicts with Barry's bcharge utility -blacklist berry_charge - diff -Nru barry-0.14/modprobe/blacklist-berry_charge.conf barry-0.0.20110506/modprobe/blacklist-berry_charge.conf --- barry-0.14/modprobe/blacklist-berry_charge.conf 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/modprobe/blacklist-berry_charge.conf 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,3 @@ +# conflicts with Barry's bcharge utility +blacklist berry_charge + diff -Nru barry-0.14/NEWS barry-0.0.20110506/NEWS --- barry-0.14/NEWS 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/NEWS 2011-05-06 12:20:16.000000000 +0000 @@ -48,5 +48,5 @@ ------------------------------------------------------------------------------ -See http://sourceforge.net/projects/barry for the latest news. +See http://www.netdirect.ca/software/packages/barry for the latest news. diff -Nru barry-0.14/opensync-plugin/aclocal.m4 barry-0.0.20110506/opensync-plugin/aclocal.m4 --- barry-0.14/opensync-plugin/aclocal.m4 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/aclocal.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,7402 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 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. - -# 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. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# 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 -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$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 conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - 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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # 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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$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>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - 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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -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*) - 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 - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - 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 -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - 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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $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 .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != 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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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 -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[[123]]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -AC_MSG_RESULT([$dynamic_linker]) -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 -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[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 -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - 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 <&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 - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - 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 - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[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 &1 /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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -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 -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - 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 - 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]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# 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]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f 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 -]) -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 - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # 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_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = 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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=no - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$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]].*|aix5*) - 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. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - 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 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) 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. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# 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. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi - -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[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. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - -# Copyright (C) 2002, 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. - -# 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. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 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. - -# 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` -]) - - -# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 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 4 - -# This was merged into AC_PROG_CC in Autoconf. - -AU_DEFUN([AM_PROG_CC_STDC], -[AC_PROG_CC -AC_DIAGNOSE([obsolete], [$0: - your code should no longer depend upon `am_cv_prog_cc_stdc', but upon - `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when - you adjust the code. You can also remove the above call to - AC_PROG_CC if you already called it elsewhere.]) -am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc -]) -AU_DEFUN([fp_PROG_CC_STDC]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 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 7 - -# 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]) -AC_SUBST([$1_FALSE]) -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 -# 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 8 - -# 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], 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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 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 3 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 -# 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 - -# 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.58])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 -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -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 - 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) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -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 -]) -]) - - -# 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_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 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. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -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 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_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.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 -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 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 4 - -# 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 -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 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 3 - -# _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], -[AC_FOREACH([_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])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 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 4 - -# 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 -# 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 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# 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="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 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 - -# _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. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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/ax_c_check_flag.m4]) -m4_include([../m4/ax_cxx_check_flag.m4]) diff -Nru barry-0.14/opensync-plugin/config.h.in barry-0.0.20110506/opensync-plugin/config.h.in --- barry-0.14/opensync-plugin/config.h.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION diff -Nru barry-0.14/opensync-plugin/configure barry-0.0.20110506/opensync-plugin/configure --- barry-0.14/opensync-plugin/configure 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,22863 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Barry OpenSync Plugin 0.2. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -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 - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -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 - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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'" - - - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - - - -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, 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= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='Barry OpenSync Plugin' -PACKAGE_TARNAME='barryplugin' -PACKAGE_VERSION='0.2' -PACKAGE_STRING='Barry OpenSync Plugin 0.2' -PACKAGE_BUGREPORT='' - -ac_unique_file="src/barry_sync.cc" -# 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='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -PKG_CONFIG -PACKAGE_CFLAGS -PACKAGE_LIBS -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -CPP -GREP -EGREP -CXX -CXXFLAGS -ac_ct_CXX -CXXDEPMODE -am__fastdepCXX_TRUE -am__fastdepCXX_FALSE -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -LN_S -ECHO -AR -RANLIB -CXXCPP -F77 -FFLAGS -ac_ct_F77 -LIBTOOL -SED -WITH_GCCVISIBILITY_TRUE -WITH_GCCVISIBILITY_FALSE -BARRY_CFLAGS -BARRY_LIBS -TREE_BUILD_CXXFLAGS -TREE_BUILD_LDFLAGS -OPENSYNC_CONFIGDIR -OPENSYNC_PLUGINDIR -OPENSYNC_FORMATSDIR -OPENSYNC_HEADERDIR -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -PKG_CONFIG -PACKAGE_CFLAGS -PACKAGE_LIBS -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC -CXXCPP -F77 -FFLAGS -BARRY_CFLAGS -BARRY_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# 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=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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=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 ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - 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'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -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 - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -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 - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -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 .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - 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 .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - 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 Barry OpenSync Plugin 0.2 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/barryplugin] - --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 Barry OpenSync Plugin 0.2:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-static[=PKGS] build static libraries [default=no] - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-pic try to use only PIC/non-PIC objects [default=use - both] - --with-tags[=TAGS] include additional configurations [automatic] - -Some influential environment variables: - PKG_CONFIG path to pkg-config utility - PACKAGE_CFLAGS - C compiler flags for PACKAGE, overriding pkg-config - PACKAGE_LIBS - linker flags for PACKAGE, overriding pkg-config - 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 C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags - BARRY_CFLAGS - C compiler flags for BARRY, overriding pkg-config - BARRY_LIBS linker flags for BARRY, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_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" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 - 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 -Barry OpenSync Plugin configure 0.2 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 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 -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 Barry OpenSync Plugin $as_me 0.2, which was -generated by GNU Autoconf 2.61. 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=. - 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$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 - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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 - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - 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'; { (exit 1); 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 - -# 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 - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - 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. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -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,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -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 - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`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. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -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 - - -am__api_version="1.9" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -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. - - -# 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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -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 -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$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' - -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# 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". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" >&2;} - { (exit 1); exit 1; }; } - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! -Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! -Check your system clock" >&2;} - { (exit 1); exit 1; }; } -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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 $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 - -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } -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='barryplugin' - VERSION='0.2' - - -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"} - -install_sh=${install_sh-"$am_aux_dir/install-sh"} - -# 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - - -ac_config_headers="$ac_config_headers config.h" - - -pkg_modules="opensync-1.0 glib-2.0" - - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 - { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 -echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - PKG_CONFIG="" - fi - -fi - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for PACKAGE" >&5 -echo $ECHO_N "checking for PACKAGE... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$PACKAGE_CFLAGS"; then - pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 - ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$PACKAGE_LIBS"; then - pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 - ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -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 - PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$pkg_modules"` - else - PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"` - fi - # Put the nasty error message in config.log where it belongs - echo "$PACKAGE_PKG_ERRORS" >&5 - - { { echo "$as_me:$LINENO: error: Package requirements ($pkg_modules) were not met: - -$PACKAGE_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 PACKAGE_CFLAGS -and PACKAGE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements ($pkg_modules) were not met: - -$PACKAGE_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 PACKAGE_CFLAGS -and PACKAGE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: 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 PACKAGE_CFLAGS -and PACKAGE_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." >&5 -echo "$as_me: 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 PACKAGE_CFLAGS -and PACKAGE_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." >&2;} - { (exit 1); exit 1; }; } -else - PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS - PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_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='\' -fi - - -if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out 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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.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 - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - - -{ echo "$as_me:$LINENO: checking for library containing strerror" >&5 -echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } -if test "${ac_cv_search_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 strerror (); -int -main () -{ -return strerror (); - ; - return 0; -} -_ACEOF -for ac_lib in '' cposix; 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 - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_search_strerror=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_strerror+set}" = set; then - break -fi -done -if test "${ac_cv_search_strerror+set}" = set; then - : -else - ac_cv_search_strerror=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 -echo "${ECHO_T}$ac_cv_search_strerror" >&6; } -ac_res=$ac_cv_search_strerror -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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 -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$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 -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* 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" - 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -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 - -depcc="$CC" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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 - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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 -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$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 - - - -am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc - -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 -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f 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 -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -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 - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_GREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_EGREP" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -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_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -depcc="$CXX" am_compiler_list= - -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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'. - 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_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - 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 - - case $depmode in - 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 - ;; - none) break ;; - esac - # 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. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none -fi - -fi -{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type - - - -if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' -else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -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=no -fi - - - -# 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-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 - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -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 - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$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 - 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 - -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -aix4* | aix5*) - 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'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - 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 - ;; - -gnu*) - 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]) 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 - ;; - -interix3*) - # 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 Linux ELF. -linux* | k*bsd*-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=unknown - ;; - -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 - ;; - -solaris*) - 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 - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -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 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 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:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 7081 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - 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-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - 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" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - 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 -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - -# 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } -if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_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 >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -fi - - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn - 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_F77" && break -done - - if test "x$ac_ct_F77" = x; then - F77="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - F77=$ac_ct_F77 - fi -fi - - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_prog_f77_g=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - -# find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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*) - # 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; - ;; - - 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 - ;; - - 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 - ;; - *) - # 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. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - 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` - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } -else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux* | k*bsd*-gnu) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - 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 - -# 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 - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_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 -f 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 - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi - -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -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 - -# 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 to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$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 - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -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 \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 <&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 - -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 - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no - -# 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 - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi - -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -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;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:8930: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8934: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$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= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - 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*) - # 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' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - interix3*) - # 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 - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - hpux*) - # 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='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - 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 - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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' - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # 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' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - 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 - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$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:9198: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:9202: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } - -if test x"$lt_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 -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 - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:9302: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:9306: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$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 - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # 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_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = 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>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - 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 - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - - 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*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - 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 - ;; - - interix3*) - 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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs=no - 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 $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' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - 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 - ;; - - 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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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 - - 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 - ;; - - aix4* | aix5*) - 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 - 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")) && (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].*|aix5*) - 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_libdir_separator=':' - link_all_deplibs=yes - - 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 - hardcode_direct=yes - 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 - 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 - - # 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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 echo "${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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - 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*) - 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 - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - 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 `echo "$deplibs" | $SED -e '\''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' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - freebsd1*) - ld_shlibs=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 -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 -fPIC ${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 -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${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 - 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 -a "$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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${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' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - 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_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - 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 - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - 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 - ;; - - 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - 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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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 - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - 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' - 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 linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - 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*) - 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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 - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -# -# 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 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:$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=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant 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_AC_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 -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } - -if test "$hardcode_action" = relink; 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 - -striplib= -old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}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" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac -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*) - 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 - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; 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 - - ;; - - *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* 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 (); -/* 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_shl_load || defined __stub___shl_load -choke me -#endif - -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* 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 (); -/* 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_dlopen || defined __stub___dlopen -choke me -#endif - -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_svld_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* 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 -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_dld_link=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -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" - - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$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\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 < -#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 - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=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; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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 -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$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 - - -# Report which library types will actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 -# 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# 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. - -# 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//" - -# 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 - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# 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 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# 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 and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - -# 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 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 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# 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 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_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 - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\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 -EOF - ;; - esac - - # 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) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi - - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no - -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - -# 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. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - 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 - 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].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - 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_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - - if test "$GXX" = 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 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=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_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_CXX=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_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$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 - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_CXX=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_CXX=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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_CXX='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - 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. - # 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. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" - - -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - - for p in `eval $output_verbose_link_cmd`; do - case $p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi - - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi - -$rm -f confest.$objext - -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; - -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac - - -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac - -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-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_CXX='-Bstatic' - fi - ;; - amigaos*) - # 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_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # 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_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # 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*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:14035: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14039: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:14139: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:14143: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - linux* | k*bsd*-gnu) - link_all_deplibs_CXX=no - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# 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_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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 -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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 - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-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_F77='-Bstatic' - fi - ;; - - amigaos*) - # 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_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - interix3*) - # 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_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # 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_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-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_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # 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:15700: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:15704: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:15804: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:15808: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # 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_F77="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = 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_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$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_F77='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_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${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_F77='$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_F77='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_F77=no - else - ld_shlibs_F77=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $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_F77=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$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_F77=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_F77=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$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].*|aix5*) - 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_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - 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 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=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_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_F77=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_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$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. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$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*) - archive_cmds_F77='$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_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$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' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$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_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - *) - ld_shlibs_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } - -if test "$hardcode_action_F77" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_F77 - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_F77 - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_F77 - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_F77 - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_F77 - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# 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_F77 - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no - -old_archive_cmds_GCJ=$old_archive_cmds - - -lt_prog_compiler_no_builtin_flag_GCJ= - -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' - - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$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:17991: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17995: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi - -fi - -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic' - fi - ;; - - amigaos*) - # 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_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; - - interix3*) - # 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_GCJ=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; - - hpux*) - # 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_GCJ='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # 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_GCJ='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-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_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - linux* | k*bsd*-gnu) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # 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:18259: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:18263: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } - -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$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:18363: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:18367: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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 - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -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 - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # 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_GCJ="_GLOBAL_OFFSET_TABLE_" - # 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. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # 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 - ;; - esac - - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = 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_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [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 - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$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_GCJ='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_GCJ=no - fi - ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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' - ;; - - linux* | k*bsd*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - link_all_deplibs_GCJ=no - else - ld_shlibs_GCJ=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no - cat <&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. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=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 - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - 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 - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$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].*|aix5*) - 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_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - 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 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=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_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 - - # 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_GCJ=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_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$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. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$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*) - archive_cmds_GCJ='$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_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # 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. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$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' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$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_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - *) - ld_shlibs_GCJ=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ 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. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # 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. - 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 -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -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 - 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' - ;; - -aix4* | aix5*) - version_type=linux - 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*) - 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=`$echo "X$lib" | $Xsed -e '\''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' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - 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' - 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="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - 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 - ;; - 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 - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # 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}${versuffix}$shared_ext ${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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - 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 - ;; - -freebsd1*) - dynamic_linker=no - ;; - -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[123]*) 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 - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -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 - 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' - ;; - -interix3*) - 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' - 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 - 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 Linux ELF. -linux* | k*bsd*-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' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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 - 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=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=yes - ;; - -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" - ;; - -solaris*) - 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=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 - 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 - export_dynamic_flag_spec='${wl}-Blargedynsym' - 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 - 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 - 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' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - 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' - ;; - -uts4*) - version_type=linux - 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 -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$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 - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - -if test "$hardcode_action_GCJ" = relink; 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 - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_GCJ - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# 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_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - else - tagname="" - fi - ;; - - RC) - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# 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 warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$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 -printf "$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 conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # 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 - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# 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 - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_RC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_RC - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# 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 - -# 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 - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC - -# Library versioning type. -version_type=$version_type - -# 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 - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_RC - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_RC - -# 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 - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# 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 - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# 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_RC - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# 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_RC - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC - -# 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 - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -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" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - - - - - - - - - - - - - - - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&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" | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - # Extract the first word of "sed gsed" to use in msg output -if test -z "$SED"; then -set dummy sed gsed; ac_prog_name=$2 -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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" - { test -f "$ac_path_SED" && $as_test_x "$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 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - 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 - ac_count=`expr $ac_count + 1` - 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 - - -fi - -SED="$ac_cv_path_SED" -if test -z "$SED"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_SED=$SED -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 -echo "${ECHO_T}$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - - - - - flag=`echo "-fvisibility=hidden" | $SED 'y% .=/+-(){}<>:*,%_______________%'` - - { echo "$as_me:$LINENO: checking whether the C compiler accepts the -fvisibility=hidden flag" >&5 -echo $ECHO_N "checking whether the C compiler accepts the -fvisibility=hidden flag... $ECHO_C" >&6; } -if { as_var=ax_cv_c_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&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 - - - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} - -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - eval "ax_cv_c_check_flag_$flag=yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - eval "ax_cv_c_check_flag_$flag=no" - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - CFLAGS="$save_CFLAGS" - - 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 -ac_res=`eval echo '${'ax_cv_c_check_flag_$flag'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - - if eval "test \"`echo '$ax_cv_c_check_flag_'$flag`\" = yes"; then - - : - HAVE_C_GCCVISIBILITY=1 - -else - - : - HAVE_C_GCCVISIBILITY=0 - -fi - - - - - - - - flag=`echo "-fvisibility=hidden" | $SED 'y% .=/+-(){}<>:*,%_______________%'` - - { echo "$as_me:$LINENO: checking whether the C++ compiler accepts the -fvisibility=hidden flag" >&5 -echo $ECHO_N "checking whether the C++ compiler accepts the -fvisibility=hidden flag... $ECHO_C" >&6; } -if { as_var=ax_cv_cxx_check_flag_$flag; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} - -_ACEOF -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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - eval "ax_cv_cxx_check_flag_$flag=yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - - eval "ax_cv_cxx_check_flag_$flag=no" - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - CXXFLAGS="$save_CXXFLAGS" - - 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 -ac_res=`eval echo '${'ax_cv_cxx_check_flag_$flag'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - - if eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"; then - - : - HAVE_CXX_GCCVISIBILITY=1 - -else - - : - HAVE_CXX_GCCVISIBILITY=0 - -fi - - - - -if test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"; then - WITH_GCCVISIBILITY_TRUE= - WITH_GCCVISIBILITY_FALSE='#' -else - WITH_GCCVISIBILITY_TRUE='#' - WITH_GCCVISIBILITY_FALSE= -fi - - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - -pkg_failed=no -{ echo "$as_me:$LINENO: checking for BARRY" >&5 -echo $ECHO_N "checking for BARRY... $ECHO_C" >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$BARRY_CFLAGS"; then - pkg_cv_BARRY_CFLAGS="$BARRY_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libbarry-0 libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libbarry-0 libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_BARRY_CFLAGS=`$PKG_CONFIG --cflags "libbarry-0 libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$BARRY_LIBS"; then - pkg_cv_BARRY_LIBS="$BARRY_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libbarry-0 libusb\"") >&5 - ($PKG_CONFIG --exists --print-errors "libbarry-0 libusb") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - pkg_cv_BARRY_LIBS=`$PKG_CONFIG --libs "libbarry-0 libusb" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -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 - BARRY_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libbarry-0 libusb"` - else - BARRY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libbarry-0 libusb"` - fi - # Put the nasty error message in config.log where it belongs - echo "$BARRY_PKG_ERRORS" >&5 - - { { echo "$as_me:$LINENO: error: Package requirements (libbarry-0 libusb) were not met: - -$BARRY_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 BARRY_CFLAGS -and BARRY_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&5 -echo "$as_me: error: Package requirements (libbarry-0 libusb) were not met: - -$BARRY_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 BARRY_CFLAGS -and BARRY_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" >&2;} - { (exit 1); exit 1; }; } -elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: 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 BARRY_CFLAGS -and BARRY_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." >&5 -echo "$as_me: 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 BARRY_CFLAGS -and BARRY_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." >&2;} - { (exit 1); exit 1; }; } -else - BARRY_CFLAGS=$pkg_cv_BARRY_CFLAGS - BARRY_LIBS=$pkg_cv_BARRY_LIBS - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - : -fi - -# Carry the special tree build environment variables from parent configure, -# just in case user is doing a complete tree build with --enable-opensync-plugin - - - -OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir opensync-1.0) -OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir opensync-1.0) -OPENSYNC_FORMATSDIR=$(pkg-config --variable=formatsdir opensync-1.0) -OPENSYNC_HEADERDIR=$(pkg-config --variable=headerdir opensync-1.0) - - ## This is the place where you can install the default configuration files of your plugin - ## This is the dir where you plugin will be installed - ## Here are format plugins installed (if any) - ## Here are the headers that a user interface may need (if any) - -ac_config_files="$ac_config_files Makefile src/Makefile" - -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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_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 - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -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= -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=`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. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${WITH_GCCVISIBILITY_TRUE}" && test -z "${WITH_GCCVISIBILITY_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"WITH_GCCVISIBILITY\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"WITH_GCCVISIBILITY\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $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} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## 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=: - # 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 - - - - -# PATH needs CR -# 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 - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -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.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -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 - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -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 - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. 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" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # 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 -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -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 -fi -echo >conf$$.file -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 -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -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=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# 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 - -# 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 Barry OpenSync Plugin $as_me 0.2, which was -generated by GNU Autoconf 2.61. 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 - -cat >>$CONFIG_STATUS <<_ACEOF -# 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_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet 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_cs_version="\\ -Barry OpenSync Plugin config.status 0.2 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 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' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -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=$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 ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - 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. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$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 -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# 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" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - 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= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -PACKAGE_CFLAGS!$PACKAGE_CFLAGS$ac_delim -PACKAGE_LIBS!$PACKAGE_LIBS$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -RANLIB!$RANLIB$ac_delim -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -SED!$SED$ac_delim -WITH_GCCVISIBILITY_TRUE!$WITH_GCCVISIBILITY_TRUE$ac_delim -WITH_GCCVISIBILITY_FALSE!$WITH_GCCVISIBILITY_FALSE$ac_delim -BARRY_CFLAGS!$BARRY_CFLAGS$ac_delim -BARRY_LIBS!$BARRY_LIBS$ac_delim -TREE_BUILD_CXXFLAGS!$TREE_BUILD_CXXFLAGS$ac_delim -TREE_BUILD_LDFLAGS!$TREE_BUILD_LDFLAGS$ac_delim -OPENSYNC_CONFIGDIR!$OPENSYNC_CONFIGDIR$ac_delim -OPENSYNC_PLUGINDIR!$OPENSYNC_PLUGINDIR$ac_delim -OPENSYNC_FORMATSDIR!$OPENSYNC_FORMATSDIR$ac_delim -OPENSYNC_HEADERDIR!$OPENSYNC_HEADERDIR$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[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="$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 || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - 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 || -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" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`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 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# 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= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - 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 - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;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 -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then 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. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $ac_file | $ac_file:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $ac_file" >`$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 || -echo X$ac_file | - 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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /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 || -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 || -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 - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`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 || -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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# 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 || { (exit 1); exit 1; } -fi - diff -Nru barry-0.14/opensync-plugin/configure.ac barry-0.0.20110506/opensync-plugin/configure.ac --- barry-0.14/opensync-plugin/configure.ac 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/configure.ac 2011-05-06 12:20:17.000000000 +0000 @@ -1,10 +1,12 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.59) -AC_INIT([Barry OpenSync Plugin], 0.2, [], barryplugin) -AM_INIT_AUTOMAKE(foreign) +AC_PREREQ(2.61) +AC_INIT([Barry OpenSync Plugin], [0.18.0], [barry-devel@lists.sourceforge.net]) AC_CONFIG_SRCDIR(src/barry_sync.cc) AC_CONFIG_HEADER(config.h) +AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE(foreign) pkg_modules="opensync-1.0 glib-2.0" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) @@ -29,7 +31,7 @@ AC_LANG([C++]) -PKG_CHECK_MODULES([BARRY], [libbarry-0 libusb]) +PKG_CHECK_MODULES([BARRY], [libbarry-0 libbarrysync-0]) # Carry the special tree build environment variables from parent configure, # just in case user is doing a complete tree build with --enable-opensync-plugin diff -Nru barry-0.14/opensync-plugin/.cvsignore barry-0.0.20110506/opensync-plugin/.cvsignore --- barry-0.14/opensync-plugin/.cvsignore 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/.cvsignore 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru barry-0.14/opensync-plugin/debian/changelog barry-0.0.20110506/opensync-plugin/debian/changelog --- barry-0.14/opensync-plugin/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/changelog 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,6 @@ +opensync-plugin-barry (0.18-0) unstable; urgency=low + + * Individual package for the 0.22 plugin + + -- Chris Frey Thu, 16 Sep 2010 03:20:17 -0400 + diff -Nru barry-0.14/opensync-plugin/debian/compat barry-0.0.20110506/opensync-plugin/debian/compat --- barry-0.14/opensync-plugin/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/compat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1 @@ +4 diff -Nru barry-0.14/opensync-plugin/debian/control barry-0.0.20110506/opensync-plugin/debian/control --- barry-0.14/opensync-plugin/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/control 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,26 @@ +Source: opensync-plugin-barry +Section: misc +Priority: optional +Maintainer: Chris Frey +Build-Depends: debhelper (>= 4.0.0), g++ (>= 4.1), cdbs, autoconf, automake, libtool, pkg-config, libusb-dev, zlib1g-dev, libopensync0-dev (>= 0.22), libopensync0-dev (<< 0.30), libbarry-dev (>= 0.18) +Standards-Version: 3.8.0 + +Package: opensync-plugin-barry +Section: libs +Architecture: any +Depends: libopensync0 (>= 0.22), libopensync0 (<< 0.30), libbarry0 (>= 0.18), libbarry0 (<< 0.19), ${shlibs:Depends} +Description: Opensync Blackberry plugin, based on the Barry project + Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. + . + This package contains an opensync plugin for use with libopensync 0.22. + +Package: opensync-plugin-barry-dbg +Section: libs +Priority: extra +Architecture: any +Depends: libopensync0 (>= 0.22), libopensync0 (<< 0.30), opensync-plugin-barry (= ${binary:Version}) +Description: Opensync Blackberry plugin, based on the Barry project + Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. + . + This package contains the debug version of the Barry opensync plugin. + diff -Nru barry-0.14/opensync-plugin/debian/copyright barry-0.0.20110506/opensync-plugin/debian/copyright --- barry-0.14/opensync-plugin/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/copyright 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,58 @@ +This package was debianized by Chris Frey on +Fri, 29 Dec 2006 20:34:01 -0500. + +It was downloaded from http://sourceforge.net/projects/barry + +Upstream Authors: + Chris Frey + + +Copyright: + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Chris Frey + Copyright (C) 2008, Brian Edginton (edge@edginton.net) + Copyright (C) 1995-9 by Cryptography Research, Inc. + Copyright (C) 2003 Ximian, Inc. 2005 Armin Bauer + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2009, Josh Kropf + For scripts in contrib/ directory: + Copyright (C) 2008 Niels de Vos + Copyright (C) 2008, ashley willis + + +License: + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + + For opensync-plugin/src/vformat.[c,h]: + 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, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL'. diff -Nru barry-0.14/opensync-plugin/debian/opensync-plugin-barry-dbg.install barry-0.0.20110506/opensync-plugin/debian/opensync-plugin-barry-dbg.install --- barry-0.14/opensync-plugin/debian/opensync-plugin-barry-dbg.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/opensync-plugin-barry-dbg.install 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,2 @@ +opensync-plugin-barry-dbg/usr/lib/debug/* + diff -Nru barry-0.14/opensync-plugin/debian/opensync-plugin-barry.install barry-0.0.20110506/opensync-plugin/debian/opensync-plugin-barry.install --- barry-0.14/opensync-plugin/debian/opensync-plugin-barry.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/opensync-plugin-barry.install 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,3 @@ +debian/tmp/usr/lib/opensync/* +debian/tmp/usr/share/opensync/defaults/barry-sync + diff -Nru barry-0.14/opensync-plugin/debian/rules barry-0.0.20110506/opensync-plugin/debian/rules --- barry-0.14/opensync-plugin/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/debian/rules 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +# Based on the multi2 sample debian/rules file: +# --- +# Sample debian/rules that uses debhelper. +# This file is public domain software, originally written by Joey Hess. + +#export DH_VERBOSE=1 +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +#include /usr/share/cdbs/1/rules/simple-patchsys.mk + +# where sources are +DEB_SRCDIR = . +# in which directory to build +DEB_BUILDDIR = . +# in which directory to install the sofware(must be full path! CURDIR does this) +DEB_DESTDIR = $(CURDIR)/debian/tmp +#To register a debug library package libfoo-dbg for libfoo (which needs unstripped '.so') in compat mode 4: +DEB_DH_STRIP_ARGS := --dbg-package=opensync-plugin-barry +#CDBS automatically handles common flags to pass to the configure script, +#but it is possible to give some extra parameters : +#DEB_CONFIGURE_EXTRA_FLAGS := +COMMON_CONFIGURE_FLAGS := --prefix=/usr +DEB_INSTALL_DOCS_ALL = + +post-patches:: + @rm -f $(CURDIR)/deb_srcdir + @ln -s $(DEB_SRCDIR) $(CURDIR)/deb_srcdir + @test -x $(DEB_SRCDIR)/configure && echo "allready autoreconf" || (cd $(DEB_SRCDIR) && autoreconf -i) + +makebuilddir:: + # This rule is meant for the parent debian/rules to be able to call + # us, and give us the location of a pre-built libbarry to + # insert into our DESTDIR, to avoid needing to install + # libbarry-dev to build this package. + # If TREE_BUILD_DIR is empty, nothing happens. + (if [ -n "$(TREE_BUILD_DIR)" ] ; then \ + cd $(TREE_BUILD_DIR) && \ + make DESTDIR=$(DEB_DESTDIR) install && \ + rm -f `find $(DEB_DESTDIR) -name "*.la"` && \ + cp $(TREE_BUILD_DIR)/debian/libbarry*/DEBIAN/shlibs \ + $(CURDIR)/debian/shlibs.local ; \ + fi) + +clean:: + -@rm -f $(CURDIR)/deb_srcdir + diff -Nru barry-0.14/opensync-plugin/m4/ax_c_check_flag.m4 barry-0.0.20110506/opensync-plugin/m4/ax_c_check_flag.m4 --- barry-0.14/opensync-plugin/m4/ax_c_check_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/m4/ax_c_check_flag.m4 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,89 @@ +##### http://autoconf-archive.cryp.to/ax_c_check_flag.html +# +# SYNOPSIS +# +# AX_C_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) +# +# DESCRIPTION +# +# This macro tests if the C compiler supports the flag FLAG-TO-CHECK. +# If successfull execute ACTION-IF-SUCCESS otherwise +# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be +# used as in AC_LANG_PROGRAM macro. +# +# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to +# Bogdan Drozdowski for testing and bug fixes. +# +# LAST MODIFICATION +# +# 2007-11-26 +# +# COPYLEFT +# +# Copyright (c) 2007 Francesco Salvestrini +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_C_CHECK_FLAG],[ + AC_PREREQ([2.61]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PROG_SED]) + + flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'` + + AC_CACHE_CHECK([whether the C compiler accepts the $1 flag], + [ax_cv_c_check_flag_$flag],[ + + AC_LANG_PUSH([C]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([$2],[$3]) + ],[ + eval "ax_cv_c_check_flag_$flag=yes" + ],[ + eval "ax_cv_c_check_flag_$flag=no" + ]) + + CFLAGS="$save_CFLAGS" + + AC_LANG_POP + + ]) + + AS_IF([eval "test \"`echo '$ax_cv_c_check_flag_'$flag`\" = yes"],[ + : + $4 + ],[ + : + $5 + ]) +]) diff -Nru barry-0.14/opensync-plugin/m4/ax_cxx_check_flag.m4 barry-0.0.20110506/opensync-plugin/m4/ax_cxx_check_flag.m4 --- barry-0.14/opensync-plugin/m4/ax_cxx_check_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/m4/ax_cxx_check_flag.m4 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,89 @@ +##### http://autoconf-archive.cryp.to/ax_cxx_check_flag.html +# +# SYNOPSIS +# +# AX_CXX_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) +# +# DESCRIPTION +# +# This macro tests if the C++ compiler supports the flag +# FLAG-TO-CHECK. If successfull execute ACTION-IF-SUCCESS otherwise +# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be +# used as in AC_LANG_PROGRAM macro. +# +# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to +# Bogdan Drozdowski for testing and bug fixes. +# +# LAST MODIFICATION +# +# 2007-11-26 +# +# COPYLEFT +# +# Copyright (c) 2007 Francesco Salvestrini +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_CXX_CHECK_FLAG],[ + AC_PREREQ([2.61]) + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_SED]) + + flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'` + + AC_CACHE_CHECK([whether the C++ compiler accepts the $1 flag], + [ax_cv_cxx_check_flag_$flag],[ + + AC_LANG_PUSH([C++]) + + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $1" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([$2],[$3]) + ],[ + eval "ax_cv_cxx_check_flag_$flag=yes" + ],[ + eval "ax_cv_cxx_check_flag_$flag=no" + ]) + + CXXFLAGS="$save_CXXFLAGS" + + AC_LANG_POP + + ]) + + AS_IF([eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"],[ + : + $4 + ],[ + : + $5 + ]) +]) diff -Nru barry-0.14/opensync-plugin/Makefile.am barry-0.0.20110506/opensync-plugin/Makefile.am --- barry-0.14/opensync-plugin/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/Makefile.am 2011-05-06 12:20:17.000000000 +0000 @@ -1,4 +1,4 @@ -ACLOCAL_FLAGS = -I ../m4 +ACLOCAL_FLAGS = -I m4 SUBDIRS = src diff -Nru barry-0.14/opensync-plugin/Makefile.in barry-0.0.20110506/opensync-plugin/Makefile.in --- barry-0.14/opensync-plugin/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,642 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = . -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/../config.guess \ - $(srcdir)/../config.sub $(srcdir)/../install-sh \ - $(srcdir)/../ltmain.sh $(srcdir)/../missing \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog NEWS -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../m4/ax_c_check_flag.m4 \ - $(top_srcdir)/../m4/ax_cxx_check_flag.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BARRY_CFLAGS = @BARRY_CFLAGS@ -BARRY_LIBS = @BARRY_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -OPENSYNC_CONFIGDIR = @OPENSYNC_CONFIGDIR@ -OPENSYNC_FORMATSDIR = @OPENSYNC_FORMATSDIR@ -OPENSYNC_HEADERDIR = @OPENSYNC_HEADERDIR@ -OPENSYNC_PLUGINDIR = @OPENSYNC_PLUGINDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ -PACKAGE_LIBS = @PACKAGE_LIBS@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TREE_BUILD_CXXFLAGS = @TREE_BUILD_CXXFLAGS@ -TREE_BUILD_LDFLAGS = @TREE_BUILD_LDFLAGS@ -VERSION = @VERSION@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -ACLOCAL_FLAGS = -I ../m4 -SUBDIRS = src -EXTRA_DIST = \ - buildgen.sh \ - patches - -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) - -config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# 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): - @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; \ - (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" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @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; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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 || \ - tags="$$tags $$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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - mkdir $(distdir) - $(mkdir_p) $(distdir)/.. $(distdir)/../m4 - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__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 -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' -distuninstallcheck: - @cd $(distuninstallcheck_dir) \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(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 - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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 - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-libtool clean-recursive \ - ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-recursive distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am - - -dist-hook: - rm -rf `find $(distdir) -name CVS` -# 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 barry-0.14/opensync-plugin/src/barry_sync.cc barry-0.0.20110506/opensync-plugin/src/barry_sync.cc --- barry-0.14/opensync-plugin/src/barry_sync.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/barry_sync.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -61,7 +61,7 @@ // shortcut references using namespace Barry; using Barry::RecordStateTable; - Mode::Desktop &desktop = *env->m_pDesktop; + Mode::Desktop &desktop = *env->GetDesktop(); // find the matching cache, state table, and id map for this change DatabaseSyncState::cache_type &cache = pSync->m_Cache; @@ -209,7 +209,7 @@ return true; } - Barry::Mode::Desktop &desktop = *env->m_pDesktop; + Barry::Mode::Desktop &desktop = *env->GetDesktop(); // get the state table again, so we can update // the cache properly @@ -316,7 +316,6 @@ osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, "Unable to find PIN %lx", env->m_pin); return; } - env->m_ProbeResult = probe.Get(nIndex); env->Connect(probe.Get(nIndex)); @@ -402,7 +401,7 @@ DatabaseSyncState::cache_type &cache = pSync->m_Cache; Barry::RecordStateTable &table = pSync->m_Table; idmap &map = pSync->m_IdMap; - Barry::Mode::Desktop &desktop = *env->m_pDesktop; + Barry::Mode::Desktop &desktop = *env->GetDesktop(); unsigned int dbId = pSync->m_dbId; @@ -544,20 +543,20 @@ // Create first plugin OSyncPluginInfo *info = osync_plugin_new_info(env); - + info->name = "barry-sync"; - info->longname = "Barry OpenSync plugin v0.14 for the Blackberry handheld"; + info->longname = "Barry OpenSync plugin v0.18.0 for the Blackberry handheld"; info->description = "Plugin to synchronize calendar and contact entries on USB Blackberry handhelds"; info->version = 1; // API version (opensync api?) info->is_threadsafe = TRUE; - + info->functions.initialize = initialize; info->functions.connect = connect; info->functions.sync_done = sync_done; info->functions.disconnect = disconnect; info->functions.finalize = finalize; info->functions.get_changeinfo = get_changeinfo; - + // If you like, you can overwrite the default timeouts of your plugin // The default is set to 60 sec. Note that this MUST NOT be used to // wait for expected timeouts (Lets say while waiting for a webserver). diff -Nru barry-0.14/opensync-plugin/src/barry_sync.h barry-0.0.20110506/opensync-plugin/src/barry_sync.h --- barry-0.14/opensync-plugin/src/barry_sync.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/barry_sync.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/opensync-plugin/src/environment.cc barry-0.0.20110506/opensync-plugin/src/environment.cc --- barry-0.14/opensync-plugin/src/environment.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/environment.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,7 +27,9 @@ #include #include #include +#include +using namespace Barry; ////////////////////////////////////////////////////////////////////////////// // DatabaseSyncState @@ -174,9 +176,6 @@ : member(pm), m_pin(-1), m_DebugMode(false), - m_password(""), - m_pCon(0), - m_pDesktop(0), m_CalendarSync(pm, "calendar"), m_ContactsSync(pm, "contacts") { @@ -184,61 +183,48 @@ BarryEnvironment::~BarryEnvironment() { - delete m_pDesktop; - delete m_pCon; } void BarryEnvironment::DoConnect() { - // Create controller - m_pCon = new Barry::Controller(m_ProbeResult); - m_pDesktop = new Barry::Mode::Desktop(*m_pCon); - m_pDesktop->Open(m_password.c_str()); + if( !m_con.get() ) + throw std::logic_error("Tried to use empty Connector"); + + m_con->Connect(); // Save the DBIDs and DBNames of the databases we will work with - m_CalendarSync.m_dbName = Barry::Calendar::GetDBName(); - m_CalendarSync.m_dbId = m_pDesktop->GetDBID(Barry::Calendar::GetDBName()); + if( m_CalendarSync.m_Sync ) { + m_CalendarSync.m_dbName = Barry::Calendar::GetDBName(); + m_CalendarSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Calendar::GetDBName()); + } - m_ContactsSync.m_dbId = m_pDesktop->GetDBID(Barry::Contact::GetDBName()); - m_ContactsSync.m_dbName = Barry::Contact::GetDBName(); + if( m_ContactsSync.m_Sync ) { + m_ContactsSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Contact::GetDBName()); + m_ContactsSync.m_dbName = Barry::Contact::GetDBName(); + } } -void BarryEnvironment::Connect(const Barry::ProbeResult &result) +void BarryEnvironment::SetPassword(const std::string &password) { - Disconnect(); - - // save result in case we need to reconnect later - m_ProbeResult = result; + m_password = password; + if( m_con.get() ) + m_con->SetPassword(password.c_str()); +} +void BarryEnvironment::Connect(const Barry::ProbeResult &result) +{ + m_con.reset(new DesktopConnector(m_password.c_str(), "UTF-8", result)); DoConnect(); } void BarryEnvironment::Reconnect() { - Disconnect(); - - // FIXME - temporary fix for odd reconnect message... without this - // probe, the reconnect will often fail on newer Blackberries - // due to an unexpected close socket message. It is unclear - // if this is really a message from the device, but until then, - // we add this probe. - { - Barry::Probe probe; - int i = probe.FindActive(m_ProbeResult.m_pin); - if( i != -1 ) - m_ProbeResult = probe.Get(i); - } - - DoConnect(); + m_con->Reconnect(2); } void BarryEnvironment::Disconnect() { - delete m_pDesktop; - m_pDesktop = 0; - - delete m_pCon; - m_pCon = 0; + m_con->Disconnect(); } void BarryEnvironment::ClearDirtyFlags(Barry::RecordStateTable &table, @@ -246,14 +232,14 @@ { Trace trace("ClearDirtyFlags"); - unsigned int dbId = m_pDesktop->GetDBID(dbname); + unsigned int dbId = m_con->GetDesktop().GetDBID(dbname); Barry::RecordStateTable::StateMapType::const_iterator i = table.StateMap.begin(); for( ; i != table.StateMap.end(); ++i ) { if( i->second.Dirty ) { trace.logf("Clearing dirty flag for db %u, index %u", dbId, i->first); - m_pDesktop->ClearDirty(dbId, i->first); + m_con->GetDesktop().ClearDirty(dbId, i->first); } } } @@ -308,7 +294,7 @@ // - sync contacts std::istringstream iss(m_ConfigData); - std::string line, key; + std::string line; while( std::getline(iss, line) ) { if( line[0] == '#' ) @@ -317,6 +303,7 @@ std::istringstream ils(line); int cal = 0, con = 0; + std::string key; ils >> key; if( key == "DebugMode" ) { diff -Nru barry-0.14/opensync-plugin/src/environment.h barry-0.0.20110506/opensync-plugin/src/environment.h --- barry-0.14/opensync-plugin/src/environment.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/environment.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -25,6 +25,7 @@ #include #include #include +#include #include "idmap.h" @@ -75,6 +76,9 @@ struct BarryEnvironment { +private: + std::string m_password; + public: OSyncMember *member; @@ -82,12 +86,9 @@ std::string m_ConfigData; uint32_t m_pin; bool m_DebugMode; - std::string m_password; // device communication - Barry::ProbeResult m_ProbeResult; - Barry::Controller *m_pCon; - Barry::Mode::Desktop *m_pDesktop; + std::auto_ptr m_con; // sync data DatabaseSyncState m_CalendarSync, m_ContactsSync; @@ -99,6 +100,9 @@ BarryEnvironment(OSyncMember *pm); ~BarryEnvironment(); + Barry::Mode::Desktop* GetDesktop() { return &m_con->GetDesktop(); } + void SetPassword(const std::string &password); + void Connect(const Barry::ProbeResult &result); void Reconnect(); void Disconnect(); diff -Nru barry-0.14/opensync-plugin/src/idmap.cc barry-0.0.20110506/opensync-plugin/src/idmap.cc --- barry-0.14/opensync-plugin/src/idmap.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/idmap.cc 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ // /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/opensync-plugin/src/idmap.h barry-0.0.20110506/opensync-plugin/src/idmap.h --- barry-0.14/opensync-plugin/src/idmap.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/idmap.h 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ // /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/opensync-plugin/src/Makefile.am barry-0.0.20110506/opensync-plugin/src/Makefile.am --- barry-0.14/opensync-plugin/src/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/Makefile.am 2011-05-06 12:20:17.000000000 +0000 @@ -28,11 +28,9 @@ barry_sync_la_SOURCES = \ barry_sync.cc barry_sync.h \ environment.cc environment.h \ - vbase.cc vbase.h \ vevent.cc vevent.h \ vcard.cc vcard.h \ idmap.cc idmap.h \ - vformat.c vformat.h \ trace.h barry_sync_la_LDFLAGS = -avoid-version -export-dynamic -module diff -Nru barry-0.14/opensync-plugin/src/Makefile.in barry-0.0.20110506/opensync-plugin/src/Makefile.in --- barry-0.14/opensync-plugin/src/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,562 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -@WITH_GCCVISIBILITY_TRUE@am__append_1 = -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -#AM_CXXFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -fvisibility-inlines-hidden -@WITH_GCCVISIBILITY_TRUE@am__append_2 = -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -#AM_LDFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -@WITH_GCCVISIBILITY_TRUE@am__append_3 = -fvisibility=hidden -subdir = src -DIST_COMMON = $(dist_config_DATA) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../m4/ax_c_check_flag.m4 \ - $(top_srcdir)/../m4/ax_cxx_check_flag.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 = -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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(barry_syncdir)" \ - "$(DESTDIR)$(configdir)" -barry_syncLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(barry_sync_LTLIBRARIES) -barry_sync_la_DEPENDENCIES = -am_barry_sync_la_OBJECTS = barry_sync.lo environment.lo vbase.lo \ - vevent.lo vcard.lo idmap.lo vformat.lo -barry_sync_la_OBJECTS = $(am_barry_sync_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/../depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(barry_sync_la_SOURCES) -DIST_SOURCES = $(barry_sync_la_SOURCES) -dist_configDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dist_config_DATA) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BARRY_CFLAGS = @BARRY_CFLAGS@ -BARRY_LIBS = @BARRY_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @TREE_BUILD_LDFLAGS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -OPENSYNC_CONFIGDIR = @OPENSYNC_CONFIGDIR@ -OPENSYNC_FORMATSDIR = @OPENSYNC_FORMATSDIR@ -OPENSYNC_HEADERDIR = @OPENSYNC_HEADERDIR@ -OPENSYNC_PLUGINDIR = @OPENSYNC_PLUGINDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ -PACKAGE_LIBS = @PACKAGE_LIBS@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TREE_BUILD_CXXFLAGS = @TREE_BUILD_CXXFLAGS@ -TREE_BUILD_LDFLAGS = @TREE_BUILD_LDFLAGS@ -VERSION = @VERSION@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -barry_syncdir = @OPENSYNC_PLUGINDIR@ -configdir = @OPENSYNC_CONFIGDIR@ -#formatsdir=@OPENSYNC_FORMATSDIR@ -opensyncheaderdir = @OPENSYNC_HEADERDIR@ -INCLUDES = @TREE_BUILD_CXXFLAGS@ @PACKAGE_CFLAGS@ @BARRY_CFLAGS@ -AM_CFLAGS = -Wall -Werror $(am__append_1) -AM_CXXFLAGS = -Wall -Werror $(am__append_2) -AM_LDFLAGS = $(am__append_3) -EXTRA_DIST = barry_sync.h -dist_config_DATA = barry-sync -opensyncheader_HEADER = barry_sync.h -barry_sync_LTLIBRARIES = barry_sync.la -barry_sync_la_SOURCES = \ - barry_sync.cc barry_sync.h \ - environment.cc environment.h \ - vbase.cc vbase.h \ - vevent.cc vevent.h \ - vcard.cc vcard.h \ - idmap.cc idmap.h \ - vformat.c vformat.h \ - trace.h - -barry_sync_la_LDFLAGS = -avoid-version -export-dynamic -module -barry_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @BARRY_LIBS@ -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .cc .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - 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 -install-barry_syncLTLIBRARIES: $(barry_sync_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(barry_syncdir)" || $(mkdir_p) "$(DESTDIR)$(barry_syncdir)" - @list='$(barry_sync_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(barry_syncLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(barry_syncdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(barry_syncLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(barry_syncdir)/$$f"; \ - else :; fi; \ - done - -uninstall-barry_syncLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(barry_sync_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(barry_syncdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(barry_syncdir)/$$p"; \ - done - -clean-barry_syncLTLIBRARIES: - -test -z "$(barry_sync_LTLIBRARIES)" || rm -f $(barry_sync_LTLIBRARIES) - @list='$(barry_sync_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 -barry_sync.la: $(barry_sync_la_OBJECTS) $(barry_sync_la_DEPENDENCIES) - $(CXXLINK) -rpath $(barry_syncdir) $(barry_sync_la_LDFLAGS) $(barry_sync_la_OBJECTS) $(barry_sync_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/barry_sync.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vbase.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vcard.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vevent.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vformat.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $@ $< - -.cc.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-dist_configDATA: $(dist_config_DATA) - @$(NORMAL_INSTALL) - test -z "$(configdir)" || $(mkdir_p) "$(DESTDIR)$(configdir)" - @list='$(dist_config_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_configDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(configdir)/$$f'"; \ - $(dist_configDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(configdir)/$$f"; \ - done - -uninstall-dist_configDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_config_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(configdir)/$$f'"; \ - rm -f "$(DESTDIR)$(configdir)/$$f"; \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(LTLIBRARIES) $(DATA) -installdirs: - for dir in "$(DESTDIR)$(barry_syncdir)" "$(DESTDIR)$(configdir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-barry_syncLTLIBRARIES clean-generic clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-barry_syncLTLIBRARIES install-dist_configDATA - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(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-barry_syncLTLIBRARIES \ - uninstall-dist_configDATA uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean \ - clean-barry_syncLTLIBRARIES clean-generic clean-libtool ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am \ - install-barry_syncLTLIBRARIES install-data install-data-am \ - install-dist_configDATA install-exec install-exec-am \ - install-info install-info-am install-man 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-barry_syncLTLIBRARIES \ - uninstall-dist_configDATA uninstall-info-am - - -#formats_LTLIBRARIES = format.la -# -#format_la_SOURCES = format.c -#format_la_LDFLAGS = -avoid-version -export-dynamic -module -#format_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ -# 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 barry-0.14/opensync-plugin/src/trace.h barry-0.0.20110506/opensync-plugin/src/trace.h --- barry-0.14/opensync-plugin/src/trace.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/trace.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,6 +24,7 @@ #include #include +#include class Trace { diff -Nru barry-0.14/opensync-plugin/src/vbase.cc barry-0.0.20110506/opensync-plugin/src/vbase.cc --- barry-0.14/opensync-plugin/src/vbase.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vbase.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,240 +0,0 @@ -// -// \file vbase.cc -// vformat support routines in base class -// - -/* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "vbase.h" -#include "trace.h" -#include "vformat.h" // comes from opensync, but not a public header yet -#include -#include -#include - - -////////////////////////////////////////////////////////////////////////////// -// vAttr - -std::string vAttr::GetName() -{ - std::string ret; - - if( !m_attr ) - return ret; - - const char *name = b_vformat_attribute_get_name(m_attr); - if( name ) - ret = name; - return ret; -} - -std::string vAttr::GetValue(int nth) -{ - std::string ret; - const char *value = 0; - - if( m_attr ) { - if( b_vformat_attribute_is_single_valued(m_attr) ) { - if( nth == 0 ) - value = b_vformat_attribute_get_value(m_attr); - } - else { - value = b_vformat_attribute_get_nth_value(m_attr, nth); - } - } - - if( value ) - ret = value; - - return ret; -} - -std::string vAttr::GetParam(const char *name, int nth) -{ - std::string ret; - - if( !m_attr ) - return ret; - - b_VFormatParam *param = b_vformat_attribute_find_param(m_attr, name); - if( !param ) - return ret; - - const char *value = b_vformat_attribute_param_get_nth_value(param, nth); - if( value ) - ret = value; - - return ret; -} - - -////////////////////////////////////////////////////////////////////////////// -// vCalendar - -vBase::vBase() - : m_format(0) -{ -} - -vBase::~vBase() -{ - if( m_format ) { - b_vformat_free(m_format); - } -} - -void vBase::SetFormat(b_VFormat *format) -{ - if( m_format ) { - b_vformat_free(m_format); - m_format = 0; - } - m_format = format; -} - -void vBase::Clear() -{ - if( m_format ) { - b_vformat_free(m_format); - m_format = 0; - } -} - -vAttrPtr vBase::NewAttr(const char *name) -{ - Trace trace("vBase::NewAttr"); - - trace.logf("creating valueless attr: %s", name); - - vAttrPtr attr(b_vformat_attribute_new(NULL, name)); - if( !attr.Get() ) - throw ConvertError("resource error allocating vformat attribute"); - return attr; -} - -vAttrPtr vBase::NewAttr(const char *name, const char *value) -{ - Trace trace("vBase::NewAttr"); - -/* -some vCard values are positional (like name), so blank should be allowed... - - if( strlen(value) == 0 ) { - trace.logf("attribute '%s' contains no data, skipping", name); - return vAttrPtr(); - } -*/ - - trace.logf("creating attr: %s, %s", name, value); - - vAttrPtr attr(b_vformat_attribute_new(NULL, name)); - if( !attr.Get() ) - throw ConvertError("resource error allocating vformat attribute"); - - b_vformat_attribute_add_value(attr.Get(), value); - return attr; -} - -void vBase::AddAttr(vAttrPtr attr) -{ - Trace trace("vBase::AddAttr"); - - if( !attr.Get() ) { - trace.log("attribute contains no data, skipping"); - return; - } - - b_vformat_add_attribute(m_format, attr.Extract()); -} - -void vBase::AddValue(vAttrPtr &attr, const char *value) -{ - Trace trace("vBase::AddValue"); - if( !attr.Get() ) { - trace.log("attribute pointer contains no data, skipping"); - return; - } -/* - if( strlen(value) == 0 ) { - trace.log("attribute value is empty, skipping"); - return; - } -*/ - b_vformat_attribute_add_value(attr.Get(), value); -} - -void vBase::AddParam(vAttrPtr &attr, const char *name, const char *value) -{ - Trace trace("vBase::AddParam"); - - if( !attr.Get() ) { - trace.log("attribute pointer contains no data, skipping"); - return; - } -/* - if( strlen(value) == 0 ) { - trace.log("parameter value is empty, skipping"); - return; - } -*/ - - b_VFormatParam *pParam = b_vformat_attribute_param_new(name); - b_vformat_attribute_param_add_value(pParam, value); - b_vformat_attribute_add_param(attr.Get(), pParam); -} - -std::string vBase::GetAttr(const char *attrname, const char *block) -{ - Trace trace("vBase::GetAttr"); - trace.logf("getting attr: %s", attrname); - - std::string ret; - const char *value = 0; - - bool needs_freeing = false; - - b_VFormatAttribute *attr = b_vformat_find_attribute(m_format, attrname, 0, block); - if( attr ) { - if( b_vformat_attribute_is_single_valued(attr) ) { - value = b_vformat_attribute_get_value(attr); - needs_freeing = true; - } - else { - // FIXME, this is hardcoded - value = b_vformat_attribute_get_nth_value(attr, 0); - } - } - - if( value ) - ret = value; - - if( needs_freeing ) - g_free((char *)value); - - trace.logf("attr value: %s", ret.c_str()); - return ret; -} - -vAttr vBase::GetAttrObj(const char *attrname, int nth, const char *block) -{ - Trace trace("vBase::GetAttrObj"); - trace.logf("getting attr: %s", attrname); - - return vAttr(b_vformat_find_attribute(m_format, attrname, nth, block)); -} - diff -Nru barry-0.14/opensync-plugin/src/vbase.h barry-0.0.20110506/opensync-plugin/src/vbase.h --- barry-0.14/opensync-plugin/src/vbase.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vbase.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/// -/// \file vbase.h -/// Base class for vformat support -/// - -/* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#ifndef __BARRY_SYNC_VBASE_H__ -#define __BARRY_SYNC_VBASE_H__ - -#include -#include -#include "vformat.h" - -// forward declarations -class BarryEnvironment; - - -// FIXME - possibly scrap this in favour of opensync's xml time routines, -// but this will require an overhaul of the plugin itself. -class vTimeZone -{ -public: - struct ZoneBlock - { - bool m_daylightSaving; - std::string m_name; - std::string m_dtstart; - std::string m_tzoffsetfrom; - std::string m_tzoffsetto; - }; - -private: - bool m_valid; - -public: - std::string m_id; - -public: - vTimeZone(); - ~vTimeZone(); - - void Clear(); - - bool IsValid(); - - /// used for comparing by TZID - bool operator==(const std::string &tzid) const; -}; - - -// A special smart pointer for vformat pointer handling. -// Behaves like std::auto_ptr<> in that only one object -// at a time owns the pointer, and destruction frees it. -template -class vSmartPtr -{ - mutable T *m_pt; - -public: - vSmartPtr() : m_pt(0) {} - vSmartPtr(T *pt) : m_pt(pt) {} - vSmartPtr(const vSmartPtr &sp) : m_pt(sp.m_pt) - { - sp.m_pt = 0; - } - ~vSmartPtr() - { - if( m_pt ) - FreeFunc(m_pt); - } - - vSmartPtr& operator=(T *pt) - { - Extract(); - m_pt = pt; - return *this; - } - - vSmartPtr& operator=(const vSmartPtr &sp) - { - Extract(); - m_pt = sp.Extract(); - return *this; - } - - T* Extract() - { - T *rp = m_pt; - m_pt = 0; - return rp; - } - - T* Get() - { - return m_pt; - } -}; - -typedef vSmartPtr vAttrPtr; -typedef vSmartPtr vParamPtr; -typedef vSmartPtr gStringPtr; - - -// -// vAttr -// -/// Class for reading a b_VFormatAttribute. Reading does not require -/// memory management, so none is done. -/// -class vAttr -{ - b_VFormatAttribute *m_attr; - -public: - vAttr() - : m_attr(0) - { - } - - vAttr(b_VFormatAttribute *attr) - : m_attr(attr) - { - } - - vAttr& operator=(b_VFormatAttribute *attr) - { - m_attr = attr; - return *this; - } - - b_VFormatAttribute* Get() { return m_attr; } - - // These functions do not throw an error if the value - // is NULL or does not exist (for example, if you ask for - // value #5 and there are only 4). - std::string GetName(); - std::string GetValue(int nth = 0); - std::string GetParam(const char *name, int nth = 0); -}; - - -// -// vBase -// -/// Base class containing vformat helper API. -/// -class vBase -{ - // internal data for managing the vformat - b_VFormat *m_format; - -public: - // FIXME - if you put this class in the Barry library, - // you'll need to change the class hierarchy - class ConvertError : public std::runtime_error - { - public: - ConvertError(const std::string &msg) : std::runtime_error(msg) {} - }; - -protected: - vBase(); - virtual ~vBase(); - - b_VFormat* Format() { return m_format; } - const b_VFormat* Format() const { return m_format; } - void SetFormat(b_VFormat *format); - - void Clear(); - - vAttrPtr NewAttr(const char *name); - vAttrPtr NewAttr(const char *name, const char *value); - void AddAttr(vAttrPtr attr); - void AddValue(vAttrPtr &attr, const char *value); - void AddParam(vAttrPtr &attr, const char *name, const char *value); - - std::string GetAttr(const char *attrname, const char *block = 0); - vAttr GetAttrObj(const char *attrname, int nth = 0, const char *block = 0); -}; - -#endif - diff -Nru barry-0.14/opensync-plugin/src/vcard.cc barry-0.0.20110506/opensync-plugin/src/vcard.cc --- barry-0.14/opensync-plugin/src/vcard.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vcard.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -19,366 +19,17 @@ root directory of this project for more details. */ -#include "vcard.h" #include "environment.h" #include "trace.h" -#include "vformat.h" // comes from opensync, but not a public header yet +#include "vcard.h" +#include #include #include #include #include #include - -////////////////////////////////////////////////////////////////////////////// -// Utility functions - -void ToLower(std::string &str) -{ - size_t i = 0; - while( i < str.size() ) { - str[i] = tolower(str[i]); - i++; - } -} - -////////////////////////////////////////////////////////////////////////////// -// vCard - -vCard::vCard() - : m_gCardData(0) -{ -} - -vCard::~vCard() -{ - if( m_gCardData ) { - g_free(m_gCardData); - } -} - -void vCard::AddAddress(const char *rfc_type, const Barry::PostalAddress &address) -{ - // add label first - vAttrPtr label = NewAttr("LABEL"); - AddParam(label, "TYPE", rfc_type); - AddValue(label, address.GetLabel().c_str()); - AddAttr(label); - - // add breakout address form - vAttrPtr adr = NewAttr("ADR"); // RFC 2426, 3.2.1 - AddParam(adr, "TYPE", rfc_type); - AddValue(adr, address.Address3.c_str()); // PO Box - AddValue(adr, address.Address2.c_str()); // Extended address - AddValue(adr, address.Address1.c_str()); // Street address - AddValue(adr, address.City.c_str()); // Locality (city) - AddValue(adr, address.Province.c_str()); // Region (province) - AddValue(adr, address.PostalCode.c_str()); // Postal code - AddValue(adr, address.Country.c_str()); // Country name - AddAttr(adr); -} - -void vCard::AddCategories(const Barry::CategoryList &categories) -{ - if( !categories.size() ) - return; - - vAttrPtr cat = NewAttr("CATEGORIES"); // RFC 2426, 3.6.1 - Barry::CategoryList::const_iterator i = categories.begin(); - for( ; i < categories.end(); ++i ) { - AddValue(cat, i->c_str()); - } - AddAttr(cat); -} - -/// Add phone conditionally, only if phone has data in it -void vCard::AddPhoneCond(const char *rfc_type, const std::string &phone) -{ - if( phone.size() ) { - vAttrPtr tel = NewAttr("TEL", phone.c_str()); - AddParam(tel, "TYPE", rfc_type); - AddAttr(tel); - } -} - -void vCard::ParseAddress(vAttr &adr, Barry::PostalAddress &address) -{ - // RFC 2426, 3.2.1 - address.Address3 = adr.GetValue(0); // PO Box - address.Address2 = adr.GetValue(1); // Extended address - address.Address1 = adr.GetValue(2); // Street address - address.City = adr.GetValue(3); // Locality (city) - address.Province = adr.GetValue(4); // Region (province) - address.PostalCode = adr.GetValue(5); // Postal code - address.Country = adr.GetValue(6); // Country name -} - -void vCard::ParseCategories(vAttr &cat, Barry::CategoryList &cats) -{ - int i = 0; - std::string value = cat.GetValue(i); - while( value.size() ) { - cats.push_back(value); - i++; - value = cat.GetValue(i); - } -} - - - -// Main conversion routine for converting from Barry::Contact to -// a vCard string of data. -const std::string& vCard::ToVCard(const Barry::Contact &con) -{ - Trace trace("vCard::ToVCard"); - std::ostringstream oss; - con.Dump(oss); - trace.logf("ToVCard, initial Barry record: %s", oss.str().c_str()); - - // start fresh - Clear(); - SetFormat( b_vformat_new() ); - if( !Format() ) - throw ConvertError("resource error allocating vformat"); - - // store the Barry object we're working with - m_BarryContact = con; - - // - // begin building vCard data - // - - AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Contact Record//EN")); - - std::string fullname = con.GetFullName(); - if( fullname.size() ) { - AddAttr(NewAttr("FN", fullname.c_str())); - } - else { - // - // RFC 2426, 3.1.1 states that FN MUST be present in the - // vcard object. Unfortunately, the Blackberry doesn't - // require a name, only a name or company name. - // - // In this case we do nothing, and generate an invalid - // vcard, since if we try to fix our output here, we'll - // likely end up with duplicated company names in the - // Blackberry record after a few syncs. - // - } - - if( con.FirstName.size() || con.LastName.size() ) { - vAttrPtr name = NewAttr("N"); // RFC 2426, 3.1.2 - AddValue(name, con.LastName.c_str()); // Family Name - AddValue(name, con.FirstName.c_str()); // Given Name - AddValue(name, ""); // Additional Names - AddValue(name, con.Prefix.c_str()); // Honorific Prefixes - AddValue(name, ""); // Honorific Suffixes - AddAttr(name); - } - - if( con.WorkAddress.HasData() ) - AddAddress("work", con.WorkAddress); - if( con.HomeAddress.HasData() ) - AddAddress("home", con.HomeAddress); - - // add all applicable phone numbers... can't add the WorkPhone2 - // since VCARD30 TEL fields only take one number, as far as I know - AddPhoneCond("pref", con.Phone); - AddPhoneCond("fax", con.Fax); - AddPhoneCond("work", con.WorkPhone); - AddPhoneCond("home", con.HomePhone); - AddPhoneCond("cell", con.MobilePhone); - AddPhoneCond("msg", con.Pager); - - // add all email addresses, marking first one as "pref" - Barry::Contact::EmailList::const_iterator eai = con.EmailAddresses.begin(); - for( unsigned int i = 0; eai != con.EmailAddresses.end(); ++eai, ++i ) { - const std::string& e = con.GetEmail(i); - if( e.size() ) { - vAttrPtr email = NewAttr("EMAIL", e.c_str()); - if( i == 0 ) { - AddParam(email, "TYPE", "internet,pref"); - } - else { - AddParam(email, "TYPE", "internet"); - } - AddAttr(email); - } - } - - if( con.JobTitle.size() ) { - AddAttr(NewAttr("TITLE", con.JobTitle.c_str())); - AddAttr(NewAttr("ROLE", con.JobTitle.c_str())); - } - - // Image not supported, since vformat routines probably don't - // support binary VCARD fields.... - - if( con.Company.size() ) { - // RFC 2426, 3.5.5 - vAttrPtr org = NewAttr("ORG", con.Company.c_str()); // Organization name - AddValue(org, ""); // Division name - AddAttr(org); - } - - if( con.Birthday.HasData() ) - AddAttr(NewAttr("BDAY", con.Birthday.ToYYYYMMDD().c_str())); - - if( con.Notes.size() ) - AddAttr(NewAttr("NOTE", con.Notes.c_str())); - if( con.URL.size() ) - AddAttr(NewAttr("URL", con.URL.c_str())); - if( con.Categories.size() ) - AddCategories(con.Categories); - - // generate the raw VCARD data - m_gCardData = b_vformat_to_string(Format(), VFORMAT_CARD_30); - m_vCardData = m_gCardData; - - trace.logf("ToVCard, resulting vcard data: %s", m_vCardData.c_str()); - return m_vCardData; -} - -// Main conversion routine for converting from vCard data string -// to a Barry::Contact object. -const Barry::Contact& vCard::ToBarry(const char *vcard, uint32_t RecordId) -{ - using namespace std; - - Trace trace("vCard::ToBarry"); - trace.logf("ToBarry, working on vcard data: %s", vcard); - - // start fresh - Clear(); - - // store the vCard raw data - m_vCardData = vcard; - - // create format parser structures - SetFormat( b_vformat_new_from_string(vcard) ); - if( !Format() ) - throw ConvertError("resource error allocating vformat"); - - - // - // Parse the vcard data - // - - Barry::Contact &con = m_BarryContact; - con.SetIds(Barry::Contact::GetDefaultRecType(), RecordId); - - vAttr name = GetAttrObj("N"); - if( name.Get() ) { - // RFC 2426, 3.1.2 - con.LastName = name.GetValue(0); // Family Name - con.FirstName = name.GetValue(1); // Given Name - con.Prefix = name.GetValue(3); // Honorific Prefixes - } - - vAttr adr = GetAttrObj("ADR"); - for( int i = 0; adr.Get(); adr = GetAttrObj("ADR", ++i) ) - { - std::string type = adr.GetParam("TYPE"); - ToLower(type); - - // do not use "else" here, since TYPE can have multiple keys - if( strstr(type.c_str(), "work") ) - ParseAddress(adr, con.WorkAddress); - if( strstr(type.c_str(), "home") ) - ParseAddress(adr, con.HomeAddress); - } - - - // add all applicable phone numbers... can't add the WorkPhone2 - // since VCARD30 TEL fields only take one number, as far as I know - vAttr tel = GetAttrObj("TEL"); - for( int i = 0; tel.Get(); tel = GetAttrObj("TEL", ++i) ) - { - std::string stype = tel.GetParam("TYPE"); - ToLower(stype); - const char *type = stype.c_str(); - - // do not use "else" here, since TYPE can have multiple keys - if( strstr(type, "pref") ) - con.Phone = tel.GetValue(); - if( strstr(type, "fax") ) - con.Fax = tel.GetValue(); - if( strstr(type, "work") ) - con.WorkPhone = tel.GetValue(); - if( strstr(type, "home") ) - con.HomePhone = tel.GetValue(); - if( strstr(type, "cell") ) - con.MobilePhone = tel.GetValue(); - if( strstr(type, "msg") ) - con.Pager = tel.GetValue(); - } - - // scan for all email addresses... append addresses to the - // list by default, but prepend if its type is set to "pref" - // i.e. we want the preferred email address first - vAttr email = GetAttrObj("EMAIL"); - for( int i = 0; email.Get(); email = GetAttrObj("EMAIL", ++i) ) - { - std::string type = email.GetParam("TYPE"); - ToLower(type); - - bool of_interest = (i == 0 || strstr(type.c_str(), "pref")); - bool x400 = strstr(type.c_str(), "x400"); - - if( of_interest && !x400 ) { - con.EmailAddresses.insert(con.EmailAddresses.begin(), email.GetValue()); - } - else { - con.EmailAddresses.push_back( email.GetValue() ); - } - } - - // figure out which company title we want to keep... - // favour the TITLE field, but if it's empty, use ROLE - con.JobTitle = GetAttr("TITLE"); - if( !con.JobTitle.size() ) - con.JobTitle = GetAttr("ROLE"); - - con.Company = GetAttr("ORG"); - con.Notes = GetAttr("NOTE"); - con.URL = GetAttr("URL"); - if( GetAttr("BDAY").size() && !con.Birthday.FromYYYYMMDD( GetAttr("BDAY") ) ) - throw ConvertError("Unable to parse BDAY field"); - - vAttr cat = GetAttrObj("CATEGORIES"); - if( cat.Get() ) - ParseCategories(cat, con.Categories); - - // Last sanity check: Blackberry requires that at least - // name or Company has data. - if( !con.GetFullName().size() && !con.Company.size() ) - throw ConvertError("FN and ORG fields both blank in VCARD data"); - - return m_BarryContact; -} - -// Transfers ownership of m_gCardData to the caller. -char* vCard::ExtractVCard() -{ - char *ret = m_gCardData; - m_gCardData = 0; - return ret; -} - -void vCard::Clear() -{ - vBase::Clear(); - m_vCardData.clear(); - m_BarryContact.Clear(); - - if( m_gCardData ) { - g_free(m_gCardData); - m_gCardData = 0; - } -} - - +using namespace Barry::Sync; ////////////////////////////////////////////////////////////////////////////// // @@ -419,8 +70,8 @@ m_Contact = vcard.ToBarry(data, m_RecordId); } - catch( vCard::ConvertError &ce ) { - trace.logf("ERROR: vCard::ConvertError exception: %s", ce.what()); + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vcard:Barry::ConvertError exception: %s", ce.what()); return false; } @@ -445,13 +96,13 @@ m_Data = vcard.ExtractVCard(); } - catch( vCard::ConvertError &ce ) { - trace.logf("ERROR: vCard::ConvertError exception: %s", ce.what()); + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vcard:Barry::ConvertError exception: %s", ce.what()); } } // Barry builder operator -bool VCardConverter::operator()(Barry::Contact &rec, unsigned int dbId) +bool VCardConverter::operator()(Barry::Contact &rec, Barry::Builder &) { Trace trace("VCardConverter::builder operator()"); @@ -473,7 +124,7 @@ VCardConverter contact2vcard; RecordParser parser(contact2vcard); - env->m_pDesktop->GetRecord(dbId, index, parser); + env->GetDesktop()->GetRecord(dbId, index, parser); return contact2vcard.ExtractData(); } @@ -506,7 +157,7 @@ oss << "unable to parse change data for new RecordId: " << newRecordId << " data: " << data; errmsg = oss.str(); - trace.logf(errmsg.c_str()); + trace.log(errmsg.c_str()); return false; } @@ -514,13 +165,13 @@ if( add ) { trace.log("adding record"); - env->m_pDesktop->AddRecord(dbId, builder); + env->GetDesktop()->AddRecord(dbId, builder); } else { trace.log("setting record"); - env->m_pDesktop->SetRecord(dbId, StateIndex, builder); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); trace.log("clearing dirty flag"); - env->m_pDesktop->ClearDirty(dbId, StateIndex); + env->GetDesktop()->ClearDirty(dbId, StateIndex); } return true; diff -Nru barry-0.14/opensync-plugin/src/vcard.h barry-0.0.20110506/opensync-plugin/src/vcard.h --- barry-0.14/opensync-plugin/src/vcard.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vcard.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -19,58 +19,16 @@ root directory of this project for more details. */ -#ifndef __BARRY_SYNC_VCARD_H__ -#define __BARRY_SYNC_VCARD_H__ +#ifndef __BARRYSYNC_VCARD_H__ +#define __BARRYSYNC_VCARD_H__ #include #include #include -#include "vbase.h" -#include "vformat.h" // forward declarations class BarryEnvironment; - -// -// vCard -// -/// Class for converting between RFC 2425/2426 vCard data format, -/// and the Barry::Contact class. -/// -class vCard : public vBase -{ - // data to pass to external requests - char *m_gCardData; // dynamic memory returned by vformat()... can - // be used directly by the plugin, without - // overmuch allocation and freeing (see Extract()) - std::string m_vCardData;// copy of m_gCardData, for C++ use - Barry::Contact m_BarryContact; - -protected: - void AddAddress(const char *rfc_type, const Barry::PostalAddress &addr); - void AddCategories(const Barry::CategoryList &categories); - void AddPhoneCond(const char *rfc_type, const std::string &phone); - - void ParseAddress(vAttr &adr, Barry::PostalAddress &address); - void ParseCategories(vAttr &cat, Barry::CategoryList &cats); - -public: - vCard(); - ~vCard(); - - const std::string& ToVCard(const Barry::Contact &con); - const Barry::Contact& ToBarry(const char *vcal, uint32_t RecordId); - - const std::string& GetVCard() const { return m_vCardData; } - const Barry::Contact& GetBarryContact() const { return m_BarryContact; } - - char* ExtractVCard(); - - void Clear(); -}; - - class VCardConverter { char *m_Data; @@ -92,7 +50,7 @@ void operator()(const Barry::Contact &rec); // Barry builder operator - bool operator()(Barry::Contact &rec, unsigned int dbId); + bool operator()(Barry::Contact &rec, Barry::Builder &); // Handles calling of the Barry::Controller to fetch a specific // record, indicated by index (into the RecordStateTable). diff -Nru barry-0.14/opensync-plugin/src/vevent.cc barry-0.0.20110506/opensync-plugin/src/vevent.cc --- barry-0.14/opensync-plugin/src/vevent.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vevent.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -19,416 +19,16 @@ root directory of this project for more details. */ +#include #include "vevent.h" #include "environment.h" #include "trace.h" -#include "vformat.h" // comes from opensync, but not a public header yet #include #include #include #include - -////////////////////////////////////////////////////////////////////////////// -// vCalendar - -vCalendar::vCalendar() - : m_gCalData(0) -{ -} - -vCalendar::~vCalendar() -{ - if( m_gCalData ) { - g_free(m_gCalData); - } -} - -const char *vCalendar::WeekDays[] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; - -unsigned short vCalendar::GetWeekDayIndex(const char *dayname) -{ - for( int i = 0; i < 7; i++ ) { - if( strcasecmp(dayname, WeekDays[i]) == 0 ) - return i; - } - return 0; -} - -bool vCalendar::HasMultipleVEvents() const -{ - int count = 0; - b_VFormat *format = const_cast(Format()); - GList *attrs = format ? b_vformat_get_attributes(format) : 0; - for( ; attrs; attrs = attrs->next ) { - b_VFormatAttribute *attr = (b_VFormatAttribute*) attrs->data; - if( strcasecmp(b_vformat_attribute_get_name(attr), "BEGIN") == 0 && - strcasecmp(b_vformat_attribute_get_nth_value(attr, 0), "VEVENT") == 0 ) - { - count++; - } - } - return count > 1; -} - -void vCalendar::RecurToVCal() -{ - using namespace Barry; - using namespace std; - Barry::Calendar &cal = m_BarryCal; - - if( !cal.Recurring ) - return; - - vAttrPtr attr = NewAttr("RRULE"); - - switch( cal.RecurringType ) - { - case Calendar::Day: // eg. every day - AddParam(attr, "FREQ", "DAILY"); - break; - - case Calendar::MonthByDate: // eg. every month on the 12th - // see: DayOfMonth - AddParam(attr, "FREQ", "MONTHLY"); - { - ostringstream oss; - oss << cal.DayOfMonth; - AddParam(attr, "BYMONTHDAY", oss.str().c_str()); - } - break; - - case Calendar::MonthByDay: // eg. every month on 3rd Wed - // see: DayOfWeek and WeekOfMonth - AddParam(attr, "FREQ", "MONTHLY"); - if( cal.DayOfWeek <= 6 ) { // DayOfWeek is unsigned - ostringstream oss; - oss << cal.WeekOfMonth << WeekDays[cal.DayOfWeek]; - AddParam(attr, "BYDAY", oss.str().c_str()); - } - break; - - case Calendar::YearByDate: // eg. every year on March 5 - // see: DayOfMonth and MonthOfYear - AddParam(attr, "FREQ", "YEARLY"); - { - ostringstream oss; - oss << cal.MonthOfYear; - AddParam(attr, "BYMONTH", oss.str().c_str()); - } - { - ostringstream oss; - oss << cal.DayOfMonth; - AddParam(attr, "BYMONTHDAY", oss.str().c_str()); - } - break; - - case Calendar::YearByDay: // eg. every year on 3rd Wed of Jan - // see: DayOfWeek, WeekOfMonth, and - // MonthOfYear - AddParam(attr, "FREQ", "YEARLY"); - if( cal.DayOfWeek <= 6 ) { // DayOfWeek is unsigned - ostringstream oss; - oss << cal.WeekOfMonth << WeekDays[cal.DayOfWeek]; - AddParam(attr, "BYDAY", oss.str().c_str()); - - oss.str(""); - oss << cal.MonthOfYear; - AddParam(attr, "BYMONTH", oss.str().c_str()); - } - break; - - case Calendar::Week: // eg. every week on Mon and Fri - // see: WeekDays - AddParam(attr, "FREQ", "WEEKLY"); - { - ostringstream oss; - for( int i = 0, bm = 1, cnt = 0; i < 7; i++, bm <<= 1 ) { - if( cal.WeekDays & bm ) { - if( cnt ) - oss << ","; - oss << WeekDays[i]; - cnt++; - } - } - AddParam(attr, "BYDAY", oss.str().c_str()); - } - break; - - default: - throw ConvertError("Unknown RecurringType in Barry Calendar object"); - } - - // add some common parameters - if( cal.Interval > 1 ) { - ostringstream oss; - oss << cal.Interval; - AddParam(attr, "INTERVAL", oss.str().c_str()); - } - if( !cal.Perpetual ) { - gStringPtr rend(osync_time_unix2vtime(&cal.RecurringEndTime)); - AddParam(attr, "UNTIL", rend.Get()); - } - - AddAttr(attr); - -/* - bool AllDayEvent; - - /// - /// Recurring data - /// - /// Note: interval can be used on all of these recurring types to - /// make it happen "every other time" or more, etc. - /// - - bool Recurring; - RecurringCodeType RecurringType; - unsigned short Interval; // must be >= 1 - time_t RecurringEndTime; // only pertains if Recurring is true - // sets the date and time when - // recurrence of this appointment - // should no longer occur - // If a perpetual appointment, this - // is 0xFFFFFFFF in the low level data - // Instead, set the following flag. - bool Perpetual; // if true, this will always recur - unsigned short TimeZoneCode; // the time zone originally used - // for the recurrence data... - // seems to have little use, but - // set to your current time zone - // as a good default - - unsigned short // recurring details, depending on type - DayOfWeek, // 0-6 - WeekOfMonth, // 1-5 - DayOfMonth, // 1-31 - MonthOfYear; // 1-12 - unsigned char WeekDays; // bitmask, bit 0 = sunday - - #define CAL_WD_SUN 0x01 - #define CAL_WD_MON 0x02 - #define CAL_WD_TUE 0x04 - #define CAL_WD_WED 0x08 - #define CAL_WD_THU 0x10 - #define CAL_WD_FRI 0x20 - #define CAL_WD_SAT 0x40 - -*/ - -} - -void vCalendar::RecurToBarryCal() -{ - // FIXME - needs to be implemented - - // GetWeekDayIndex() -} - -// Main conversion routine for converting from Barry::Calendar to -// a vCalendar string of data. -const std::string& vCalendar::ToVCal(const Barry::Calendar &cal) -{ - Trace trace("vCalendar::ToVCal"); - std::ostringstream oss; - cal.Dump(oss); - trace.logf("ToVCal, initial Barry record: %s", oss.str().c_str()); - - // start fresh - Clear(); - SetFormat( b_vformat_new() ); - if( !Format() ) - throw ConvertError("resource error allocating vformat"); - - // store the Barry object we're working with - m_BarryCal = cal; - - // begin building vCalendar data - AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Calendar Record//EN")); - AddAttr(NewAttr("BEGIN", "VEVENT")); - AddAttr(NewAttr("SEQUENCE", "0")); - AddAttr(NewAttr("SUMMARY", cal.Subject.c_str())); - AddAttr(NewAttr("DESCRIPTION", cal.Notes.c_str())); - AddAttr(NewAttr("LOCATION", cal.Location.c_str())); - - gStringPtr start(osync_time_unix2vtime(&cal.StartTime)); - gStringPtr end(osync_time_unix2vtime(&cal.EndTime)); - gStringPtr notify(osync_time_unix2vtime(&cal.NotificationTime)); - - AddAttr(NewAttr("DTSTART", start.Get())); - AddAttr(NewAttr("DTEND", end.Get())); - // FIXME - add a truly globally unique "UID" string? - - - AddAttr(NewAttr("BEGIN", "VALARM")); - AddAttr(NewAttr("ACTION", "AUDIO")); - - // notify must be UTC, when specified in DATE-TIME - vAttrPtr trigger = NewAttr("TRIGGER", notify.Get()); - AddParam(trigger, "VALUE", "DATE-TIME"); - AddAttr(trigger); - - AddAttr(NewAttr("END", "VALARM")); - - - if( cal.Recurring ) { - RecurToVCal(); - } - - AddAttr(NewAttr("END", "VEVENT")); - - // generate the raw VCALENDAR data - m_gCalData = b_vformat_to_string(Format(), VFORMAT_EVENT_20); - m_vCalData = m_gCalData; - - trace.logf("ToVCal, resulting vcal data: %s", m_vCalData.c_str()); - return m_vCalData; -} - -// Main conversion routine for converting from vCalendar data string -// to a Barry::Calendar object. -const Barry::Calendar& vCalendar::ToBarry(const char *vcal, uint32_t RecordId) -{ - using namespace std; - - Trace trace("vCalendar::ToBarry"); - trace.logf("ToBarry, working on vcal data: %s", vcal); - - // we only handle vCalendar data with one vevent block - if( HasMultipleVEvents() ) - throw ConvertError("vCalendar data contains more than one VEVENT block, unsupported"); - - // start fresh - Clear(); - - // store the vCalendar raw data - m_vCalData = vcal; - - // create format parser structures - SetFormat( b_vformat_new_from_string(vcal) ); - if( !Format() ) - throw ConvertError("resource error allocating vformat"); - - string start = GetAttr("DTSTART", "/vevent"); - trace.logf("DTSTART attr retrieved: %s", start.c_str()); - string end = GetAttr("DTEND", "/vevent"); - trace.logf("DTEND attr retrieved: %s", end.c_str()); - string subject = GetAttr("SUMMARY", "/vevent"); - trace.logf("SUMMARY attr retrieved: %s", subject.c_str()); - if( subject.size() == 0 ) { - subject = ""; - trace.logf("ERROR: bad data, blank SUMMARY: %s", vcal); - } - vAttr trigger_obj = GetAttrObj("TRIGGER", 0, "/valarm"); - - string location = GetAttr("LOCATION", "/vevent"); - trace.logf("LOCATION attr retrieved: %s", location.c_str()); - - string notes = GetAttr("DESCRIPTION", "/vevent"); - trace.logf("DESCRIPTION attr retrieved: %s", notes.c_str()); - - - // - // Now, run checks and convert into Barry object - // - - - // FIXME - we are assuming that any non-UTC timestamps - // in the vcalendar record will be in the current timezone... - // This is wrong! fix this later. - // - // Also, we current ignore any time zone - // parameters that might be in the vcalendar format... this - // must be fixed. - // - time_t now = time(NULL); - int zoneoffset = osync_time_timezone_diff(localtime(&now)); - - Barry::Calendar &rec = m_BarryCal; - rec.SetIds(Barry::Calendar::GetDefaultRecType(), RecordId); - - if( !start.size() ) - throw ConvertError("Blank DTSTART"); - rec.StartTime = osync_time_vtime2unix(start.c_str(), zoneoffset); - - if( !end.size() ) { - // DTEND is actually optional! According to the - // RFC, a DTSTART with no DTEND should be treated - // like a "special day" like an anniversary, which occupies - // no time. - // - // Since the Blackberry doesn't really map well to this - // case, we'll set the end time to 1 day past start. - // - rec.EndTime = rec.StartTime + 24 * 60 * 60; - } - else { - rec.EndTime = osync_time_vtime2unix(end.c_str(), zoneoffset); - } - - rec.Subject = subject; - rec.Location = location; - rec.Notes = notes; - - // convert trigger time into notification time - // assume no notification, by default - rec.NotificationTime = 0; - if( trigger_obj.Get() ) { - string trigger_type = trigger_obj.GetParam("VALUE"); - string trigger = trigger_obj.GetValue(); - - if( trigger.size() == 0 ) { - trace.logf("ERROR: no TRIGGER found in calendar entry, assuming notification time as 15 minutes before start."); - } - else if( trigger_type == "DATE-TIME" ) { - rec.NotificationTime = osync_time_vtime2unix(trigger.c_str(), zoneoffset); - } - else if( trigger_type == "DURATION" || trigger_type.size() == 0 ) { - // default is DURATION (RFC 4.8.6.3) - string related = trigger_obj.GetParam("RELATED"); - - // default to relative to start time - time_t *relative = &rec.StartTime; - if( related == "END" ) - relative = &rec.EndTime; - - rec.NotificationTime = *relative + osync_time_alarmdu2sec(trigger.c_str()); - } - else { - throw ConvertError("Unknown TRIGGER VALUE"); - } - } - else { - trace.logf("ERROR: no TRIGGER found in calendar entry, assuming notification time as 15 minutes before start."); - } - - std::ostringstream oss; - m_BarryCal.Dump(oss); - trace.logf("ToBarry, resulting Barry record: %s", oss.str().c_str()); - return m_BarryCal; -} - -// Transfers ownership of m_gCalData to the caller. -char* vCalendar::ExtractVCal() -{ - char *ret = m_gCalData; - m_gCalData = 0; - return ret; -} - -void vCalendar::Clear() -{ - vBase::Clear(); - m_vCalData.clear(); - m_BarryCal.Clear(); - - if( m_gCalData ) { - g_free(m_gCalData); - m_gCalData = 0; - } -} - - +using namespace Barry::Sync; ////////////////////////////////////////////////////////////////////////////// // @@ -465,18 +65,29 @@ try { - vCalendar vcal; + vTimeConverter vtc; + vCalendar vcal(vtc); m_Cal = vcal.ToBarry(data, m_RecordId); } - catch( vCalendar::ConvertError &ce ) { - trace.logf("ERROR: vCalendar::ConvertError exception: %s", ce.what()); + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vevent:Barry::ConvertError exception: %s", ce.what()); return false; } return true; } +bool VEventConverter::MergeData(const Barry::Calendar &origin) +{ + // Save CalendarID value + // CalendarID field is used to link an entry event to an account mail + if (origin.CalendarID != m_Cal.CalendarID) + m_Cal.CalendarID = origin.CalendarID; + + return true; +} + // Barry storage operator void VEventConverter::operator()(const Barry::Calendar &rec) { @@ -488,20 +99,24 @@ m_Data = 0; } + // Keep a trace of Calendar object (need to merge with the new event) + m_Cal = rec; + try { - vCalendar vcal; + vTimeConverter vtc; + vCalendar vcal(vtc); vcal.ToVCal(rec); m_Data = vcal.ExtractVCal(); } - catch( vCalendar::ConvertError &ce ) { - trace.logf("ERROR: vCalendar::ConvertError exception: %s", ce.what()); + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vevent:Barry::ConvertError exception: %s", ce.what()); } } // Barry builder operator -bool VEventConverter::operator()(Barry::Calendar &rec, unsigned int dbId) +bool VEventConverter::operator()(Barry::Calendar &rec, Barry::Builder &) { Trace trace("VEventConverter::builder operator()"); @@ -523,7 +138,7 @@ VEventConverter cal2event; RecordParser parser(cal2event); - env->m_pDesktop->GetRecord(dbId, index, parser); + env->GetDesktop()->GetRecord(dbId, index, parser); return cal2event.ExtractData(); } @@ -556,21 +171,36 @@ oss << "unable to parse change data for new RecordId: " << newRecordId << " data: " << data; errmsg = oss.str(); - trace.logf(errmsg.c_str()); + trace.log(errmsg.c_str()); return false; } + // If we modify a data, we read at first its current value + // then we merge with the parsed value from the other opensync member + // Merge function is important because, we have to save some BlackBerry fields. + // Fix an issue with the new OS release who supports several calendar. + if( !add ) { + using namespace Barry; + + VEventConverter cal2event; + RecordParser parser(cal2event); + env->GetDesktop()->GetRecord(dbId, StateIndex, parser); + Calendar cal = cal2event.GetCalendar(); + + convert.MergeData(cal); + } + Barry::RecordBuilder builder(convert); if( add ) { trace.log("adding record"); - env->m_pDesktop->AddRecord(dbId, builder); + env->GetDesktop()->AddRecord(dbId, builder); } else { trace.log("setting record"); - env->m_pDesktop->SetRecord(dbId, StateIndex, builder); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); trace.log("clearing dirty flag"); - env->m_pDesktop->ClearDirty(dbId, StateIndex); + env->GetDesktop()->ClearDirty(dbId, StateIndex); } return true; diff -Nru barry-0.14/opensync-plugin/src/vevent.h barry-0.0.20110506/opensync-plugin/src/vevent.h --- barry-0.14/opensync-plugin/src/vevent.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vevent.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ // /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -19,58 +19,16 @@ root directory of this project for more details. */ -#ifndef __BARRY_SYNC_VEVENT_H__ -#define __BARRY_SYNC_VEVENT_H__ +#ifndef __BARRYSYNC_VEVENT_H__ +#define __BARRYSYNC_VEVENT_H__ #include #include #include -#include "vbase.h" -#include "vformat.h" // forward declarations class BarryEnvironment; -// -// vCalendar -// -/// Class for converting between RFC 2445 iCalendar data format, -/// and the Barry::Calendar class. -/// -class vCalendar : public vBase -{ - // data to pass to external requests - char *m_gCalData; // dynamic memory returned by vformat()... can - // be used directly by the plugin, without - // overmuch allocation and freeing (see Extract()) - std::string m_vCalData; // copy of m_gCalData, for C++ use - Barry::Calendar m_BarryCal; - - static const char *WeekDays[7]; - -protected: - void RecurToVCal(); - void RecurToBarryCal(); - - static unsigned short GetWeekDayIndex(const char *dayname); - bool HasMultipleVEvents() const; - -public: - vCalendar(); - ~vCalendar(); - - const std::string& ToVCal(const Barry::Calendar &cal); - const Barry::Calendar& ToBarry(const char *vcal, uint32_t RecordId); - - const std::string& GetVCal() const { return m_vCalData; } - const Barry::Calendar& GetBarryCal() const { return m_BarryCal; } - - char* ExtractVCal(); - - void Clear(); -}; - - class VEventConverter { char *m_Data; @@ -85,14 +43,19 @@ // Transfers ownership of m_Data to the caller char* ExtractData(); + const Barry::Calendar& GetCalendar() const { return m_Cal; }; + // Parses vevent data bool ParseData(const char *data); + // Merge vevent data + bool MergeData(const Barry::Calendar &origin); + // Barry storage operator void operator()(const Barry::Calendar &rec); // Barry builder operator - bool operator()(Barry::Calendar &rec, unsigned int dbId); + bool operator()(Barry::Calendar &rec, Barry::Builder &); // Handles calling of the Barry::Controller to fetch a specific // record, indicated by index (into the RecordStateTable). @@ -110,6 +73,5 @@ const char *data, bool add, std::string &errmsg); }; - #endif diff -Nru barry-0.14/opensync-plugin/src/vformat.c barry-0.0.20110506/opensync-plugin/src/vformat.c --- barry-0.14/opensync-plugin/src/vformat.c 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vformat.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2121 +0,0 @@ -/* - * Copyright (C) 2003 Ximian, Inc. - * - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Chris Toshok (toshok@ximian.com) - * Author: Armin Bauer (armin.bauer@opensync.org) - * - */ - -#include "vformat.h" - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include - -static size_t base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save); -static size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save); -static size_t base64_decode_simple (char *data, size_t len); -static char *base64_encode_simple (const char *data, size_t len); - -static size_t quoted_decode_simple (char *data, size_t len); -static char *quoted_encode_simple (const unsigned char *string, int len); - - -/** - * _helper_is_base64 is helper function to check i a string is "b" or "base64" - * @param check_string string that should be compared with "b" or "base64" - * @return 0 if check_string is not base64 and 1 if it is - */ -static int _helper_is_base64(const char *check_string) -{ - if(!g_ascii_strcasecmp ((char *) check_string, "BASE64") || - !g_ascii_strcasecmp ((char *) check_string, "b") ) - return (1); - return (0); -} - -time_t b_vformat_time_to_unix(const char *inptime) -{ - char *date = NULL; - char *time = NULL; - char *ftime = NULL; - if ((ftime = g_strrstr(inptime, "T"))) { - - date = g_strndup(inptime, ftime - inptime); - if (ftime[3] == ':') - time = g_strndup(ftime + 1, 8); - else - time = g_strndup(ftime + 1, 6); - } else { - date = g_strdup(inptime); - } - - struct tm btime; - memset(&btime, 0, sizeof(struct tm)); - btime.tm_isdst = -1; - - if (strlen(date) == 10) { - btime.tm_year = date[0] * 1000 + date[1] * 100 + date[2] * 10 + date[3] - '0' * 1111 - 1900; - btime.tm_mon = date[5] * 10 + date[6] - '0' * 11 - 1; - btime.tm_mday = date[8] * 10 + date[9] - '0' * 11; - } else { - btime.tm_year = date[0] * 1000 + date[1] * 100 + date[2] * 10 + date[3] - '0' * 1111- 1900; - btime.tm_mon = date[4] * 10 + date[5] - '0' * 11 - 1; - btime.tm_mday = date[6] * 10 + date[7] - '0' * 11; - } - - if (time && strlen(time) == 8) { - //Time - btime.tm_hour = time[0] * 10 + time[1] - '0' * 11; - btime.tm_min = time[3] * 10 + time[4] - '0' * 11; - btime.tm_sec = time[6] * 10 + time[7] - '0' * 11; - } else if (time && strlen(time) == 6) { - btime.tm_hour = time[0] * 10 + time[1] - '0' * 11; - btime.tm_min = time[2] * 10 + time[3] - '0' * 11; - btime.tm_sec = time[4] * 10 + time[5] - '0' * 11; - } - - time_t utime = mktime(&btime); - return utime; -} - -static char *_fold_lines (char *buf) -{ - GString *str = g_string_new (""); - GString *line = g_string_new (""); - char *p = buf; - char *next, *next2, *q; - gboolean newline = TRUE; - gboolean quotedprintable = FALSE; - - /* - * We're pretty liberal with line folding here. We handle - * lines folded with \r\n, \n\r, \n, =\r\n and =\n\r. - * We also turn single \r's and \n's not followed by into \r\n's. - */ - - while (*p) { - - /* search new lines for quoted printable encoding */ - if (newline) { - for (q=p; *q != '\n' && *q != '\0'; q++) - line = g_string_append_unichar (line, g_utf8_get_char (q)); - - if (strstr(line->str, "ENCODING=QUOTED-PRINTABLE")) - quotedprintable = TRUE; - - g_string_free(line, TRUE); - line = g_string_new (""); - - newline = FALSE; - } - - - if ((quotedprintable && *p == '=') || *p == '\r' || *p == '\n') { - next = g_utf8_next_char (p); - if (*next == '\n' || *next == '\r') { - next2 = g_utf8_next_char (next); - if (*next2 == '\n' || *next2 == '\r' || *next2 == ' ' || *next2 == '\t') { - p = g_utf8_next_char (next2); - } - else { - str = g_string_append (str, CRLF); - p = g_utf8_next_char (next); - newline = TRUE; - quotedprintable = FALSE; - } - } - else if (*p == '=') { - str = g_string_append_unichar (str, g_utf8_get_char (p)); - p = g_utf8_next_char (p); - } - else if (*next == ' ' || *next == '\t') { - p = g_utf8_next_char (next); - } - else { - str = g_string_append (str, CRLF); - p = g_utf8_next_char (p); - newline = TRUE; - quotedprintable = FALSE; - } - } - else { - str = g_string_append_unichar (str, g_utf8_get_char (p)); - p = g_utf8_next_char (p); - } - } - - g_free (buf); - g_string_free(line, TRUE); - - return g_string_free (str, FALSE); -} - -/* skip forward until we hit the CRLF, or \0 */ -static void _skip_to_next_line (char **p) -{ - char *lp; - lp = *p; - - while (*lp != '\r' && *lp != '\0') - lp = g_utf8_next_char (lp); - - if (*lp == '\r') { - lp = g_utf8_next_char (lp); /* \n */ - lp = g_utf8_next_char (lp); /* start of the next line */ - } - - *p = lp; -} - -/* skip forward until we hit a character in @s, CRLF, or \0. leave *p - pointing at the character that causes us to stop */ -static void _skip_until (char **p, char *s) -{ - char *lp; - - lp = *p; - - while (*lp != '\r' && *lp != '\0') { - gboolean s_matches = FALSE; - char *ls; - for (ls = s; *ls; ls = g_utf8_next_char (ls)) { - if (g_utf8_get_char (ls) == g_utf8_get_char (lp)) { - s_matches = TRUE; - break; - } - } - - if (s_matches) - break; - lp++; - } - - *p = lp; -} - -static void _read_attribute_value_add (b_VFormatAttribute *attr, GString *str, GString *charset) -{ - /* don't convert empty strings */ - if (str->len == 0) { - b_vformat_attribute_add_value(attr, str->str); - return; - } - - char *inbuf, *outbuf, *p; - size_t inbytesleft, outbytesleft; - - inbuf = str->str; - p = outbuf = malloc(str->len*2); - inbytesleft = str->len; - outbytesleft = str->len*2; - - iconv_t cd; - - /* if a CHARSET was given, let's try to convert inbuf to UTF-8 */ - if (charset) { - - cd = iconv_open("UTF-8", charset->str); -#ifdef SOLARIS - if (iconv(cd, (const char**)&inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { -#else - if (iconv(cd, &inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { -#endif - *p = 0; - b_vformat_attribute_add_value(attr, outbuf); - - } else { - - /* hmm, should not happen */ - b_vformat_attribute_add_value(attr, str->str); - - } - - iconv_close(cd); - - } else { - - /* no CHARSET was given, if inbuf is already UTF-8 we add str->str */ - if (g_utf8_validate (inbuf, -1, NULL)) { - - b_vformat_attribute_add_value (attr, str->str); - - } else { - - /* because inbuf is not UTF-8, we think it is ISO-8859-1 */ - cd = iconv_open("UTF-8", "ISO-8859-1"); -#ifdef SOLARIS - if (iconv(cd, (const char**)&inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { -#else - if (iconv(cd, &inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { -#endif - *p = 0; - b_vformat_attribute_add_value (attr, outbuf); - - } else { - - b_vformat_attribute_add_value (attr, str->str); - - } - - iconv_close(cd); - - } - - } - - free(outbuf); - -} - -static void _read_attribute_value (b_VFormatAttribute *attr, char **p, int format_encoding, GString *charset) -{ - char *lp = *p; - GString *str; - - /* read in the value */ - str = g_string_new (""); - while (*lp != '\r' && *lp != '\0') { - if (*lp == '=' && format_encoding == VF_ENCODING_QP) { - char a, b, x1=0, x2=0; - - if ((a = *(++lp)) == '\0') break; - if ((b = *(++lp)) == '\0') break; - - if (isalnum(a)) { - if (isalnum(b)) { - /* e.g. ...N=C3=BCrnberg\r\n - * ^^^ - */ - x1=a; - x2=b; - } - else if (b == '=') { - /* e.g. ...N=C=\r\n - * ^^^ - * 3=BCrnberg... - * ^ - */ - char *tmplp = lp; - if (*(++tmplp) == '\r' && *(++tmplp) == '\n' && isalnum(*(++tmplp))) { - x1 = a; - x2 = *tmplp; - lp = tmplp; - } - } - else { - /* append malformed input, and - continue parsing */ - str = g_string_append_c(str, a); - str = g_string_append_c(str, b); - } - } - else if (a == '=') { - char *tmplp = lp; - char c, d, e; - c = *(++tmplp); - d = *(++tmplp); - e = *(++tmplp); - if (b == '\r' && c == '\n' && isalnum(d) && isalnum(e)) { - x1 = d; - x2 = e; - lp = tmplp; - } - else { - /* append malformed input, and - continue parsing */ - str = g_string_append_c(str, a); - str = g_string_append_c(str, b); - } - } - else { - /* append malformed input, and - continue parsing */ - str = g_string_append_c(str, a); - str = g_string_append_c(str, b); - } - if (x1 && x2) { - char c; - - a = tolower (x1); - b = tolower (x2); - - c = (((a>='a'?a-'a'+10:a-'0')&0x0f) << 4) - | ((b>='a'?b-'a'+10:b-'0')&0x0f); - - str = g_string_append_c (str, c); - } - lp++; - x1 = x2 = 0; - } - else if (format_encoding == VF_ENCODING_BASE64) { - if((*lp != ' ') && (*lp != '\t') ) - str = g_string_append_unichar (str, g_utf8_get_char (lp)); - lp = g_utf8_next_char(lp); - } - else if (*lp == '\\') { - /* convert back to the non-escaped version of - the characters */ - lp = g_utf8_next_char(lp); - if (*lp == '\0') { - str = g_string_append_c (str, '\\'); - break; - } - switch (*lp) { - case 'n': str = g_string_append_c (str, '\n'); break; - case 'r': str = g_string_append_c (str, '\r'); break; - case ';': str = g_string_append_c (str, ';'); break; - case ',': - if (!g_ascii_strcasecmp (attr->name, "CATEGORIES")) { - //We need to handle categories here to work - //aroung a bug in evo2 - _read_attribute_value_add (attr, str, charset); - g_string_assign (str, ""); - } else - str = g_string_append_c (str, ','); - break; - case '\\': str = g_string_append_c (str, '\\'); break; - case '"': str = g_string_append_c (str, '"'); break; - /* \t is (incorrectly) used by kOrganizer, so handle it here */ - case 't': str = g_string_append_c (str, '\t'); break; - default: - osync_trace(TRACE_INTERNAL, "invalid escape, passing it through. escaped char was %i", *lp); - str = g_string_append_c (str, '\\'); - str = g_string_append_unichar (str, g_utf8_get_char(lp)); - break; - } - lp = g_utf8_next_char(lp); - } - else if ((*lp == ';') || - (*lp == ',' && !g_ascii_strcasecmp (attr->name, "CATEGORIES"))) { - _read_attribute_value_add (attr, str, charset); - g_string_assign (str, ""); - lp = g_utf8_next_char(lp); - } - else { - str = g_string_append_unichar (str, g_utf8_get_char (lp)); - lp = g_utf8_next_char(lp); - } - } - if (str) { - _read_attribute_value_add (attr, str, charset); - g_string_free (str, TRUE); - } - - if (*lp == '\r') { - lp = g_utf8_next_char (lp); /* \n */ - lp = g_utf8_next_char (lp); /* start of the next line */ - } - - *p = lp; -} - -static void _read_attribute_params(b_VFormatAttribute *attr, char **p, int *format_encoding, GString **charset) -{ - char *lp = *p; - GString *str; - b_VFormatParam *param = NULL; - gboolean in_quote = FALSE; - str = g_string_new (""); - - while (*lp != '\0') { - if (*lp == '"') { - in_quote = !in_quote; - lp = g_utf8_next_char (lp); - } - else if (in_quote || g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_' || *lp == '/' || *lp == '.' || *lp == ' ') { - str = g_string_append_unichar (str, g_utf8_get_char (lp)); - lp = g_utf8_next_char (lp); - } - /* accumulate until we hit the '=' or ';'. If we hit - * a '=' the string contains the parameter name. if - * we hit a ';' the string contains the parameter - * value and the name is either ENCODING (if value == - * QUOTED-PRINTABLE) or TYPE (in any other case.) - */ - else if (*lp == '=') { - if (str->len > 0) { - param = b_vformat_attribute_param_new (str->str); - g_string_assign (str, ""); - lp = g_utf8_next_char (lp); - } - else { - _skip_until (&lp, ":;"); - if (*lp == '\r') { - lp = g_utf8_next_char (lp); /* \n */ - lp = g_utf8_next_char (lp); /* start of the next line */ - break; - } - else if (*lp == ';') - lp = g_utf8_next_char (lp); - } - } - else if (*lp == ';' || *lp == ':' || *lp == ',') { - gboolean colon = (*lp == ':'); - gboolean comma = (*lp == ','); - - if (param) { - if (str->len > 0) { - b_vformat_attribute_param_add_value (param, str->str); - g_string_assign (str, ""); - if (!colon) - lp = g_utf8_next_char (lp); - } - else { - /* we've got a parameter of the form: - * PARAM=(.*,)?[:;] - * so what we do depends on if there are already values - * for the parameter. If there are, we just finish - * this parameter and skip past the offending character - * (unless it's the ':'). If there aren't values, we free - * the parameter then skip past the character. - */ - if (!param->values) { - b_vformat_attribute_param_free (param); - param = NULL; - if (!colon) - lp = g_utf8_next_char (lp); - } - } - - if (param - && !g_ascii_strcasecmp (param->name, "encoding")) { - if (!g_ascii_strcasecmp (param->values->data, "quoted-printable")) { - *format_encoding = VF_ENCODING_QP; - b_vformat_attribute_param_free (param); - param = NULL; - } else if ( _helper_is_base64(param->values->data)) { - *format_encoding = VF_ENCODING_BASE64; -// b_vformat_attribute_param_free (param); -// param = NULL; - } - } else if (param && !g_ascii_strcasecmp(param->name, "charset")) { - *charset = g_string_new(param->values->data); - b_vformat_attribute_param_free (param); - param = NULL; - } - } - else { - if (str->len > 0) { - char *param_name; - if (!g_ascii_strcasecmp (str->str, - "quoted-printable")) { - param_name = "ENCODING"; - *format_encoding = VF_ENCODING_QP; - } - /* apple's broken addressbook app outputs naked BASE64 - parameters, which aren't even vcard 3.0 compliant. */ - else if (!g_ascii_strcasecmp (str->str, - "base64")) { - param_name = "ENCODING"; - g_string_assign (str, "b"); - *format_encoding = VF_ENCODING_BASE64; - } - else { - param_name = "TYPE"; - } - - if (param_name) { - param = b_vformat_attribute_param_new (param_name); - b_vformat_attribute_param_add_value (param, str->str); - } - g_string_assign (str, ""); - if (!colon) - lp = g_utf8_next_char (lp); - } - else { - /* we've got an attribute with a truly empty - attribute parameter. So it's of the form: - - ATTR;[PARAM=value;]*;[PARAM=value;]*: - - (note the extra ';') - - the only thing to do here is, well.. nothing. - we skip over the character if it's not a colon, - and the rest is handled for us: We'll either - continue through the loop again if we hit a ';', - or we'll break out correct below if it was a ':' */ - if (!colon) - lp = g_utf8_next_char (lp); - } - } - if (param && !comma) { - b_vformat_attribute_add_param (attr, param); - param = NULL; - } - if (colon) - break; - } - else { - osync_trace(TRACE_INTERNAL, "invalid character found in parameter spec: \"%i\" String so far: %s", lp[0], str->str); - g_string_assign (str, ""); - _skip_until (&lp, ":;"); - } - } - - if (str) - g_string_free (str, TRUE); - - *p = lp; -} - -/* reads an entire attribute from the input buffer, leaving p pointing - at the start of the next line (past the \r\n) */ -static b_VFormatAttribute *_read_attribute (char **p) -{ - char *attr_group = NULL; - char *attr_name = NULL; - b_VFormatAttribute *attr = NULL; - GString *str, *charset = NULL; - char *lp = *p; - - gboolean is_qp = FALSE; - - /* first read in the group/name */ - str = g_string_new (""); - while (*lp != '\r' && *lp != '\0') { - if (*lp == ':' || *lp == ';') { - if (str->len != 0) { - /* we've got a name, break out to the value/attribute parsing */ - attr_name = g_string_free (str, FALSE); - break; - } - else { - /* a line of the form: - * (group.)?[:;] - * - * since we don't have an attribute - * name, skip to the end of the line - * and try again. - */ - g_string_free (str, TRUE); - *p = lp; - _skip_to_next_line(p); - goto lose; - } - } - else if (*lp == '.') { - if (attr_group) { - osync_trace(TRACE_INTERNAL, "extra `.' in attribute specification. ignoring extra group `%s'", - str->str); - g_string_free (str, TRUE); - str = g_string_new (""); - } - if (str->len != 0) { - attr_group = g_string_free (str, FALSE); - str = g_string_new (""); - } - } - else if (g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_' || *lp == '/') { - str = g_string_append_unichar (str, g_utf8_get_char (lp)); - } - else { - osync_trace(TRACE_INTERNAL, "invalid character found in attribute group/name: \"%i\" String so far: %s", lp[0], str->str); - g_string_free (str, TRUE); - *p = lp; - _skip_to_next_line(p); - goto lose; - } - - lp = g_utf8_next_char(lp); - } - - if (!attr_name) { - _skip_to_next_line (p); - goto lose; - } - - attr = b_vformat_attribute_new (attr_group, attr_name); - g_free (attr_group); - g_free (attr_name); - - if (*lp == ';') { - /* skip past the ';' */ - lp = g_utf8_next_char(lp); - _read_attribute_params (attr, &lp, &is_qp, &charset); - } - if (*lp == ':') { - /* skip past the ':' */ - lp = g_utf8_next_char(lp); - _read_attribute_value (attr, &lp, is_qp, charset); - } - - if (charset) g_string_free(charset, TRUE); - *p = lp; - - if (!attr->values) - goto lose; - - return attr; - lose: - if (attr) - b_vformat_attribute_free (attr); - return NULL; -} - -static void open_block(char **block, const char *block_name) -{ - char *start = *block ? *block : ""; - char *result = NULL; - - result = g_strconcat(start, "/", block_name, NULL); - if( *block ) - g_free(*block); - *block = result; -} - -static void close_block(char **block, const char *block_name) -{ - int name_len = strlen(block_name); - int block_len = *block ? strlen(*block) : 0; - char *cmp_start = NULL; - - if( block_len < name_len + 1 ) - return; - - cmp_start = *block + (block_len - name_len - 1); - if( cmp_start[0] == '/' && - g_ascii_strcasecmp(cmp_start+1, block_name) == 0 ) - { - // end of block hierarchy contains block name, - // so safe to remove - - // cut off the end of the string... no need to free/realloc - *cmp_start = '\0'; - } -} - -/* we try to be as forgiving as we possibly can here - this isn't a - * validator. Almost nothing is considered a fatal error. We always - * try to return *something*. - */ -static void _parse(b_VFormat *evc, const char *str) -{ - char *buf = g_strdup (str); - char *p, *end; - b_VFormatAttribute *attr; - - /* first validate the string is valid utf8 */ - if (!g_utf8_validate (buf, -1, (const char **)&end)) { - /* if the string isn't valid, we parse as much as we can from it */ - osync_trace(TRACE_INTERNAL, "invalid utf8 passed to b_VFormat. Limping along."); - *end = '\0'; - } - - buf = _fold_lines (buf); - - p = buf; - - attr = _read_attribute (&p); - if (!attr) - attr = _read_attribute (&p); - - if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "begin")) { - osync_trace(TRACE_INTERNAL, "vformat began without a BEGIN\n"); - } - if (attr && !g_ascii_strcasecmp (attr->name, "begin")) - b_vformat_attribute_free (attr); - else if (attr) - b_vformat_add_attribute (evc, attr); - - char *block = NULL; - while (*p) { - b_VFormatAttribute *next_attr = _read_attribute (&p); - - if (next_attr) { - if( g_ascii_strcasecmp(next_attr->name, "begin") == 0 ) { - // add to block hierarchy string - char *value = b_vformat_attribute_get_value(next_attr); - open_block(&block, value); - //osync_trace(TRACE_INTERNAL, "open block: %s", block); - g_free(value); - } - else if( g_ascii_strcasecmp(next_attr->name, "end") == 0 ) { - // close off the block - char *value = b_vformat_attribute_get_value(next_attr); - close_block(&block, value); - //osync_trace(TRACE_INTERNAL, "close block: %s", block); - g_free(value); - } - - // apply the block to the attr - next_attr->block = g_strdup(block); - - // add! - b_vformat_add_attribute (evc, next_attr); - attr = next_attr; - } - } - - if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "end")) { - osync_trace(TRACE_INTERNAL, "vformat ended without END"); - } - - g_free (buf); - g_free (block); -} - -char *b_vformat_escape_string (const char *s, b_VFormatType type) -{ - GString *str; - const char *p; - - str = g_string_new (""); - - /* Escape a string as described in RFC2426, section 5 */ - for (p = s; p && *p; p++) { - switch (*p) { - case '\n': - str = g_string_append (str, "\\n"); - break; - case '\r': - if (*(p+1) == '\n') - p++; - str = g_string_append (str, "\\n"); - break; - case ';': - str = g_string_append (str, "\\;"); - break; - case ',': - if (type == VFORMAT_CARD_30 || type == VFORMAT_EVENT_20 || type == VFORMAT_TODO_20) - str = g_string_append (str, "\\,"); - else - str = g_string_append_c (str, *p); - break; - case '\\': - /** - * We won't escape backslashes - * on vcard 2.1, unless it is in the end of a value. - * See comments above for a better explanation - **/ - if (*p != '\0' && type == VFORMAT_CARD_21) { - osync_trace(TRACE_INTERNAL, "[%s]We won't escape backslashes", __func__); - str = g_string_append_c(str, *p); - } - else { - osync_trace(TRACE_INTERNAL, "[%s] escape backslashes!!", __func__); - str = g_string_append (str, "\\\\"); - } - break; - default: - str = g_string_append_c (str, *p); - break; - } - } - - return g_string_free (str, FALSE); -} - -char* -b_vformat_unescape_string (const char *s) -{ - GString *str; - const char *p; - - g_return_val_if_fail (s != NULL, NULL); - - str = g_string_new (""); - - /* Unescape a string as described in RFC2426, section 4 (Formal Grammar) */ - for (p = s; *p; p++) { - if (*p == '\\') { - p++; - if (*p == '\0') { - str = g_string_append_c (str, '\\'); - break; - } - switch (*p) { - case 'n': str = g_string_append_c (str, '\n'); break; - case 'r': str = g_string_append_c (str, '\r'); break; - case ';': str = g_string_append_c (str, ';'); break; - case ',': str = g_string_append_c (str, ','); break; - case '\\': str = g_string_append_c (str, '\\'); break; - case '"': str = g_string_append_c (str, '"'); break; - /* \t is (incorrectly) used by kOrganizer, so handle it here */ - case 't': str = g_string_append_c (str, '\t'); break; - default: - osync_trace(TRACE_INTERNAL, "invalid escape, passing it through. escaped char was %s", *p); - str = g_string_append_c (str, '\\'); - str = g_string_append_unichar (str, g_utf8_get_char(p)); - break; - } - } - } - - return g_string_free (str, FALSE); -} - -void -b_vformat_construct (b_VFormat *evc, const char *str) -{ - g_return_if_fail (str != NULL); - - if (*str) - _parse (evc, str); -} - -void b_vformat_free(b_VFormat *format) -{ - g_list_foreach (format->attributes, (GFunc)b_vformat_attribute_free, NULL); - g_list_free (format->attributes); - g_free(format); -} - -b_VFormat *b_vformat_new_from_string (const char *str) -{ - g_return_val_if_fail (str != NULL, NULL); - b_VFormat *evc = g_malloc0(sizeof(b_VFormat)); - - b_vformat_construct (evc, str); - - return evc; -} - -b_VFormat *b_vformat_new(void) -{ - return b_vformat_new_from_string (""); -} - -static int _block_match(b_VFormatAttribute *attr, const char *block) -{ - // a block matches if the end of the attribute's block - // string matches a case insensitive compare with block - // - // for example, a calendar may or may not start with a - // BEGIN: VCALENDAR, so DTSTART's block string could be - // "/vcalendar/vevent" or just "/vevent". By passing - // "/vevent" or even "vevent" as the block argument above, - // we should get a match for any of the above. - - int attr_len = attr->block ? strlen(attr->block) : 0; - int block_len = block ? strlen(block) : 0; - - if( block == NULL ) - return 1; // if block is null, match everything - - if( attr_len < block_len ) - return 0; // not enough string to compare - - if( attr_len == 0 && block_len == 0 ) - return 1; // empty and null strings match - - if( attr->block == NULL ) - return 0; // don't compare if one side is null - - return g_ascii_strcasecmp(&attr->block[attr_len - block_len], block) == 0; -} - -b_VFormatAttribute *b_vformat_find_attribute(b_VFormat *vcard, const char *name, int nth, const char *block) -{ - GList *attributes = b_vformat_get_attributes(vcard); - GList *a = NULL; - int i = 0; - for (a = attributes; a; a = a->next) { - b_VFormatAttribute *attr = a->data; - if (!g_ascii_strcasecmp(b_vformat_attribute_get_name(attr), name)) { - if( block == NULL || _block_match(attr, block) ) { - if( i == nth ) - return attr; - i++; - } - } - } - return NULL; -} - -/* -b_VFormatAttribute *b_vformat_find_attribute_next(b_VFormatAttribute *last, - const char *name, - int nth) -{ - GList *attributes = last ? last->next : 0; - GList *a = NULL; - int i = 0; - for (a = attributes; a; a = a->next) { - b_VFormatAttribute *attr = a->data; - if (!g_ascii_strcasecmp(b_vformat_attribute_get_name(attr), name)) { - if( i == nth ) - return attr; - i++; - } - } - return NULL; -} -*/ - -char *b_vformat_to_string (b_VFormat *evc, b_VFormatType type) -{ - osync_trace(TRACE_ENTRY, "%s(%p, %i)", __func__, type); - GList *l; - GList *v; - - GString *str = g_string_new (""); - - switch (type) { - case VFORMAT_CARD_21: - str = g_string_append (str, "BEGIN:VCARD\r\nVERSION:2.1\r\n"); - break; - case VFORMAT_CARD_30: - str = g_string_append (str, "BEGIN:VCARD\r\nVERSION:3.0\r\n"); - break; - case VFORMAT_TODO_10: - case VFORMAT_EVENT_10: - str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:1.0\r\n"); - break; - case VFORMAT_TODO_20: - case VFORMAT_EVENT_20: - str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n"); - break; - case VFORMAT_NOTE: - str = g_string_append (str, "BEGIN:VNOTE\r\nVERSION:1.1\r\n"); - break; - } - - for (l = evc->attributes; l; l = l->next) { - GList *p; - b_VFormatAttribute *attr = l->data; - GString *attr_str; - int l; - int format_encoding = VF_ENCODING_RAW; - - attr_str = g_string_new (""); - - /* From rfc2425, 5.8.2 - * - * contentline = [group "."] name *(";" param) ":" value CRLF - */ - - if (attr->group) { - attr_str = g_string_append (attr_str, attr->group); - attr_str = g_string_append_c (attr_str, '.'); - } - attr_str = g_string_append (attr_str, attr->name); - /* handle the parameters */ - for (p = attr->params; p; p = p->next) { - b_VFormatParam *param = p->data; - /* 5.8.2: - * param = param-name "=" param-value *("," param-value) - */ - if( type == VFORMAT_CARD_30 || type == VFORMAT_TODO_20 - || type == VFORMAT_EVENT_20) { - - /** - * Character set can only be specified on the CHARSET - * parameter on the Content-Type MIME header field. - **/ - if (!g_ascii_strcasecmp (param->name, "CHARSET")) - continue; - attr_str = g_string_append_c (attr_str, ';'); - attr_str = g_string_append (attr_str, param->name); - if (param->values) { - attr_str = g_string_append_c (attr_str, '='); - } - for (v = param->values; v; v = v->next) { - if (_helper_is_base64((const char *) v->data)) { - format_encoding = VF_ENCODING_BASE64; - /*Only the "B" encoding of [RFC 2047] is an allowed*/ - v->data="B"; - } - /** - * QUOTED-PRINTABLE inline encoding has been - * eliminated. - **/ - if (!g_ascii_strcasecmp (param->name, "ENCODING") && !g_ascii_strcasecmp ((char *) v->data, "QUOTED-PRINTABLE")) { - osync_trace(TRACE_ERROR, "%s false encoding QUOTED-PRINTABLE is not allowed", __func__); - format_encoding = VF_ENCODING_QP; - } - attr_str = g_string_append (attr_str, v->data); - - if (v->next) - attr_str = g_string_append_c (attr_str, ','); - } - } - else { - attr_str = g_string_append_c (attr_str, ';'); - /** - * The "TYPE=" is optional skip it. - * LOGO, PHOTO and SOUND multimedia formats MUST - * have a "TYPE=" parameter - **/ - gboolean must_have_type = FALSE; - if (!g_ascii_strcasecmp (attr->name, "PHOTO") || !g_ascii_strcasecmp (attr->name, "LOGO") || !g_ascii_strcasecmp (attr->name, "SOUND") ) - must_have_type = TRUE; - if ( must_have_type || g_ascii_strcasecmp (param->name, "TYPE") ) - attr_str = g_string_append (attr_str, param->name); - if ( param->values && (must_have_type || g_ascii_strcasecmp (param->name, "TYPE")) ) - attr_str = g_string_append_c (attr_str, '='); - for (v = param->values; v; v = v->next) { - // check for quoted-printable encoding - if (!g_ascii_strcasecmp (param->name, "ENCODING") && !g_ascii_strcasecmp ((char *) v->data, "QUOTED-PRINTABLE")) - format_encoding = VF_ENCODING_QP; - // check for base64 encoding - if (_helper_is_base64((const char *) v->data)) { - format_encoding = VF_ENCODING_BASE64; - v->data="BASE64"; - } - attr_str = g_string_append (attr_str, v->data); - if (v->next) - attr_str = g_string_append_c (attr_str, ','); - } - } - } - - attr_str = g_string_append_c (attr_str, ':'); - - for (v = attr->values; v; v = v->next) { - char *value = v->data; - char *escaped_value = NULL; - - if (!g_ascii_strcasecmp (attr->name, "RRULE") && - strstr (value, "BYDAY") == v->data) { - attr_str = g_string_append (attr_str, value); - } else { - escaped_value = b_vformat_escape_string (value, type); - attr_str = g_string_append (attr_str, escaped_value); - } - - if (v->next) { - - /* XXX toshok - i hate you, rfc 2426. - why doesn't CATEGORIES use a ; like - a normal list attribute? */ - if (!g_ascii_strcasecmp (attr->name, "CATEGORIES")) - attr_str = g_string_append_c (attr_str, ','); - else - attr_str = g_string_append_c (attr_str, ';'); - } - - g_free (escaped_value); - } - - /* Folding lines: - * ^^^^^^^^^^^^^^ - * - * rfc 2426 (vCard), 2.6 Line Delimiting and Folding: - * After generating a content line, - * lines longer than 75 characters SHOULD be folded according to the - * folding procedure described in [MIME-DIR]. - * - * rfc 2445 (iCalendar), 4.1 Content Lines: - * Lines of text SHOULD NOT be longer than 75 octets, excluding the line - * break. Long content lines SHOULD be split into a multiple line - * representations using a line "folding" technique. That is, a long - * line can be split between any two characters by inserting a CRLF - * immediately followed by a single linear white space character (i.e., - * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence - * of CRLF followed immediately by a single linear white space character - * is ignored (i.e., removed) when processing the content type. - * - * SUMMARY: When generating a content line, lines longer then 75 characters SHOULD be folded! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * Differences between encodings: - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * rfc 2425 [MIME-DIR], 5.8.1: - * A logical line MAY be continued on the next physical line anywhere - * between two characters by inserting a CRLF immediately followed by a - * single (white space) character. - * - * rfc 2045, 6.7, chapter 5: - * The quoted-printable specs says that softbreaks should be generated by inserting a =\r\n - * without follwing - * - * UTF-8 - * ^^^^^ - * - * Note that all the line folding above is described in terms of characters - * not bytes. In particular, it would be an error to put a line break - * within a UTF-8 character. - */ - - l = 0; - do { - if (g_utf8_strlen(attr_str->str, attr_str->len) - l > 75) { - l += 75; - - /* If using QP, must be sure that we do not fold within a quote sequence */ - if (format_encoding == VF_ENCODING_QP) { - if (g_utf8_get_char(g_utf8_offset_to_pointer(attr_str->str, l-1)) == '=') l--; - else if (g_utf8_get_char(g_utf8_offset_to_pointer(attr_str->str, l-2)) == '=') l -= 2; - } - - char *p = g_utf8_offset_to_pointer(attr_str->str, l); - - if (format_encoding == VF_ENCODING_QP) - attr_str = g_string_insert_len (attr_str, p - attr_str->str, "=" CRLF "", sizeof ("=" CRLF "") - 1); - else - attr_str = g_string_insert_len (attr_str, p - attr_str->str, CRLF " ", sizeof (CRLF " ") - 1); - } - else - break; - } while (l < g_utf8_strlen(attr_str->str, attr_str->len)); - - attr_str = g_string_append (attr_str, CRLF); - /** - * base64= - * the end of the text is marked with two CRLF sequences - * this results in one blank line before the start of the - * next property - **/ - if( format_encoding == VF_ENCODING_BASE64 - && (type == VFORMAT_CARD_21)) - attr_str = g_string_append (attr_str, CRLF); - - str = g_string_append (str, attr_str->str); - g_string_free (attr_str, TRUE); - } - - switch (type) { - case VFORMAT_CARD_21: - str = g_string_append (str, "END:VCARD\r\n"); - break; - case VFORMAT_CARD_30: - str = g_string_append (str, "END:VCARD\r\n"); - break; - case VFORMAT_TODO_10: - case VFORMAT_EVENT_10: - str = g_string_append (str, "END:VCALENDAR\r\n"); - break; - case VFORMAT_TODO_20: - case VFORMAT_EVENT_20: - str = g_string_append (str, "END:VCALENDAR\r\n"); - break; - case VFORMAT_NOTE: - str = g_string_append (str, "END:VNOTE\r\n"); - break; - } - - osync_trace(TRACE_EXIT, "%s(%p, %i)", __func__, type); - return g_string_free (str, FALSE); -} - -void b_vformat_dump_structure (b_VFormat *evc) -{ - GList *a; - GList *v; - int i; - - printf ("b_VFormat\n"); - for (a = evc->attributes; a; a = a->next) { - GList *p; - b_VFormatAttribute *attr = a->data; - printf ("+-- %s\n", attr->name); - if (attr->params) { - printf (" +- params=\n"); - - for (p = attr->params, i = 0; p; p = p->next, i++) { - b_VFormatParam *param = p->data; - printf (" | [%d] = %s", i,param->name); - printf ("("); - for (v = param->values; v; v = v->next) { - char *value = b_vformat_escape_string ((char*)v->data, VFORMAT_CARD_21); - printf ("%s", value); - if (v->next) - printf (","); - g_free (value); - } - - printf (")\n"); - } - } - printf (" +- values=\n"); - for (v = attr->values, i = 0; v; v = v->next, i++) { - printf (" [%d] = `%s'\n", i, (char*)v->data); - } - } -} - -b_VFormatAttribute *b_vformat_attribute_new (const char *attr_group, const char *attr_name) -{ - b_VFormatAttribute *attr; - - attr = g_new0 (b_VFormatAttribute, 1); - - attr->group = g_strdup (attr_group); - attr->name = g_strdup (attr_name); - - return attr; -} - -void -b_vformat_attribute_free (b_VFormatAttribute *attr) -{ - g_return_if_fail (attr != NULL); - - g_free (attr->block); - g_free (attr->group); - g_free (attr->name); - - b_vformat_attribute_remove_values (attr); - - b_vformat_attribute_remove_params (attr); - - g_free (attr); -} - -b_VFormatAttribute* -b_vformat_attribute_copy (b_VFormatAttribute *attr) -{ - b_VFormatAttribute *a; - GList *p; - - g_return_val_if_fail (attr != NULL, NULL); - - a = b_vformat_attribute_new (b_vformat_attribute_get_group (attr), - b_vformat_attribute_get_name (attr)); - - for (p = attr->values; p; p = p->next) - b_vformat_attribute_add_value (a, p->data); - - for (p = attr->params; p; p = p->next) - b_vformat_attribute_add_param (a, b_vformat_attribute_param_copy (p->data)); - - return a; -} - -void -b_vformat_remove_attributes (b_VFormat *evc, const char *attr_group, const char *attr_name) -{ - GList *attr; - - g_return_if_fail (attr_name != NULL); - - attr = evc->attributes; - while (attr) { - GList *next_attr; - b_VFormatAttribute *a = attr->data; - - next_attr = attr->next; - - if (((!attr_group && !a->group) || - (attr_group && !g_ascii_strcasecmp (attr_group, a->group))) && - ((!attr_name && !a->name) || !g_ascii_strcasecmp (attr_name, a->name))) { - - /* matches, remove/delete the attribute */ - evc->attributes = g_list_remove_link (evc->attributes, attr); - - b_vformat_attribute_free (a); - } - - attr = next_attr; - } -} - -void -b_vformat_remove_attribute (b_VFormat *evc, b_VFormatAttribute *attr) -{ - g_return_if_fail (attr != NULL); - - evc->attributes = g_list_remove (evc->attributes, attr); - b_vformat_attribute_free (attr); -} - -void -b_vformat_add_attribute (b_VFormat *evc, b_VFormatAttribute *attr) -{ - g_return_if_fail (attr != NULL); - - evc->attributes = g_list_append (evc->attributes, attr); -} - -void -b_vformat_add_attribute_with_value (b_VFormat *b_VFormat, - b_VFormatAttribute *attr, const char *value) -{ - g_return_if_fail (attr != NULL); - - b_vformat_attribute_add_value (attr, value); - - b_vformat_add_attribute (b_VFormat, attr); -} - -void -b_vformat_add_attribute_with_values (b_VFormat *b_VFormat, b_VFormatAttribute *attr, ...) -{ - va_list ap; - char *v; - - g_return_if_fail (attr != NULL); - - va_start (ap, attr); - - while ((v = va_arg (ap, char*))) { - b_vformat_attribute_add_value (attr, v); - } - - va_end (ap); - - b_vformat_add_attribute (b_VFormat, attr); -} - -void -b_vformat_attribute_add_value (b_VFormatAttribute *attr, const char *value) -{ - g_return_if_fail (attr != NULL); - - attr->values = g_list_append (attr->values, g_strdup (value)); -} - -void -b_vformat_attribute_add_value_decoded (b_VFormatAttribute *attr, const char *value, int len) -{ - g_return_if_fail (attr != NULL); - - switch (attr->encoding) { - case VF_ENCODING_RAW: - osync_trace(TRACE_INTERNAL, "can't add_value_decoded with an attribute using RAW encoding. you must set the ENCODING parameter first"); - break; - case VF_ENCODING_BASE64: { - char *b64_data = base64_encode_simple (value, len); - GString *decoded = g_string_new_len (value, len); - - /* make sure the decoded list is up to date */ - b_vformat_attribute_get_values_decoded (attr); - - attr->values = g_list_append (attr->values, b64_data); - attr->decoded_values = g_list_append (attr->decoded_values, decoded); - break; - } - case VF_ENCODING_QP: { - char *qp_data = quoted_encode_simple ((unsigned char*)value, len); - GString *decoded = g_string_new (value); - - /* make sure the decoded list is up to date */ - b_vformat_attribute_get_values_decoded (attr); - - attr->values = g_list_append (attr->values, qp_data); - attr->decoded_values = g_list_append (attr->decoded_values, decoded); - break; - } - case VF_ENCODING_8BIT: { - char *data = g_strdup(value); - GString *decoded = g_string_new (value); - - /* make sure the decoded list is up to date */ - b_vformat_attribute_get_values_decoded (attr); - - attr->values = g_list_append (attr->values, data); - attr->decoded_values = g_list_append (attr->decoded_values, decoded); - break; - } - } -} - -void -b_vformat_attribute_add_values (b_VFormatAttribute *attr, ...) -{ - va_list ap; - char *v; - - g_return_if_fail (attr != NULL); - - va_start (ap, attr); - - while ((v = va_arg (ap, char*))) { - b_vformat_attribute_add_value (attr, v); - } - - va_end (ap); -} - -static void -free_gstring (GString *str) -{ - g_string_free (str, TRUE); -} - -void -b_vformat_attribute_remove_values (b_VFormatAttribute *attr) -{ - g_return_if_fail (attr != NULL); - - g_list_foreach (attr->values, (GFunc)g_free, NULL); - g_list_free (attr->values); - attr->values = NULL; - - g_list_foreach (attr->decoded_values, (GFunc)free_gstring, NULL); - g_list_free (attr->decoded_values); - attr->decoded_values = NULL; -} - -void -b_vformat_attribute_remove_params (b_VFormatAttribute *attr) -{ - g_return_if_fail (attr != NULL); - - g_list_foreach (attr->params, (GFunc)b_vformat_attribute_param_free, NULL); - g_list_free (attr->params); - attr->params = NULL; - - /* also remove the cached encoding on this attribute */ - attr->encoding_set = FALSE; - attr->encoding = VF_ENCODING_RAW; -} - -b_VFormatParam* -b_vformat_attribute_param_new (const char *name) -{ - b_VFormatParam *param = g_new0 (b_VFormatParam, 1); - param->name = g_strdup (name); - - return param; -} - -void -b_vformat_attribute_param_free (b_VFormatParam *param) -{ - g_return_if_fail (param != NULL); - - g_free (param->name); - - b_vformat_attribute_param_remove_values (param); - - g_free (param); -} - -b_VFormatParam* -b_vformat_attribute_param_copy (b_VFormatParam *param) -{ - b_VFormatParam *p; - GList *l; - - g_return_val_if_fail (param != NULL, NULL); - - p = b_vformat_attribute_param_new (b_vformat_attribute_param_get_name (param)); - - for (l = param->values; l; l = l->next) { - b_vformat_attribute_param_add_value (p, l->data); - } - - return p; -} - -void -b_vformat_attribute_add_param (b_VFormatAttribute *attr, - b_VFormatParam *param) -{ - g_return_if_fail (attr != NULL); - g_return_if_fail (param != NULL); - - attr->params = g_list_append (attr->params, param); - - /* we handle our special encoding stuff here */ - - if (!g_ascii_strcasecmp (param->name, "ENCODING")) { - if (attr->encoding_set) { - osync_trace(TRACE_INTERNAL, "ENCODING specified twice"); - return; - } - - if (param->values && param->values->data) { - if (_helper_is_base64((const char*)param->values->data)) - attr->encoding = VF_ENCODING_BASE64; - else if (!g_ascii_strcasecmp ((char*)param->values->data, "QUOTED-PRINTABLE")) - attr->encoding = VF_ENCODING_QP; - else if (!g_ascii_strcasecmp ((char *)param->values->data, "8BIT")) - attr->encoding = VF_ENCODING_8BIT; - else { - osync_trace(TRACE_INTERNAL, "Unknown value `%s' for ENCODING parameter. values will be treated as raw", - (char*)param->values->data); - } - - attr->encoding_set = TRUE; - } - else { - osync_trace(TRACE_INTERNAL, "ENCODING parameter added with no value"); - } - } -} - -b_VFormatParam *b_vformat_attribute_find_param(b_VFormatAttribute *attr, const char *name) -{ - g_return_val_if_fail (attr != NULL, NULL); - GList *p = NULL; - for (p = attr->params; p; p = p->next) { - b_VFormatParam *param = p->data; - if (!g_ascii_strcasecmp (param->name, name)) - return param; - } - return NULL; -} - -void -b_vformat_attribute_set_value (b_VFormatAttribute *attr, - int nth, const char *value) -{ - GList *param = g_list_nth(attr->values, nth); - g_free(param->data); - param->data = g_strdup(value); -} - -void -b_vformat_attribute_param_add_value (b_VFormatParam *param, - const char *value) -{ - g_return_if_fail (param != NULL); - - param->values = g_list_append (param->values, g_strdup (value)); -} - -void -b_vformat_attribute_param_add_values (b_VFormatParam *param, - ...) -{ - va_list ap; - char *v; - - g_return_if_fail (param != NULL); - - va_start (ap, param); - - while ((v = va_arg (ap, char*))) { - b_vformat_attribute_param_add_value (param, v); - } - - va_end (ap); -} - -void -b_vformat_attribute_add_param_with_value (b_VFormatAttribute *attr, const char *name, const char *value) -{ - g_return_if_fail (attr != NULL); - g_return_if_fail (name != NULL); - - if (!value) - return; - - b_VFormatParam *param = b_vformat_attribute_param_new(name); - - b_vformat_attribute_param_add_value (param, value); - - b_vformat_attribute_add_param (attr, param); -} - -void -b_vformat_attribute_add_param_with_values (b_VFormatAttribute *attr, - b_VFormatParam *param, ...) -{ - va_list ap; - char *v; - - g_return_if_fail (attr != NULL); - g_return_if_fail (param != NULL); - - va_start (ap, param); - - while ((v = va_arg (ap, char*))) { - b_vformat_attribute_param_add_value (param, v); - } - - va_end (ap); - - b_vformat_attribute_add_param (attr, param); -} - -void -b_vformat_attribute_param_remove_values (b_VFormatParam *param) -{ - g_return_if_fail (param != NULL); - - g_list_foreach (param->values, (GFunc)g_free, NULL); - g_list_free (param->values); - param->values = NULL; -} - -GList* -b_vformat_get_attributes (b_VFormat *format) -{ - return format->attributes; -} - -const char* -b_vformat_attribute_get_group (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - return attr->group; -} - -const char* -b_vformat_attribute_get_name (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - return attr->name; -} - -const char* -b_vformat_attribute_get_block (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - return attr->block; -} - -GList* -b_vformat_attribute_get_values (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - return attr->values; -} - -GList* -b_vformat_attribute_get_values_decoded (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - if (!attr->decoded_values) { - GList *l; - switch (attr->encoding) { - case VF_ENCODING_RAW: - case VF_ENCODING_8BIT: - for (l = attr->values; l; l = l->next) - attr->decoded_values = g_list_append (attr->decoded_values, g_string_new ((char*)l->data)); - break; - case VF_ENCODING_BASE64: - for (l = attr->values; l; l = l->next) { - char *decoded = g_strdup ((char*)l->data); - int len = base64_decode_simple (decoded, strlen (decoded)); - attr->decoded_values = g_list_append (attr->decoded_values, g_string_new_len (decoded, len)); - g_free (decoded); - } - break; - case VF_ENCODING_QP: - for (l = attr->values; l; l = l->next) { - if (!(l->data)) - continue; - char *decoded = g_strdup ((char*)l->data); - int len = quoted_decode_simple (decoded, strlen (decoded)); - attr->decoded_values = g_list_append (attr->decoded_values, g_string_new_len (decoded, len)); - g_free (decoded); - } - break; - } - } - - return attr->decoded_values; -} - -gboolean -b_vformat_attribute_is_single_valued (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, FALSE); - - if (attr->values == NULL - || attr->values->next != NULL) - return FALSE; - - return TRUE; -} - -char* -b_vformat_attribute_get_value (b_VFormatAttribute *attr) -{ - GList *values; - - g_return_val_if_fail (attr != NULL, NULL); - - values = b_vformat_attribute_get_values (attr); - - if (!b_vformat_attribute_is_single_valued (attr)) - osync_trace(TRACE_INTERNAL, "b_vformat_attribute_get_value called on multivalued attribute"); - - return values ? g_strdup ((char*)values->data) : NULL; -} - -GString* -b_vformat_attribute_get_value_decoded (b_VFormatAttribute *attr) -{ - GList *values; - GString *str = NULL; - - g_return_val_if_fail (attr != NULL, NULL); - - values = b_vformat_attribute_get_values_decoded (attr); - - if (!b_vformat_attribute_is_single_valued (attr)) - osync_trace(TRACE_INTERNAL, "b_vformat_attribute_get_value_decoded called on multivalued attribute"); - - if (values) - str = values->data; - - return str ? g_string_new_len (str->str, str->len) : NULL; -} - -const char *b_vformat_attribute_get_nth_value(b_VFormatAttribute *attr, int nth) -{ - GList *values = b_vformat_attribute_get_values_decoded(attr); - if (!values) - return NULL; - GString *retstr = (GString *)g_list_nth_data(values, nth); - if (!retstr) - return NULL; - - if (!g_utf8_validate(retstr->str, -1, NULL)) { - values = b_vformat_attribute_get_values(attr); - if (!values) - return NULL; - return g_list_nth_data(values, nth); - } - - return retstr->str; -} - -gboolean -b_vformat_attribute_has_type (b_VFormatAttribute *attr, const char *typestr) -{ - GList *params; - GList *p; - - g_return_val_if_fail (attr != NULL, FALSE); - g_return_val_if_fail (typestr != NULL, FALSE); - - params = b_vformat_attribute_get_params (attr); - - for (p = params; p; p = p->next) { - b_VFormatParam *param = p->data; - - if (!strcasecmp (b_vformat_attribute_param_get_name (param), "TYPE")) { - GList *values = b_vformat_attribute_param_get_values (param); - GList *v; - - for (v = values; v; v = v->next) { - if (!strcasecmp ((char*)v->data, typestr)) - return TRUE; - } - } - } - - return FALSE; -} - - -gboolean b_vformat_attribute_has_param(b_VFormatAttribute *attr, const char *name) -{ - g_return_val_if_fail (attr != NULL, FALSE); - g_return_val_if_fail (name != NULL, FALSE); - - GList *params = b_vformat_attribute_get_params(attr); - GList *p; - for (p = params; p; p = p->next) { - b_VFormatParam *param = p->data; - if (!strcasecmp(name, b_vformat_attribute_param_get_name(param))) - return TRUE; - } - return FALSE; -} - -GList* -b_vformat_attribute_get_params (b_VFormatAttribute *attr) -{ - g_return_val_if_fail (attr != NULL, NULL); - - return attr->params; -} - -const char* -b_vformat_attribute_param_get_name (b_VFormatParam *param) -{ - g_return_val_if_fail (param != NULL, NULL); - - return param->name; -} - -GList* -b_vformat_attribute_param_get_values (b_VFormatParam *param) -{ - g_return_val_if_fail (param != NULL, NULL); - - return param->values; -} - -const char *b_vformat_attribute_param_get_nth_value(b_VFormatParam *param, int nth) -{ - const char *ret = NULL; - GList *values = b_vformat_attribute_param_get_values(param); - if (!values) - return NULL; - ret = g_list_nth_data(values, nth); - return ret; -} - -static const char *base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -//static unsigned char _evc_base64_rank[256]; - -static void base64_init(char *rank) -{ - int i; - - memset(rank, 0xff, sizeof(rank)); - for (i=0;i<64;i++) { - rank[(unsigned int)base64_alphabet[i]] = i; - } - rank['='] = 0; -} - -/* call this when finished encoding everything, to - flush off the last little bit */ -static size_t base64_encode_close(unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save) -{ - int c1, c2; - unsigned char *outptr = out; - - if (inlen>0) - outptr += base64_encode_step(in, inlen, break_lines, outptr, state, save); - - c1 = ((unsigned char *)save)[1]; - c2 = ((unsigned char *)save)[2]; - - switch (((char *)save)[0]) { - case 2: - outptr[2] = base64_alphabet[ ( (c2 &0x0f) << 2 ) ]; - g_assert(outptr[2] != 0); - goto skip; - case 1: - outptr[2] = '='; - skip: - outptr[0] = base64_alphabet[ c1 >> 2 ]; - outptr[1] = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 )]; - outptr[3] = '='; - outptr += 4; - break; - } - if (break_lines) - *outptr++ = '\n'; - - *save = 0; - *state = 0; - - return outptr-out; -} - -/* - performs an 'encode step', only encodes blocks of 3 characters to the - output at a time, saves left-over state in state and save (initialise to - 0 on first invocation). -*/ -static size_t base64_encode_step(unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save) -{ - register unsigned char *inptr, *outptr; - - if (len<=0) - return 0; - - inptr = in; - outptr = out; - - if (len + ((char *)save)[0] > 2) { - unsigned char *inend = in+len-2; - register int c1, c2, c3; - register int already; - - already = *state; - - switch (((char *)save)[0]) { - case 1: c1 = ((unsigned char *)save)[1]; goto skip1; - case 2: c1 = ((unsigned char *)save)[1]; - c2 = ((unsigned char *)save)[2]; goto skip2; - } - - /* yes, we jump into the loop, no i'm not going to change it, it's beautiful! */ - while (inptr < inend) { - c1 = *inptr++; - skip1: - c2 = *inptr++; - skip2: - c3 = *inptr++; - *outptr++ = base64_alphabet[ c1 >> 2 ]; - *outptr++ = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 ) ]; - *outptr++ = base64_alphabet[ ( (c2 &0x0f) << 2 ) | (c3 >> 6) ]; - *outptr++ = base64_alphabet[ c3 & 0x3f ]; - /* this is a bit ugly ... */ - if (break_lines && (++already)>=19) { - *outptr++='\n'; - already = 0; - } - } - - ((char *)save)[0] = 0; - len = 2-(inptr-inend); - *state = already; - } - - if (len>0) { - register char *saveout; - - /* points to the slot for the next char to save */ - saveout = & (((char *)save)[1]) + ((char *)save)[0]; - - /* len can only be 0 1 or 2 */ - switch(len) { - case 2: *saveout++ = *inptr++; - case 1: *saveout++ = *inptr++; - } - ((char *)save)[0]+=len; - } - - return outptr-out; -} - - -/** - * base64_decode_step: decode a chunk of base64 encoded data - * @in: input stream - * @len: max length of data to decode - * @out: output stream - * @state: holds the number of bits that are stored in @save - * @save: leftover bits that have not yet been decoded - * - * Decodes a chunk of base64 encoded data - **/ -static size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save) -{ - unsigned char base64_rank[256]; - base64_init((char*)base64_rank); - - register unsigned char *inptr, *outptr; - unsigned char *inend, c; - register unsigned int v; - int i; - - inend = in+len; - outptr = out; - - /* convert 4 base64 bytes to 3 normal bytes */ - v=*save; - i=*state; - inptr = in; - while (inptr>16; - *outptr++ = v>>8; - *outptr++ = v; - i=0; - } - } - } - - *save = v; - *state = i; - - /* quick scan back for '=' on the end somewhere */ - /* fortunately we can drop 1 output char for each trailing = (upto 2) */ - i=2; - while (inptr>in && i) { - inptr--; - if (base64_rank[*inptr] != 0xff) { - if (*inptr == '=' && outptr>out) - outptr--; - i--; - } - } - - /* if i!= 0 then there is a truncation error! */ - return outptr-out; -} - -static char *base64_encode_simple (const char *data, size_t len) -{ - unsigned char *out; - int state = 0, outlen; - unsigned int save = 0; - - g_return_val_if_fail (data != NULL, NULL); - - out = g_malloc (len * 4 / 3 + 5); - outlen = base64_encode_close ((unsigned char *)data, len, FALSE, - out, &state, (int*)&save); - out[outlen] = '\0'; - return (char *)out; -} - -static size_t base64_decode_simple (char *data, size_t len) -{ - int state = 0; - unsigned int save = 0; - - g_return_val_if_fail (data != NULL, 0); - - return base64_decode_step ((unsigned char *)data, len, - (unsigned char *)data, &state, &save); -} - -static char *quoted_encode_simple(const unsigned char *string, int len) -{ - GString *tmp = g_string_new(""); - - int i = 0; - while(string[i] != 0) { - if (string[i] > 127 || string[i] == 13 || string[i] == 10 || string[i] == '=') { - g_string_append_printf(tmp, "=%02X", string[i]); - } else { - g_string_append_c(tmp, string[i]); - } - i++; - } - - char *ret = tmp->str; - g_string_free(tmp, FALSE); - return ret; -} - - -static size_t quoted_decode_simple (char *data, size_t len) -{ - g_return_val_if_fail (data != NULL, 0); - - GString *string = g_string_new(data); - if (!string) - return 0; - - char hex[5]; - hex[4] = 0; - - while (1) { - //Get the index of the next encoded char - int i = strcspn(string->str, "="); - if (i >= strlen(string->str)) - break; - - strcpy(hex, "0x"); - strncat(hex, &string->str[i + 1], 2); - char rep = ((int)(strtod(hex, NULL))); - g_string_erase(string, i, 2); - g_string_insert_c(string, i, rep); - } - - memset(data, 0, strlen(data)); - strcpy(data, string->str); - g_string_free(string, 1); - - return strlen(data); -} diff -Nru barry-0.14/opensync-plugin/src/vformat.h barry-0.0.20110506/opensync-plugin/src/vformat.h --- barry-0.14/opensync-plugin/src/vformat.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin/src/vformat.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2003 Ximian, Inc. 2005 Armin Bauer - * - * Copyright (C) 2003 Ximian, Inc. - * - * 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Chris Toshok (toshok@ximian.com) - * Author: Armin Bauer (armin.bauer@opensync.org) - * - */ - -#ifndef _VFORMAT_H -#define _VFORMAT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - VFORMAT_CARD_21, - VFORMAT_CARD_30, - VFORMAT_NOTE, - VFORMAT_EVENT_10, - VFORMAT_EVENT_20, - VFORMAT_TODO_10, - VFORMAT_TODO_20 -} b_VFormatType; - -typedef struct b_VFormat { - //b_VFormatType type; - GList *attributes; -} b_VFormat; - -#define CRLF "\r\n" - -typedef enum { - VF_ENCODING_RAW, /* no encoding */ - VF_ENCODING_BASE64, /* base64 */ - VF_ENCODING_QP, /* quoted-printable */ - VF_ENCODING_8BIT -} b_VFormatEncoding; - -typedef struct b_VFormatAttribute { - char *block; /* "vtimezone/standard", or "vevent", depending on - current begin/end location... may be null */ - char *group; - char *name; - GList *params; /* b_VFormatParam */ - GList *values; - GList *decoded_values; - b_VFormatEncoding encoding; - gboolean encoding_set; -} b_VFormatAttribute; - -typedef struct b_VFormatParam { - char *name; - GList *values; /* GList of char*'s*/ -} b_VFormatParam; - - -/*b_VFormat *vcard_new(b_VFormatType type); -b_VFormat *vcard_new_from_string (const char *str, b_VFormatType type); -//char *vcard_to_string(VFormat *card, VFormatType format); - -VFormat *vnote_new(void); -VFormat *vnote_new_from_string(const char *str); -//char *vnote_to_string(VFormat *note); - - -VFormat *vevent_new(void); -VFormat *vevent_new_from_string(const char *str); -//char *vevent_to_string(VFormat *event); - -VFormat *vtodo_new(void); -VFormat *vtodo_new_from_string(const char *str);*/ -//char *vtodo_to_string(VFormat *todo); - -/* mostly for debugging */ -b_VFormat *b_vformat_new(void); -b_VFormat *b_vformat_new_from_string(const char *str); -void b_vformat_dump_structure(b_VFormat *format); -char *b_vformat_to_string(b_VFormat *evc, b_VFormatType type); -time_t b_vformat_time_to_unix(const char *inptime); -void b_vformat_free(b_VFormat *format); - -/* attributes */ -b_VFormatAttribute *b_vformat_attribute_new (const char *attr_group, const char *attr_name); -void b_vformat_attribute_free (b_VFormatAttribute *attr); -b_VFormatAttribute *b_vformat_attribute_copy (b_VFormatAttribute *attr); -void b_vformat_remove_attributes (b_VFormat *vformat, const char *attr_group, const char *attr_name); -void b_vformat_remove_attribute (b_VFormat *vformat, b_VFormatAttribute *attr); -void b_vformat_add_attribute (b_VFormat *vformat, b_VFormatAttribute *attr); -void b_vformat_add_attribute_with_value (b_VFormat *vformat, b_VFormatAttribute *attr, const char *value); -void b_vformat_add_attribute_with_values (b_VFormat *vformat, b_VFormatAttribute *attr, ...); -void b_vformat_attribute_add_value (b_VFormatAttribute *attr, const char *value); -void b_vformat_attribute_set_value (b_VFormatAttribute *attr, int nth, const char *value); -void b_vformat_attribute_add_value_decoded (b_VFormatAttribute *attr, const char *value, int len); -void b_vformat_attribute_add_values (b_VFormatAttribute *attr, ...); -void b_vformat_attribute_remove_values (b_VFormatAttribute *attr); -void b_vformat_attribute_remove_params (b_VFormatAttribute *attr); -b_VFormatAttribute *b_vformat_find_attribute (b_VFormat *evc, const char *name, int nth, const char *block); - -/* attribute parameters */ -b_VFormatParam* b_vformat_attribute_param_new (const char *param_name); -void b_vformat_attribute_param_free (b_VFormatParam *param); -b_VFormatParam* b_vformat_attribute_param_copy (b_VFormatParam *param); -void b_vformat_attribute_add_param (b_VFormatAttribute *attr, b_VFormatParam *param); -b_VFormatParam *b_vformat_attribute_find_param(b_VFormatAttribute *attr, const char *name); -void b_vformat_attribute_add_param_with_value (b_VFormatAttribute *attr, const char *name, const char *value); -void b_vformat_attribute_add_param_with_values (b_VFormatAttribute *attr, - b_VFormatParam *param, ...); - -void b_vformat_attribute_param_add_value (b_VFormatParam *param, - const char *value); -void b_vformat_attribute_param_add_values (b_VFormatParam *param, - ...); -void b_vformat_attribute_param_remove_values (b_VFormatParam *param); -gboolean b_vformat_attribute_has_param(b_VFormatAttribute *attr, const char *name); - -/* b_VFormat* accessors. nothing returned from these functions should be - freed by the caller. */ -GList* b_vformat_get_attributes (b_VFormat *vformat); -const char* b_vformat_attribute_get_group (b_VFormatAttribute *attr); -const char* b_vformat_attribute_get_name (b_VFormatAttribute *attr); -const char* b_vformat_attribute_get_block (b_VFormatAttribute *attr); -GList* b_vformat_attribute_get_values (b_VFormatAttribute *attr); /* GList elements are of type char* */ -GList* b_vformat_attribute_get_values_decoded (b_VFormatAttribute *attr); /* GList elements are of type GString* */ -const char *b_vformat_attribute_get_nth_value(b_VFormatAttribute *attr, int nth); - -/* special accessors for single valued attributes */ -gboolean b_vformat_attribute_is_single_valued (b_VFormatAttribute *attr); -char* b_vformat_attribute_get_value (b_VFormatAttribute *attr); -GString* b_vformat_attribute_get_value_decoded (b_VFormatAttribute *attr); - -GList* b_vformat_attribute_get_params (b_VFormatAttribute *attr); -const char* b_vformat_attribute_param_get_name (b_VFormatParam *param); -GList* b_vformat_attribute_param_get_values (b_VFormatParam *param); -const char *b_vformat_attribute_param_get_nth_value(b_VFormatParam *param, int nth); - -/* special TYPE= parameter predicate (checks for TYPE=@typestr */ -gboolean b_vformat_attribute_has_type (b_VFormatAttribute *attr, const char *typestr); - -/* Utility functions. */ -char* b_vformat_escape_string (const char *str, b_VFormatType type); -char* b_vformat_unescape_string (const char *str); - -#ifdef __cplusplus -} -#endif - -#endif /* _VFORMAT_H */ diff -Nru barry-0.14/opensync-plugin-0.4x/AUTHORS barry-0.0.20110506/opensync-plugin-0.4x/AUTHORS --- barry-0.14/opensync-plugin-0.4x/AUTHORS 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/AUTHORS 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,9 @@ +Porting by Nicolas VIVIEN + based on the example plugin skeleton from opensync 0.4x + and on the Chris Frey's opensync plugin + +Written by Chris Frey + based on the example plugin skeleton from opensync + +See ../AUTHORS for project-wide list. + diff -Nru barry-0.14/opensync-plugin-0.4x/buildgen.sh barry-0.0.20110506/opensync-plugin-0.4x/buildgen.sh --- barry-0.14/opensync-plugin-0.4x/buildgen.sh 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/buildgen.sh 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,18 @@ +#!/bin/sh + +# +# Generates the build system. +# + +if [ "$1" = "clean" ] ; then + rm -rf autom4te.cache + rm -f Makefile.in aclocal.m4 config.guess config.h.in config.h.in~ \ + config.sub \ + configure depcomp install-sh ltmain.sh missing \ + src/Makefile.in INSTALL \ + config.h.in~ +else + autoreconf -if + #autoreconf -ifv +fi + diff -Nru barry-0.14/opensync-plugin-0.4x/ChangeLog barry-0.0.20110506/opensync-plugin-0.4x/ChangeLog --- barry-0.14/opensync-plugin-0.4x/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/ChangeLog 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ + - see ../ChangeLog for details on progress + diff -Nru barry-0.14/opensync-plugin-0.4x/configure.ac barry-0.0.20110506/opensync-plugin-0.4x/configure.ac --- barry-0.14/opensync-plugin-0.4x/configure.ac 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/configure.ac 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,54 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.61) +AC_INIT([Barry OpenSync Plugin 0.4x], [0.18.0], [barry-devel@lists.sourceforge.net]) +AC_CONFIG_SRCDIR(src/barry_sync.cc) +AC_CONFIG_HEADER(config.h) +AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE(foreign) + +pkg_modules="libopensync1 glib-2.0" +PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) +AC_SUBST(PACKAGE_CFLAGS) +AC_SUBST(PACKAGE_LIBS) + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_CXX +AC_DISABLE_STATIC +AC_PROG_LIBTOOL + +AX_C_CHECK_FLAG([-fvisibility=hidden], [], [], + [HAVE_C_GCCVISIBILITY=1], + [HAVE_C_GCCVISIBILITY=0]) +AX_CXX_CHECK_FLAG([-fvisibility=hidden], [], [], + [HAVE_CXX_GCCVISIBILITY=1], + [HAVE_CXX_GCCVISIBILITY=0]) +AM_CONDITIONAL([WITH_GCCVISIBILITY], [test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"]) + +AC_LANG([C++]) + +PKG_CHECK_MODULES([BARRY], [libbarry-0 libbarrysync-0]) + +# Carry the special tree build environment variables from parent configure, +# just in case user is doing a complete tree build with --enable-opensync-plugin +AC_SUBST(TREE_BUILD_CXXFLAGS) +AC_SUBST(TREE_BUILD_LDFLAGS) + +OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir libopensync1) +OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir libopensync1) +OPENSYNC_FORMATSDIR=$(pkg-config --variable=formatsdir libopensync1) +OPENSYNC_HEADERDIR=$(pkg-config --variable=headerdir libopensync1) + +AC_SUBST(OPENSYNC_CONFIGDIR) ## This is the place where you can install the default configuration files of your plugin +AC_SUBST(OPENSYNC_PLUGINDIR) ## This is the dir where you plugin will be installed +AC_SUBST(OPENSYNC_FORMATSDIR) ## Here are format plugins installed (if any) +AC_SUBST(OPENSYNC_HEADERDIR) ## Here are the headers that a user interface may need (if any) + +AC_OUTPUT([ +Makefile +src/Makefile +]) diff -Nru barry-0.14/opensync-plugin-0.4x/COPYING barry-0.0.20110506/opensync-plugin-0.4x/COPYING --- barry-0.14/opensync-plugin-0.4x/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/COPYING 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -Nru barry-0.14/opensync-plugin-0.4x/debian/changelog barry-0.0.20110506/opensync-plugin-0.4x/debian/changelog --- barry-0.14/opensync-plugin-0.4x/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/changelog 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,5 @@ +opensync-plugin-barry-4x (0.18-0) unstable; urgency=low + + * GIT Build for + + -- Martin Owens (DoctorMO) Wed, 15 Sep 2010 01:35:15 -0400 diff -Nru barry-0.14/opensync-plugin-0.4x/debian/compat barry-0.0.20110506/opensync-plugin-0.4x/debian/compat --- barry-0.14/opensync-plugin-0.4x/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/compat 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1 @@ +4 diff -Nru barry-0.14/opensync-plugin-0.4x/debian/control barry-0.0.20110506/opensync-plugin-0.4x/debian/control --- barry-0.14/opensync-plugin-0.4x/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/control 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,26 @@ +Source: opensync-plugin-barry-4x +Section: misc +Priority: optional +Maintainer: Chris Frey +Build-Depends: debhelper (>= 4.0.0), g++ (>= 4.1), cdbs, autoconf, automake, libtool, pkg-config, libusb-dev, zlib1g-dev, libopensync1-dev (>=0.39), libbarry-dev (>= 0.18) +Standards-Version: 3.8.0 + +Package: opensync-plugin-barry-4x +Section: libs +Architecture: any +Depends: libopensync1 (>= 0.39), libbarry0 (>= 0.18), libbarry0 (<< 0.19), ${shlibs:Depends} +Description: Opensync Blackberry plugin, based on the Barry project + Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. + . + This package contains an opensync plugin for use with libopensync 0.39 and above. + +Package: opensync-plugin-barry-4x-dbg +Section: libs +Priority: extra +Architecture: any +Depends: libopensync1 (>= 0.39), opensync-plugin-barry (= ${binary:Version}) +Description: Opensync Blackberry plugin, based on the Barry project + Barry is a GPL C++ library for interfacing with the RIM BlackBerry Handheld. + . + This package contains the debug version of the Barry opensync plugin. + diff -Nru barry-0.14/opensync-plugin-0.4x/debian/copyright barry-0.0.20110506/opensync-plugin-0.4x/debian/copyright --- barry-0.14/opensync-plugin-0.4x/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/copyright 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,58 @@ +This package was debianized by Chris Frey on +Fri, 29 Dec 2006 20:34:01 -0500. + +It was downloaded from http://sourceforge.net/projects/barry + +Upstream Authors: + Chris Frey + + +Copyright: + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Chris Frey + Copyright (C) 2008, Brian Edginton (edge@edginton.net) + Copyright (C) 1995-9 by Cryptography Research, Inc. + Copyright (C) 2003 Ximian, Inc. 2005 Armin Bauer + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2009, Josh Kropf + For scripts in contrib/ directory: + Copyright (C) 2008 Niels de Vos + Copyright (C) 2008, ashley willis + + +License: + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + + For opensync-plugin/src/vformat.[c,h]: + 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, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL'. diff -Nru barry-0.14/opensync-plugin-0.4x/debian/docs barry-0.0.20110506/opensync-plugin-0.4x/debian/docs --- barry-0.14/opensync-plugin-0.4x/debian/docs 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/docs 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru barry-0.14/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x-dbg.install barry-0.0.20110506/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x-dbg.install --- barry-0.14/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x-dbg.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x-dbg.install 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,2 @@ +opensync-plugin-barry-dbg/usr/lib/debug/* + diff -Nru barry-0.14/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x.install barry-0.0.20110506/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x.install --- barry-0.14/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x.install 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/opensync-plugin-barry-4x.install 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,3 @@ +debian/tmp/usr/lib/libopensync1/* +debian/tmp/usr/share/libopensync1/defaults/barry-sync + diff -Nru barry-0.14/opensync-plugin-0.4x/debian/rules barry-0.0.20110506/opensync-plugin-0.4x/debian/rules --- barry-0.14/opensync-plugin-0.4x/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/debian/rules 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,47 @@ +#!/usr/bin/make -f +# Based on the multi2 sample debian/rules file: +# --- +# Sample debian/rules that uses debhelper. +# This file is public domain software, originally written by Joey Hess. + +#export DH_VERBOSE=1 +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +#include /usr/share/cdbs/1/rules/simple-patchsys.mk + +# where sources are +DEB_SRCDIR = . +# in which directory to build +DEB_BUILDDIR = . +# in which directory to install the sofware(must be full path! CURDIR does this) +DEB_DESTDIR = $(CURDIR)/debian/tmp +#To register a debug library package libfoo-dbg for libfoo (which needs unstripped '.so') in compat mode 4: +DEB_DH_STRIP_ARGS := --dbg-package=opensync-plugin-barry-4x +#CDBS automatically handles common flags to pass to the configure script, +#but it is possible to give some extra parameters : +#DEB_CONFIGURE_EXTRA_FLAGS := +COMMON_CONFIGURE_FLAGS := --prefix=/usr +DEB_INSTALL_DOCS_ALL = + +post-patches:: + @rm -f $(CURDIR)/deb_srcdir + @ln -s $(DEB_SRCDIR) $(CURDIR)/deb_srcdir + @test -x $(DEB_SRCDIR)/configure && echo "allready autoreconf" || (cd $(DEB_SRCDIR) && autoreconf -i) + +makebuilddir:: + # This rule is meant for the parent debian/rules to be able to call + # us, and give us the location of a pre-built libbarry to + # insert into our DESTDIR, to avoid needing to install + # libbarry-dev to build this package. + # If TREE_BUILD_DIR is empty, nothing happens. + (if [ -n "$(TREE_BUILD_DIR)" ] ; then \ + cd $(TREE_BUILD_DIR) && \ + make DESTDIR=$(DEB_DESTDIR) install && \ + rm -f `find $(DEB_DESTDIR) -name "*.la"` && \ + cp $(TREE_BUILD_DIR)/debian/libbarry*/DEBIAN/shlibs \ + $(CURDIR)/debian/shlibs.local ; \ + fi) + +clean:: + -@rm -f $(CURDIR)/deb_srcdir + diff -Nru barry-0.14/opensync-plugin-0.4x/m4/ax_c_check_flag.m4 barry-0.0.20110506/opensync-plugin-0.4x/m4/ax_c_check_flag.m4 --- barry-0.14/opensync-plugin-0.4x/m4/ax_c_check_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/m4/ax_c_check_flag.m4 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,89 @@ +##### http://autoconf-archive.cryp.to/ax_c_check_flag.html +# +# SYNOPSIS +# +# AX_C_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) +# +# DESCRIPTION +# +# This macro tests if the C compiler supports the flag FLAG-TO-CHECK. +# If successfull execute ACTION-IF-SUCCESS otherwise +# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be +# used as in AC_LANG_PROGRAM macro. +# +# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to +# Bogdan Drozdowski for testing and bug fixes. +# +# LAST MODIFICATION +# +# 2007-11-26 +# +# COPYLEFT +# +# Copyright (c) 2007 Francesco Salvestrini +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_C_CHECK_FLAG],[ + AC_PREREQ([2.61]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PROG_SED]) + + flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'` + + AC_CACHE_CHECK([whether the C compiler accepts the $1 flag], + [ax_cv_c_check_flag_$flag],[ + + AC_LANG_PUSH([C]) + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([$2],[$3]) + ],[ + eval "ax_cv_c_check_flag_$flag=yes" + ],[ + eval "ax_cv_c_check_flag_$flag=no" + ]) + + CFLAGS="$save_CFLAGS" + + AC_LANG_POP + + ]) + + AS_IF([eval "test \"`echo '$ax_cv_c_check_flag_'$flag`\" = yes"],[ + : + $4 + ],[ + : + $5 + ]) +]) diff -Nru barry-0.14/opensync-plugin-0.4x/m4/ax_cxx_check_flag.m4 barry-0.0.20110506/opensync-plugin-0.4x/m4/ax_cxx_check_flag.m4 --- barry-0.14/opensync-plugin-0.4x/m4/ax_cxx_check_flag.m4 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/m4/ax_cxx_check_flag.m4 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,89 @@ +##### http://autoconf-archive.cryp.to/ax_cxx_check_flag.html +# +# SYNOPSIS +# +# AX_CXX_CHECK_FLAG(FLAG-TO-CHECK,[PROLOGUE],[BODY],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE]) +# +# DESCRIPTION +# +# This macro tests if the C++ compiler supports the flag +# FLAG-TO-CHECK. If successfull execute ACTION-IF-SUCCESS otherwise +# ACTION-IF-FAILURE. PROLOGUE and BODY are optional and should be +# used as in AC_LANG_PROGRAM macro. +# +# This code is inspired from KDE_CHECK_COMPILER_FLAG macro. Thanks to +# Bogdan Drozdowski for testing and bug fixes. +# +# LAST MODIFICATION +# +# 2007-11-26 +# +# COPYLEFT +# +# Copyright (c) 2007 Francesco Salvestrini +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([AX_CXX_CHECK_FLAG],[ + AC_PREREQ([2.61]) + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_SED]) + + flag=`echo "$1" | $SED 'y% .=/+-(){}<>:*,%_______________%'` + + AC_CACHE_CHECK([whether the C++ compiler accepts the $1 flag], + [ax_cv_cxx_check_flag_$flag],[ + + AC_LANG_PUSH([C++]) + + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $1" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([$2],[$3]) + ],[ + eval "ax_cv_cxx_check_flag_$flag=yes" + ],[ + eval "ax_cv_cxx_check_flag_$flag=no" + ]) + + CXXFLAGS="$save_CXXFLAGS" + + AC_LANG_POP + + ]) + + AS_IF([eval "test \"`echo '$ax_cv_cxx_check_flag_'$flag`\" = yes"],[ + : + $4 + ],[ + : + $5 + ]) +]) diff -Nru barry-0.14/opensync-plugin-0.4x/Makefile.am barry-0.0.20110506/opensync-plugin-0.4x/Makefile.am --- barry-0.14/opensync-plugin-0.4x/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,10 @@ +ACLOCAL_FLAGS = -I m4 + +SUBDIRS = src + +EXTRA_DIST = \ + buildgen.sh + +dist-hook: + rm -rf `find $(distdir) -name CVS` + diff -Nru barry-0.14/opensync-plugin-0.4x/README barry-0.0.20110506/opensync-plugin-0.4x/README --- barry-0.14/opensync-plugin-0.4x/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/README 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,133 @@ + +***************************************************************************** +* CAUTION: This is alpha software. Please make complete backups of your * +* Blackberry device before experimenting. While the author has * +* had good success with this software, that is no guarantee that * +* you will. Please make backups. * +***************************************************************************** + +Development note: this plugin is in flux, not only from pure development, + but also because the OpenSync libraries themselves are getting + close to releasing version 0.4x, which changes some internals + from 0.22. This plugin is currently based on 0.4x, but that may + change in the future. + +Introduction: +------------- +This directory contains a plugin for the OpenSync framework, which can +be used to synchronize between handhelds and desktop management software, +such as Evolution and Mozilla Sunbird. + +Please note that this plugin has the potential to not only change the +data in your Blackberry handheld, but also, through sending sync ADD, +MODIFY and DELETE changes, can change the data in your address book +and calendar in your desktop software of choice. As this plugin is +in development, please exercise caution, and make backups of your +Blackberry (see the ../gui directory) *and* backups of your desktop +software's data. + + +You can find more information on the OpenSync framework, as well +as tarballs for the version 0.4x library and plugins when they become +available, at the following website: + + http://www.opensync.org/ + + + +Library Dependencies: +--------------------- + +You will need the following packages installed on your system, including +any dev or devel packages that come along with them. + + pkg-config Used by the configure scripts + cmake 2.4.4 Used to build OpenSync + libopensync-0.4x OpenSync framework library + sqlite Required by OpenSync + glib2 Required by OpenSync + libxml2 Required by OpenSync + libbarry 0.x In the same tarball as this code. + libusb Required by libbarry + +In addition to libopensync, you will need a plugin for your desktop +software of choice, or for other handheld devices, such as the Palm. +Please see the OpenSync website for a list of available plugins. + +If you've installed Barry or OpenSync in a non-standard spot, use something +like the following: + + export PKG_CONFIG_PATH="/home/cdfrey/Barry/lib/pkgconfig:/home/cdfrey/software/lib/pkgconfig" + ./configure --prefix=/home/cdfrey/Barry + + + +Opensync 0.3x/0.4x build and test environment: +---------------------------------------------- + +The opensync 0.3x/0.4x build tree is still a moving target. To test this +plugin, with, for example, Evolution, you will need the following SVN repos: + + libopensync + http://svn.opensync.org/trunk + + vformat plugin + http://svn.opensync.org/format-plugins/vformat + + xmlformat plugin + http://svn.opensync.org/format-plugins/xmlformat/trunk + + file-sync plugin (needed for plain format) + http://svn.opensync.org/plugins/file-sync + + evolution plugin + http://svn.opensync.org/plugins/evolution2 + + osynctool (command line) + http://svn.opensync.org/osynctool/trunk + +Using cmake, compile them in the above listed order, using the following +set of commands: + + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=/home/cdfrey/rootdir .. + make + make install + +Build the Barry plugin: + + cd opensync-plugin-0.4x + export PKG_CONFIG_PATH=/home/cdfrey/rootdir/lib/pkgconfig + ./configure --prefix=/home/cdfrey/rootdir + make + make install + +Then setup your syncing target and sync: + + cd /home/cdfrey/rootdir/bin + evolution --force-shutdown + ./osynctool --delgroup EvoBarry + ./osynctool --addgroup EvoBarry + evolution --force-shutdown + ./osynctool --addmember EvoBarry evo2-sync + ./osynctool --addmember EvoBarry barry-sync + evolution --force-shutdown + ./osynctool --configure EvoBarry 1 + ./osynctool --configure EvoBarry 2 + evolution --force-shutdown + ./osynctool --discover EvoBarry + evolution --force-shutdown + ./osynctool --showgroup EvoBarry + evolution --force-shutdown + ./osynctool --sync EvoBarry + +As you can see, the evolution plugin is rather picky about running alone, +so be liberal with the force-shutdown commands. :-) + +Please report any bugs you find to the Barry mailing list. + +Thanks! + +January 2009 + diff -Nru barry-0.14/opensync-plugin-0.4x/src/barry-sync barry-0.0.20110506/opensync-plugin-0.4x/src/barry-sync --- barry-0.14/opensync-plugin-0.4x/src/barry-sync 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/barry-sync 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,64 @@ + + + + + PIN number + PinCode + string + 3009efe3 + + + Debug mode + Debug + bool + 1 + + + + + + + + + 1 + + + vcard30 + + + Contacts + contact + + + 1 + + + vevent20 + + + Event + event + + + 1 + + + vjournal + + + Memo + note + + + 1 + + + vtodo20 + + + Todo + todo + + + + diff -Nru barry-0.14/opensync-plugin-0.4x/src/barry_sync.cc barry-0.0.20110506/opensync-plugin-0.4x/src/barry_sync.cc --- barry-0.14/opensync-plugin-0.4x/src/barry_sync.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/barry_sync.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,1131 @@ +// +// \file barry_sync.cc +// Opensync module for the USB Blackberry handheld +// + +/* + Copyright (C) 2009, Nicolas VIVIEN (opensync plugin porting on opensync 0.4x ; Task & Memo support) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include "barry_sync.h" +#include "environment.h" +#include "vtodo.h" +#include "vjournal.h" +#include "vevent.h" +#include "vcard.h" +#include "trace.h" +#include +#include +#include +#include +#include + +typedef Barry::vSmartPtr AutoOSyncList; + +// All functions that are callable from outside must look like C +extern "C" { + BXEXPORT int get_version(void); + static void *initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error); + static osync_bool discover(OSyncPluginInfo *info, void *userdata, OSyncError **error); + + static void contact_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata); + static void contact_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + + static void event_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata); + static void event_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + + static void journal_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata); + static void journal_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + + static void todo_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata); + static void todo_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + + static void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); + static void commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata); + static void finalize(void *userdata); + BXEXPORT osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error); +} + + + +////////////////////////////////////////////////////////////////////////////// +// +// Support functions and classes +// + +// Generates a "hash" by grabbing the existing hash +// of the given uid, and adding 1 to it if dirty. +std::string GenerateHash(OSyncHashTable *hashtable, + const std::string &uid, + bool dirty) +{ + unsigned long hashcount = 0; + + const char *hash = osync_hashtable_get_hash(hashtable, uid.c_str()); + if( hash ) { + errno = 0; + hashcount = strtoul(hash, NULL, 10); + if( errno ) + throw std::runtime_error("Error converting string to unsigned long: " + std::string(hash)); + } + + hashcount += (dirty ? 1 : 0); + + std::ostringstream oss; + oss << std::dec << hashcount; + return oss.str(); +} + +void GetChanges(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, + BarryEnvironment *env, + DatabaseSyncState *pSync, + const char *DBDBName, + const char *ObjTypeName, const char *FormatName, + GetData_t getdata, + osync_bool slow_sync) +{ + Trace trace("GetChanges"); + + OSyncError *error = NULL; + + // shortcut references + using namespace Barry; + using Barry::RecordStateTable; + Mode::Desktop &desktop = *env->GetDesktop(); + + // find hash table + // + // Note: Since the Blackberry tracks dirty flags for us, we don't + // need the hash table to help determine what records have + // changed, and therefore we don't need to actually load + // all the record data across USB either. + // + // The hashtable only needs the hash to change when data + // has changed, so we set each change object's hash to: + // last_hash + (dirty ? 1 : 0) + // + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); + + // check if slow sync has been requested + if (slow_sync) { + trace.log("GetChanges: slow sync request detected"); + + if( !osync_hashtable_slowsync(hashtable, &error) ) { + std::ostringstream oss; + oss << "GetChanges: slow sync error: " << osync_error_print(&error); + osync_error_unref(&error); + + trace.log(oss.str().c_str()); + throw std::runtime_error(oss.str()); + } + } + + // fetch state table + unsigned int dbId = desktop.GetDBID(DBDBName); + RecordStateTable &table = pSync->m_Table; + desktop.GetRecordStateTable(dbId, table); + + OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); + + + // cycle through the state table... for each record in the state + // table, register a change and the fake hash (see note above) + // and let the hash table determine what changetype it is + RecordStateTable::StateMapType::const_iterator i = table.StateMap.begin(); + for( ; i != table.StateMap.end(); ++i ) { + + OSyncChange *change = 0; + const RecordStateTable::IndexType &index = i->first; + const RecordStateTable::State &state = i->second; + + // create change to pass to hashtable + change = osync_change_new(&error); + if( !change ) { + osync_context_report_osyncwarning(ctx, error); + osync_error_unref(&error); + continue; + } + + // convert record ID to uid string + std::string uid = pSync->Map2Uid(state.RecordId); + + // setup change, just enough for hashtable use + osync_change_set_uid(change, uid.c_str()); + trace.logf("change record ID: %s", uid.c_str()); + std::string hash = GenerateHash(hashtable, uid, state.Dirty); + osync_change_set_hash(change, hash.c_str()); + + + // let hashtable determine what's going to happen + OSyncChangeType changetype = osync_hashtable_get_changetype(hashtable, change); + osync_change_set_changetype(change, changetype); + + // let hashtable know we've processed this change + osync_hashtable_update_change(hashtable, change); + + + // Decision time: if nothing has changed, skip + if( changetype == OSYNC_CHANGE_TYPE_UNMODIFIED ) { + osync_change_unref(change); + continue; + } + + + // + // finish filling out the change object + // + + // Now you can set the data for the object + // Set the last argument to FALSE if the real data + // should be queried later in a "get_data" function + OSyncObjFormat *format = osync_format_env_find_objformat(formatenv, FormatName); + char *data = (*getdata)(env, dbId, index); + OSyncData *odata = osync_data_new(data, strlen(data), format, &error); + + if (!odata) { + osync_change_unref(change); + osync_context_report_osyncwarning(ctx, error); + osync_error_unref(&error); + continue; + } + +// FIXME ? Is this line is usefull ? +// osync_data_set_objtype(odata, osync_objtype_sink_get_name(sink)); + + osync_change_set_data(change, odata); + osync_data_unref(odata); + + // just report the change via + osync_context_report_change(ctx, change); + + osync_change_unref(change); + } + + // the hashtable can now give us a linked list of deleted + // entries, after the above processing + AutoOSyncList uids = osync_hashtable_get_deleted(hashtable); + for( OSyncList *u = uids.Get(); u; u = u->next) { + + const char *uid = (const char*) u->data; + uint32_t recordId = strtoul(uid, NULL, 10); + + // search the state table + i = table.StateMap.begin(); + for( ; i != table.StateMap.end(); ++i ) { + + if( i->second.RecordId == recordId ) { + throw std::runtime_error("Found deleted record ID in state map! " + std::string(uid)); + } + } + + // register a DELETE, no data + trace.log("found DELETE change"); + + OSyncChange *change = osync_change_new(&error); + if( !change ) { + osync_context_report_osyncwarning(ctx, error); + osync_error_unref(&error); + continue; + } + + osync_change_set_uid(change, uid); + trace.log(uid); + osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_DELETED); + +// osync_change_set_objformat_string(change, FormatName); + + OSyncObjFormat *format = osync_format_env_find_objformat(formatenv, FormatName); + OSyncData *odata = osync_data_new(NULL, 0, format, &error); + if( !odata ) { + osync_change_unref(change); + osync_context_report_osyncwarning(ctx, error); + osync_error_unref(&error); + continue; + } + + osync_data_set_objtype(odata, osync_objtype_sink_get_name(sink)); + + osync_change_set_data(change, odata); + osync_data_unref(odata); + + // report the change + osync_context_report_change(ctx, change); + + // tell hashtable we've processed this item + osync_hashtable_update_change(hashtable, change); + + osync_change_unref(change); + } +} + +CommitData_t GetCommitFunction(OSyncChange *change) +{ + Trace trace("GetCommitFunction()"); + + const char *name = osync_change_get_objtype(change); + + if( strcmp(name, "event") == 0 ) { + return &VEventConverter::CommitRecordData; + } + else if( strcmp(name, "contact") == 0 ) { + return &VCardConverter::CommitRecordData; + } + else if( strcmp(name, "note") == 0 ) { + return &VJournalConverter::CommitRecordData; + } + else if( strcmp(name, "todo") == 0 ) { + return &VTodoConverter::CommitRecordData; + } + else { + trace.log("unknown !"); + trace.log(name); + + return 0; + } +} + +bool FinishSync(OSyncContext *ctx, BarryEnvironment *env, DatabaseSyncState *pSync) +{ + Trace trace("FinishSync()"); + + if( !pSync->m_Sync ) { + // this mode is disabled in config, skip + return true; + } + + // we reconnect to the device here, since dirty flags + // for records we've just touched do not show up until + // a disconnect... as far as I can tell. + env->ReconnectForDirtyFlags(); + + // get the state table again, so we can update + // the cache properly + Barry::Mode::Desktop &desktop = *env->GetDesktop(); + desktop.GetRecordStateTable(pSync->m_dbId, pSync->m_Table); + + // clear all dirty flags in device + env->ClearDirtyFlags(pSync->m_Table, pSync->m_dbName); + return true; +} + + +static bool barry_contact_initialize(BarryEnvironment *env, OSyncPluginInfo *info, OSyncError **error) +{ + Trace trace("contact initialize"); + + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, "contact"); + if (!sink) + return false; + osync_bool sinkEnabled = osync_objtype_sink_is_enabled(sink); + if (!sinkEnabled) + return false; + + trace.log("contact enabled"); + + osync_objtype_sink_set_connect_func(sink, connect); + osync_objtype_sink_set_disconnect_func(sink, disconnect); + osync_objtype_sink_set_get_changes_func(sink, contact_get_changes); + osync_objtype_sink_set_commit_func(sink, commit_change); + osync_objtype_sink_set_sync_done_func(sink, contact_sync_done); + + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + OSyncPluginResource *resource = osync_plugin_config_find_active_resource(config, "contact"); + + AutoOSyncList objformatsinks = osync_plugin_resource_get_objformat_sinks(resource); + + bool hasObjFormat = false; + + OSyncList *r; + for(r = objformatsinks.Get();r;r = r->next) { + OSyncObjFormatSink *objformatsink = (OSyncObjFormatSink *) r->data; + + if(!strcmp("vcard30", osync_objformat_sink_get_objformat(objformatsink))) { + trace.log("vcard30 found in barry-sync"); + hasObjFormat = true; + break; + } + } + + if (!hasObjFormat) { + return false; + } + +// OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); + +// env->format = osync_format_env_find_objformat(formatenv, "vcard30"); + env->m_ContactsSync.sink = sink; + + osync_objtype_sink_set_userdata(sink, env); + + osync_objtype_sink_enable_hashtable(sink, TRUE); + + trace.log("contact initialize OK"); + + return true; +} + + +static bool barry_calendar_initialize(BarryEnvironment *env, OSyncPluginInfo *info, OSyncError **error) +{ + Trace trace("calendar initialize"); + + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, "event"); + if (!sink) + return false; + osync_bool sinkEnabled = osync_objtype_sink_is_enabled(sink); + if (!sinkEnabled) + return false; + + trace.log("calendar enabled"); + + osync_objtype_sink_set_connect_func(sink, connect); + osync_objtype_sink_set_disconnect_func(sink, disconnect); + osync_objtype_sink_set_get_changes_func(sink, event_get_changes); + osync_objtype_sink_set_commit_func(sink, commit_change); + osync_objtype_sink_set_sync_done_func(sink, event_sync_done); + + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + OSyncPluginResource *resource = osync_plugin_config_find_active_resource(config, "event"); + + AutoOSyncList objformatsinks = osync_plugin_resource_get_objformat_sinks(resource); + + bool hasObjFormat = false; + + OSyncList *r; + for(r = objformatsinks.Get();r;r = r->next) { + OSyncObjFormatSink *objformatsink = (OSyncObjFormatSink *) r->data; + + if(!strcmp("vevent20", osync_objformat_sink_get_objformat(objformatsink))) { + hasObjFormat = true; + break; + } + } + + if (!hasObjFormat) { + return false; + } + +// OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); + +// env->format = osync_format_env_find_objformat(formatenv, "vevent20"); + env->m_CalendarSync.sink = sink; + + osync_objtype_sink_set_userdata(sink, env); + + osync_objtype_sink_enable_hashtable(sink, TRUE); + + return true; +} + + +static bool barry_journal_initialize(BarryEnvironment *env, OSyncPluginInfo *info, OSyncError **error) +{ + Trace trace("journal initialize"); + + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, "note"); + if (!sink) + return false; + osync_bool sinkEnabled = osync_objtype_sink_is_enabled(sink); + if (!sinkEnabled) + return false; + + trace.log("journal enabled"); + + osync_objtype_sink_set_connect_func(sink, connect); + osync_objtype_sink_set_disconnect_func(sink, disconnect); + osync_objtype_sink_set_get_changes_func(sink, journal_get_changes); + osync_objtype_sink_set_commit_func(sink, commit_change); + osync_objtype_sink_set_sync_done_func(sink, journal_sync_done); + + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + OSyncPluginResource *resource = osync_plugin_config_find_active_resource(config, "note"); + + AutoOSyncList objformatsinks = osync_plugin_resource_get_objformat_sinks(resource); + + bool hasObjFormat = false; + + OSyncList *r; + for(r = objformatsinks.Get();r;r = r->next) { + OSyncObjFormatSink *objformatsink = (OSyncObjFormatSink *) r->data; + + if(!strcmp("vjournal", osync_objformat_sink_get_objformat(objformatsink))) { + hasObjFormat = true; + break; + } + } + + if (!hasObjFormat) { + return false; + } + +// OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); + +// env->format = osync_format_env_find_objformat(formatenv, "vjournal"); + env->m_JournalSync.sink = sink; + + osync_objtype_sink_set_userdata(sink, env); + + osync_objtype_sink_enable_hashtable(sink, TRUE); + + return true; +} + + +static bool barry_todo_initialize(BarryEnvironment *env, OSyncPluginInfo *info, OSyncError **error) +{ + Trace trace("todo initialize"); + + OSyncObjTypeSink *sink = osync_plugin_info_find_objtype(info, "todo"); + if (!sink) + return false; + osync_bool sinkEnabled = osync_objtype_sink_is_enabled(sink); + if (!sinkEnabled) + return false; + + trace.log("todo enabled"); + + osync_objtype_sink_set_connect_func(sink, connect); + osync_objtype_sink_set_disconnect_func(sink, disconnect); + osync_objtype_sink_set_get_changes_func(sink, todo_get_changes); + osync_objtype_sink_set_commit_func(sink, commit_change); + osync_objtype_sink_set_sync_done_func(sink, todo_sync_done); + + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + OSyncPluginResource *resource = osync_plugin_config_find_active_resource(config, "todo"); + + AutoOSyncList objformatsinks = osync_plugin_resource_get_objformat_sinks(resource); + + bool hasObjFormat = false; + + OSyncList *r; + for(r = objformatsinks.Get();r;r = r->next) { + OSyncObjFormatSink *objformatsink = (OSyncObjFormatSink *) r->data; + + if(!strcmp("vtodo20", osync_objformat_sink_get_objformat(objformatsink))) { + hasObjFormat = true; + break; + } + } + + if (!hasObjFormat) { + return false; + } + +// OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); + +// env->format = osync_format_env_find_objformat(formatenv, "vtodo20"); + env->m_TodoSync.sink = sink; + + osync_objtype_sink_set_userdata(sink, env); + + osync_objtype_sink_enable_hashtable(sink, TRUE); + + return true; +} + + + + +////////////////////////////////////////////////////////////////////////////// +// +// OpenSync API +// + +static void *initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) +{ + Trace trace("initialize"); + + BarryEnvironment *env = 0; + + try { + env = new BarryEnvironment(info); + + /* + * Read plugin config + */ + OSyncPluginConfig *config = osync_plugin_info_get_config(info); + + if (!config) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to get config."); + + delete env; + + return NULL; + } + + /* + * Process plugin specific advanced options + */ + AutoOSyncList optslist = osync_plugin_config_get_advancedoptions(config); + for (OSyncList *o = optslist.Get(); o; o = o->next) { + OSyncPluginAdvancedOption *option = (OSyncPluginAdvancedOption *) o->data; + + const char *val = osync_plugin_advancedoption_get_value(option); + const char *name = osync_plugin_advancedoption_get_name(option); + + if (!strcmp(name, "PinCode")) { + env->m_pin = strtol(val, NULL, 16); + } + else if (!strcmp(name, "Debug")) { + env->m_DebugMode = (!strcmp(val, "1")) ? true : false; + } + } + + OSyncPluginAuthentication *optauth = osync_plugin_config_get_authentication(config); + + if (osync_plugin_authentication_option_is_supported(optauth, OSYNC_PLUGIN_AUTHENTICATION_PASSWORD)) { + const char *val = osync_plugin_authentication_get_password(optauth); + + env->SetPassword(val); + } + + + // FIXME - near the end of release, do a run with + // this set to true, and look for USB protocol + // inefficiencies. + Barry::Init(env->m_DebugMode); + + + /* + * Process Ressource options + */ + trace.log("Process Ressource options..."); + + if (barry_calendar_initialize(env, info, error)) { + env->m_CalendarSync.m_Sync = true; + } + else { + trace.log("No sync Calendar"); + env->m_CalendarSync.m_Sync = false; + } + + if (barry_contact_initialize(env, info, error)) { + env->m_ContactsSync.m_Sync = true; + } + else { + trace.log("No sync Contact"); + env->m_ContactsSync.m_Sync = false; + } + + if (barry_journal_initialize(env, info, error)) { + env->m_JournalSync.m_Sync = true; + } + else { + trace.log("No sync Journal"); + env->m_JournalSync.m_Sync = false; + } + + if (barry_todo_initialize(env, info, error)) { + env->m_TodoSync.m_Sync = true; + } + else { + trace.log("No sync Todo"); + env->m_TodoSync.m_Sync = false; + } + + return (void *) env; + } + // Don't let exceptions escape to the C modules + catch( std::bad_alloc &ba ) { + trace.logf("Unable to allocate memory for controller: %s", ba.what()); + delete env; + return NULL; + } + catch( std::exception &e ) { + trace.logf("exception: %s", e.what()); + delete env; + return NULL; + } +} + + +static osync_bool discover(OSyncPluginInfo *info, void *userdata, OSyncError **error) +{ + Trace trace("discover"); + + AutoOSyncList sinks = osync_plugin_info_get_objtype_sinks(info); + for (OSyncList *s = sinks.Get(); s; s = s->next) { + OSyncObjTypeSink *sink = (OSyncObjTypeSink*) s->data; + + osync_objtype_sink_set_available(sink, true); + } + + OSyncVersion *version = osync_version_new(error); + osync_version_set_plugin(version, "Barry"); + osync_version_set_modelversion(version, "1"); + //osync_version_set_firmwareversion(version, "firmwareversion"); + //osync_version_set_softwareversion(version, "softwareversion"); + //osync_version_set_hardwareversion(version, "hardwareversion"); + osync_plugin_info_set_version(info, version); + osync_version_unref(version); + + return true; +} + + +static void connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + Trace trace("connect"); + + trace.logf("%s(%p, %p, %p, %p)\n", __func__, sink, info, ctx, userdata); + + try { + BarryEnvironment *env = (BarryEnvironment *) userdata; + + // I have to test if the device is already connected. + // Indeed, if I sync both contact and event, the connect + // function is called two times. + if (!env->isConnected()) { + // Probe for available devices + Barry::Probe probe; + int nIndex = probe.FindActive(env->m_pin); + if( nIndex == -1 ) { + osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, "Unable to find PIN %x", env->m_pin); + return; + } + + trace.log("connecting..."); + + env->Connect(probe.Get(nIndex)); + + trace.log("connected !"); + } + + // Success! + osync_context_report_success(ctx); + + trace.log("connect success"); + } + // Don't let exceptions escape to the C modules + catch( std::bad_alloc &ba ) { + osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, + "Unable to allocate memory for controller: %s", ba.what()); + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, + "%s", e.what()); + } +} + + +static void contact_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) +{ + Trace trace("contact_get_changeinfo"); + + try { + BarryEnvironment *env = (BarryEnvironment *) userdata; + + GetChanges(sink, info, ctx, env, &env->m_ContactsSync, + "Address Book", "contact", "vcard30", + &VCardConverter::GetRecordData, + slow_sync); + + // Success! + osync_context_report_success(ctx); + } + + // don't let exceptions escape to the C modules + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + +static void event_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) +{ + Trace trace("event_get_changeinfo"); + + try { + BarryEnvironment *env = (BarryEnvironment *) userdata; + + GetChanges(sink, info, ctx, env, &env->m_CalendarSync, + "Calendar", "event", "vevent20", + &VEventConverter::GetRecordData, + slow_sync); + + // Success! + osync_context_report_success(ctx); + } + // don't let exceptions escape to the C modules + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void journal_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) +{ + Trace trace("journal_get_changeinfo"); + + try { + BarryEnvironment *env = (BarryEnvironment *) userdata; + + GetChanges(sink, info, ctx, env, &env->m_JournalSync, + "Memos", "note", "vjournal", + &VJournalConverter::GetRecordData, + slow_sync); + + // Success! + osync_context_report_success(ctx); + } + // don't let exceptions escape to the C modules + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void todo_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *userdata) +{ + Trace trace("todo_get_changeinfo"); + + try { + BarryEnvironment *env = (BarryEnvironment *) userdata; + + GetChanges(sink, info, ctx, env, &env->m_TodoSync, + "Tasks", "todo", "vtodo20", + &VTodoConverter::GetRecordData, + slow_sync); + + // Success! + osync_context_report_success(ctx); + } + // don't let exceptions escape to the C modules + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata) +{ + Trace trace("commit_change"); + + // We can rely on a valid record state table, since get_changeinfo() + // will be called first, and will fill the table. + + try { + + BarryEnvironment *env = (BarryEnvironment *) userdata; + + OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink); + + // find the needed commit function, based on objtype of the change + CommitData_t CommitData = GetCommitFunction(change); + if( !CommitData ) { + osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, + "unable to get commit function pointer"); + return; + } + + // find the matching cache, state table, and id map for this change + DatabaseSyncState *pSync = env->GetSyncObject(change); + if( !pSync ) { + osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, + "unable to get sync object that matches change type"); + return; + } + + // is syncing turned on for this type? + if( !pSync->m_Sync ) { + osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, + "This object type is disabled in the barry-sync config"); + return; + } + + // make references instead of pointers + Barry::RecordStateTable &table = pSync->m_Table; + Barry::Mode::Desktop &desktop = *env->GetDesktop(); + unsigned int dbId = pSync->m_dbId; + + + // either generate or retrieve the record ID, based on type + Barry::RecordStateTable::IndexType StateIndex; + unsigned long RecordId = 0; + if( osync_change_get_changetype(change) == OSYNC_CHANGE_TYPE_ADDED ) { + // create new ID for this record + RecordId = table.MakeNewRecordId(); + + // tell opensync to save our ID + char *puid = g_strdup_printf("%lu", RecordId); + osync_change_set_uid(change, puid); + g_free(puid); + } + else { + // extract RecordId from change's UID, + const char *uid = osync_change_get_uid(change); + trace.logf("uid from change: %s", uid); + + // convert existing UID string to RecordId + if( strlen(uid) == 0 || + sscanf(uid, "%lu", &RecordId) != 1 || + RecordId == 0) + { + trace.logf("Unable to extract a valid record ID from: %s", uid); + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "Unable to extract a valid record ID from: %s", uid); + return; + } + + // search for the RecordId in the state table, to find the + // index... we only need the index if we are deleting or + // modifying + if( !table.GetIndex(RecordId, &StateIndex) ) { + osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, + "unable to get state table index for RecordId: %lu", + RecordId); + return; + } + } + + // if we get here, we are about to update the device, + // and dirty flags will change in such a way that a + // reconnect will be required later... so flag this state + env->RequireDirtyReconnect(); + + + std::string errmsg; + bool status; + + OSyncData *odata = NULL; + char *plain = NULL; + + switch( osync_change_get_changetype(change) ) + { + case OSYNC_CHANGE_TYPE_DELETED: + desktop.DeleteRecord(dbId, StateIndex); + break; + + case OSYNC_CHANGE_TYPE_ADDED: + odata = osync_change_get_data(change); + osync_data_get_data(odata, &plain, NULL); + status = (*CommitData)(env, dbId, StateIndex, RecordId, + plain, true, errmsg); + if( !status ) { + trace.logf("CommitData() for ADDED state returned false: %s", errmsg.c_str()); + osync_context_report_error(ctx, OSYNC_ERROR_PARAMETER, "%s", errmsg.c_str()); + return; + } + osync_change_set_hash(change, "0"); + break; + + case OSYNC_CHANGE_TYPE_MODIFIED: + odata = osync_change_get_data(change); + osync_data_get_data(odata, &plain, NULL); + status = (*CommitData)(env, dbId, StateIndex, RecordId, + plain, false, errmsg); + if( !status ) { + trace.logf("CommitData() for MODIFIED state returned false: %s", errmsg.c_str()); + osync_context_report_error(ctx, OSYNC_ERROR_PARAMETER, "%s", errmsg.c_str()); + return; + } + osync_change_set_hash(change, "0"); + break; + + default: + trace.log("Unknown change type"); + break; + } + + // Update hashtable + osync_hashtable_update_change(hashtable, change); + + // Answer the call + osync_context_report_success(ctx); + return; + + + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + return; + } +} + + +static void contact_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + // + // This function will only be called if the sync was successfull + // + + Trace trace("contact_sync_done"); + + try { + + BarryEnvironment *env = (BarryEnvironment *) userdata; + + // do cleanup for each database + if( FinishSync(ctx, env, &env->m_ContactsSync) ) + { + // Success + osync_context_report_success(ctx); + } + + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void event_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + // + // This function will only be called if the sync was successfull + // + + Trace trace("event_sync_done"); + + try { + + BarryEnvironment *env = (BarryEnvironment *) userdata; + + // do cleanup for each database + if( FinishSync(ctx, env, &env->m_CalendarSync) ) + { + // Success + osync_context_report_success(ctx); + } + + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void journal_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + // + // This function will only be called if the sync was successfull + // + + Trace trace("journal_sync_done"); + + try { + + BarryEnvironment *env = (BarryEnvironment *) userdata; + + // do cleanup for each database + if( FinishSync(ctx, env, &env->m_JournalSync) ) + { + // Success + osync_context_report_success(ctx); + } + + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void todo_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + // + // This function will only be called if the sync was successfull + // + + Trace trace("todo_sync_done"); + + try { + + BarryEnvironment *env = (BarryEnvironment *) userdata; + + // do cleanup for each database + if( FinishSync(ctx, env, &env->m_TodoSync) ) + { + // Success + osync_context_report_success(ctx); + } + + } + catch( std::exception &e ) { + osync_context_report_error(ctx, OSYNC_ERROR_IO_ERROR, "%s", e.what()); + } +} + + +static void disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata) +{ + Trace trace("contact_disconnect"); + + // Done! + osync_context_report_success(ctx); +} + + +static void finalize(void *data) +{ + Trace trace("finalize"); + + BarryEnvironment *env = (BarryEnvironment *) data; + + // Disconnect the controller, which closes our connection + if (env->isConnected()) + env->Disconnect(); + + delete env; +} + + +osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error) +{ + Trace trace("get_sync_info"); + + // Create a new OpenSync plugin + OSyncPlugin *plugin = osync_plugin_new(error); + if( !plugin ) { + trace.log(osync_error_print(error)); + return false; + } + + // Describe our plugin + osync_plugin_set_name(plugin, "barry-sync"); + osync_plugin_set_longname(plugin, "Barry OpenSync plugin v0.18.0 for the Blackberry handheld"); + osync_plugin_set_description(plugin, "Plugin to synchronize note, task, calendar and contact entries on USB Blackberry handhelds"); + + // Set the callback functions + osync_plugin_set_initialize(plugin, initialize); + osync_plugin_set_finalize(plugin, finalize); + osync_plugin_set_discover(plugin, discover); + osync_plugin_set_start_type(plugin, OSYNC_START_TYPE_PROCESS); + + if( !osync_plugin_env_register_plugin(env, plugin, error) ) { + trace.log(osync_error_print(error)); + return false; + } + + osync_plugin_unref(plugin); + + return true; +} + + +int get_version(void) +{ + return 1; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/barry_sync.h barry-0.0.20110506/opensync-plugin-0.4x/src/barry_sync.h --- barry-0.14/opensync-plugin-0.4x/src/barry_sync.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/barry_sync.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,37 @@ +// +// \file barry_sync.h +// Opensync module for the USB Blackberry handheld +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_H__ +#define __BARRY_SYNC_H__ + +#include +#include + +class BarryEnvironment; + +typedef char* (*GetData_t)(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType); +typedef bool (*CommitData_t)(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg); + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/environment.cc barry-0.0.20110506/opensync-plugin-0.4x/src/environment.cc --- barry-0.14/opensync-plugin-0.4x/src/environment.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/environment.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,229 @@ +// +// \file environment.cc +// Container / environment class for the sync module. +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include +#include +#include + +#include "environment.h" +#include "trace.h" +#include +#include +#include +#include +#include +#include +#include + +using namespace Barry; + +////////////////////////////////////////////////////////////////////////////// +// DatabaseSyncState + +DatabaseSyncState::DatabaseSyncState(OSyncPluginInfo *info, const char *description) + : m_dbId(0), + m_Sync(false), + m_Desc(description) +{ +} + +DatabaseSyncState::~DatabaseSyncState() +{ +} + +// +// Map2Uid +// +/// Converts record ID to string, since opensync 0.4x keeps the +/// same UID as we give it. +/// +std::string DatabaseSyncState::Map2Uid(uint32_t recordId) const +{ + std::ostringstream oss; + oss << std::dec << recordId; + return oss.str(); +} + + + +////////////////////////////////////////////////////////////////////////////// +// BarryEnvironment Public API + +BarryEnvironment::BarryEnvironment(OSyncPluginInfo *info): + info(info), + m_pin(-1), + m_DebugMode(false), + m_CalendarSync(info, "calendar"), + m_ContactsSync(info, "contacts"), + m_JournalSync(info, "note"), + m_TodoSync(info, "todo") +{ +} + +BarryEnvironment::~BarryEnvironment() +{ +} + +void BarryEnvironment::DoConnect() +{ + if( !m_con.get() ) + throw std::logic_error("Tried to use empty Connector"); + + m_con->Connect(); + + // Save the DBIDs and DBNames of the databases we will work with + if( m_CalendarSync.m_Sync ) { + m_CalendarSync.m_dbName = Barry::Calendar::GetDBName(); + m_CalendarSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Calendar::GetDBName()); + } + + if( m_ContactsSync.m_Sync ) { + m_ContactsSync.m_dbName = Barry::Contact::GetDBName(); + m_ContactsSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Contact::GetDBName()); + } + + if( m_JournalSync.m_Sync ) { + m_JournalSync.m_dbName = Barry::Memo::GetDBName(); + m_JournalSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Memo::GetDBName()); + } + + if( m_TodoSync.m_Sync ) { + m_TodoSync.m_dbName = Barry::Task::GetDBName(); + m_TodoSync.m_dbId = m_con->GetDesktop().GetDBID(Barry::Task::GetDBName()); + } +} + +void BarryEnvironment::SetPassword(const std::string &password) +{ + m_password = password; + if( m_con.get() ) + m_con->SetPassword(password.c_str()); +} + +void BarryEnvironment::Connect(const Barry::ProbeResult &result) +{ + m_con.reset(new DesktopConnector(m_password.c_str(), "UTF-8", result)); + DoConnect(); +} + +void BarryEnvironment::Reconnect() +{ + m_con->Reconnect(2); +} + +void BarryEnvironment::Disconnect() +{ + m_con->Disconnect(); +} + +bool BarryEnvironment::isConnected() +{ + return m_con.get() && m_con->IsConnected(); +} + +void BarryEnvironment::ReconnectForDirtyFlags() +{ + m_con->ReconnectForDirtyFlags(); +} + +void BarryEnvironment::RequireDirtyReconnect() +{ + m_con->RequireDirtyReconnect(); +} + +void BarryEnvironment::ClearDirtyFlags(Barry::RecordStateTable &table, + const std::string &dbname) +{ + Trace trace("ClearDirtyFlags"); + + unsigned int dbId = m_con->GetDesktop().GetDBID(dbname); + + Barry::RecordStateTable::StateMapType::const_iterator i = table.StateMap.begin(); + for( ; i != table.StateMap.end(); ++i ) { + if( i->second.Dirty ) { + trace.logf("Clearing dirty flag for db %u, index %u", + dbId, i->first); + m_con->GetDesktop().ClearDirty(dbId, i->first); + } + } +} + +void BarryEnvironment::ClearCalendarDirtyFlags() +{ + Trace trace("ClearCalendarDirtyFlags"); + ClearDirtyFlags(m_CalendarSync.m_Table, Barry::Calendar::GetDBName()); +} + +void BarryEnvironment::ClearContactsDirtyFlags() +{ + Trace trace("ClearContactsDirtyFlags"); + ClearDirtyFlags(m_ContactsSync.m_Table, Barry::Contact::GetDBName()); +} + +void BarryEnvironment::ClearJournalDirtyFlags() +{ + Trace trace("ClearJournalDirtyFlags"); + ClearDirtyFlags(m_JournalSync.m_Table, Barry::Memo::GetDBName()); +} + +void BarryEnvironment::ClearTodoDirtyFlags() +{ + Trace trace("ClearTodoDirtyFlags"); + ClearDirtyFlags(m_TodoSync.m_Table, Barry::Task::GetDBName()); +} + +DatabaseSyncState* BarryEnvironment::GetSyncObject(OSyncChange *change) +{ + Trace trace("BarryEnvironment::GetSyncObject()"); + + const char *name = osync_change_get_objtype(change); + + trace.logf("osync_change_get_objtype returns %s", name); + + if( strcmp(name, "event") == 0 ) { + trace.log("return calendar object"); + + return &m_CalendarSync; + } + else if( strcmp(name, "contact") == 0 ) { + trace.log("return contact object"); + + return &m_ContactsSync; + } + else if( strcmp(name, "note") == 0 ) { + trace.log("return journal object"); + + return &m_JournalSync; + } + else if( strcmp(name, "todo") == 0 ) { + trace.log("return todo object"); + + return &m_TodoSync; + } + + trace.log("return none"); + + return 0; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/environment.h barry-0.0.20110506/opensync-plugin-0.4x/src/environment.h --- barry-0.14/opensync-plugin-0.4x/src/environment.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/environment.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,103 @@ +// +// \file environment.h +// Container / environment class for the sync module. +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_ENVIRONMENT_H__ +#define __BARRY_SYNC_ENVIRONMENT_H__ + +#include +#include +#include +#include +#include + + +struct DatabaseSyncState +{ +public: + OSyncObjTypeSink *sink; + +public: + // device data + unsigned int m_dbId; + std::string m_dbName; + Barry::RecordStateTable m_Table; + + bool m_Sync; + +private: + std::string m_Desc; + +public: + DatabaseSyncState(OSyncPluginInfo *info, const char *description); + ~DatabaseSyncState(); + + std::string Map2Uid(uint32_t recordId) const; +}; + + +struct BarryEnvironment +{ +private: + std::string m_password; + +public: + OSyncMember *member; + OSyncPluginInfo *info; + + // user config data + std::string m_ConfigData; + uint32_t m_pin; + bool m_DebugMode; + + // device communication + std::auto_ptr m_con; + + // sync data + DatabaseSyncState m_CalendarSync, m_ContactsSync, m_JournalSync, m_TodoSync; + +protected: + void DoConnect(); + +public: + BarryEnvironment(OSyncPluginInfo *info); + ~BarryEnvironment(); + + Barry::Mode::Desktop* GetDesktop() { return &m_con->GetDesktop(); } + void SetPassword(const std::string &password); + + void Connect(const Barry::ProbeResult &result); + void Reconnect(); + void Disconnect(); + bool isConnected(); + void ReconnectForDirtyFlags(); + void RequireDirtyReconnect(); + + DatabaseSyncState* GetSyncObject(OSyncChange *change); + + void ClearDirtyFlags(Barry::RecordStateTable &table, const std::string &dbname); + void ClearCalendarDirtyFlags(); + void ClearContactsDirtyFlags(); + void ClearJournalDirtyFlags(); + void ClearTodoDirtyFlags(); +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/format_check.h barry-0.0.20110506/opensync-plugin-0.4x/src/format_check.h --- barry-0.14/opensync-plugin-0.4x/src/format_check.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/format_check.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,32 @@ +// +// \file format_check.h +// Simple macro to enable gcc printf-style format string checks +// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_FORMAT_CHECK_H__ +#define __BARRY_SYNC_FORMAT_CHECK_H__ + +#if __GNUC__ +#define BARRY_GCC_FORMAT_CHECK(a,b) __attribute__ ((format(printf, a, b))) +#else +#define BARRY_GCC_FORMAT_CHECK(a,b) +#endif + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/Makefile.am barry-0.0.20110506/opensync-plugin-0.4x/src/Makefile.am --- barry-0.14/opensync-plugin-0.4x/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/Makefile.am 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,48 @@ +barry_syncdir=@OPENSYNC_PLUGINDIR@ +configdir=@OPENSYNC_CONFIGDIR@ +#formatsdir=@OPENSYNC_FORMATSDIR@ +opensyncheaderdir=@OPENSYNC_HEADERDIR@ + +INCLUDES = @TREE_BUILD_CXXFLAGS@ @PACKAGE_CFLAGS@ @BARRY_CFLAGS@ +LIBS = @TREE_BUILD_LDFLAGS@ + +AM_CFLAGS = -Wall -Werror +AM_CXXFLAGS = -Wall -Werror +AM_LDFLAGS = +if WITH_GCCVISIBILITY +AM_CFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden +#AM_CXXFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -fvisibility-inlines-hidden +AM_CXXFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden +#AM_LDFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +AM_LDFLAGS += -fvisibility=hidden +endif + +EXTRA_DIST = barry_sync.h + +dist_config_DATA = barry-sync + +opensyncheader_HEADER = barry_sync.h + +barry_sync_LTLIBRARIES = barry_sync.la + +barry_sync_la_SOURCES = \ + barry_sync.cc barry_sync.h \ + environment.cc environment.h \ + vevent.cc vevent.h \ + vcard.cc vcard.h \ + vjournal.cc vjournal.h \ + vtodo.cc vtodo.h \ + format_check.h \ + trace.h \ + tosserror.h + +barry_sync_la_LDFLAGS = -avoid-version -export-dynamic -module +barry_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @BARRY_LIBS@ + +## if you plan to install format libraries: ## +#formats_LTLIBRARIES = format.la +# +#format_la_SOURCES = format.c +#format_la_LDFLAGS = -avoid-version -export-dynamic -module +#format_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ + diff -Nru barry-0.14/opensync-plugin-0.4x/src/tosserror.h barry-0.0.20110506/opensync-plugin-0.4x/src/tosserror.h --- barry-0.14/opensync-plugin-0.4x/src/tosserror.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/tosserror.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,103 @@ +/// +/// \file tosserror.h +/// RAII class for OSyncError structs that are wholly +/// belonging to the barry plugin. +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_TOSSERROR_H__ +#define __BARRY_SYNC_TOSSERROR_H__ + +#include "trace.h" +#include + +// +// TossError +// +/// This is a wrapper class for OSyncError *error pointers. +/// For some of the opensync API, these error pointers are passed +/// into functions, such as osync_time_*() functions, and filled +/// in the event that an error occurs. These kinds of *errors are +/// not passed into the framework, and so it is our responsibility +/// to free them. +/// +/// This class makes it easy to do that freeing. +/// +class TossError +{ + OSyncError *m_error; + + const char *m_func; + Trace *m_trace; + +public: + // simple wrapper... unref's the error on destruction + TossError() + : m_error(0) + , m_func(0) + , m_trace(0) + { + } + + // log wrapper... logs to given tracer and unref's on destruction + TossError(const char *funcname, Trace &trace) + : m_error(0) + , m_func(funcname) + , m_trace(&trace) + { + } + + ~TossError() + { + Clear(); + } + + /// Returns NULL if no error + const char* GetErrorMsg() + { + return osync_error_print(&m_error); + } + + bool IsSet() + { + return osync_error_is_set(&m_error); + } + + void Log() + { + if( m_error && m_trace ) + m_trace->logf("%s: %s", m_func, GetErrorMsg()); + } + + void Clear() + { + if( m_error ) { + Log(); + osync_error_unref(&m_error); + m_error = 0; + } + } + + operator OSyncError**() + { + return &m_error; + } +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/trace.h barry-0.0.20110506/opensync-plugin-0.4x/src/trace.h --- barry-0.14/opensync-plugin-0.4x/src/trace.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/trace.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,72 @@ +// +// \file trace.h +// RAII class for trace logging. +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_TRACE_H__ +#define __BARRY_SYNC_TRACE_H__ + +#include +#include +#include +#include "format_check.h" + +class Trace +{ + const char *text, *tag; +public: + explicit Trace(const char *t) : text(t), tag(0) + { + osync_trace(TRACE_ENTRY, "barry_sync: %s", text); + } + + Trace(const char *t, const char *tag) : text(t), tag(tag) + { + osync_trace(TRACE_ENTRY, "barry_sync (%s): %s", tag, text); + } + + ~Trace() + { + if( tag ) + osync_trace(TRACE_EXIT, "barry_sync (%s): %s", tag, text); + else + osync_trace(TRACE_EXIT, "barry_sync: %s", text); + } + + void log(const char *t) + { + osync_trace(TRACE_INTERNAL, "barry_sync: %s", t); + } + + void logf(const char *t, ...) BARRY_GCC_FORMAT_CHECK(2, 3) + { + va_list vl; + va_start(vl, t); + char buffer[2048]; + int n = vsnprintf(buffer, sizeof(buffer), t, vl); + va_end(vl); + if( n > -1 && n < (int)sizeof(buffer) ) + osync_trace(TRACE_INTERNAL, "barry_sync: %s", buffer); + else + osync_trace(TRACE_INTERNAL, "barry_sync: (trace error, output too long for buffer: %s)", t); + } +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vcard.cc barry-0.0.20110506/opensync-plugin-0.4x/src/vcard.cc --- barry-0.14/opensync-plugin-0.4x/src/vcard.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vcard.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,178 @@ +/// +/// \file vcard.cc +/// Conversion routines for vcards +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vcard.h" +#include "environment.h" +#include "trace.h" +#include +#include +#include +#include +#include + +using namespace Barry::Sync; + +////////////////////////////////////////////////////////////////////////////// +// + +VCardConverter::VCardConverter() + : m_Data(0) +{ +} + +VCardConverter::VCardConverter(uint32_t newRecordId) + : m_Data(0), + m_RecordId(newRecordId) +{ +} + +VCardConverter::~VCardConverter() +{ + if( m_Data ) + g_free(m_Data); +} + +// Transfers ownership of m_Data to the caller +char* VCardConverter::ExtractData() +{ + Trace trace("VCardConverter::ExtractData"); + char *ret = m_Data; + m_Data = 0; + return ret; +} + +bool VCardConverter::ParseData(const char *data) +{ + Trace trace("VCardConverter::ParseData"); + + try { + + vCard vcard; + m_Contact = vcard.ToBarry(data, m_RecordId); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vcard:Barry::ConvertError exception: %s", ce.what()); + return false; + } + + return true; +} + +// Barry storage operator +void VCardConverter::operator()(const Barry::Contact &rec) +{ + Trace trace("VCardConverter::operator()"); + + // Delete data if some already exists + if( m_Data ) { + g_free(m_Data); + m_Data = 0; + } + + try { + + vCard vcard; + vcard.ToVCard(rec); + m_Data = vcard.ExtractVCard(); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vcard:Barry::ConvertError exception: %s", ce.what()); + } +} + +// Barry builder operator +bool VCardConverter::operator()(Barry::Contact &rec, Barry::Builder &) +{ + Trace trace("VCardConverter::builder operator()"); + + rec = m_Contact; + return true; +} + +// Handles calling of the Barry::Controller to fetch a specific +// record, indicated by index (into the RecordStateTable). +// Returns a g_malloc'd string of data containing the vcard30 +// data. It is the responsibility of the caller to free it. +// This is intended to be passed into the GetChanges() function. +char* VCardConverter::GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index) +{ + Trace trace("VCardConverter::GetRecordData()"); + + using namespace Barry; + + VCardConverter contact2vcard; + RecordParser parser(contact2vcard); + env->GetDesktop()->GetRecord(dbId, index, parser); + return contact2vcard.ExtractData(); +} + +bool VCardConverter::CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg) +{ + Trace trace("VCardConverter::CommitRecordData()"); + + uint32_t newRecordId; + if( add ) { + // use given id if possible + if( recordId && !env->m_ContactsSync.m_Table.GetIndex(recordId) ) { + // recordId is unique and non-zero + newRecordId = recordId; + } + else { + trace.log("Can't use recommended recordId, generating new one."); + newRecordId = env->m_ContactsSync.m_Table.MakeNewRecordId(); + } + } + else { + newRecordId = env->m_ContactsSync.m_Table.StateMap[StateIndex].RecordId; + } + trace.logf("newRecordId: %u", newRecordId); + + VCardConverter convert(newRecordId); + if( !convert.ParseData(data) ) { + std::ostringstream oss; + oss << "unable to parse change data for new RecordId: " + << newRecordId << " data: " << data; + errmsg = oss.str(); + trace.log(errmsg.c_str()); + return false; + } + + Barry::RecordBuilder builder(convert); + + if( add ) { + trace.log("adding record"); + env->GetDesktop()->AddRecord(dbId, builder); + } + else { + trace.log("setting record"); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); + trace.log("clearing dirty flag"); + env->GetDesktop()->ClearDirty(dbId, StateIndex); + } + + return true; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vcard.h barry-0.0.20110506/opensync-plugin-0.4x/src/vcard.h --- barry-0.14/opensync-plugin-0.4x/src/vcard.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vcard.h 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,73 @@ +/// +/// \file vcard.h +/// Conversion routines for vcards +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYSYNC_VCARD_H__ +#define __BARRYSYNC_VCARD_H__ + +#include +#include +#include +#include + +// forward declarations +class BarryEnvironment; + +class VCardConverter +{ + char *m_Data; + Barry::Contact m_Contact; + uint32_t m_RecordId; + +public: + VCardConverter(); + explicit VCardConverter(uint32_t newRecordId); + ~VCardConverter(); + + // Transfers ownership of m_Data to the caller + char* ExtractData(); + + // Parses vevent data + bool ParseData(const char *data); + + // Barry storage operator + void operator()(const Barry::Contact &rec); + + // Barry builder operator + bool operator()(Barry::Contact &rec, Barry::Builder &); + + // Handles calling of the Barry::Controller to fetch a specific + // record, indicated by index (into the RecordStateTable). + // Returns a g_malloc'd string of data containing the vevent20 + // data. It is the responsibility of the caller to free it. + // This is intended to be passed into the GetChanges() function. + static char* GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index); + + // Handles either adding or overwriting a calendar record, + // given vevent20 data in data, and the proper environmebnt, + // dbId, StateIndex. Set add to true if adding. + static bool CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg); +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vevent.cc barry-0.0.20110506/opensync-plugin-0.4x/src/vevent.cc --- barry-0.14/opensync-plugin-0.4x/src/vevent.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vevent.cc 2011-05-06 12:20:16.000000000 +0000 @@ -0,0 +1,210 @@ +// +// \file vevent.cc +// Conversion routines for vevents (VCALENDAR, etc) +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include + +#include "vevent.h" +#include "environment.h" +#include "trace.h" +#include "tosserror.h" +#include +#include +#include +#include +#include + +using namespace Barry::Sync; + +////////////////////////////////////////////////////////////////////////////// +// + +VEventConverter::VEventConverter() + : m_Data(0) +{ +} + +VEventConverter::VEventConverter(uint32_t newRecordId) + : m_Data(0), + m_RecordId(newRecordId) +{ +} + +VEventConverter::~VEventConverter() +{ + if( m_Data ) + g_free(m_Data); +} + +// Transfers ownership of m_Data to the caller +char* VEventConverter::ExtractData() +{ + Trace trace("VEventConverter::ExtractData"); + char *ret = m_Data; + m_Data = 0; + return ret; +} + +bool VEventConverter::ParseData(const char *data) +{ + Trace trace("VEventConverter::ParseData"); + + try { + + vTimeConverter vtc; + vCalendar vcal(vtc); + m_Cal = vcal.ToBarry(data, m_RecordId); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vevent:Barry::ConvertError exception: %s", ce.what()); + return false; + } + + return true; +} + +bool VEventConverter::MergeData(const Barry::Calendar &origin) +{ + // Save CalendarID value + // CalendarID field is used to link an entry event to an account mail + if (origin.CalendarID != m_Cal.CalendarID) + m_Cal.CalendarID = origin.CalendarID; + + return true; +} + +// Barry storage operator +void VEventConverter::operator()(const Barry::Calendar &rec) +{ + Trace trace("VEventConverter::operator()"); + + // Delete data if some already exists + if( m_Data ) { + g_free(m_Data); + m_Data = 0; + } + + // Keep a trace of Calendar object (need to merge with the new event) + m_Cal = rec; + + try { + vTimeConverter vtc; + vCalendar vcal(vtc); + vcal.ToVCal(rec); + m_Data = vcal.ExtractVCal(); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vevent:Barry::ConvertError exception: %s", ce.what()); + } +} + +// Barry builder operator +bool VEventConverter::operator()(Barry::Calendar &rec, Barry::Builder &) +{ + Trace trace("VEventConverter::builder operator()"); + + rec = m_Cal; + return true; +} + +// Handles calling of the Barry::Controller to fetch a specific +// record, indicated by index (into the RecordStateTable). +// Returns a g_malloc'd string of data containing the vevent20 +// data. It is the responsibility of the caller to free it. +// This is intended to be passed into the GetChanges() function. +char* VEventConverter::GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index) +{ + Trace trace("VEventConverter::GetRecordData()"); + + using namespace Barry; + + VEventConverter cal2event; + RecordParser parser(cal2event); + env->GetDesktop()->GetRecord(dbId, index, parser); + return cal2event.ExtractData(); +} + +bool VEventConverter::CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg) +{ + Trace trace("VEventConverter::CommitRecordData()"); + + uint32_t newRecordId; + if( add ) { + // use given id if possible + if( recordId && !env->m_CalendarSync.m_Table.GetIndex(recordId) ) { + // recordId is unique and non-zero + newRecordId = recordId; + } + else { + trace.log("Can't use recommended recordId, generating new one."); + newRecordId = env->m_CalendarSync.m_Table.MakeNewRecordId(); + } + } + else { + newRecordId = env->m_CalendarSync.m_Table.StateMap[StateIndex].RecordId; + } + trace.logf("newRecordId: %u", newRecordId); + + VEventConverter convert(newRecordId); + if( !convert.ParseData(data) ) { + std::ostringstream oss; + oss << "unable to parse change data for new RecordId: " + << newRecordId << " data: " << data; + errmsg = oss.str(); + trace.log(errmsg.c_str()); + return false; + } + + // If we modify a data, we read at first its current value + // then we merge with the parsed value from the other opensync member + // Merge function is important because, we have to save some BlackBerry fields. + // Fix an issue with the new OS release who supports several calendar. + if( !add ) { + using namespace Barry; + + VEventConverter cal2event; + RecordParser parser(cal2event); + env->GetDesktop()->GetRecord(dbId, StateIndex, parser); + + convert.MergeData(cal2event.GetCalendar()); + } + + Barry::RecordBuilder builder(convert); + + if( add ) { + trace.log("adding record"); + env->GetDesktop()->AddRecord(dbId, builder); + } + else { + trace.log("setting record"); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); + trace.log("clearing dirty flag"); + env->GetDesktop()->ClearDirty(dbId, StateIndex); + } + + return true; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vevent.h barry-0.0.20110506/opensync-plugin-0.4x/src/vevent.h --- barry-0.14/opensync-plugin-0.4x/src/vevent.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vevent.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,78 @@ +// +// \file vevent.h +// Conversion routines for vevents (VCALENDAR, etc) +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYSYNC_VEVENT_H__ +#define __BARRYSYNC_VEVENT_H__ + +#include +#include +#include +#include + +// forward declarations +class BarryEnvironment; + +class VEventConverter +{ + char *m_Data; + Barry::Calendar m_Cal; + uint32_t m_RecordId; + +public: + VEventConverter(); + explicit VEventConverter(uint32_t newRecordId); + ~VEventConverter(); + + // Transfers ownership of m_Data to the caller + char* ExtractData(); + + const Barry::Calendar& GetCalendar() const { return m_Cal; }; + + // Parses vevent data + bool ParseData(const char *data); + + // Merge vevent data + bool MergeData(const Barry::Calendar &origin); + + // Barry storage operator + void operator()(const Barry::Calendar &rec); + + // Barry builder operator + bool operator()(Barry::Calendar &rec, Barry::Builder &); + + // Handles calling of the Barry::Controller to fetch a specific + // record, indicated by index (into the RecordStateTable). + // Returns a g_malloc'd string of data containing the vevent20 + // data. It is the responsibility of the caller to free it. + // This is intended to be passed into the GetChanges() function. + static char* GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index); + + // Handles either adding or overwriting a calendar record, + // given vevent20 data in data, and the proper environmebnt, + // dbId, StateIndex. Set add to true if adding. + static bool CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg); +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vjournal.cc barry-0.0.20110506/opensync-plugin-0.4x/src/vjournal.cc --- barry-0.14/opensync-plugin-0.4x/src/vjournal.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vjournal.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,181 @@ +// +// \file vjournal.cc +// Conversion routines for vjournals (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include + +#include "vjournal.h" +#include "environment.h" +#include "trace.h" +#include +#include +#include +#include + +using namespace Barry::Sync; + +////////////////////////////////////////////////////////////////////////////// +// + +VJournalConverter::VJournalConverter() + : m_Data(0) +{ +} + +VJournalConverter::VJournalConverter(uint32_t newRecordId) + : m_Data(0), + m_RecordId(newRecordId) +{ +} + +VJournalConverter::~VJournalConverter() +{ + if( m_Data ) + g_free(m_Data); +} + +// Transfers ownership of m_Data to the caller +char* VJournalConverter::ExtractData() +{ + Trace trace("VMemoConverter::ExtractData"); + char *ret = m_Data; + m_Data = 0; + return ret; +} + +bool VJournalConverter::ParseData(const char *data) +{ + Trace trace("VJournalConverter::ParseData"); + + try { + + vJournal vjournal; + m_Memo = vjournal.ToBarry(data, m_RecordId); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vjournal:Barry::ConvertError exception: %s", ce.what()); + return false; + } + + return true; +} + +// Barry storage operator +void VJournalConverter::operator()(const Barry::Memo &rec) +{ + Trace trace("VJournalConverter::operator()"); + + // Delete data if some already exists + if( m_Data ) { + g_free(m_Data); + m_Data = 0; + } + + try { + + vJournal vjournal; + vjournal.ToMemo(rec); + m_Data = vjournal.ExtractVJournal(); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vjournal:Barry::ConvertError exception: %s", ce.what()); + } +} + +// Barry builder operator +bool VJournalConverter::operator()(Barry::Memo &rec, Barry::Builder &) +{ + Trace trace("VMemoConverter::builder operator()"); + + rec = m_Memo; + return true; +} + +// Handles calling of the Barry::Controller to fetch a specific +// record, indicated by index (into the RecordStateTable). +// Returns a g_malloc'd string of data containing the vevent20 +// data. It is the responsibility of the caller to free it. +// This is intended to be passed into the GetChanges() function. +char* VJournalConverter::GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index) +{ + Trace trace("VMemoConverter::GetRecordData()"); + + using namespace Barry; + + VJournalConverter memo2journal; + RecordParser parser(memo2journal); + env->GetDesktop()->GetRecord(dbId, index, parser); + return memo2journal.ExtractData(); +} + +bool VJournalConverter::CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg) +{ + Trace trace("VJournalConverter::CommitRecordData()"); + + uint32_t newRecordId; + if( add ) { + // use given id if possible + if( recordId && !env->m_JournalSync.m_Table.GetIndex(recordId) ) { + // recordId is unique and non-zero + newRecordId = recordId; + } + else { + trace.log("Can't use recommended recordId, generating new one."); + newRecordId = env->m_JournalSync.m_Table.MakeNewRecordId(); + } + } + else { + newRecordId = env->m_JournalSync.m_Table.StateMap[StateIndex].RecordId; + } + trace.logf("newRecordId: %u", newRecordId); + + VJournalConverter convert(newRecordId); + if( !convert.ParseData(data) ) { + std::ostringstream oss; + oss << "unable to parse change data for new RecordId: " + << newRecordId << " data: " << data; + errmsg = oss.str(); + trace.log(errmsg.c_str()); + return false; + } + + Barry::RecordBuilder builder(convert); + + if( add ) { + trace.log("adding record"); + env->GetDesktop()->AddRecord(dbId, builder); + } + else { + trace.log("setting record"); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); + trace.log("clearing dirty flag"); + env->GetDesktop()->ClearDirty(dbId, StateIndex); + } + + return true; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vjournal.h barry-0.0.20110506/opensync-plugin-0.4x/src/vjournal.h --- barry-0.14/opensync-plugin-0.4x/src/vjournal.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vjournal.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,75 @@ +// +// \file vjournal.h +// Conversion routines for vjournals (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYSYNC_VJOURNAL_H__ +#define __BARRYSYNC_VJOURNAL_H__ + +#include +#include +#include +#include + + +// forward declarations +class BarryEnvironment; + +class VJournalConverter +{ + char *m_Data; + Barry::Memo m_Memo; + uint32_t m_RecordId; + +public: + VJournalConverter(); + explicit VJournalConverter(uint32_t newRecordId); + ~VJournalConverter(); + + // Transfers ownership of m_Data to the caller + char* ExtractData(); + + // Parses vjournal data + bool ParseData(const char *data); + + // Barry storage operator + void operator()(const Barry::Memo &rec); + + // Barry builder operator + bool operator()(Barry::Memo &rec, Barry::Builder &); + + // Handles calling of the Barry::Controller to fetch a specific + // record, indicated by index (into the RecordStateTable). + // Returns a g_malloc'd string of data containing the vevent20 + // data. It is the responsibility of the caller to free it. + // This is intended to be passed into the GetChanges() function. + static char* GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index); + + // Handles either adding or overwriting a calendar record, + // given vevent20 data in data, and the proper environmebnt, + // dbId, StateIndex. Set add to true if adding. + static bool CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg); +}; + +#endif + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vtodo.cc barry-0.0.20110506/opensync-plugin-0.4x/src/vtodo.cc --- barry-0.14/opensync-plugin-0.4x/src/vtodo.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vtodo.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,184 @@ +// +// \file vtodo.cc +// Conversion routines for vtodos (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include + +#include "vtodo.h" +#include "environment.h" +#include "trace.h" +#include "tosserror.h" +#include +#include +#include +#include + +using namespace Barry::Sync; + +////////////////////////////////////////////////////////////////////////////// +// + +VTodoConverter::VTodoConverter() + : m_Data(0) +{ +} + +VTodoConverter::VTodoConverter(uint32_t newRecordId) + : m_Data(0), + m_RecordId(newRecordId) +{ +} + +VTodoConverter::~VTodoConverter() +{ + if( m_Data ) + g_free(m_Data); +} + +// Transfers ownership of m_Data to the caller +char* VTodoConverter::ExtractData() +{ + Trace trace("VTodoConverter::ExtractData"); + char *ret = m_Data; + m_Data = 0; + return ret; +} + +bool VTodoConverter::ParseData(const char *data) +{ + Trace trace("VTodoConverter::ParseData"); + + try { + + vTimeConverter vtc; + vTodo vtodo(vtc); + m_Task = vtodo.ToBarry(data, m_RecordId); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vtodo:Barry::ConvertError exception: %s", ce.what()); + return false; + } + + return true; +} + +// Barry storage operator +void VTodoConverter::operator()(const Barry::Task &rec) +{ + Trace trace("VTodoConverter::operator()"); + + // Delete data if some already exists + if( m_Data ) { + g_free(m_Data); + m_Data = 0; + } + + try { + + vTimeConverter vtc; + vTodo vtodo(vtc); + vtodo.ToTask(rec); + m_Data = vtodo.ExtractVTodo(); + + } + catch( Barry::ConvertError &ce ) { + trace.logf("ERROR: vtodo:Barry::ConvertError exception: %s", ce.what()); + } +} + +// Barry builder operator +bool VTodoConverter::operator()(Barry::Task &rec, Barry::Builder &) +{ + Trace trace("VTodoConverter::builder operator()"); + + rec = m_Task; + return true; +} + +// Handles calling of the Barry::Controller to fetch a specific +// record, indicated by index (into the RecordStateTable). +// Returns a g_malloc'd string of data containing the vevent20 +// data. It is the responsibility of the caller to free it. +// This is intended to be passed into the GetChanges() function. +char* VTodoConverter::GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index) +{ + Trace trace("VTodoConverter::GetRecordData()"); + + using namespace Barry; + + VTodoConverter task2todo; + RecordParser parser(task2todo); + env->GetDesktop()->GetRecord(dbId, index, parser); + return task2todo.ExtractData(); +} + +bool VTodoConverter::CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg) +{ + Trace trace("VTodoConverter::CommitRecordData()"); + + uint32_t newRecordId; + if( add ) { + // use given id if possible + if( recordId && !env->m_TodoSync.m_Table.GetIndex(recordId) ) { + // recordId is unique and non-zero + newRecordId = recordId; + } + else { + trace.log("Can't use recommended recordId, generating new one."); + newRecordId = env->m_TodoSync.m_Table.MakeNewRecordId(); + } + } + else { + newRecordId = env->m_TodoSync.m_Table.StateMap[StateIndex].RecordId; + } + trace.logf("newRecordId: %u", newRecordId); + + VTodoConverter convert(newRecordId); + if( !convert.ParseData(data) ) { + std::ostringstream oss; + oss << "unable to parse change data for new RecordId: " + << newRecordId << " data: " << data; + errmsg = oss.str(); + trace.log(errmsg.c_str()); + return false; + } + + Barry::RecordBuilder builder(convert); + + if( add ) { + trace.log("adding record"); + env->GetDesktop()->AddRecord(dbId, builder); + } + else { + trace.log("setting record"); + env->GetDesktop()->SetRecord(dbId, StateIndex, builder); + trace.log("clearing dirty flag"); + env->GetDesktop()->ClearDirty(dbId, StateIndex); + } + + return true; +} + diff -Nru barry-0.14/opensync-plugin-0.4x/src/vtodo.h barry-0.0.20110506/opensync-plugin-0.4x/src/vtodo.h --- barry-0.14/opensync-plugin-0.4x/src/vtodo.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/opensync-plugin-0.4x/src/vtodo.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,74 @@ +// +// \file vtodo.h +// Conversion routines for vtodos (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYSYNC_VTODO_H__ +#define __BARRYSYNC_VTODO_H__ + +#include +#include +#include +#include + +// forward declarations +class BarryEnvironment; + +class VTodoConverter +{ + char *m_Data; + Barry::Task m_Task; + uint32_t m_RecordId; + +public: + VTodoConverter(); + explicit VTodoConverter(uint32_t newRecordId); + ~VTodoConverter(); + + // Transfers ownership of m_Data to the caller + char* ExtractData(); + + // Parses vjournal data + bool ParseData(const char *data); + + // Barry storage operator + void operator()(const Barry::Task &rec); + + // Barry builder operator + bool operator()(Barry::Task &rec, Barry::Builder &); + + // Handles calling of the Barry::Controller to fetch a specific + // record, indicated by index (into the RecordStateTable). + // Returns a g_malloc'd string of data containing the vevent20 + // data. It is the responsibility of the caller to free it. + // This is intended to be passed into the GetChanges() function. + static char* GetRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType index); + + // Handles either adding or overwriting a calendar record, + // given vtodo20 data in data, and the proper environmebnt, + // dbId, StateIndex. Set add to true if adding. + static bool CommitRecordData(BarryEnvironment *env, unsigned int dbId, + Barry::RecordStateTable::IndexType StateIndex, uint32_t recordId, + const char *data, bool add, std::string &errmsg); +}; + +#endif + diff -Nru barry-0.14/po/barry.pot barry-0.0.20110506/po/barry.pot --- barry-0.14/po/barry.pot 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/barry.pot 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,42 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Net Direct, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: barry 0.18.0\n" +"Report-Msgid-Bugs-To: http://netdirect.ca/barry\n" +"POT-Creation-Date: 2011-01-27 14:01-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: tools/breset.cc:67 +#, c-format +msgid "Scanning for Blackberry devices...\n" +msgstr "" + +#: tools/breset.cc:81 +#, c-format +msgid "Found..." +msgstr "" + +#: tools/breset.cc:82 +#, c-format +msgid "attempting to reset.\n" +msgstr "" + +#: tools/breset.cc:86 +#, c-format +msgid "Can't reset device on bus %s, devnum %u\n" +msgstr "" + +#: tools/breset.cc:91 +#, c-format +msgid "%d device%s reset.\n" +msgstr "" diff -Nru barry-0.14/po/boldquot.sed barry-0.0.20110506/po/boldquot.sed --- barry-0.14/po/boldquot.sed 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/boldquot.sed 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,10 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff -Nru barry-0.14/po/ChangeLog barry-0.0.20110506/po/ChangeLog --- barry-0.14/po/ChangeLog 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/ChangeLog 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,12 @@ +2009-11-19 gettextize + + * Makefile.in.in: New file, from gettext-0.17. + * boldquot.sed: New file, from gettext-0.17. + * en@boldquot.header: New file, from gettext-0.17. + * en@quot.header: New file, from gettext-0.17. + * insert-header.sin: New file, from gettext-0.17. + * quot.sed: New file, from gettext-0.17. + * remove-potcdate.sin: New file, from gettext-0.17. + * Rules-quot: New file, from gettext-0.17. + * POTFILES.in: New file. + diff -Nru barry-0.14/po/en@boldquot.header barry-0.0.20110506/po/en@boldquot.header --- barry-0.14/po/en@boldquot.header 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/en@boldquot.header 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,25 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff -Nru barry-0.14/po/en@quot.header barry-0.0.20110506/po/en@quot.header --- barry-0.14/po/en@quot.header 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/en@quot.header 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,22 @@ +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff -Nru barry-0.14/po/fr.po barry-0.0.20110506/po/fr.po --- barry-0.14/po/fr.po 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/fr.po 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,43 @@ +# French translations for barry package. +# Copyright (C) 2009-2011 Net Direct, Inc. +# This file is distributed under the same license as the barry package. +# Nicolas , 2009, French translation copyright +# +msgid "" +msgstr "" +"Project-Id-Version: barry 0.18.0\n" +"Report-Msgid-Bugs-To: http://netdirect.ca/barry\n" +"POT-Creation-Date: 2011-01-27 14:01-0500\n" +"PO-Revision-Date: 2009-11-19 23:13+0100\n" +"Last-Translator: Nicolas \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: tools/breset.cc:67 +#, c-format +msgid "Scanning for Blackberry devices...\n" +msgstr "Recherche de téléphone Blackberry...\n" + +#: tools/breset.cc:81 +#, c-format +msgid "Found..." +msgstr "Trouvé..." + +#: tools/breset.cc:82 +#, c-format +msgid "attempting to reset.\n" +msgstr "Réinitialisation en cours.\n" + +#: tools/breset.cc:86 +#, c-format +msgid "Can't reset device on bus %s, devnum %u\n" +msgstr "Impossible de réinitialiser le périphérique, bus %s, devnum %u\n" + +#: tools/breset.cc:91 +#, c-format +msgid "%d device%s reset.\n" +msgstr "%d périphérique%s réinitialisé.\n" diff -Nru barry-0.14/po/insert-header.sin barry-0.0.20110506/po/insert-header.sin --- barry-0.14/po/insert-header.sin 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/insert-header.sin 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,23 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff -Nru barry-0.14/po/LINGUAS barry-0.0.20110506/po/LINGUAS --- barry-0.14/po/LINGUAS 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/LINGUAS 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,3 @@ +# Set of available languages. +fr + diff -Nru barry-0.14/po/Makevars barry-0.0.20110506/po/Makevars --- barry-0.14/po/Makevars 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/Makevars 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,44 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Net Direct, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +# +# See the "contact" page from the URL below: +MSGID_BUGS_ADDRESS = http://netdirect.ca/barry + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + diff -Nru barry-0.14/po/POTFILES.in barry-0.0.20110506/po/POTFILES.in --- barry-0.14/po/POTFILES.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/POTFILES.in 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,92 @@ +# List of source files which contain translatable strings. +src/data.cc +src/r_task.cc +src/r_memo.cc +src/router.cc +src/m_mode_base.cc +src/pppfilter.cc +src/r_command.cc +src/common.cc +src/j_message.cc +src/error.cc +src/strnlen.c +src/ldif.cc +src/r_recordstate.cc +src/sha1.cc +src/r_sms.cc +src/j_manager.cc +src/threadwrap.cc +src/r_servicebook.cc +src/iconv.cc +src/m_desktop.cc +src/m_raw_channel.cc +src/record.cc +src/dp_codinfo.cc +src/time.cc +src/bmp.cc +src/cod.cc +src/dataqueue.cc +src/log.cc +src/j_server.cc +src/r_calllog.cc +src/controller.cc +src/m_ipmodem.cc +src/r_timezone.cc +src/m_serial.cc +src/r_dbdb.cc +src/r_folder.cc +src/m_jvmdebug.cc +src/r_calendar.cc +src/j_record.cc +src/protocol.cc +src/usbwrap.cc +src/r_contact.cc +src/dp_parser.cc +src/probe.cc +src/packet.cc +src/socket.cc +src/m_javaloader.cc +src/version.cc +src/base64.cc +src/j_jdwp.cc +src/r_recur_base.cc +src/r_message_base.cc +src/tzwrapper.cc +src/vformat.c +src/vbase.cc +src/vcard.cc +src/vevent.cc +src/vjournal.cc +src/vtodo.cc + +opensync-plugin/src/vcard.cc +opensync-plugin/src/vevent.cc +opensync-plugin/src/idmap.cc +opensync-plugin/src/barry_sync.cc +opensync-plugin/src/environment.cc + +opensync-plugin-0.4x/src/vcard.cc +opensync-plugin-0.4x/src/vjournal.cc +opensync-plugin-0.4x/src/vevent.cc +opensync-plugin-0.4x/src/barry_sync.cc +opensync-plugin-0.4x/src/vtodo.cc +opensync-plugin-0.4x/src/environment.cc + +tools/brimtrans.cc +tools/bjvmdebug.cc +tools/bjdwp.cc +tools/bcharge.cc +tools/bdptest.cc +tools/bktrans.cc +tools/brecsum.cc +tools/btranslate.cc +tools/breset.cc +tools/bidentify.cc +tools/pppob.cc +tools/bs11nread.cc +tools/btool.cc +tools/bfuse.cc +tools/upldif.cc +tools/bjavaloader.cc +tools/brawchannel.cc + diff -Nru barry-0.14/po/quot.sed barry-0.0.20110506/po/quot.sed --- barry-0.14/po/quot.sed 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/quot.sed 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,6 @@ +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff -Nru barry-0.14/po/README barry-0.0.20110506/po/README --- barry-0.14/po/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/README 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,26 @@ +HOWTO to add a new language or update translation +================================================= + +To add a new language +--------------------- + +Sample to add spanish language + + $ cd /po + $ msginit --locale=es --input=barry.pot + $ echo "es" >> LINGUAS + $ make update-po + +Then, send to barry team your work. + +To update translation +--------------------- + +You have to only edit a ".po" file. + + $ cd /po + $ vi es.po + $ make update-po + +Then, send to barry team your work. + diff -Nru barry-0.14/po/remove-potcdate.sin barry-0.0.20110506/po/remove-potcdate.sin --- barry-0.14/po/remove-potcdate.sin 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/remove-potcdate.sin 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff -Nru barry-0.14/po/Rules-quot barry-0.0.20110506/po/Rules-quot --- barry-0.14/po/Rules-quot 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/po/Rules-quot 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,47 @@ +# Special Makefile rules for English message catalogs with quotation marks. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sin + sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff -Nru barry-0.14/ppp/barry-att_cingular barry-0.0.20110506/ppp/barry-att_cingular --- barry-0.14/ppp/barry-att_cingular 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-att_cingular 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,37 @@ +# See the README file in the source tree for notes and documentation + +# pppd peer file for ATT / Cingular +# by Richard Esplin +# Licensed under the same terms as libbarry. + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-att_cingular.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user "" +password "" + +defaultroute +usepeerdns + +noipdefault +nodetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +novj + +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-att_cingular.chat barry-0.0.20110506/ppp/barry-att_cingular.chat --- barry-0.14/ppp/barry-att_cingular.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-att_cingular.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,27 @@ +# Chatscript for ATT / Cingular +# by Richard Esplin +# Licensed under the same terms as libbarry. +# +# Please send all working peer files to cdfrey@foursquare.net, so we can +# build a library of peer files for different carriers. + +# Google says this info is important for ATT/Cingular: +# Modem Initialization String: AT +CGDCONT=1,"IP","wap.cingular" +# Dial-up Phone Number: *99# +# Dial-up username/password: blank/blank + +SAY 'Setting abort string\n' +ABORT ERROR + +SAY 'Initializing modem\n' +OK AT +OK ATZ + +SAY 'Carrier Information\n' +OK AT+CGDCONT=1,"IP","wap.cingular" +OK ATI +OK ATDT*99# + +SAY 'Connecting\n' +CONNECT + diff -Nru barry-0.14/ppp/barry-chinamobile barry-0.0.20110506/ppp/barry-chinamobile --- barry-0.14/ppp/barry-chinamobile 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-chinamobile 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,34 @@ +# See the README file in the source tree for notes and documentation + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-chinamobile.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user "" +password "" + +defaultroute +usepeerdns + +noipdefault +nodetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +novj + +nomultilink +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-chinamobile.chat barry-0.0.20110506/ppp/barry-chinamobile.chat --- barry-0.14/ppp/barry-chinamobile.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-chinamobile.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,3 @@ +ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR +OK 'AT+CGDCONT=1,"IP","cmnet"' +OK 'ATDT*99#' \ No newline at end of file diff -Nru barry-0.14/ppp/barry-fido.chat barry-0.0.20110506/ppp/barry-fido.chat --- barry-0.14/ppp/barry-fido.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-fido.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,9 @@ +# +# Contributed to Barry by Sujay D'Souza +# +ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO +DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABO +RT ERROR +OK 'AT+CGDCONT=1,"IP","internet.fido.ca"' +OK 'ATDT*99#' + diff -Nru barry-0.14/ppp/barry-kpn barry-0.0.20110506/ppp/barry-kpn --- barry-0.14/ppp/barry-kpn 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-kpn 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,34 @@ +# See the README file in the source tree for notes and documentation + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-kpn.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user "KPN" +password "gprs" + +defaultroute +usepeerdns + +noipdefault +nodetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nomultilink +nopcomp +nomagic +novj + +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-kpn.chat barry-0.0.20110506/ppp/barry-kpn.chat --- barry-0.14/ppp/barry-kpn.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-kpn.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,7 @@ +ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR +SAY "Initializing\n" +'' ATZ +OK AT+CGDCONT=1,"IP","internet" +OK-AT-OK ATDT*99# +CONNECT \d\c + diff -Nru barry-0.14/ppp/barry-minimal barry-0.0.20110506/ppp/barry-minimal --- barry-0.14/ppp/barry-minimal 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-minimal 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,23 @@ +# See the README file in the source tree for notes and documentation + +# This is based on connection data for a Rogers provider. +# Sometimes it is better to let pppd do the handshaking for us. +# In cases where barry-rogers gives the error +# "Could not determine local IP address", this setup may work. + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-minimal.chat" +pty "/usr/sbin/pppob" + +user wapuser1 + +nodetach +defaultroute +noipdefault +noauth +usepeerdns + +lcp-echo-failure 0 +lcp-echo-interval 0 + +debug + diff -Nru barry-0.14/ppp/barry-minimal.chat barry-0.0.20110506/ppp/barry-minimal.chat --- barry-0.14/ppp/barry-minimal.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-minimal.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,26 @@ +# +# Some of these options found documented at: +# http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux +# +# Others are based on the peer file in XmBlackBerry +# +# Please send all working peer files to cdfrey@foursquare.net, so we can +# build a library of peer files for different carriers. +# +ABORT ERROR +'' AT&F +OK ATZ +OK ATI +OK AT+CNUM +OK AT+CSQ +# Some Blackberries reboot on this command +#OK AT+CREG? +#OK AT+CGDCONT? +#OK AT+CGQREQ? +#OK AT+CGQMIN? +#OK AT+CGATT? +#OK AT+CGREG? +OK AT+CGDCONT=1,"IP","internet.com" +OK ATDT*99# +CONNECT + diff -Nru barry-0.14/ppp/barry-o2ireland barry-0.0.20110506/ppp/barry-o2ireland --- barry-0.14/ppp/barry-o2ireland 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-o2ireland 2011-05-06 12:20:17.000000000 +0000 @@ -1,21 +1,27 @@ -debug debug debug -nodetach +# See the README file in the source tree for notes and documentation -pty "/usr/sbin/pppob" connect "/usr/sbin/chat -f /etc/chatscripts/barry-o2ireland.chat" +pty "/usr/sbin/pppob" + +debug debug debug + user "gprs" password "gprs" defaultroute usepeerdns + noipdefault nodetach -novj nocrtscts +novj + nomultilink ipcp-restart 7 ipcp-accept-local ipcp-accept-remote lcp-echo-interval 0 lcp-echo-failure 999 + mtu 1492 + diff -Nru barry-0.14/ppp/barry-optus-au barry-0.0.20110506/ppp/barry-optus-au --- barry-0.14/ppp/barry-optus-au 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-optus-au 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,34 @@ +# See the README file in the source tree for notes and documentation + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-optus.chat" +pty "/usr/sbin/pppob" + +#debug + +noauth +user "" +password "" + +defaultroute +usepeerdns + +noipdefault +updetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +nomultilink + +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +ipcp-max-configure 30 +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-optus-au.chat barry-0.0.20110506/ppp/barry-optus-au.chat --- barry-0.14/ppp/barry-optus-au.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-optus-au.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,33 @@ +# +# Some of these options found documented at: +# http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux +# +# Others are based on the peer file in XmBlackBerry +# +# Please send all working peer files to cdfrey@foursquare.net, so we can +# build a library of peer files for different carriers. +# +ABORT ERROR +'' AT&F +OK ATZ +#OK ATI +#OK AT+CNUM +#OK AT+CSQ +# Some Blackberries reboot on this command +#OK AT+CREG? +#OK AT+CGDCONT? +#OK AT+CGQREQ? +#OK AT+CGQMIN? +#OK AT+CGATT? +#OK AT+CGREG? +#OK AT+CGDCONT=1,"IP","internet.com" +OK AT+CGDCONT=1,"IP","internet" + +OK ATE0V1 + +OK AT +OK ATS0=0 + +OK ATDT*99# +CONNECT + diff -Nru barry-0.14/ppp/barry-orange-spain barry-0.0.20110506/ppp/barry-orange-spain --- barry-0.14/ppp/barry-orange-spain 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-orange-spain 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,34 @@ +# See the README file in the source tree for notes and documentation + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-orange-spain.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user "" +password "" + +defaultroute +usepeerdns + +noipdefault +nodetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nomagic +nopcomp +novj + +nomultilink +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-orange-spain.chat barry-0.0.20110506/ppp/barry-orange-spain.chat --- barry-0.14/ppp/barry-orange-spain.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-orange-spain.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,9 @@ +ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR +SAY "Initializing\n" +'' ATZ +SAY "ATE\n" +OK 'AT+CGDCONT=1,"IP","internet"' +OK 'AT' +OK 'ATDT*99***1#' +SAY "Dialing\n" + diff -Nru barry-0.14/ppp/barry-rogers barry-0.0.20110506/ppp/barry-rogers --- barry-0.14/ppp/barry-rogers 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-rogers 2011-05-06 12:20:17.000000000 +0000 @@ -1,80 +1,34 @@ -# -# Some of these options found documented at: -# http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux -# -# Others are based on the peer file in XmBlackBerry -# -# Please send all working peer files to cdfrey@foursquare.net, so we can -# build a library of peer files for different carriers. -# +# See the README file in the source tree for notes and documentation connect "/usr/sbin/chat -f /etc/chatscripts/barry-rogers.chat" +pty "/usr/sbin/pppob" + +debug -# -# authentication options - no need for ISP to authenticate to us, but -# we may need a login here: user/password/name -# noauth user wapuser password wap name wapuser -# -# handle the default route and DNS -# -#nodefaultroute defaultroute usepeerdns -# -# disable unsupported options -# noipdefault nodetach -novj nodeflate nobsdcomp noaccomp -#default-asyncmap nocrtscts nopcomp nomagic +novj -passive - -#nomultilink ipcp-restart 7 ipcp-accept-local ipcp-accept-remote -# need lcp-echo turned off, at least for tmobile, otherwise c0onnectin -# disconnects after few mn of inactivity. -# thanks to loon for this info lcp-echo-interval 0 lcp-echo-failure 999 - -# -# limit size of packets -# +passive mtu 1492 -# -# operate in debug mode -# -debug -#debug debug debug - -# -# call pppob for the USB link -# -pty "/usr/sbin/pppob" - - -# -# unused options -# - -#modem -## refused anyway, no point in trying every time -#novj - diff -Nru barry-0.14/ppp/barry-rogers.chat barry-0.0.20110506/ppp/barry-rogers.chat --- barry-0.14/ppp/barry-rogers.chat 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-rogers.chat 2011-05-06 12:20:17.000000000 +0000 @@ -13,12 +13,13 @@ OK ATI OK AT+CNUM OK AT+CSQ -OK AT+CREG? -OK AT+CGDCONT? -OK AT+CGQREQ? -OK AT+CGQMIN? -OK AT+CGATT? -OK AT+CGREG? +# Some Blackberries reboot on this command +#OK AT+CREG? +#OK AT+CGDCONT? +#OK AT+CGQREQ? +#OK AT+CGQMIN? +#OK AT+CGATT? +#OK AT+CGREG? OK AT+CGDCONT=1,"IP","internet.com" OK ATDT*99# CONNECT diff -Nru barry-0.14/ppp/barry-sprint barry-0.0.20110506/ppp/barry-sprint --- barry-0.14/ppp/barry-sprint 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-sprint 2011-05-06 12:20:17.000000000 +0000 @@ -1,80 +1,34 @@ -# -# Some of these options found documented at: -# http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux -# -# Others are based on the peer file in XmBlackBerry -# -# Please send all working peer files to cdfrey@foursquare.net, so we can -# build a library of peer files for different carriers. -# +# See the README file in the source tree for notes and documentation connect "/usr/sbin/chat -f /etc/chatscripts/barry-sprint.chat" +pty "/usr/sbin/pppob" + +debug -# -# authentication options - no need for ISP to authenticate to us, but -# we may need a login here: user/password/name -# noauth user wapuser password wap name wapuser -# -# handle the default route and DNS -# -#nodefaultroute defaultroute usepeerdns -# -# disable unsupported options -# noipdefault nodetach -novj nodeflate nobsdcomp noaccomp -#default-asyncmap nocrtscts nopcomp nomagic +novj -passive - -#nomultilink ipcp-restart 7 ipcp-accept-local ipcp-accept-remote -# need lcp-echo turned off, at least for tmobile, otherwise c0onnectin -# disconnects after few mn of inactivity. -# thanks to loon for this info lcp-echo-interval 0 lcp-echo-failure 999 - -# -# limit size of packets -# +passive mtu 1492 -# -# operate in debug mode -# -debug -#debug debug debug - -# -# call pppob for the USB link -# -pty "/usr/sbin/pppob" - - -# -# unused options -# - -#modem -## refused anyway, no point in trying every time -#novj - diff -Nru barry-0.14/ppp/barry-telus barry-0.0.20110506/ppp/barry-telus --- barry-0.14/ppp/barry-telus 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-telus 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,35 @@ +# See the README file in the source tree for notes and documentation +# This is a copy of barry-sprint, confirmed to work by Matt McGirr + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-telus.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user wapuser +password wap +name wapuser + +defaultroute +usepeerdns + +noipdefault +nodetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +novj + +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-telus.chat barry-0.0.20110506/ppp/barry-telus.chat --- barry-0.14/ppp/barry-telus.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-telus.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,14 @@ +# +# This sample chat script was reported to the mailing list by Andy Herkey, +# for his Sprint provider. +# +# Please send all working peer files to cdfrey@foursquare.net, so we can +# build a library of peer files for different carriers. +# +ABORT ERROR +'' AT&F +OK ATZ +OK ATI +OK ATDT#777 +CONNECT + diff -Nru barry-0.14/ppp/barry-tmobileus barry-0.0.20110506/ppp/barry-tmobileus --- barry-0.14/ppp/barry-tmobileus 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-tmobileus 2011-05-06 12:20:17.000000000 +0000 @@ -1,13 +1,10 @@ -# -# This file contains options for T-Mobile US Blackberries -# -# It is based on a file reported to work, but edited for Barry. -# +# See the README file in the source tree for notes and documentation connect "/usr/sbin/chat -f /etc/chatscripts/barry-tmobileus.chat" +pty "/usr/sbin/pppob" + +debug -# You may not need to auth. If you do, use your user/pass from www.t-mobile.com. -#noauth user "" password "" @@ -16,28 +13,23 @@ noipdefault nodetach -novj noaccomp nocrtscts nopcomp nomagic +novj nomultilink ipcp-restart 7 ipcp-accept-local ipcp-accept-remote - -# added so not to disconnect after a few minutes lcp-echo-interval 0 lcp-echo-failure 999 mtu 1492 -debug -debug debug debug - -pty "/usr/sbin/pppob" # 921600 Works For Me (TM) but won't "speed up" your connection. # 115200 also works. 921600 local + diff -Nru barry-0.14/ppp/barry-verizon barry-0.0.20110506/ppp/barry-verizon --- barry-0.14/ppp/barry-verizon 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-verizon 2011-05-06 12:20:17.000000000 +0000 @@ -1,10 +1,9 @@ -# -# This file contains options for Verizon Blackberries -# -# It is based on a file reported to work, but edited for Barry. -# +# See the README file in the source tree for notes and documentation connect "/usr/sbin/chat -f /etc/chatscripts/barry-verizon.chat" +pty "/usr/sbin/pppob" + +debug noauth user "" @@ -15,32 +14,15 @@ noipdefault nodetach -novj -#nodeflate -#nobsdcomp -#noaccomp -#default-asyncmap nocrtscts -#nopcomp -#nomagic - -#passive +novj nomultilink ipcp-restart 7 ipcp-accept-local ipcp-accept-remote -# added so not to disconnect after a few minutes lcp-echo-interval 0 lcp-echo-failure 999 mtu 1492 -debug -#debug debug debug - -pty "/usr/sbin/pppob" - -#115200 -#modem - diff -Nru barry-0.14/ppp/barry-verizon.chat barry-0.0.20110506/ppp/barry-verizon.chat --- barry-0.14/ppp/barry-verizon.chat 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-verizon.chat 2011-05-06 12:20:17.000000000 +0000 @@ -1,5 +1,10 @@ -ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED ABORT ERROR -SAY "Initializing\n" +ABORT ERROR +'' +++AT '' ATZ -OK-AT-OK ATDT#777 -CONNECT \d\c +OK AT&F +OK ATE0V1 +OK AT +OK ATS0=0 +OK ATDT#777 +CONNECT + diff -Nru barry-0.14/ppp/barry-vodafone-au barry-0.0.20110506/ppp/barry-vodafone-au --- barry-0.14/ppp/barry-vodafone-au 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-vodafone-au 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,34 @@ +# See the README file in the source tree for notes and documentation + +connect "/usr/sbin/chat -f /etc/chatscripts/barry-vodafone-au.chat" +pty "/usr/sbin/pppob" + +debug + +noauth +user "" +password "" + +defaultroute +usepeerdns + +noipdefault +updetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +nomultilink + +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +ipcp-max-configure 30 +lcp-echo-interval 0 +lcp-echo-failure 999 + +passive +mtu 1492 + diff -Nru barry-0.14/ppp/barry-vodafone-au.chat barry-0.0.20110506/ppp/barry-vodafone-au.chat --- barry-0.14/ppp/barry-vodafone-au.chat 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/ppp/barry-vodafone-au.chat 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,33 @@ +# +# Some of these options found documented at: +# http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux +# +# Others are based on the peer file in XmBlackBerry +# +# Please send all working peer files to cdfrey@foursquare.net, so we can +# build a library of peer files for different carriers. +# +ABORT ERROR +'' AT&F +OK ATZ +#OK ATI +#OK AT+CNUM +#OK AT+CSQ +# Some Blackberries reboot on this command +#OK AT+CREG? +#OK AT+CGDCONT? +#OK AT+CGQREQ? +#OK AT+CGQMIN? +#OK AT+CGATT? +#OK AT+CGREG? +#OK AT+CGDCONT=1,"IP","internet.com" +OK AT+CGDCONT=1,"IP","live.vodafone.com" + +OK ATE0V1 + +OK AT +OK ATS0=0 + +OK ATDT*99# +CONNECT + diff -Nru barry-0.14/ppp/README barry-0.0.20110506/ppp/README --- barry-0.14/ppp/README 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/ppp/README 2011-05-06 12:20:17.000000000 +0000 @@ -14,8 +14,99 @@ http://groups.google.com/group/comp.os.linux.misc/browse_thread/thread/11fb49a3c035573/7d7e19b2e4820b0c http://linuxgazette.net/issue77/lechnyr.html +Other options can be found at: + http://wiki.colar.net/tethering_with_blackberry_pearl_on_linux -Chris Frey - -May 2008 +The original peer files were based on the XmBlackBerry peer file, but +many have been added over the years for various ISPs. + +Please send all working peer files to cdfrey@foursquare.net, so we can +build a library of peer files for different carriers. + +Peer File Option Notes: +----------------------- + +# +# the chat script and the USB link +# +connect "/usr/sbin/chat -f /etc/chatscripts/barry-rogers.chat" +pty "/usr/sbin/pppob" + +# +# decide the level of debug output you need +# +debug +#debug debug debug + +# +# authentication options - no need for ISP to authenticate to us, but +# we may need a login here: user/password/name +# +# Rogers style: +noauth +user wapuser +password wap +name wapuser + +# or: + +# T-Mobile style: +# You may not need to auth. If you do, use your user/pass +# from www.t-mobile.com. +user "" +password "" + + + +# +# routing options +# +#nodefaultroute # the safest, but least useful +defaultroute +usepeerdns + +# +# options that are usually unsupported, so disable them +# +noipdefault +nodetach +# note that there's a new option on the scene: updetach +#updetach +nodeflate +nobsdcomp +noaccomp +nocrtscts +nopcomp +nomagic +#default-asyncmap # does not usually need to be specified + +# This is disabled by default for a Barry config, but this +# has caused connection issues in the past. If you are unable +# to get an ip with your provider, try commenting this out. +# See: +# http://www.mail-archive.com/barry-devel@lists.sourceforge.net/msg01871.html +novj + +#nomultilink +ipcp-restart 7 +ipcp-accept-local +ipcp-accept-remote +# need lcp-echo turned off, at least for tmobile, otherwise c0onnectin +# disconnects after few mn of inactivity. +# thanks to loon for this info +lcp-echo-interval 0 +lcp-echo-failure 999 + +# +# limit size of packets, misc. options +# +passive +mtu 1492 + +# +# unused options... modem and local are opposites, and determine how +# far pppd goes to use the line like a modem +# +#modem +#local diff -Nru barry-0.14/README barry-0.0.20110506/README --- barry-0.14/README 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/README 2011-05-06 12:20:16.000000000 +0000 @@ -1,29 +1,33 @@ -***************************************************************************** -* CAUTION: This is alpha software. Please make complete backups of your * -* Blackberry device before experimenting. While the author has * -* had good success with this software, that is no guarantee that * -* you will. Please make backups. * -***************************************************************************** +****************************************************************************** +* CAUTION: This is unofficial software, based on reverse engineering the * +* USB protocol. It does not have the advantage of any internal * +* knowledge of RIM software design or specs. Please make complete * +* backups of your BlackBerry device, using the official RIM * +* software, before experimenting. While the author has had good * +* success with this software, that is no guarantee that you will. * +* Please make backups. * +****************************************************************************** Introduction: ------------- -Barry is a GPL C++ library to interface with USB BlackBerry handheld devices -on Linux. This is one of Net Direct Inc.'s (http://www.netdirect.ca/) -open source projects. +Barry is a GPL C++ library and application set to interface with +USB BlackBerry handheld devices on Linux. This is one of +Net Direct Inc.'s (http://www.netdirect.ca/) open source projects. The SourceForge project page can be found at: http://sourceforge.net/projects/barry/ The documentation page can be found at: - http://www.netdirect.ca/software/packages/barry/ + http://netdirect.ca/barry or http://barry.sourceforge.net/ (redirect) The same documentation (and perhaps more up to date) can be found in the -doc/www/ directory, starting with the file index.html. +doc/www/ directory. If you have php CLI installed, run the static.sh +script to generate the HTML, then start reading at index.html. Enjoy! -September 2007 +December 2010 diff -Nru barry-0.14/rpm/barry.spec barry-0.0.20110506/rpm/barry.spec --- barry-0.14/rpm/barry.spec 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/rpm/barry.spec 2011-05-06 12:20:17.000000000 +0000 @@ -10,23 +10,44 @@ %define with_opensync 1 %endif +# Fedora 12 has the desktop packages installed for our build system +%if 0%{?fc12} || 0%{?fc13} || 0%{?fc14} + %define with_desktop 1 +%else + %define with_desktop 0 +%endif + +%if 0%{?fc12} || 0%{?fc13} || 0%{?fc14} + %define use_69_rules 1 +%else + %define use_69_rules 0 +%endif Summary: BlackBerry(tm) Desktop for Linux Name: barry -Version: 0.14 +Version: 0.18.0 Release: 0 Group: Applications/Productivity -License: GPL +License: GPLv2+ Source: %{name}-%{version}.tar.bz2 -URL: http://www.netdirect.ca/downloads/barry +URL: http://www.netdirect.ca/software/packages/barry Vendor: Net Direct Inc. BuildRoot: %{_tmppath}/%{name}-%{release}-%{version}-root %if 0%{?suse_version} -BuildRequires: libusb, gcc-c++, pkgconfig, boost-devel +BuildRequires: libusb, gcc-c++, pkgconfig, boost-devel, fuse-devel, zlib-devel %else -BuildRequires: libusb-devel, gcc-c++, pkgconfig, boost-devel +BuildRequires: libusb-devel, gcc-c++, pkgconfig, boost-devel, fuse-devel, zlib-devel +%endif + +%if %{with_gui} +BuildRequires: desktop-file-utils +%endif + +# desktop tree +%if %{with_desktop} +BuildRequires: wxGTK-devel %endif %define barryroot %{_builddir}/%{name}-%{version} @@ -67,18 +88,18 @@ %package util -Summary: BlackBerry(tm) Desktop for Linux - bcharge, btool, breset and others +Summary: BlackBerry(tm) Desktop for Linux - bcharge, btool, breset, bio and others Group: Applications/Productivity -Requires: libbarry0 +Requires: libbarry0 fuse Conflicts: barry-bcharge %description util Barry is a desktop toolset for managing your BlackBerry(tm) device. (BlackBerry is a registered trademark of Research in Motion Limited.) -This package contains the commandline tools bcharge, btool, breset and others -which will enable you to charge your device with a proper 500mA and be able -to access the data on the device in many ways. +This package contains the commandline tools bcharge, btool, breset, bio and +others which will enable you to charge your device with a proper 500mA +and be able to access the data on the device in many ways. %if %{with_gui} @@ -115,18 +136,33 @@ This package contains the opensync plugin. %endif +# desktop tree +%if %{with_desktop} +%package desktop +Summary: BlackBerry(tm) Desktop Panel GUI for Linux +Group: Applications/Productivity +Requires: libbarry0, libopensync >= 0.22 +BuildRequires: wxGTK-devel + +%description desktop +Barry is a desktop toolset for managing your BlackBerry(tm) device. (BlackBerry +is a registered trademark of Research in Motion Limited.) + +This package contains the desktop panel GUI. +%endif + %prep %setup -q %build # main tree -%{configure} --with-boost +%{configure} --enable-boost --enable-nls --with-zlib %{__make} %{?_smp_mflags} # gui tree %if %{with_gui} cd gui/ -%{configure} PKG_CONFIG_PATH="..:$PKG_CONFIG_PATH" CXXFLAGS="-I../.." LDFLAGS="-L../../src" +%{configure} PKG_CONFIG_PATH="..:$PKG_CONFIG_PATH" CXXFLAGS="-I../.." LDFLAGS="-L../../src" --enable-nls %{__make} %{?_smp_mflags} cd ../ %endif @@ -134,7 +170,15 @@ # opensync tree %if %{with_opensync} cd opensync-plugin/ -%{configure} PKG_CONFIG_PATH="..:$PKG_CONFIG_PATH" CXXFLAGS="-I../.." LDFLAGS="-L../../src" +%{configure} PKG_CONFIG_PATH="..:$PKG_CONFIG_PATH" CXXFLAGS="-I../.." LDFLAGS="-L../../src" --enable-nls +%{__make} %{?_smp_mflags} +cd ../ +%endif + +# desktop tree +%if %{with_desktop} +cd desktop/ +%{configure} PKG_CONFIG_PATH="..:$PKG_CONFIG_PATH" CXXFLAGS="-I../.." LDFLAGS="-L../../src" --enable-nls %{__make} %{?_smp_mflags} cd ../ %endif @@ -142,30 +186,71 @@ %install # main tree %{__make} DESTDIR=%{buildroot} install +# delete some test-only programs +%{__rm} -f %{buildroot}%{_bindir}/bdptest +%{__rm} -f %{buildroot}%{_bindir}/bjvmdebug +# proceed as usual... %{__mkdir_p} %{buildroot}%{_sysconfdir}/udev/rules.d %{__cp} udev/10-blackberry.rules %{buildroot}%{_sysconfdir}/udev/rules.d/ -%{__mkdir_p} %{buildroot}%{_sysconfdir}/security/console.perms.d -%{__cp} udev/10-blackberry.perms %{buildroot}%{_sysconfdir}/security/console.perms.d/ +%if %{use_69_rules} +%{__cp} udev/69-blackberry.rules %{buildroot}%{_sysconfdir}/udev/rules.d/ +%else +%{__cp} udev/99-blackberry-perms.rules %{buildroot}%{_sysconfdir}/udev/rules.d/ +%endif %{__mkdir_p} %{buildroot}%{_sysconfdir}/modprobe.d -%{__cp} modprobe/blacklist-berry_charge %{buildroot}%{_sysconfdir}/modprobe.d/ +%{__cp} modprobe/blacklist-berry_charge.conf %{buildroot}%{_sysconfdir}/modprobe.d/ %{__mkdir_p} %{buildroot}%{_sysconfdir}/ppp/peers %{__cp} ppp/barry-rogers %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-minimal %{buildroot}%{_sysconfdir}/ppp/peers/ %{__cp} ppp/barry-verizon %{buildroot}%{_sysconfdir}/ppp/peers/ %{__cp} ppp/barry-sprint %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-telus %{buildroot}%{_sysconfdir}/ppp/peers/ %{__cp} ppp/barry-o2ireland %{buildroot}%{_sysconfdir}/ppp/peers/ %{__cp} ppp/barry-tmobileus %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-att_cingular %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-chinamobile %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-kpn %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-orange-spain %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-optus-au %{buildroot}%{_sysconfdir}/ppp/peers/ +%{__cp} ppp/barry-vodafone-au %{buildroot}%{_sysconfdir}/ppp/peers/ %{__mkdir_p} %{buildroot}%{_sysconfdir}/chatscripts %{__cp} ppp/barry-rogers.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-minimal.chat %{buildroot}%{_sysconfdir}/chatscripts/ %{__cp} ppp/barry-verizon.chat %{buildroot}%{_sysconfdir}/chatscripts/ %{__cp} ppp/barry-sprint.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-telus.chat %{buildroot}%{_sysconfdir}/chatscripts/ %{__cp} ppp/barry-o2ireland.chat %{buildroot}%{_sysconfdir}/chatscripts/ %{__cp} ppp/barry-tmobileus.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-att_cingular.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-chinamobile.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-kpn.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-orange-spain.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-optus-au.chat %{buildroot}%{_sysconfdir}/chatscripts/ +%{__cp} ppp/barry-vodafone-au.chat %{buildroot}%{_sysconfdir}/chatscripts/ +# Install hal fdi config +%{__mkdir_p} %{buildroot}%{_datadir}/hal/fdi/information/10freedesktop +%{__mkdir_p} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor +%{__cp} hal/fdi/information/10freedesktop/10-blackberry.fdi %{buildroot}%{_datadir}/hal/fdi/information/10freedesktop +%{__cp} hal/fdi/policy/10osvendor/19-blackberry-acl.fdi %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor +# Install hal support script +%{__mkdir_p} %{buildroot}%{_bindir} +%{__cp} hal/hal-blackberry %{buildroot}%{_bindir} +# Install bash completion scripts +%{__mkdir_p} %{buildroot}%{_sysconfdir}/bash_completion.d +%{__cp} bash/bjavaloader %{buildroot}%{_sysconfdir}/bash_completion.d +%{__cp} bash/btool %{buildroot}%{_sysconfdir}/bash_completion.d # gui tree %if %{with_gui} cd gui/ %{__make} DESTDIR=%{buildroot} install +# Install barry logo icon cd ../ +%{__mkdir_p} %{buildroot}%{_datadir}/pixmaps +%{__cp} logo/barry_logo_icon.png %{buildroot}%{_datadir}/pixmaps +desktop-file-install --vendor netdirect \ + --dir %{buildroot}%{_datadir}/applications \ + menu/barrybackup.desktop %endif # opensync tree @@ -175,6 +260,17 @@ cd ../ %endif +# desktop tree +%if %{with_desktop} +cd desktop/ +%{__make} DESTDIR=%{buildroot} install +cd ../ +%{__cp} logo/barry_logo_icon.png %{buildroot}%{_datadir}/pixmaps/barry_desktop_icon.png +desktop-file-install --vendor netdirect \ + --dir %{buildroot}%{_datadir}/applications \ + menu/barrydesktop.desktop +%endif + %files -n libbarry0 %defattr(-,root,root) %attr(-,root,root) %{_libdir}/*.so* @@ -182,12 +278,11 @@ %files -n libbarry-devel %defattr(-,root,root) -%doc examples/*.cc examples/*.am %attr(0644,root,root) %{_includedir}/barry/* %attr(0644,root,root) %{_libdir}/*.a %attr(0755,root,root) %{_libdir}/*.la %attr(0644,root,root) %{_libdir}/pkgconfig/*.pc -%doc COPYING TODO doc/* +%doc COPYING TODO doc/* examples/*.cc %files util %defattr(-,root,root) @@ -195,13 +290,29 @@ %attr(0755,root,root) %{_sbindir}/breset %attr(0755,root,root) %{_sbindir}/pppob %attr(0755,root,root) %{_bindir}/btool +%attr(0755,root,root) %{_bindir}/bio +%attr(0755,root,root) %{_bindir}/btardump +%attr(0755,root,root) %{_bindir}/bfuse +%attr(0755,root,root) %{_bindir}/bjavaloader +%attr(0755,root,root) %{_bindir}/balxparse +%attr(0755,root,root) %{_bindir}/bjdwp +%attr(0755,root,root) %{_bindir}/brawchannel %attr(0755,root,root) %{_bindir}/bs11nread %attr(0755,root,root) %{_bindir}/bidentify %attr(0755,root,root) %{_bindir}/brecsum %attr(0755,root,root) %{_bindir}/upldif %attr(0755,root,root) %{_bindir}/bktrans %attr(0755,root,root) %{_bindir}/btranslate +%attr(0755,root,root) %{_bindir}/brimtrans +%attr(0755,root,root) %{_bindir}/hal-blackberry %attr(0644,root,root) %{_mandir}/man1/btool* +%attr(0644,root,root) %{_mandir}/man1/bio* +%attr(0644,root,root) %{_mandir}/man1/btardump* +%attr(0644,root,root) %{_mandir}/man1/bfuse* +%attr(0644,root,root) %{_mandir}/man1/bjavaloader* +%attr(0644,root,root) %{_mandir}/man1/balxparse* +%attr(0644,root,root) %{_mandir}/man1/bjdwp* +%attr(0644,root,root) %{_mandir}/man1/brawchannel* %attr(0644,root,root) %{_mandir}/man1/bs11nread* %attr(0644,root,root) %{_mandir}/man1/bidentify* %attr(0644,root,root) %{_mandir}/man1/bcharge* @@ -209,26 +320,50 @@ %attr(0644,root,root) %{_mandir}/man1/brecsum* %attr(0644,root,root) %{_mandir}/man1/breset* %attr(0644,root,root) %{_mandir}/man1/upldif* +%attr(0644,root,root) %{_datadir}/locale/* +%attr(0644,root,root) %{_datadir}/hal/fdi/information/10freedesktop/10-blackberry.fdi +%attr(0644,root,root) %{_datadir}/hal/fdi/policy/10osvendor/19-blackberry-acl.fdi %attr(0644,root,root) %config %{_sysconfdir}/udev/rules.d/* -%attr(0644,root,root) %config %{_sysconfdir}/security/console.perms.d/* -%attr(0644,root,root) %config %{_sysconfdir}/modprobe.d/blacklist-berry_charge +%attr(0644,root,root) %config %{_sysconfdir}/modprobe.d/blacklist-berry_charge.conf %attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-rogers +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-minimal %attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-verizon %attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-sprint +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-telus %attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-o2ireland %attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-tmobileus +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-att_cingular +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-chinamobile +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-kpn +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-orange-spain +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-optus-au +%attr(0644,root,root) %config %{_sysconfdir}/ppp/peers/barry-vodafone-au %attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-rogers.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-minimal.chat %attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-verizon.chat %attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-sprint.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-telus.chat %attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-o2ireland.chat %attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-tmobileus.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-att_cingular.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-chinamobile.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-kpn.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-orange-spain.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-optus-au.chat +%attr(0640,root,root) %config %{_sysconfdir}/chatscripts/barry-vodafone-au.chat +%attr(0640,root,root) %config %{_sysconfdir}/bash_completion.d/bjavaloader +%attr(0640,root,root) %config %{_sysconfdir}/bash_completion.d/btool %doc COPYING +%doc zsh +%doc ppp/README %if %{with_gui} %files gui %defattr(-,root,root) %attr(0755,root,root) %{_bindir}/barrybackup %attr(0644,root,root) %{_datadir}/barry/glade/*.glade +%attr(0644,root,root) %{_datadir}/pixmaps/barry_logo_icon.png +%attr(0644,root,root) %{_datadir}/applications/*barrybackup.desktop %attr(0644,root,root) %{_mandir}/man1/barrybackup* %doc COPYING %endif @@ -241,6 +376,22 @@ %doc COPYING %endif +# desktop tree +%if %{with_desktop} +%files desktop +%defattr(-,root,root) +%attr(0755,root,root) %{_bindir}/barrydesktop +%attr(0755,root,root) %{_bindir}/bsyncjail +%attr(0755,root,root) %{_bindir}/bsynccl +%attr(0644,root,root) %{_datadir}/barry/desktop/0.22/* +%attr(0644,root,root) %{_datadir}/barry/desktop/0.40/* +%attr(0644,root,root) %{_datadir}/barry/desktop/images/*.png +%attr(0644,root,root) %{_datadir}/pixmaps/barry_desktop_icon.png +%attr(0644,root,root) %{_datadir}/applications/*barrydesktop.desktop +%attr(0644,root,root) %{_mandir}/man1/barrydesktop* +%doc COPYING +%endif + %clean [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} [ "%{barryroot}" != "/" ] && %{__rm} -rf %{barryroot} @@ -252,6 +403,36 @@ /sbin/ldconfig %changelog +* Thu Feb 10 2011 Chris Frey 0.18.0-0 +- version bump + +* Fri May 28 2010 Chris Frey 0.17.0-0 +- version bump +- added NLS support +- cleaned up conditionals +- added Fedora 13 support +- added new ppp chat scripts for Orange Spain, Optus and Vodafone AU +- added copy of barry-sprint as barry-telus +- added brawchannel, btardump, bio, and balxparse +- added desktop support +- cleaned up desktop variables + +* Sat Sep 29 2009 Chris Frey 0.16-0 +- version bump +- added new ppp chat script for KPN Nederland +- using new udev rules set +- added bjdwp and manpage, and removed some test-only programs +- added bash and zsh completion scripts +- added .desktop file and icon for barrybackup + +* Fri Apr 10 2009 Chris Frey 0.15-0 +- version bump +- added HAL FDI scripts +- added bjavaloader and bfuse +- updated for udev directory reorganization in Barry source tree +- added zlib-devel to BuildRequires list +- added brimtrans + * Wed Sep 24 2008 Chris Frey 0.14-0 - version bump - added new ppp chat script for T-Mobile US diff -Nru barry-0.14/src/a_alxparser.cc barry-0.0.20110506/src/a_alxparser.cc --- barry-0.14/src/a_alxparser.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_alxparser.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,347 @@ +/// +/// \file a_alxparser.cc +/// ALX file parser (for one file) +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include "a_alxparser.h" + + +namespace Barry { + + +namespace ALX { + + +ALXParser::ALXParser(OSLoader& osloader, std::istream& input) + : XML::XMLParser(input, "ISO-8859-1") + , osloader(osloader) +{ + node = MAIN_NONE; + subnode = SUB_NONE; + m_register = true; +} + + +ALXParser::~ALXParser(void) +{ +} + + +bool ALXParser::Run(const bool enable) +{ + m_register = enable; + + return XMLParser::Run(); +} + + +void ALXParser::on_start_document() +{ +// std::cout << "on_start_document()" << std::endl; +} + + +void ALXParser::on_end_document() +{ +// std::cout << "on_end_document()" << std::endl; +} + + +void ALXParser::on_start_element(const Glib::ustring& name, + const xmlpp::SaxParser::AttributeList& attrs) +{ + depth++; + + buffdata = ""; + + switch (node) { + case MAIN_NONE: + if (name == "loader") + node = IN_LOADER; +// else +// exit(-1); + break; + + case IN_LOADER: + subnode = SUB_NONE; + + if (name == "system") { + node = IN_SYSTEM; + } + else if (name == "application") { + node = IN_APPLICATION; + + m_codsection.reset( new Application(attrs) ); + } + else if (name == "library") { + node = IN_LIBRARY; + + m_codsection.reset( new Library(attrs) ); + } + break; + + case IN_SYSTEM: + if (name == "directory") + subnode = IN_DIRECTORY; + else if (name == "osfiles") { + subnode = IN_OSFILES; + } + else if (name == "application") { + node = IN_SYSTEM_APPLICATION; + subnode = SUB_NONE; + + m_codsection.reset( new Application(attrs) ); + } + else if (name == "library") { + node = IN_SYSTEM_LIBRARY; + subnode = SUB_NONE; + + m_codsection.reset( new Application(attrs) ); + } + else if ((subnode == IN_OSFILES) && (name == "os")) + osloader.AddProperties(attrs); + break; + + case IN_LIBRARY: + case IN_APPLICATION: + case IN_APPLICATION_APPLICATION: + case IN_SYSTEM_APPLICATION: + case IN_SYSTEM_LIBRARY: + if (subnode == SUB_NONE) { + if ((node == IN_APPLICATION) && (name == "application")) { + node = IN_APPLICATION_APPLICATION; + + m_savecodsection = m_codsection; + m_codsection.reset( new Application(attrs) ); + } + else if (name == "name") + subnode = IN_NAME; + else if (name == "description") + subnode = IN_DESCRIPTION; + else if (name == "version") + subnode = IN_VERSION; + else if (name == "vendor") + subnode = IN_VENDOR; + else if (name == "copyright") + subnode = IN_COPYRIGHT; + else if (name == "directory") { + if (osloader.IsSupported(attrs)) + subnode = IN_DIRECTORY; + } + else if (name == "language") { + if (osloader.IsSupported(attrs)) + subnode = IN_LANGUAGE_SUPPORTED; + else + subnode = IN_LANGUAGE; + } + else if (name == "required") + subnode = IN_REQUIRED; + else if (name == "fileset") { + if (osloader.IsSupported(attrs)) + subnode = IN_FILESET; + } + } + break; + + default: + break; + } +} + + +void ALXParser::on_end_element(const Glib::ustring& name) +{ + depth--; + + switch (node) { + case MAIN_NONE: +// exit(-1); + break; + + case IN_LOADER: + if (name == "loader") + node = MAIN_NONE; + break; + + case IN_SYSTEM: + if (name == "system") { + subnode = SUB_NONE; + node = IN_LOADER; + } + + switch (subnode) { + case IN_DIRECTORY: + if (name == "directory") + subnode = SUB_NONE; + break; + + case IN_OSFILES: + if (name == "osfiles") + subnode = SUB_NONE; + else if (name == "os") + osloader.SetSFIFile(buffdata); + break; + default: + break; + } + break; + + case IN_LIBRARY: + case IN_APPLICATION: + case IN_APPLICATION_APPLICATION: + case IN_SYSTEM_APPLICATION: + case IN_SYSTEM_LIBRARY: + if (name == "application") { + if (m_register) + osloader.AddApplication(m_codsection); + subnode = SUB_NONE; + if (node == IN_APPLICATION) + node = IN_LOADER; + else if (node == IN_SYSTEM_APPLICATION) + node = IN_SYSTEM; + else if (node == IN_APPLICATION_APPLICATION) { + node = IN_APPLICATION; + m_codsection = m_savecodsection; + } + } + else if (name == "library") { + if (m_register) + osloader.AddLibrary(m_codsection); + subnode = SUB_NONE; + if (node == IN_LIBRARY) + node = IN_LOADER; + else if (node == IN_SYSTEM_LIBRARY) + node = IN_SYSTEM; + } + + switch (subnode) { + case IN_NAME: + if (name == "name") { + m_codsection->SetName(buffdata); + subnode = SUB_NONE; + } + break; + case IN_DESCRIPTION: + if (name == "description") { + m_codsection->SetDescription(buffdata); + subnode = SUB_NONE; + } + break; + case IN_VERSION: + if (name == "version") { + m_codsection->SetVersion(buffdata); + subnode = SUB_NONE; + } + break; + case IN_VENDOR: + if (name == "vendor") { + m_codsection->SetVendor(buffdata); + subnode = SUB_NONE; + } + break; + case IN_COPYRIGHT: + if (name == "copyright") { + m_codsection->SetCopyright(buffdata); + subnode = SUB_NONE; + } + break; + case IN_DIRECTORY: + if (name == "directory") { + m_codsection->SetDirectory(buffdata); + subnode = SUB_NONE; + } + break; + case IN_LANGUAGE: + if (name == "language") { + subnode = SUB_NONE; + } + break; + case IN_LANGUAGE_SUPPORTED: + if (name == "language") { + subnode = SUB_NONE; + } + else if (name == "name") { + m_codsection->SetName(buffdata); + } + break; + case IN_REQUIRED: + if (name == "required") { + subnode = SUB_NONE; + m_codsection->SetRequired(buffdata); + } + break; + case IN_FILESET: + if (name == "fileset") { + subnode = SUB_NONE; + } + else if (name == "files") { + m_codsection->AddFiles(buffdata); + } + break; + + default: + break; + } + break; + + default: + break; + } +} + + +void ALXParser::on_characters(const Glib::ustring& data) +{ + buffdata.append(data); +} + + +void ALXParser::on_comment(const Glib::ustring& text) +{ +// std::cout << "on_comment(): " << text << std::endl; +} + + +void ALXParser::on_warning(const Glib::ustring& text) +{ +// std::cout << "on_warning(): " << text << std::endl; +} + + +void ALXParser::on_error(const Glib::ustring& text) +{ +// std::cout << "on_error(): " << text << std::endl; +} + + +void ALXParser::on_fatal_error(const Glib::ustring& text) +{ + std::cout << "on_fatal_error(): " << text << std::endl; +} + + +} // namespace ALX + +} // namespace Barry + diff -Nru barry-0.14/src/a_alxparser.h barry-0.0.20110506/src/a_alxparser.h --- barry-0.14/src/a_alxparser.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_alxparser.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,108 @@ +/// +/// \file a_alxparser.h +/// ALX file parser (for one file) +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_ALX_PARSER_H__ +#define __BARRY_A_ALX_PARSER_H__ + +#include + +#include "dll.h" +#include "xmlparser.h" +#include "a_codsection.h" +#include "a_library.h" +#include "a_application.h" +#include "a_osloader.h" +#include + + +namespace Barry { + +namespace ALX { + + +class BXEXPORT ALXParser : public XML::XMLParser +{ +public: + enum MainNodeType { + MAIN_NONE, + IN_LOADER, + IN_SYSTEM, + IN_SYSTEM_APPLICATION, + IN_SYSTEM_LIBRARY, + IN_APPLICATION, + IN_APPLICATION_APPLICATION, + IN_LIBRARY + }; + + enum SubNodeType { + SUB_NONE, + IN_DIRECTORY, + IN_OSFILES, + IN_NAME, + IN_DESCRIPTION, + IN_VERSION, + IN_VENDOR, + IN_COPYRIGHT, + IN_LANGUAGE, + IN_LANGUAGE_SUPPORTED, + IN_REQUIRED, + IN_FILESET + }; + +private: + bool m_register; + OSLoader& osloader; + MainNodeType node; + SubNodeType subnode; + std::string buffdata; + + std::tr1::shared_ptr m_codsection; + std::tr1::shared_ptr m_savecodsection; + +public: + ALXParser(OSLoader& osloader, std::istream& input); + virtual ~ALXParser(void); + + virtual bool Run(const bool enable); + +protected: + // SaxParser overrides, also overridden in XMLParser + virtual void on_start_document(); + virtual void on_end_document(); + virtual void on_start_element(const Glib::ustring& name, + const xmlpp::SaxParser::AttributeList& attrs); + virtual void on_end_element(const Glib::ustring& name); + virtual void on_characters(const Glib::ustring& data); + virtual void on_comment(const Glib::ustring& text); + virtual void on_warning(const Glib::ustring& text); + virtual void on_error(const Glib::ustring& text); + virtual void on_fatal_error(const Glib::ustring& text); +}; + + +} // namespace ALX + +} // namespace Barry + +#endif + + diff -Nru barry-0.14/src/a_application.cc barry-0.0.20110506/src/a_application.cc --- barry-0.14/src/a_application.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_application.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,73 @@ +/// +/// \file a_application.cc +/// ALX Application class based on CODSection class +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include "a_application.h" + + +namespace Barry { + + +namespace ALX { + + +Application::Application(void) + : CODSection() +{ +} + + +Application::Application(const xmlpp::SaxParser::AttributeList& attrs) + : CODSection(attrs) +{ +} + + +Application::~Application(void) +{ +} + + +void Application::Dump(std::ostream &os) const +{ + os << " Application " << name << " - " << version << std::endl; + os << " ID : " << id << std::endl; + os << " Description : " << description << std::endl; + os << " Vendor : " << vendor << std::endl; + os << " Copyright : " << copyright << std::endl; + os << " Required : " << (isRequired ? "Yes" : "No") << std::endl; + + std::vector::const_iterator b = codfiles.begin(), e = codfiles.end(); + + os << " Files : " << std::endl; + for (; b != e; b++) + os << " - " << directory << "/" << (*b) << std::endl; +} + + +} // namespace ALX + +} // namespace Barry + diff -Nru barry-0.14/src/a_application.h barry-0.0.20110506/src/a_application.h --- barry-0.14/src/a_application.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_application.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,61 @@ +/// +/// \file a_application.h +/// ALX Application class based on CODSection class +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_APPLICATION_H__ +#define __BARRY_A_APPLICATION_H__ + +#include + +#include "dll.h" +#include "a_codsection.h" + + +namespace Barry { + +namespace ALX { + + +class BXEXPORT Application : public CODSection +{ +public: + Application(void); + Application(const xmlpp::SaxParser::AttributeList& attrs); + virtual ~Application(void); + + virtual void Dump(std::ostream &os) const; +}; + + +inline std::ostream& operator<<(std::ostream& os, const Application& app) +{ + app.Dump(os); + return os; +} + + +} // namespace ALX + +} // namespace Barry + +#endif + + diff -Nru barry-0.14/src/a_codsection.cc barry-0.0.20110506/src/a_codsection.cc --- barry-0.14/src/a_codsection.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_codsection.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,163 @@ +/// +/// \file a_codsection.cc +/// COD structure for the ALX file parser +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include "a_codsection.h" + + +namespace Barry { + +namespace { + +std::string trim(const std::string &str) { + int i; + int start, end; + + std::string s; + + const int len = str.size(); + + // ltrim + for (i=0; (((str[i]==' ') || (str[i]=='\t') || (str[i]=='\r') || (str[i]=='\n')) && (i=0)); i--); + end = i+1; + + s = str.substr(start, end-start); + + return s; +} + +} + + +namespace ALX { + + +CODSection::CODSection(void) +{ + isRequired = false; +} + + +CODSection::CODSection(const xmlpp::SaxParser::AttributeList& attrs) +{ + isRequired = false; + + for (xmlpp::SaxParser::AttributeList::const_iterator iter = attrs.begin(); iter != attrs.end(); ++iter) { + std::string attribut(iter->name); + std::string value(iter->value); + + if (attribut == "id") + SetID(value); + } +} + + +CODSection::~CODSection(void) +{ + isRequired = false; +} + + +void CODSection::SetID(const std::string& id) +{ + this->id = id; +} + + +void CODSection::SetName(const std::string& name) +{ + this->name = trim(name); +} + + +void CODSection::SetDescription(const std::string& description) +{ + this->description = trim(description); +} + + +void CODSection::SetVersion(const std::string& version) +{ + this->version = trim(version); +} + + +void CODSection::SetVendor(const std::string& vendor) +{ + this->vendor = trim(vendor); +} + + +void CODSection::SetCopyright(const std::string& copyright) +{ + this->copyright = trim(copyright); +} + + +void CODSection::SetDirectory(const std::string& directory) +{ + this->directory = trim(directory); +} + + +void CODSection::SetRequired(const std::string& required) +{ + std::string s = trim(required); + + if (s == "true") + isRequired = true; + else + isRequired = false; +} + + +void CODSection::AddFiles(const std::string& files) +{ + std::string file; + std::istringstream iss(files); + + while( std::getline(iss, file) ) { + file = trim(file); + + if (file.length() > 0) + AddFile(file); + } +} + + +void CODSection::AddFile(const std::string& file) +{ + codfiles.push_back(file); +} + + +} // namespace ALX + +} // namespace Barry + diff -Nru barry-0.14/src/a_codsection.h barry-0.0.20110506/src/a_codsection.h --- barry-0.14/src/a_codsection.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_codsection.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,84 @@ +/// +/// \file a_codsection.h +/// COD structure for the ALX file parser +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_CODSECTION_H__ +#define __BARRY_A_CODSECTION_H__ + +#include + +#include "dll.h" +#include "a_common.h" + + +namespace Barry { + +namespace ALX { + + +class BXEXPORT CODSection +{ +protected: + std::string id; + std::string name; + std::string description; + std::string version; + std::string vendor; + std::string copyright; + std::string directory; + + bool isRequired; + std::vector codfiles; + +public: + CODSection(void); + CODSection(const xmlpp::SaxParser::AttributeList& attrs); + virtual ~CODSection(void); + + virtual void Dump(std::ostream &os) const = 0; + + virtual void SetID(const std::string& id); + virtual void SetName(const std::string& name); + virtual void SetDescription(const std::string& description); + virtual void SetVersion(const std::string& version); + virtual void SetVendor(const std::string& vendor); + virtual void SetCopyright(const std::string& copyright); + virtual void SetDirectory(const std::string& directory); + virtual void SetRequired(const std::string& required); + virtual void AddFiles(const std::string& files); + virtual void AddFile(const std::string& files); +}; + + +inline std::ostream& operator<<(std::ostream& os, const CODSection& cod) +{ + cod.Dump(os); + return os; +} + + +} // namespace ALX + +} // namespace Barry + +#endif + + diff -Nru barry-0.14/src/a_common.h barry-0.0.20110506/src/a_common.h --- barry-0.14/src/a_common.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_common.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,30 @@ +/// +/// \file a_common.h +/// ALX file parser common header +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_COMMON_H__ +#define __BARRY_A_COMMON_H__ + +#include +#include + +#endif + diff -Nru barry-0.14/src/a_library.cc barry-0.0.20110506/src/a_library.cc --- barry-0.14/src/a_library.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_library.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,73 @@ +/// +/// \file a_library.cc +/// ALX Library class based on CODSection class +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include "a_library.h" + + +namespace Barry { + + +namespace ALX { + + +Library::Library(void) + : CODSection() +{ +} + + +Library::Library(const xmlpp::SaxParser::AttributeList& attrs) + : CODSection(attrs) +{ +} + + +Library::~Library(void) +{ +} + + +void Library::Dump(std::ostream &os) const +{ + os << " Library " << name << " - " << version << std::endl; + os << " ID : " << id << std::endl; + os << " Description : " << description << std::endl; + os << " Vendor : " << vendor << std::endl; + os << " Copyright : " << copyright << std::endl; + os << " Required : " << (isRequired ? "Yes" : "No") << std::endl; + + std::vector::const_iterator b = codfiles.begin(), e = codfiles.end(); + + os << " Files : " << std::endl; + for (; b != e; b++) + os << " - " << directory << "/" << (*b) << std::endl; +} + + +} // namespace ALX + +} // namespace Barry + diff -Nru barry-0.14/src/a_library.h barry-0.0.20110506/src/a_library.h --- barry-0.14/src/a_library.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_library.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,61 @@ +/// +/// \file a_library.h +/// ALX Library class based on CODSection class +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_LIBRARY_H__ +#define __BARRY_A_LIBRARY_H__ + +#include + +#include "dll.h" +#include "a_codsection.h" + + +namespace Barry { + +namespace ALX { + + +class BXEXPORT Library : public CODSection +{ +public: + Library(void); + Library(const xmlpp::SaxParser::AttributeList& attrs); + virtual ~Library(void); + + virtual void Dump(std::ostream &os) const; +}; + + +inline std::ostream& operator<<(std::ostream& os, const Library& app) +{ + app.Dump(os); + return os; +} + + +} // namespace ALX + +} // namespace Barry + +#endif + + diff -Nru barry-0.14/src/a_osloader.cc barry-0.0.20110506/src/a_osloader.cc --- barry-0.14/src/a_osloader.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_osloader.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,216 @@ +/// +/// \file a_osloader.cc +/// OS files parser (multi ALX files parser) +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include +#include +#include + +#include "a_osloader.h" +#include "a_alxparser.h" +#include "vsmartptr.h" +#include "error.h" + + +namespace Barry { + +namespace ALX { + + +OSLoader::OSLoader(void) +{ +} + + +OSLoader::~OSLoader(void) +{ +} + + +void OSLoader::Load(const std::string& pathname) +{ +#define ALX_FILE_EXT ".alx" + + int offset; + + struct dirent *entry; + + std::string alxfile; + const std::string ext = ALX_FILE_EXT; + + // At first, we have to read platform properties... + alxfile = pathname + "/Platform.alx"; + LoadALXFile(alxfile, false); + + // Then, we can read all ALX files + // Wrap it in a smart pointer so exceptions are safe + vLateSmartPtr path(&closedir); + path.reset( opendir(pathname.c_str()) ); + if( path.get() == NULL ) + throw Barry::ErrnoError("Could not opendir: " + pathname, errno); + + while ((entry = readdir(path.get())) != NULL) { + alxfile = entry->d_name; + + if (alxfile.length() < ext.length()) + continue; + + offset = alxfile.length() - ext.length(); + + // Ignore all files except ".alx" files + if (alxfile.substr(offset, ext.length()) != ALX_FILE_EXT) + continue; + + LoadALXFile(pathname + "/" + alxfile, true); + } +} + + +void OSLoader::LoadALXFile(const std::string& alxfile, const bool enable) +{ + std::ifstream file(alxfile.c_str()); + if( !file ) + throw Barry::Error("Cannot open ALX file: " + alxfile); + + ALX::ALXParser parser(*this, file); + + parser.Run(enable); + + file.close(); +} + + +void OSLoader::Dump(std::ostream &os) const +{ + os << "OS Properties :" << std::endl; + + { + std::map::const_iterator b = properties.begin(), e = properties.end(); + + for (; b != e; b++) { + os << " - " << (*b).first << " = " << (*b).second << std::endl; + } + } + + os << std::endl; + + os << "SFI File :" << std::endl; + os << " " << sfifile << std::endl; + os << std::endl; + + os << "Applications :" << std::endl; + + { + CODSectionList::const_iterator b = applications.begin(), e = applications.end(); + + for (; b != e; b++) { + os << (**b) << std::endl; + } + } + + os << "Libraries :" << std::endl; + + { + CODSectionList::const_iterator b = libraries.begin(), e = libraries.end(); + + for (; b != e; b++) { + os << (**b) << std::endl; + } + } +} + + +void OSLoader::AddProperties(const std::string& property, const std::string& value) +{ + properties[property] = value; + + if (property == "JVMLevel") + properties["Java"] = value; +} + + +void OSLoader::AddProperties(const xmlpp::SaxParser::AttributeList& attrs) +{ + for (xmlpp::SaxParser::AttributeList::const_iterator iter = attrs.begin(); iter != attrs.end(); ++iter) { + std::string attribut(iter->name); + std::string value(iter->value); + + AddProperties(attribut, value); + } +} + + +void OSLoader::SetSFIFile(const std::string& name) +{ + sfifile = name; +} + + +bool OSLoader::IsSupported(const xmlpp::SaxParser::AttributeList& attrs) +{ + if (properties.empty()) + return false; + + for (xmlpp::SaxParser::AttributeList::const_iterator iter = attrs.begin(); iter != attrs.end(); ++iter) { + std::string attribut(iter->name); + std::string value(iter->value); + + std::string s = properties[attribut]; + + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + std::transform(s.begin(), s.end(), s.begin(), ::tolower); + + if (value[0] == '~') { + value = value.substr(1, value.length()-1); + + if (s == value) + return false; + } + else { + if (s != value) + return false; + } + } + + return true; +} + + +void OSLoader::AddApplication(OSLoader::CODSectionPtr app) +{ + applications.push_back(app); +} + + +void OSLoader::AddLibrary(OSLoader::CODSectionPtr lib) +{ + libraries.push_back(lib); +} + + +} // namespace ALX + +} // namespace Barry + diff -Nru barry-0.14/src/a_osloader.h barry-0.0.20110506/src/a_osloader.h --- barry-0.14/src/a_osloader.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/a_osloader.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,99 @@ +/// +/// \file a_osloader.h +/// OS files parser (multi ALX files parser) +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_A_OSLOADER_H__ +#define __BARRY_A_OSLOADER_H__ + +#include +#include +#include + +#include "dll.h" +#include "a_application.h" +#include "a_library.h" +#include + + +#define OS_LANG_ENGLISH "" +#define OS_LANG_ARABIC "0x0001" +#define OS_LANG_CATALAN "0x0003" +#define OS_LANG_CZECH "0x0005" +#define OS_LANG_GERMAN "0x0007" +#define OS_LANG_SPANISH "0x000a" +#define OS_LANG_FRENCH "0x000c" +#define OS_LANG_HEBREW "0x000d" +#define OS_LANG_HUNGARIAN "0x000e" +#define OS_LANG_ITALIAN "0x0010" +#define OS_LANG_JAPANESE "0x0011" +#define OS_LANG_KOREAN "0x0012" + + +namespace Barry { + +namespace ALX { + +class BXEXPORT OSLoader +{ +public: + typedef std::tr1::shared_ptr CODSectionPtr; + typedef std::vector CODSectionList; + typedef std::map PropertyMap; + +private: + std::string sfifile; + CODSectionList applications; + CODSectionList libraries; + PropertyMap properties; + +public: + OSLoader(void); + ~OSLoader(void); + + void Load(const std::string& path); + /// Load ALX file, and if enable is true, register the applications + /// and libraries found inside it with this OSLoader class. + void LoadALXFile(const std::string& alxfile, const bool enable=true); + + void Dump(std::ostream &os) const; + + void AddProperties(const std::string& property, const std::string& value); + void AddProperties(const xmlpp::SaxParser::AttributeList& attrs); + void SetSFIFile(const std::string& name); + bool IsSupported(const xmlpp::SaxParser::AttributeList& attrs); + void AddApplication(CODSectionPtr app); + void AddLibrary(CODSectionPtr lib); +}; + + +inline std::ostream& operator<<(std::ostream& os, const OSLoader& osloader) +{ + osloader.Dump(os); + return os; +} + + +} // namespace ALX + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/backup.cc barry-0.0.20110506/src/backup.cc --- barry-0.14/src/backup.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/backup.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,92 @@ +/// +/// \file backup.cc +/// Special parser class to support creation of Barry Backup files +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "backup.h" +#include "tarfile.h" +#include "error.h" +#include +#include +#include + +namespace Barry { + +Backup::Backup(const std::string &tarpath) +{ + try { + m_tar.reset( new reuse::TarFile(tarpath.c_str(), true, + &reuse::gztar_ops_nonthread, true) ); + } + catch( reuse::TarFile::TarError &te ) { + throw Barry::BackupError(te.what()); + } +} + +Backup::~Backup() +{ + try { + Close(); + } + catch( Barry::BackupError & ) { + // throw it away + } +} + +void Backup::Close() +{ + if( m_tar.get() ) try { + m_tar->Close(); + m_tar.reset(); + } + catch( reuse::TarFile::TarError &te ) { + throw Barry::BackupError(te.what()); + } +} + + +////////////////////////////////////////////////////////////////////////////// +// Barry::Parser overrides + +void Backup::ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic) +{ + m_current_dbname = data.GetDBName(); + + std::ostringstream oss; + oss << std::hex << data.GetUniqueId() + << " " << (unsigned int)data.GetRecType(); + m_tar_id_text = oss.str(); + + if( m_current_dbname.size() == 0 ) + throw Barry::BackupError("Backup: No database name available"); + if( m_tar_id_text.size() == 0 ) + throw Barry::BackupError("Backup: No unique ID available!"); + + m_record_data.assign( + (const char*)data.GetData().GetData() + data.GetOffset(), + data.GetData().GetSize() - data.GetOffset()); + + // save to tarball + std::string tarname = m_current_dbname + "/" + m_tar_id_text; + m_tar->AppendFile(tarname.c_str(), m_record_data); +} + +} // namespace Barry + diff -Nru barry-0.14/src/backup.h barry-0.0.20110506/src/backup.h --- barry-0.14/src/backup.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/backup.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,60 @@ +/// +/// \file backup.h +/// Special parser class to support creation of Barry Backup files +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYBACKUP_BACKUP_H__ +#define __BARRYBACKUP_BACKUP_H__ + +#include "dll.h" +#include "parser.h" +#include +#include + +// forward declarations +namespace reuse { + class TarFile; +} + +namespace Barry { + +class BXEXPORT Backup : public Barry::Parser +{ +private: + std::auto_ptr m_tar; + + std::string m_current_dbname; + std::string m_tar_id_text; + std::string m_record_data; + +public: + explicit Backup(const std::string &tarpath); + ~Backup(); + + void Close(); + + // Barry::Parser overrides + virtual void ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic); +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/barryalx.h barry-0.0.20110506/src/barryalx.h --- barry-0.14/src/barryalx.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/barryalx.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,35 @@ +/// +/// \file barryalx.h +/// Main header file for libbarryalx +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_BARRYALX_H__ +#define __BARRY_BARRYALX_H__ + +// Include only the public backup / restore headers +// (not tarfile) +#include "a_common.h" +#include "a_codsection.h" +#include "a_library.h" +#include "a_application.h" +#include "a_osloader.h" +#include "a_alxparser.h" + +#endif + diff -Nru barry-0.14/src/barrybackup.h barry-0.0.20110506/src/barrybackup.h --- barry-0.14/src/barrybackup.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/barrybackup.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,31 @@ +/// +/// \file barrybackup.h +/// Main header file for libbarrybackup +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_BARRYBACKUP_H__ +#define __BARRY_BARRYBACKUP_H__ + +// Include only the public backup / restore headers +// (not tarfile) +#include "backup.h" +#include "restore.h" + +#endif + diff -Nru barry-0.14/src/barry.h barry-0.0.20110506/src/barry.h --- barry-0.14/src/barry.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/barry.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -51,6 +51,7 @@ #include "usbwrap.h" // to be moved to libusb someday #include "common.h" // Init() #include "error.h" // exceptions +#include "configfile.h" #include "probe.h" // device prober class #include "dataqueue.h" #include "socket.h" @@ -58,16 +59,36 @@ #include "protocol.h" // application-safe header #include "parser.h" #include "builder.h" -#include "record.h" #include "ldif.h" +#include "ldifio.h" #include "controller.h" #include "m_desktop.h" -#include "m_desktoptmpl.h" #include "m_ipmodem.h" #include "m_serial.h" +#include "m_javaloader.h" +#include "m_raw_channel.h" +#include "m_jvmdebug.h" #include "version.h" #include "log.h" #include "sha1.h" +#include "iconv.h" +#include "bmp.h" +#include "cod.h" +#include "record.h" +#include "threadwrap.h" +#include "vsmartptr.h" +#include "pipe.h" +#include "connector.h" + +// Include the JDW Debug Parser classes +#include "dp_codinfo.h" + +// Include the JDWP Server classes +#include "j_manager.h" +#include "j_server.h" + +// Include the template helpers after the record classes +#include "m_desktoptmpl.h" #ifdef __BARRY_BOOST_MODE__ // Boost serialization seems to be picky about header order, do them all here diff -Nru barry-0.14/src/barrysync.h barry-0.0.20110506/src/barrysync.h --- barry-0.14/src/barrysync.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/barrysync.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,35 @@ +/// +/// \file barrysync.h +/// Main header file for libbarrysync +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_BARRYSYNC_H__ +#define __BARRY_BARRYSYNC_H__ + +// Include the Sync and vFormat support classes +#include "tzwrapper.h" +#include "vbase.h" +#include "vcard.h" +#include "vevent.h" +#include "vjournal.h" +#include "vtodo.h" +#include "mimeio.h" + +#endif + diff -Nru barry-0.14/src/base64.cc barry-0.0.20110506/src/base64.cc --- barry-0.14/src/base64.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/base64.cc 2011-05-06 12:20:17.000000000 +0000 @@ -13,6 +13,7 @@ #include "base64.h" #include #include +#include #define TRUE 1 #define FALSE 0 @@ -34,13 +35,13 @@ public: base64_input(const std::string &input) : begin(input.begin()), end(input.end()) {} - + int operator()() { if (begin == end) { return EOF; } - return *begin++; + return (int)((unsigned int)(unsigned char) *begin++); } }; diff -Nru barry-0.14/src/bmp.cc barry-0.0.20110506/src/bmp.cc --- barry-0.14/src/bmp.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/bmp.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,164 @@ +/// +/// \file bmp.cc +/// BMP conversion routines +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "bmp.h" +#include "bmp-internal.h" +#include "error.h" +#include "endian.h" +#include "data.h" +#include "m_javaloader.h" + +namespace Barry { + +// +// GetTotalBitmapSize +// +/// Returns the total number of bytes needed to convert a +/// screenshot of the given dimensions into a bitmap, +/// using the ScreenshotToBitmap() function. +/// +BXEXPORT size_t GetTotalBitmapSize(const JLScreenInfo &info) +{ + return sizeof(bmp_file_header_t) + + sizeof(bmp_info_header_t) + + (info.width * info.height * 4); // 4 byte RGB per pixel + +} + +// +// ScreenshotToBitmap +// +/// Converts screenshot data obtained via JavaLoader::GetScreenshot() +/// into uncompressed bitmap format, suitable for writing BMP files. +/// Arguments info and screenshot come from GetScreenshot() and the +/// converted data is stored in bitmap. +/// +// +// This function assumes that the btoh() converter functions match +// the needs of the bitmap file format. Namely: little endian. +// +BXEXPORT void ScreenshotToBitmap(const JLScreenInfo &info, + const Data &screenshot, + Data &bitmap) +{ + // Read screen info + size_t width = info.width; + size_t height = info.height; + size_t total_bitmap_size = GetTotalBitmapSize(info); + + // make sure there is enough screeshot pixel data for the + // given width and height + if( screenshot.GetSize() < (width * height * 2) ) // 2 byte screenshot pixel data + throw Error("Screenshot data size is too small for given width+height"); + + + // setup write pointer + unsigned char *write = bitmap.GetBuffer(total_bitmap_size); + + // + // Build header BMP file + // + bmp_file_header_t *fileheader = (bmp_file_header_t*) write; + write += sizeof(bmp_file_header_t); + + // BMP + fileheader->bfType[0] = 'B'; + fileheader->bfType[1] = 'M'; + + // Size of file + fileheader->bfSize = btohl(total_bitmap_size); + + // Always 0x00 + fileheader->bfReserved1 = 0; + fileheader->bfReserved2 = 0; + + // Offset to find the data + fileheader->bfOffBits = btohl(sizeof(bmp_file_header_t) + sizeof(bmp_info_header_t)); + + + // + // Build info BMP file + // + bmp_info_header_t *infoheader = (bmp_info_header_t*) write; + write += sizeof(bmp_info_header_t); + + // Size of info section + infoheader->biSize = btohl(sizeof(bmp_info_header_t)); + + // Width x Height + infoheader->biWidth = btohl(width); + infoheader->biHeight = btohl(height); + + // Planes number + infoheader->biPlanes = btohs(0x01); + + // Bit count + infoheader->biBitCount = btohs(0x20); + + // Compression : No + infoheader->biCompression = 0; + + // Size of image + infoheader->biSizeImage = btohl(4 * width * height); + + // Pels Per Meter + infoheader->biXPelsPerMeter = 0; + infoheader->biYPelsPerMeter = 0; + + // Color palette used : None + infoheader->biClrUsed = 0; + + // Color palette important : None + infoheader->biClrImportant = 0; + + + // I work with 2 bytes (see the pixel format) + const uint16_t *data = (const uint16_t*) screenshot.GetData(); + size_t pixel_count = width * height; + + // For each pixel... (note BMP format is up and backwards, hence + // offset calculation for each pixel in for loop) + for (size_t j=0; j LSB + // ^^^^^^ : Blue (between 0x00 and 0x1F) + // ^^^^^^^ : Green (between 0x00 and 0x3F) + // ^^^^^^ : Red (between 0x00 and 0x1F) + + write[3] = 0x00; // alpha + write[2] = (((value >> 11) & 0x1F) * 0xFF) / 0x1F; // red + write[1] = (((value >> 5) & 0x3F) * 0xFF) / 0x3F; // green + write[0] = ((value & 0x1F) * 0xFF) / 0x1F; // blue + + write += 4; + } + } + + bitmap.ReleaseBuffer(total_bitmap_size); +} + +} // namespace Barry + diff -Nru barry-0.14/src/bmp.h barry-0.0.20110506/src/bmp.h --- barry-0.14/src/bmp.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/bmp.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,40 @@ +/// +/// \file bmp.h +/// BMP conversion routines +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_BMP_H__ +#define __BARRY_BMP_H__ + +#include "dll.h" +#include + +namespace Barry { + +class Data; +class JLScreenInfo; + +BXEXPORT size_t GetTotalBitmapSize(const JLScreenInfo &info); +BXEXPORT void ScreenshotToBitmap(const JLScreenInfo &info, + const Data &screenshot, Data &bitmap); + +} + +#endif + diff -Nru barry-0.14/src/bmp-internal.h barry-0.0.20110506/src/bmp-internal.h --- barry-0.14/src/bmp-internal.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/bmp-internal.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,65 @@ +/// +/// \file bmp-internal.h +/// BMP structures +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + See also: + http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#ifndef __BARRY_BMP_INTERNAL_H__ +#define __BARRY_BMP_INTERNAL_H__ + +#include "dll.h" +#include +#include +#include "platform.h" // safe to include platform.h here, since + // bmp-internal.h is not installed either + +#if USE_PACK_PRAGMA +#pragma pack(push, 1) +#endif + +typedef struct BXLOCAL { + char bfType[2]; // Contains always 'BM' + uint32_t bfSize; // Size of file + uint16_t bfReserved1; // 0x00 + uint16_t bfReserved2; // 0x00 + uint32_t bfOffBits; // Offset to find the raw data +} ATTRIBUTE_PACKED bmp_file_header_t; + +typedef struct BXLOCAL { + uint32_t biSize; // Size of struct itself + uint32_t biWidth; // Width of image + uint32_t biHeight; // Height of image + uint16_t biPlanes; // + uint16_t biBitCount; // + uint32_t biCompression; // + uint32_t biSizeImage; // Size of raw data + uint32_t biXPelsPerMeter; // + uint32_t biYPelsPerMeter; // + uint32_t biClrUsed; // + uint32_t biClrImportant; // +} ATTRIBUTE_PACKED bmp_info_header_t; + +#if USE_PACK_PRAGMA +#pragma pack(pop) +#endif + +#endif + diff -Nru barry-0.14/src/builder.cc barry-0.0.20110506/src/builder.cc --- barry-0.14/src/builder.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/builder.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,81 @@ +/// +/// \file builder.cc +/// Virtual protocol packet builder wrapper +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "builder.h" +#include +#include + +namespace Barry { + +////////////////////////////////////////////////////////////////////////////// +// DBDataBuilder class + + +DBDataBuilder::DBDataBuilder(const DBData &orig) + : m_orig(orig) +{ +} + +DBDataBuilder::~DBDataBuilder() +{ +} + +bool DBDataBuilder::BuildRecord(DBData &data, size_t &offset, + const IConverter *ic) +{ + if( offset == m_orig.GetOffset() ) { + data = m_orig; + } + else { + // copy the metadata + data.CopyMeta(m_orig); + + // copy the buffer, to the new offset + if( m_orig.GetOffset() > m_orig.GetData().GetSize() ) + throw std::logic_error("DBDataBuilder: offset greater than size"); + size_t actual = m_orig.GetData().GetSize() - m_orig.GetOffset(); + size_t total = offset + actual; + unsigned char *buf = data.UseData().GetBuffer(total); + memcpy(buf + offset, + m_orig.GetData().GetData() + m_orig.GetOffset(), + actual); + data.UseData().ReleaseBuffer(total); + + // set the new offset + data.SetOffset(offset); + } + return true; +} + +bool DBDataBuilder::FetchRecord(DBData &data, const IConverter *ic) +{ + data = m_orig; + return true; +} + +bool DBDataBuilder::EndOfFile() const +{ + return true; +} + +} // namespace Barry + + diff -Nru barry-0.14/src/builder.h barry-0.0.20110506/src/builder.h --- barry-0.14/src/builder.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/builder.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,9 +23,31 @@ #define __BARRY_BUILDER_H__ #include "dll.h" +#include "data.h" +#include +#include + +// +// This macro can be used to automatically generate code for all known +// record types. Just #undef HANDLE_BUILDER, then #define it to whatever +// you need, then use ALL_KNOWN_BUILDER_TYPES. See parser.cc for +// various examples. +// +// These are sorted so their GetDBName()'s will display in alphabetical order. +// +#define ALL_KNOWN_BUILDER_TYPES \ + HANDLE_BUILDER(Contact) \ + HANDLE_BUILDER(Calendar) \ + HANDLE_BUILDER(CalendarAll) \ + HANDLE_BUILDER(ContentStore) \ + HANDLE_BUILDER(Memo) \ + HANDLE_BUILDER(Task) \ namespace Barry { +// forward declarations +class IConverter; + // // Builder class // @@ -40,28 +62,86 @@ Builder() {} virtual ~Builder() {} - /// Called first in the sequence, to allow the application to - /// load the needed data from memory, disk, etc. If successful, - /// return true. If at the end of the series, return false. - virtual bool Retrieve(unsigned int databaseId) = 0; - - /// Called to retrive the unique ID for this record. - virtual uint8_t GetRecType() const = 0; - virtual uint32_t GetUniqueId() const = 0; - - /// Called before BuildFields() in order to build the header - /// for this record. Store the raw data in data, at the - /// offset given in offset. When finished, update offset to - /// point to the next spot to put new data. - virtual void BuildHeader(Data &data, size_t &offset) = 0; - /// Called to build the record field data. Store the raw data /// in data, using offset to know where to write. Be sure to /// update offset, and be sure to adjust the size of the data /// packet (possibly with Data::ReleaseBuffer()). - virtual void BuildFields(Data &data, size_t &offset) = 0; + /// + /// Returns true if successful, and false if at the end of + /// the series. Note that if EndOfFile() is false after + /// this function returns false, then there may be another + /// series available, which the next call to BuildRecord() + /// will determine. + /// + virtual bool BuildRecord(DBData &data, size_t &offset, + const IConverter *ic) = 0; + + /// Same as BuildRecord, but does not care about any offsets. + /// The caller should call DBData::GetOffset() afterward + /// to discover if there is an offset to the result. + /// + /// This is usually the fastest of the two functions, since + /// extra copying may be required if a specific offset is + /// given. When building records from Record classes, both + /// functions are the same speed. But when building records + /// from the device, the device decides the offset, so FetchRecord() + /// is faster, since BuildRecord requires a copy to adjust + /// to the right offset. + /// + /// The caller should use the function that results in the least + /// amount of copying for the caller. If the caller doesn't + /// care about where the resulting record is in data, use + /// FetchRecord(). + /// + virtual bool FetchRecord(DBData &data, const IConverter *ic) = 0; + + /// Sometimes a builder can have multiple databases stored + /// in it, so when Build/Fetch returns false, check if there + /// is more data with this function. This function is + /// not used by database-oriented functions, but by pipe- + /// oriented functions. + virtual bool EndOfFile() const = 0; +}; + + +// +// DBDataBuilder +// +/// Wrapper class around a DBData object, to make it easy to pass a DBData +/// object into a function or API that requires a builder. The main +/// advantage to this is that the Builder API allows for movement of +/// data, depending on the required offsets. +/// +class BXEXPORT DBDataBuilder : public Builder +{ + const DBData &m_orig; + +public: + explicit DBDataBuilder(const DBData &orig); + virtual ~DBDataBuilder(); + + virtual bool BuildRecord(DBData &data, size_t &offset, + const IConverter *ic); + virtual bool FetchRecord(DBData &data, const IConverter *ic); + virtual bool EndOfFile() const; }; +// +// SetDBData +// +/// Contains the proper way to convert a record object into a DBData object. +/// +template +void SetDBData(const RecordT &rec, DBData &data, size_t &offset, + const IConverter *ic) +{ + data.SetVersion(DBData::REC_VERSION_1); + data.SetOffset(offset); + data.SetDBName(RecordT::GetDBName()); + data.SetIds(rec.GetRecType(), rec.GetUniqueId()); + rec.BuildHeader(data.UseData(), offset); + rec.BuildFields(data.UseData(), offset, ic); +} // // RecordBuilder template class @@ -88,19 +168,31 @@ { StorageT *m_storage; bool m_owned; + bool m_record_loaded; + bool m_end_of_file; RecordT m_rec; public: /// Constructor that references an externally managed storage object. RecordBuilder(StorageT &storage) - : m_storage(&storage), m_owned(false) {} + : m_storage(&storage) + , m_owned(false) + , m_record_loaded(false) + , m_end_of_file(false) + { + } /// Constructor that references a locally managed storage object. /// The pointer passed in will be stored, and freed when this class /// is destroyed. It is safe to call this constructor with /// a 'new'ly created storage object. RecordBuilder(StorageT *storage) - : m_storage(storage), m_owned(true) {} + : m_storage(storage) + , m_owned(true) + , m_record_loaded(false) + , m_end_of_file(false) + { + } ~RecordBuilder() { @@ -108,31 +200,30 @@ delete m_storage; } - virtual bool Retrieve(unsigned int databaseId) + virtual bool BuildRecord(DBData &data, size_t &offset, + const IConverter *ic) { - return (*m_storage)(m_rec, databaseId); - } + if( m_end_of_file ) + return false; - virtual uint8_t GetRecType() const - { - return m_rec.GetRecType(); - } + if( !(*m_storage)(m_rec, *this) ) { + m_end_of_file = true; + return false; + } - virtual uint32_t GetUniqueId() const - { - return m_rec.GetUniqueId(); + SetDBData(m_rec, data, offset, ic); + return true; } - /// Functor member called by Controller::SaveDatabase() during - /// processing. - virtual void BuildHeader(Data &data, size_t &offset) + virtual bool FetchRecord(DBData &data, const IConverter *ic) { - m_rec.BuildHeader(data, offset); + size_t offset = 0; + return BuildRecord(data, offset, ic); } - virtual void BuildFields(Data &data, size_t &offset) + virtual bool EndOfFile() const { - m_rec.BuildFields(data, offset); + return m_end_of_file; } }; @@ -151,7 +242,7 @@ public: RecordFetch(const RecordT &rec) : m_rec(rec), m_done(false) {} - bool operator()(RecordT &rec, unsigned int dbId) const + bool operator()(RecordT &rec, Builder &) const { if( m_done ) return false; diff -Nru barry-0.14/src/cbarry.h barry-0.0.20110506/src/cbarry.h --- barry-0.14/src/cbarry.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/cbarry.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ */ /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/clog.h barry-0.0.20110506/src/clog.h --- barry-0.14/src/clog.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/clog.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,38 @@ +/// +/// \file clog.h +/// C oriented logging routines for Barry +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CLOG_H__ +#define __BARRY_CLOG_H__ + +#include "dll.h" + +#ifdef __cplusplus +extern "C" { +#endif + +BXEXPORT void BarryLogf(int verbose, const char *msg, ...) BARRY_GCC_FORMAT_CHECK(2, 3); + +#ifdef __cplusplus +} +#endif + +#endif // __BARRY_CLOG_H__ + diff -Nru barry-0.14/src/cod.cc barry-0.0.20110506/src/cod.cc --- barry-0.14/src/cod.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/cod.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,221 @@ +/// +/// \file cod.cc +/// COD file API +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2009, Josh Kropf + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "cod.h" +#include "cod-internal.h" +#include "error.h" +#include "endian.h" +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_ZLIB + #include +#endif + +using namespace std; + +namespace Barry { + + +size_t SeekNextCod(std::istream &input) +{ + unsigned char codtype_simple[] = CODFILE_TYPE_SIMPLE; + char codtype_pkzip[] = CODFILE_TYPE_PKZIP; + char local_file_sig[] = PKZIP_LOCAL_FILE_SIG; + char directory_sig[] = PKZIP_DIRECTORY_SIG; + + char signature[4]; + + // finished reading stream containing single cod file + input.peek(); + if( input.eof() ) { + return 0; + } + + if( input.read(signature, sizeof(signature)).eof() ) { + throw Error("SeekNextCod: EOF while reading file signature"); + } + + if( memcmp(signature, codtype_pkzip, sizeof(codtype_pkzip)) == 0 ) { + + if( memcmp(signature, local_file_sig, sizeof(signature)) == 0 ) { + pkzip_local_header_t header; + + if( input.read((char *)&header, sizeof(pkzip_local_header_t)).eof() ) { + throw Error("SeekNextCod: EOF while reading PKZIP header"); + } + + // skip cod file name and extra field, we don't need them + size_t skip_len = header.file_name_length + header.extra_field_length; + if( input.ignore(skip_len).eof() ) { + throw Error("SeekNextCod: EOF while skipping unused fields"); + } + + return btohl(header.compressed_size); + } + else if( memcmp(signature, directory_sig, sizeof(signature)) == 0 ) { + // done reading when central directory is reached + return 0; + } + } + else if( memcmp(signature, codtype_simple, sizeof(codtype_simple)) == 0 ) { + // find and return size of cod file + if( input.seekg(0, ios::end).fail() ) { + throw Error("SeekNextCod: seek to end failed"); + } + + uint32_t size = input.tellg(); + + if( input.seekg(0, ios::beg).fail() ) { + throw Error("SeekNextCod: seek to start failed"); + } + + return size; + } + else { + throw Error("SeekNextCod: unknown COD file signature"); + } + + return 0; +} + + +CodFileBuilder::CodFileBuilder(const std::string &module_name, size_t module_count) + : m_module_name(module_name) + , m_module_count(module_count) + , m_current_module(0) +{ +} + +CodFileBuilder::~CodFileBuilder() +{ +} + +void CodFileBuilder::WriteNextHeader(std::ostream &output, const uint8_t* module_buffer, uint32_t module_size) +{ + // ignored for single module .cod files (simple .cod file) + if( m_module_count == 1 ) { + return; + } + + // 32bit CRC of module in file header and directory entry + // using zero for CRC will result in warnings when inflating .cod file + uint32_t crc = 0; + +#ifdef HAVE_ZLIB + crc = crc32(0, NULL, module_size); + crc = crc32(crc, module_buffer, module_size); +#endif + + // .cod file name for siblings have hyphenated index number, name-1.cod + std::ostringstream file_name(m_module_name, ios::app); + if( m_current_module == 0 ) + file_name << ".cod"; + else + file_name << "-" << m_current_module << ".cod"; + + // current stream pointer is relative offset to start of file entry + uint32_t entry_offset = output.tellp(); + + // structures for the local file entry and central directory entry + pkzip_local_header_t header; + pkzip_directory_t entry; + + // zero both structs, most fields are zero + memset(&header, 0, sizeof(pkzip_local_header_t)); + memset(&entry, 0, sizeof(pkzip_directory_t)); + + char header_sig[] = PKZIP_LOCAL_FILE_SIG; + output.write(header_sig, sizeof(header_sig)); + + // version is always 0x00A0 = 'Windows NTFS' + header.version_needed = htobs(10); + + // time and date fields seem to randomly have invalid or fixed values + // just leave them as zero + //header.last_mod_time + //header.last_mod_date + + header.crc_32 = htobl(crc); + header.compressed_size = htobl(module_size); + header.uncompressed_size = htobl(module_size); + header.file_name_length = htobs(file_name.str().length()); + + // the very first cod sibling to be written has an extra field + // length equal to 4, with all zeros in the field itself + // all subsequent siblings have a zero length extra field + //header.extra_field_length = htobs(4); + + output.write((char *)&header, sizeof(pkzip_local_header_t)); + output << file_name.str(); + + char footer_sig[] = PKZIP_DIRECTORY_SIG; + + // version is always 0x00A0 = 'Windows NTFS' + entry.version_madeby = htobs(10); + entry.version_needed = htobs(10); + + entry.crc_32 = htobl(crc); + entry.compressed_size = htobl(module_size); + entry.uncompressed_size = htobl(module_size); + entry.file_name_length = htobs(file_name.str().length()); + entry.relative_offset = htobl(entry_offset); + + m_directory.write(footer_sig, sizeof(footer_sig)); + m_directory.write((char*)&entry, sizeof(pkzip_directory_t)); + m_directory << file_name.str(); + + m_current_module ++; +} + +void CodFileBuilder::WriteFooter(std::ostream &output) +{ + // ignored for single module .cod files (simple .cod file) + if( m_module_count == 1 ) { + return; + } + + pkzip_end_directory_t end; + memset(&end, 0, sizeof(pkzip_end_directory_t)); + + end.this_disk_entry_count = htobs(m_current_module); + end.total_entry_count = htobs(m_current_module); + end.directory_length = htobl(m_directory.str().length()); + + // current stream pointer is relative offset to start of directory + end.directory_offset = output.tellp(); + + char sig[] = PKZIP_END_DIRECTORY_SIG; + + output.write(m_directory.str().data(), m_directory.str().length()); + output.write(sig, sizeof(sig)); + output.write((char *)&end, sizeof(pkzip_end_directory_t)); +} + + +} // namespace Barry + diff -Nru barry-0.14/src/cod.h barry-0.0.20110506/src/cod.h --- barry-0.14/src/cod.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/cod.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,99 @@ +/// +/// \file cod.h +/// COD file API +/// + +/* + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_COD_H__ +#define __BARRY_COD_H__ + +#include "dll.h" +#include "data.h" +#include +#include +#include +#include + +namespace Barry { + + +// +// SeekNextCod +// +/// Seeks the input stream to the next packed sibling .cod file and returns +/// the packed .cod file size. When all siblings have been read, zero is +/// returned. +/// +/// When input stream does not contain the signature for a packed .cod file, +/// it's assumed the entire stream is the .cod file. +/// +/// \param input stream to read from +/// +/// \return size of next packed .cod file, or 0 finished reading .cod files +/// +size_t SeekNextCod(std::istream &input); + + +/// +/// The CodFileBuilder class is used to assemble multiple .cod files into +/// a single packed .cod file using the pkzip file format. +/// +class BXEXPORT CodFileBuilder +{ + std::string m_module_name; + + size_t m_module_count; + unsigned int m_current_module; + + std::ostringstream m_directory; + +public: + CodFileBuilder(const std::string &module_name, size_t module_count = 1); + + ~CodFileBuilder(); + + /// + /// Writes packed .cod file header to the output stream, and appends + /// an entry to the central directory. If the module count used to + /// create CodFileBuilder is equal to one, the call is ignored. + /// + /// Note: it is the caller's responsibility to write the actual + /// COD file data after calling this function. + /// + /// \param output stream to write to + /// + /// \param buffer buffered .cod file data, input to CRC-32 function + /// + /// \param module_size total size of .cod file data + /// + void WriteNextHeader(std::ostream &output, const uint8_t* buffer, + uint32_t module_size); + + /// + /// Write the central directory and central directory ending indicator + /// to the output stream. + /// + /// \param output stream to write to + /// + void WriteFooter(std::ostream &output); +}; + +} + +#endif + diff -Nru barry-0.14/src/cod-internal.h barry-0.0.20110506/src/cod-internal.h --- barry-0.14/src/cod-internal.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/cod-internal.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,172 @@ +/// +/// \file cod-internal.h +/// COD structure +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2009, Josh Kropf + See also: + http://drbolsen.wordpress.com/2006/07/26/blackberry-cod-file-format/ + http://drbolsen.wordpress.com/2006/08/11/10/ + http://www.pkware.com/documents/casestudies/APPNOTE.TXT + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#ifndef __BARRY_COD_INTERNAL_H__ +#define __BARRY_COD_INTERNAL_H__ + +#include "dll.h" +#include +#include +#include "platform.h" // safe to include platform.h here, since + // cod-internal.h is not installed either + +#if USE_PACK_PRAGMA +#pragma pack(push, 1) +#endif + +#define CODFILE_TYPE_SIMPLE {0xDE, 0xC0} +#define CODFILE_TYPE_PKZIP {0x50, 0x4B} +#define PKZIP_LOCAL_FILE_SIG {0x50, 0x4B, 0x03, 0x04} +#define PKZIP_DIRECTORY_SIG {0x50, 0x4B, 0x01, 0x02} +#define PKZIP_END_DIRECTORY_SIG {0x50, 0x4B, 0x05, 0x06} + + +typedef struct BXLOCAL { + uint16_t hour:5; + uint16_t minute:6; + uint16_t second:5; +} ATTRIBUTE_PACKED msdos_time_t; + + +typedef struct BXLOCAL { + uint16_t year:7; // number of years since 1980 + uint16_t month:4; + uint16_t day:5; +} ATTRIBUTE_PACKED msdos_date_t; + + +typedef struct BXLOCAL { + //uint8_t signature[4]; // PKZIP local file header 0x504B0304 + uint16_t version_needed; // version needed to extract, 0x0A00 + uint16_t general_flag; // general purpose bit flag, 0x0000 + uint16_t compression_method; // compression method, 0x0000 = stored, no compression + msdos_time_t last_mod_time; + msdos_date_t last_mod_date; + uint32_t crc_32; + uint32_t compressed_size; // compression method is 'stored' + uint32_t uncompressed_size; // both sizes are equal + uint16_t file_name_length; + uint16_t extra_field_length; + //char file_name[variable]; + //char extra_field[variable]; +} ATTRIBUTE_PACKED pkzip_local_header_t; + + +typedef struct BXLOCAL { + //uint8_t signature[4]; // PKZIP central directory 0x504B0304 + uint16_t version_madeby; // version used to compress, 0x0A00 + uint16_t version_needed; // version needed to extract, 0x0A00 + uint16_t general_flag; // general purpose bit flag, 0x0000 + uint16_t compression_method; // compression method, 0x0000 = stored, no compression + msdos_time_t last_mod_time; + msdos_date_t last_mod_date; + uint32_t crc_32; + uint32_t compressed_size; // size of corresponding local file entry + uint32_t uncompressed_size; // both sizes are equal + uint16_t file_name_length; + uint16_t extra_field_length; + uint16_t file_comment_length; + uint16_t disk_number; // number of the disk on which this file begins, always zero + uint16_t internal_file_attr; // always zero + uint32_t external_file_attr; // always zero + uint32_t relative_offset; // offset from beginning of this disk (this zip file) + // to start of corresponding local file entry + //char file_name[variable]; + //char extra_field[variable]; + //char file_comment[variable]; +} ATTRIBUTE_PACKED pkzip_directory_t; + + +typedef struct BXLOCAL { + //uint8_t signature[4]; // PKZIP end central directory 0x504B0506 + uint16_t this_disk_number; // number of this disk, always zero + uint16_t disk_with_first; // number of the disk with the start of + // central directory, always zero + uint16_t this_disk_entry_count; // total number of entries in the central directory on this disk + uint16_t total_entry_count; // total number of entries in the central directory + // always equals this_disk_entry_count + uint32_t directory_length; // total size of the central directory + uint32_t directory_offset; // offset from beginning of this disk (this zip file) + // to the first central directory entry + uint16_t file_comment_length; + //char file_comment[variable]; +} ATTRIBUTE_PACKED pkzip_end_directory_t; + + +typedef struct BXLOCAL { + uint16_t type; // Type // 50 4B + uint8_t unknown1[8]; // // 03 04 0A 00 00 00 00 00 + uint8_t unknown2[4]; // // AB 5C 6A 39 + uint8_t unknown3[4]; // // BE 5C 58 D1 + uint32_t size1; // COD size 0x0DCC // CC 0D 01 00 + uint32_t size2; // COD size 0x0DCC // CC OD 01 00 + uint8_t strsize; // Size of string // 19 + uint8_t reserved2; // Reserved 0x00 // 00 + uint8_t strfree; // Empty uint8_t // 04 + uint8_t reserved3; // Reserved 0x00 // 00 +} ATTRIBUTE_PACKED codfile_header_t; + + +typedef struct BXLOCAL { + uint32_t flashid; + uint32_t section_number; // always 0 + uint32_t vtable_pointer; // always 0 + time_t timestamp; + uint32_t user_version; + uint32_t fieldref_pointer; + uint16_t maxtype_list_size; + uint16_t reserved; // always 0xFF + int32_t data_section; // always 0xFFFF + int32_t module_info; // always 0xFFFF + uint16_t version; + uint16_t code_size; + uint16_t data_size; + uint16_t flags; +} ATTRIBUTE_PACKED code_header_t; + + +typedef struct BXLOCAL { + uint8_t flags; + uint8_t version; + uint16_t num_icalls; + uint8_t num_modules; + uint8_t num_classes ; + uint16_t exported_string_offset; + uint16_t data_uint8_ts_offset; + uint16_t empty_field; + uint16_t class_definitions; + uint16_t array_of_unknow1_fields[14]; + uint16_t aliases; + uint16_t array_of_unknow2_fields[22]; +} ATTRIBUTE_PACKED data_header_t; + +#if USE_PACK_PRAGMA +#pragma pack(pop) +#endif + +#endif + diff -Nru barry-0.14/src/common.cc barry-0.0.20110506/src/common.cc --- barry-0.14/src/common.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/common.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,9 +20,13 @@ */ #include "common.h" -#include #include #include "debug.h" +#include "publiccfg.h" + +#if USE_LIBUSB +#include +#endif namespace Barry { @@ -38,22 +42,79 @@ /// Barry library initializer. Call this before anything else. /// This takes care of initializing the lower level libusb. /// +/// This function is safe to be called multiple times. The +/// data_dump_mode and the log stream will be updated each time +/// it is called, but the USB library will not be re-initialized. +/// /// \param[in] data_dump_mode If set to true, the protocol conversation -/// will be sent to stdout via the C++ std::cout -/// stream. +/// will be sent to the logStream specified +/// in the second argument. /// \param[in] LogStream Pointer to std::ostream object to use for /// debug output and logging. Defaults to /// std::cout. /// void Init(bool data_dump_mode, std::ostream *logStream) { + static bool initialized = false; + +#if USE_LIBUSB + // set usb debug mode first, so that USB's initialization + // is captured too if( data_dump_mode ) usb_set_debug(9); - usb_init(); +#endif + + // perform one-time initalization + if( !initialized ) { + // if the environment variable USB_DEBUG is set, that + // level value will be used instead of our 9 above... + // if you need to *force* this to 9, call Verbose(true) + // after Init() +#if USE_LIBUSB + usb_init(); +#endif + + // only need to initialize this once + pthread_mutex_init(&LogStreamMutex, NULL); + + // done + initialized = true; + } __data_dump_mode__ = data_dump_mode; LogStream = logStream; - pthread_mutex_init(&LogStreamMutex, NULL); +} + +// +// Verbose +// +/// This API call lets the application enable / disable verbose debug +/// output on the fly. +/// +/// \param[in] data_dump_mode If set to true, the protocol conversation +/// will be sent to the logStream specified +/// in the Barry::Init() call. +/// +void Verbose(bool data_dump_mode) +{ + __data_dump_mode__ = data_dump_mode; + +#if USE_LIBUSB + if( data_dump_mode ) + usb_set_debug(9); + else + usb_set_debug(0); +#endif +} + +// +// IsVerbose +// +/// Returns true if data dump mode is enabled. +/// +bool IsVerbose() +{ + return __data_dump_mode__; } } // namespace Barry diff -Nru barry-0.14/src/common.h barry-0.0.20110506/src/common.h --- barry-0.14/src/common.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/common.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,21 +28,32 @@ #define VENDOR_RIM 0x0fca #define PRODUCT_RIM_BLACKBERRY 0x0001 #define PRODUCT_RIM_PEARL_DUAL 0x0004 +#define PRODUCT_RIM_PEARL_FLIP 0x8001 // 8200 series #define PRODUCT_RIM_PEARL_8120 0x8004 #define PRODUCT_RIM_PEARL 0x0006 +#define PRODUCT_RIM_STORM 0x8007 +#define BLACKBERRY_INTERFACE 0 #define BLACKBERRY_CONFIGURATION 1 #define BLACKBERRY_DB_CLASS 0xff +#define IPRODUCT_RIM_HANDHELD 2 +#define IPRODUCT_RIM_MASS_STORAGE 4 +#define IPRODUCT_RIM_COMPOSITE 5 + // minimum number of password tries remaining at which Barry gives up // for safety #define BARRY_MIN_PASSWORD_TRIES 3 #define BARRY_MIN_PASSWORD_TRIES_ASC "3" +#define BLACKBERRY_CHARSET "WINDOWS-1252" + namespace Barry { /// See also the LogLock class. BXEXPORT void Init(bool data_dump_mode = false, std::ostream *logStream = &std::cout); +BXEXPORT void Verbose(bool data_dump_mode = true); +BXEXPORT bool IsVerbose(); } // namespace Barry diff -Nru barry-0.14/src/configfile.cc barry-0.0.20110506/src/configfile.cc --- barry-0.14/src/configfile.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/configfile.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,488 @@ +/// +/// \file configfile.cc +/// Barry configuraion class, for one device PIN +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "configfile.h" +#include "error.h" +#include "r_message.h" +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Barry { + +bool ConfigFile::DBListType::IsSelected(const std::string &dbname) const +{ + const_iterator i = begin(); + for( ; i != end(); ++i ) { + if( *i == dbname ) { + return true; + } + } + return false; +} + + +////////////////////////////////////////////////////////////////////////////// +// ConfigFile class members + +/// Loads config file for the given pin, and ends up in an +/// unenlightened state. Throws ConfigFileError on error, +/// but it is not an error if the config does not exist. +/// Never use this if you have a DatabaseDatabase object! +/// This ctor is only for temporary loading of config data. +ConfigFile::ConfigFile(Barry::Pin pin) + : m_pin(pin) + , m_loaded(false) + , m_promptBackupLabel(false) +{ + if( m_pin == 0 ) + throw ConfigFileError("Configfile: empty pin"); + + BuildFilename(); + BuildDefaultPath(); // this handles the situation that path is not set + Load(); +} + +/// Opens and loads config file for given pin, and calls Enlighten +/// Throws ConfigFileError on error. Should never fail unless +/// passed a bad pin. +ConfigFile::ConfigFile(Barry::Pin pin, + const Barry::DatabaseDatabase &db) + : m_pin(pin) + , m_loaded(false) + , m_promptBackupLabel(false) +{ + if( m_pin == 0 ) + throw ConfigFileError("Configfile: empty pin"); + + BuildFilename(); + BuildDefaultPath(); + Load(); + Enlighten(db); +} + +ConfigFile::~ConfigFile() +{ +} + +void ConfigFile::BuildFilename() +{ + size_t strsize = 255 * 5; + char *strbuf = new char[strsize]; + struct passwd pwbuf; + struct passwd *pw; + + getpwuid_r(getuid(), &pwbuf, strbuf, strsize, &pw); + if( !pw ) { + delete [] strbuf; + throw ConfigFileError("BuildFilename: getpwuid failed", errno); + } + + m_filename = pw->pw_dir; + m_filename += "/.barry/backup/"; + m_filename += m_pin.Str(); + m_filename += "/config"; + + delete [] strbuf; +} + +void ConfigFile::BuildDefaultPath() +{ + struct passwd *pw = getpwuid(getuid()); + m_path = pw->pw_dir; + m_path += "/.barry/backup/"; + m_path += m_pin.Str(); +} + +void ConfigFile::Clear() +{ + m_loaded = false; + m_backupList.clear(); + m_restoreList.clear(); + m_deviceName.clear(); + m_promptBackupLabel = false; +} + +/// Attempt to load the configuration file, but do not fail if not available +void ConfigFile::Load() +{ + // start fresh + Clear(); + + // open input file + std::ifstream in(m_filename.c_str(), std::ios::in | std::ios::binary); + if( !in ) + return; + + std::string line; + DBListType *pList = 0; + + while( std::getline(in, line) ) { + std::string keyword; + std::istringstream iss(line); + iss >> keyword; + + if( keyword == "backup_list" ) { + pList = &m_backupList; + } + else if( keyword == "restore_list" ) { + pList = &m_restoreList; + } + else if( line[0] == ' ' && pList ) { + pList->push_back(line.c_str() + 1); + } + else { + pList = 0; + + // add all remaining keyword checks here + if( keyword == "device_name" ) { + iss >> std::ws; + std::getline(iss, m_deviceName); + if( m_deviceName.size() == 0 ) { + // if there is a device_name setting, + // then this value must hold something, + // so that the user can ignore this + // field, and not get pestered all + // the time + m_deviceName = " "; + } + } + else if( keyword == "backup_path" ) { + iss >> std::ws; + std::getline(iss, m_path); + if( (m_path.size() == 0) || !(CheckPath(m_path))) + BuildDefaultPath(); + } + else if( keyword == "prompt_backup_label" ) { + int flag; + iss >> flag; + m_promptBackupLabel = flag; + } + } + } + + m_loaded = true; +} + +/// Saves current device's config, overwriting or creating a config file +bool ConfigFile::Save() +{ + if( !CheckPath(m_path, &m_last_error) ) + return false; + + std::ofstream out(m_filename.c_str(), std::ios::out | std::ios::binary); + if( !out ) { + m_last_error = "Unable to open " + m_filename + " for writing."; + return false; + } + + out << "backup_list" << std::endl; + for( DBListType::iterator i = m_backupList.begin(); i != m_backupList.end(); ++i ) { + out << " " << *i << std::endl; + } + + out << "restore_list" << std::endl; + for( DBListType::iterator i = m_restoreList.begin(); i != m_restoreList.end(); ++i ) { + out << " " << *i << std::endl; + } + + if( m_deviceName.size() ) { + out << "device_name " << m_deviceName << std::endl; + } + + if( m_path.size() ) { + out << "backup_path " << m_path << std::endl; + } + + out << "prompt_backup_label " << (m_promptBackupLabel ? 1 : 0) << std::endl; + + if( !out ) { + m_last_error = "Error during write. Config may be incomplete."; + return false; + } + return true; +} + +/// Compares a given databasedatabase from a real device with the +/// current config. If not yet configured, initialize with valid +/// defaults. +void ConfigFile::Enlighten(const Barry::DatabaseDatabase &db) +{ + if( !m_loaded ) { + // if not fully loaded, we use db as our default list + // our defaults are: backup everything, restore everything + // except email + + m_backupList.clear(); + m_restoreList.clear(); + + Barry::DatabaseDatabase::DatabaseArrayType::const_iterator i = + db.Databases.begin(); + for( ; i != db.Databases.end(); ++i ) { + // backup everything + m_backupList.push_back(i->Name); + + // restore everything except email (which could take ages) + // and Handheld Agent (which seems write protected) + if( i->Name != Barry::Message::GetDBName() && + i->Name != "Handheld Agent" ) + { + m_restoreList.push_back(i->Name); + } + } + } +} + +/// Sets list with new config +void ConfigFile::SetBackupList(const DBListType &list) +{ + m_backupList = list; + m_loaded = true; +} + +void ConfigFile::SetRestoreList(const DBListType &list) +{ + m_restoreList = list; + m_loaded = true; +} + +void ConfigFile::SetDeviceName(const std::string &name) +{ + if( name.size() ) + m_deviceName = name; + else + m_deviceName = " "; +} + +void ConfigFile::SetBackupPath(const std::string &path) +{ + if( path.size() && CheckPath(path) ) + m_path = path; + else + BuildDefaultPath(); +} + +void ConfigFile::SetPromptBackupLabel(bool prompt) +{ + m_promptBackupLabel = prompt; +} + +/// Checks that the path in path exists, and if not, creates it. +/// Returns false if unable to create path, true if ok. +bool ConfigFile::CheckPath(const std::string &path, std::string *perr) +{ + if( path.size() == 0 ) { + if( perr ) + *perr = "path is empty!"; + return false; + } + + if( access(path.c_str(), F_OK) == 0 ) + return true; + + std::string base; + std::string::size_type slash = 0; + while( (slash = path.find('/', slash + 1)) != std::string::npos ) { + base = path.substr(0, slash); + if( access(base.c_str(), F_OK) != 0 ) { + if( mkdir(base.c_str(), 0755) == -1 ) { + if( perr ) { + *perr = "mkdir(" + base + ") failed: "; + *perr += strerror(errno); + } + return false; + } + } + } + if( mkdir(path.c_str(), 0755) == -1 ) { + if( perr ) { + *perr = "last mkdir(" + path + ") failed: "; + *perr += strerror(errno); + } + return false; + } + return true; +} + + + +////////////////////////////////////////////////////////////////////////////// +// GlobalConfigFile class members + +GlobalConfigFile::GlobalConfigFile() + : m_loaded(false) + , m_verboseLogging(false) +{ + BuildFilename(); + Load(); +} + +GlobalConfigFile::GlobalConfigFile(const std::string &appname) + : m_loaded(false) + , m_appname(appname) + , m_verboseLogging(false) +{ + // there can be no spaces in the appname + if( m_appname.find(' ') != std::string::npos ) + throw std::logic_error("App name must have no spaces."); + + BuildFilename(); + Load(); +} + +GlobalConfigFile::~GlobalConfigFile() +{ +} + +void GlobalConfigFile::BuildFilename() +{ + struct passwd *pw = getpwuid(getuid()); + if( !pw ) + throw ConfigFileError("BuildFilename: getpwuid failed", errno); + + m_filename = pw->pw_dir; + m_filename += "/.barry/config"; + + // build the global path too, since this never changes + m_path = pw->pw_dir; + m_path += "/.barry"; +} + +void GlobalConfigFile::Clear() +{ + m_loaded = false; + m_lastDevice = 0; +} + +void GlobalConfigFile::Load() +{ + // start fresh + Clear(); + + // open input file + std::ifstream in(m_filename.c_str(), std::ios::in | std::ios::binary); + if( !in ) + return; + + std::string line; + + while( std::getline(in, line) ) { + std::string keyword; + std::istringstream iss(line); + iss >> keyword; + + if( keyword == "last_device" ) { + iss >> std::ws; + m_lastDevice.Clear(); + iss >> m_lastDevice; + } + else if( keyword == "verbose_logging" ) { + int flag = 0; + iss >> flag; + m_verboseLogging = flag; + } + else { + // store any other keys as app keys + if( keyword.substr(0, 2) == "X-" ) { + iss >> std::ws; + line.clear(); + std::getline(iss, line); + m_keymap[keyword] = line; + } + } + } + + m_loaded = true; +} + +/// Save the current global config, overwriting or creating as needed +bool GlobalConfigFile::Save() +{ + if( !ConfigFile::CheckPath(m_path, &m_last_error) ) + return false; + + std::ofstream out(m_filename.c_str(), std::ios::out | std::ios::binary); + if( !out ) { + m_last_error = "Unable to open " + m_filename + " for writing."; + return false; + } + + if( !(m_lastDevice == 0) ) { + out << "last_device " << m_lastDevice.Str() << std::endl; + } + + out << "verbose_logging " << (m_verboseLogging ? 1 : 0) << std::endl; + + // store all app keys + keymap_type::const_iterator ci = m_keymap.begin(); + for( ; ci != m_keymap.end(); ++ci ) { + out << ci->first << " " << ci->second << std::endl; + } + + if( !out ) { + m_last_error = "Error during write. Config may be incomplete."; + return false; + } + return true; +} + +void GlobalConfigFile::SetKey(const std::string &key, const std::string &value) +{ + if( !m_appname.size() ) + throw std::logic_error("Cannot use SetKey() without specifying an appname in the constructor."); + + if( value.find_first_of("\n\r") != std::string::npos ) + throw std::logic_error("SetKey values may not contain newline characters."); + + std::string fullkey = "X-" + m_appname + "-" + key; + m_keymap[fullkey] = value; +} + +std::string GlobalConfigFile::GetKey(const std::string &key) const +{ + if( !m_appname.size() ) + throw std::logic_error("Cannot use SetKey() without specifying an appname in the constructor."); + + std::string fullkey = "X-" + m_appname + "-" + key; + keymap_type::const_iterator ci = m_keymap.find(fullkey); + if( ci == m_keymap.end() ) + return ""; + return ci->second; +} + +void GlobalConfigFile::SetLastDevice(const Barry::Pin &pin) +{ + m_lastDevice = pin; +} + +void GlobalConfigFile::SetVerboseLogging(bool verbose) +{ + m_verboseLogging = verbose; +} + + +} // namespace Barry + diff -Nru barry-0.14/src/configfile.h barry-0.0.20110506/src/configfile.h --- barry-0.14/src/configfile.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/configfile.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,203 @@ +/// +/// \file configfile.h +/// Barry configuraion class, for one device PIN +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CONFIGFILE_H__ +#define __BARRY_CONFIGFILE_H__ + +#include "dll.h" +#include "record.h" +#include "pin.h" +#include + +namespace Barry { + +class BXEXPORT ConfigFile +{ +public: + class BXEXPORT DBListType : public std::vector + { + public: + bool IsSelected(const std::string &dbname) const; + }; + +private: + // meta data + Barry::Pin m_pin; + std::string m_path; // /path/to/config/dir without trailing slash + std::string m_filename; // /path/to/config/dir/filename + bool m_loaded; + std::string m_last_error; + + // configuration data + DBListType m_backupList; + DBListType m_restoreList; + std::string m_deviceName; + bool m_promptBackupLabel; // if true, prompt the user on every + // backup for a string to label the + // backup file with + +protected: + void BuildFilename(); + void BuildDefaultPath(); + void Clear(); + void Load(); + +public: + /// Loads config file for the given pin, and ends up in an + /// unenlightened state. Throws ConfigFileError on error, + /// but it is not an error if the config does not exist. + /// Never use this if you have a DatabaseDatabase object! + /// This ctor is only for temporary loading of config data. + explicit ConfigFile(Barry::Pin pin); + + /// Opens and loads config file for given pin, and calls Enlighten + /// Throws ConfigFileError on error. Should never fail unless + /// passed a bad pin, or if unable to get current user info. + ConfigFile(Barry::Pin pin, const Barry::DatabaseDatabase &db); + + ~ConfigFile(); + + // + // data access + // + + const std::string& get_last_error() const { return m_last_error; } + bool IsConfigLoaded() const { return m_loaded; } + + const std::string& GetPath() const { return m_path; } +// const std::string& GetDeviceConfigFilename() const { return m_device_filename; } + + // + // per-Device Configuration + // + const DBListType& GetBackupList() const { return m_backupList; } + const DBListType& GetRestoreList() const { return m_restoreList; } + const std::string& GetDeviceName() const { return m_deviceName; } + bool HasDeviceName() const { return m_deviceName.size(); } + bool PromptBackupLabel() const { return m_promptBackupLabel; } + + // + // operations + // + + /// Saves current device's config, overwriting or creating a + /// config file + bool Save(); + + /// Compares a given databasedatabase from a real device with the + /// current config. If not yet configured, initialize with valid + /// defaults. + void Enlighten(const Barry::DatabaseDatabase &db); + + // + // per-Device Configuration setting + // + + /// Sets list with new config + void SetBackupList(const DBListType &list); + void SetRestoreList(const DBListType &list); + + void SetDeviceName(const std::string &name); + void SetBackupPath(const std::string &path); + void SetPromptBackupLabel(bool prompt = true); + + // + // Utility functions + // + + /// Checks that the path in path exists, and if not, creates it. + /// Returns false if unable to create path, true if ok. + static bool CheckPath(const std::string &path, std::string *perr = 0); +}; + +class BXEXPORT GlobalConfigFile +{ +private: + typedef std::map keymap_type; + + // meta data + std::string m_path; // /path/to/.barry without trailing slash + std::string m_filename; // /path/to/.barry/config + bool m_loaded; + std::string m_last_error; + std::string m_appname; + + // global configuration data + Barry::Pin m_lastDevice; // the last selected device in a GUI + bool m_verboseLogging; + + // set/get key data + keymap_type m_keymap; + +protected: + void BuildFilename(); + void Clear(); + void Load(); + +public: + /// Loads the global config file. + /// Throws ConfigFileError on error, but it is not an error + /// if the config does not exist. + GlobalConfigFile(); + + /// Loads the global config file, as well as any application-specific + /// keywords and variables. Use this if you wish to make use of + /// SetKey() and GetKey(), otherwise these functions will throw + /// and exception since they don't have an application name. + GlobalConfigFile(const std::string &appname); + + ~GlobalConfigFile(); + + // + // data access + // + + const std::string& get_last_error() const { return m_last_error; } + bool IsConfigLoaded() const { return m_loaded; } + + // + // Global Configuration data access + // + Barry::Pin GetLastDevice() const { return m_lastDevice; } + bool VerboseLogging() const { return m_verboseLogging; } + + // + // operations + // + + /// Save the current global config, overwriting or creating as needed + bool Save(); + + /// Throws std::logic_error if not constructed with an appname + void SetKey(const std::string &key, const std::string &value); + std::string GetKey(const std::string &key) const; + + // + // Global Configuration setting + // + void SetLastDevice(const Barry::Pin &pin); + void SetVerboseLogging(bool verbose = true); +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/connector.cc barry-0.0.20110506/src/connector.cc --- barry-0.14/src/connector.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/connector.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,284 @@ +// +// \file connector.cc +// Base class interface for handling Mode connections to device +// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "connector.h" +#include "router.h" +#include "controller.h" +#include "m_desktop.h" +#include "debug.h" + +using namespace std; +using namespace Barry; + +namespace Barry { + +////////////////////////////////////////////////////////////////////////////// +// Connector base class + +// we use a const char *password here because we don't want the +// responsibility of clear its memory... that's the application's job +Connector::Connector(const char *password, + const std::string &locale, + Barry::Pin pin) + : m_password(password) + , m_needs_reconnect(false) + , m_ic(locale.c_str()) + , m_probe_result(FindDevice(pin)) + , m_connect_count(0) + , m_last_disconnect(0) + , m_bpcopy("", 0, 0) +{ +} + +Connector::Connector(const char *password, + const std::string &locale, + const Barry::ProbeResult &result) + : m_password(password) + , m_needs_reconnect(false) + , m_ic(locale.c_str()) + , m_probe_result(result) + , m_connect_count(0) + , m_last_disconnect(0) + , m_bpcopy("", 0, 0) +{ +} + +Connector::~Connector() +{ +} + +Barry::ProbeResult Connector::FindDevice(Barry::Pin pin) +{ + Barry::Probe probe; + int i = probe.FindActive(pin); + if( i != -1 ) + return probe.Get(i); + else + throw Barry::PinNotFound(pin, probe.GetCount()); +} + +void Connector::ClearPassword() +{ + // blank the memory first + size_t len = m_password.size(); + while( len ) { + len--; + m_password[len] = '0'; + } + + // free it + m_password.clear(); +} + +void Connector::SetPassword(const char *password) +{ + ClearPassword(); + m_password = password; +} + +bool Connector::Connect() +{ + Disconnect(); + + bool started = false; + for(;;) { + + try { + if( !started ) { + started = true; + StartConnect(m_password.c_str()); + } + else { + RetryPassword(m_password.c_str()); + } + + FinishConnect(); + m_connect_count++; + return true; + + } + catch( BadPassword &bp ) { + if( bp.out_of_tries() ) { + throw; + } + + m_bpcopy = bp; + + // fall through to password prompt + } + + // ask user for device password + ClearPassword(); + if( !PasswordPrompt(m_bpcopy, m_password) ) { + // user wants out + return false; + } + } +} + +void Connector::Disconnect() +{ + m_needs_reconnect = false; + if( !IsDisconnected() ) { + DoDisconnect(); + m_last_disconnect = time(NULL); + } +} + +bool Connector::Reconnect(int total_tries) +{ + int tries = 0; + + while(1) try { + + tries++; + + Disconnect(); + + if( m_connect_count ) { + // let the device settle... this seems to help prevent + // the firmware hang, and therefore ultimately speeds + // up the sync + if( (time(NULL) - m_last_disconnect) < 2 ) { + // don't bother sleeping if 2 seconds have + // already passed + sleep(1); + } + + // temporary fix for odd reconnect message... + // without this probe, the reconnect will often fail on + // newer Blackberries due to an unexpected close socket + // message. + // + // It is unclear if this is really a message from + // the device, but until then, we add this probe. + m_probe_result = FindDevice(m_probe_result.m_pin); + } + + return Connect(); + } + catch( Usb::Timeout & ) { + if( tries >= total_tries ) { + throw; + } + else { + dout("Timeout in Connector::Reconnect()... trying again"); + } + } +} + +bool Connector::ReconnectForDirtyFlags() +{ + if( m_needs_reconnect ) { + return Reconnect(); + } + else { + return true; + } +} + +void Connector::RequireDirtyReconnect() +{ + m_needs_reconnect = true; +} + + +////////////////////////////////////////////////////////////////////////////// +// DesktopConnector class + +DesktopConnector::DesktopConnector(const char *password, + const std::string &locale, + Barry::Pin pin, + Barry::SocketRoutingQueue *router, + int connect_timeout) + : Connector(password, locale, pin) + , m_router(router) + , m_connect_timeout(connect_timeout) +{ +} + +DesktopConnector::DesktopConnector(const char *password, + const std::string &locale, + const Barry::ProbeResult &result, + Barry::SocketRoutingQueue *router, + int connect_timeout) + : Connector(password, locale, result) + , m_router(router) + , m_connect_timeout(connect_timeout) +{ +} + +void DesktopConnector::StartConnect(const char *password) +{ + // Note that there is a firmware issue that causes the firmware + // to sometimes hang during a connect and it fails to respond + // to a Desktop::Open() call. To work around this, set the + // timeout to something lower than the usual 30 seconds. + // The default in DesktopConnector is 10 seconds, which should + // be fine. + // + // If this bug triggers, a Timeout exception will be thrown, + // which will be caught by the Reconnect() method, and Reconnect() + // will retry according to the total number of retries it is + // set to do. + // + if( m_router ) { + m_con.reset( new Barry::Controller(m_probe_result, + *m_router, m_connect_timeout) ); + } + else { + m_con.reset( new Barry::Controller(m_probe_result, + m_connect_timeout) ); + } + m_desktop.reset( new Barry::Mode::Desktop(*m_con, m_ic) ); + m_desktop->Open(password); +} + +void DesktopConnector::RetryPassword(const char *password) +{ + m_desktop->RetryPassword(password); +} + +void DesktopConnector::FinishConnect() +{ +} + +void DesktopConnector::DoDisconnect() +{ + m_desktop.reset(); + m_con.reset(); +} + +bool DesktopConnector::IsDisconnected() +{ + // return true if DoDisconnect can safely be skipped + return !m_con.get() && !m_desktop.get(); +} + +bool DesktopConnector::IsConnected() +{ + if( m_con.get() && m_desktop.get() ) + return true; + return false; +} + +} + diff -Nru barry-0.14/src/connector.h barry-0.0.20110506/src/connector.h --- barry-0.14/src/connector.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/connector.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,189 @@ +// +// \file connector.h +// Base class interface for handling Mode connections to device +// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CONNECT_H__ +#define __BARRY_CONNECT_H__ + +#include "dll.h" +#include "iconv.h" +#include "pin.h" +#include "probe.h" +#include +#include +#include + +namespace Barry { + +class SocketRoutingQueue; +class Controller; +namespace Mode { + class Desktop; +} + +class BXEXPORT Connector +{ +protected: + std::string m_password; + bool m_needs_reconnect; + Barry::IConverter m_ic; + Barry::ProbeResult m_probe_result; + int m_connect_count; + time_t m_last_disconnect; + + // bad password status + BadPassword m_bpcopy; + +protected: + // helper functions + static Barry::ProbeResult FindDevice(Barry::Pin pin); + + // required overrides by derived classes + virtual void StartConnect(const char *password) = 0; + virtual void RetryPassword(const char *password) = 0; + virtual void FinishConnect() = 0; + virtual void DoDisconnect() = 0; + /// slightly different than IsConnected()... this returns true + /// even if there is a partial connection in progress... + /// i.e. this returns true if DoDisconnect() can be safely skipped + virtual bool IsDisconnected() = 0; + +public: + Connector(const char *password, const std::string &locale, + Barry::Pin pin = 0); + Connector(const char *password, const std::string &locale, + const Barry::ProbeResult &result); + virtual ~Connector(); + + IConverter& GetIConverter() { return m_ic; } + const IConverter& GetIConverter() const { return m_ic; } + Barry::ProbeResult& GetProbeResult() { return m_probe_result; } + const Barry::ProbeResult& GetProbeResult() const { return m_probe_result; } + const Barry::BadPassword& GetBadPassword() const { return m_bpcopy; } + + virtual void ClearPassword(); + virtual void SetPassword(const char *password); + + /// Returns true if connected, false if user cancelled, throws + /// Barry exception on error. Note that in the case of a bad + /// password, this will return false on the first password try, + /// unless you override PasswordPrompt() below. In the default + /// case, a false here means the password was invalid, and you + /// should use GetBadPassword() to report the error. + virtual bool Connect(); + + /// Disconnects from the device + virtual void Disconnect(); + + /// Returns same as Connect(), but normally remembers the password + /// and so avoids prompting the user if possible. Password prompts + /// are still possible though, if you have called ClearPassword(). + /// + /// It is valid to call Reconnect() without ever calling Connect(), + /// since Reconnect() is simply a wrapper that handles retries. + virtual bool Reconnect(int total_tries = 2); + + /// Calls Reconnect() (and returns it's result) only if you have + /// called RequireDirtyReconnect(). Otherwise, does nothing, but + /// returns true. + virtual bool ReconnectForDirtyFlags(); + + /// Returns true if connected, false if not + virtual bool IsConnected() = 0; + + /// This function flags the Connector object so that a future + /// call to ReconnectForDirtyFlags() will actually Reconnect(). + /// This is needed in cases where you are updating the device, + /// and require that the dirty flags on the device itself are + /// properly cleared and updated. In this case, you must call + /// ReconnectForDirtyFlags() before Desktop::GetRecordStateTable(). + /// Disconnecting from the device, or reconnecting, clears the flag. + virtual void RequireDirtyReconnect(); + + // + // Callbacks, overridden by the application + // + + /// App should prompt user for password, fill password_result with + /// what he enters and then return true. Return false if user + /// wishes to stop trying. + /// + /// This function is *not* called from inside a catch() routine, + /// so it is safe to throw exceptions from it if you must. + virtual bool PasswordPrompt(const Barry::BadPassword &bp, + std::string &password_result) = 0; +}; + +class BXEXPORT DesktopConnector : public Connector +{ + Barry::SocketRoutingQueue *m_router; + std::auto_ptr m_con; + std::auto_ptr m_desktop; + int m_connect_timeout; + +protected: + virtual void StartConnect(const char *password); + virtual void RetryPassword(const char *password); + virtual void FinishConnect(); + virtual void DoDisconnect(); + virtual bool IsDisconnected(); + +public: + // Override the timeout due to a firmware issue... sometimes + // the firmware will hang during a Reconnect, and fail to + // respond to a Desktop::Open(). To work around this, we + // set the default timeout to 10 seconds so that we find this + // failure early enough to fix it within opensync's 30 second timeout. + // Then if we get such a timeout, we do the Reconnect again and + // hope for the best... this often fixes it. + // + DesktopConnector(const char *password, const std::string &locale, + Barry::Pin pin = 0, Barry::SocketRoutingQueue *router = 0, + int connect_timeout = 10000); + + DesktopConnector(const char *password, const std::string &locale, + const Barry::ProbeResult &result, + Barry::SocketRoutingQueue *router = 0, + int connect_timeout = 10000); + + virtual bool IsConnected(); + + virtual bool PasswordPrompt(const Barry::BadPassword &bp, + std::string &password_result) + { + // default to only trying the existing password once + return false; + } + + // + // Do not use these functions if IsConnected() returns false + // + + Controller& GetController() { return *m_con; } + Mode::Desktop& GetDesktop() { return *m_desktop; } + + const Controller& GetController() const { return *m_con; } + const Mode::Desktop& GetDesktop() const{ return *m_desktop; } +}; + +} + +#endif + diff -Nru barry-0.14/src/controller.cc barry-0.0.20110506/src/controller.cc --- barry-0.14/src/controller.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/controller.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,12 +20,13 @@ */ #include "controller.h" -#include "probe.h" +#include "controllerpriv.h" #include "common.h" #include "protocol.h" #include "protostructs.h" #include "data.h" #include "endian.h" +#include "platform.h" #include #define __DEBUG_MODE__ @@ -41,14 +42,11 @@ /// /// \param[in] device One of the ProbeResult objects from the /// Probe class. +/// \param[in] default_timeout Override Usb::Device's default timeout /// -Controller::Controller(const ProbeResult &device) - : m_result(device) - , m_dev(device.m_dev) - , m_iface(0) - , m_pin(device.m_pin) - , m_zero(m_dev, device.m_ep.write, device.m_ep.read, device.m_zeroSocketSequence) - , m_queue(0) +Controller::Controller(const ProbeResult &device, + int default_timeout) + : m_priv(new PrivateControllerData(device, default_timeout)) { dout("Controller: Using non-threaded sockets"); SetupUsb(device); @@ -64,82 +62,48 @@ /// Probe class. /// \param[in] queue Plugin router object for reading data /// from sockets. +/// \param[in] default_timeout Override Usb::Device's default timeout /// -Controller::Controller(const ProbeResult &device, SocketRoutingQueue &queue) - : m_result(device) - , m_dev(device.m_dev) - , m_iface(0) - , m_pin(device.m_pin) - , m_zero(queue, device.m_ep.write, device.m_zeroSocketSequence) - , m_queue(&queue) +Controller::Controller(const ProbeResult &device, + SocketRoutingQueue &queue, + int default_timeout) + : m_priv(new PrivateControllerData(device, queue, default_timeout)) { dout("Controller: Using threaded socket router"); SetupUsb(device); // set the queue to use our device - queue.SetUsbDevice(&m_dev, device.m_ep.write, device.m_ep.read); + queue.SetUsbDevice(&m_priv->m_dev, device.m_ep.write, device.m_ep.read); } void Controller::SetupUsb(const ProbeResult &device) { unsigned char cfg; - if( !m_dev.GetConfiguration(cfg) ) - throw Usb::Error(m_dev.GetLastError(), + if( !m_priv->m_dev.GetConfiguration(cfg) ) + throw Usb::Error(m_priv->m_dev.GetLastError(), "Controller: GetConfiguration failed"); - if( cfg != BLACKBERRY_CONFIGURATION ) { - if( !m_dev.SetConfiguration(BLACKBERRY_CONFIGURATION) ) - throw Usb::Error(m_dev.GetLastError(), + if( cfg != BLACKBERRY_CONFIGURATION || MUST_SET_CONFIGURATION ) { + if( !m_priv->m_dev.SetConfiguration(BLACKBERRY_CONFIGURATION) ) + throw Usb::Error(m_priv->m_dev.GetLastError(), "Controller: SetConfiguration failed"); } - m_iface = new Usb::Interface(m_dev, device.m_interface); + m_priv->m_iface = new Usb::Interface(m_priv->m_dev, device.m_interface); - m_dev.ClearHalt(device.m_ep.read); - m_dev.ClearHalt(device.m_ep.write); + if( device.m_needSetAltInterface ) { + m_priv->m_dev.SetAltInterface(device.m_interface); + } + + if( device.m_needClearHalt ) { + m_priv->m_dev.ClearHalt(device.m_ep.read); + m_priv->m_dev.ClearHalt(device.m_ep.write); + } } Controller::~Controller() { -// // trap exceptions in the destructor -// try { -// // a non-default socket has been opened, close it -// m_socket.Close(); -// } -// catch( std::runtime_error &re ) { -// // do nothing... log it? -// dout("Exception caught in ~Socket: " << re.what()); -// } - - // detach the router from our device - if( m_queue ) { - m_queue->ClearUsbDevice(); - m_queue = 0; - } - - // cleanup the interface - delete m_iface; - - // this happens when for some reason the Desktop mode - // is not fully opened, but the device has already recommended - // a socket to open... in this case, reset the device - // in the hopes that on next open, it will be in a - // recognizable state. - // - // FIXME - this should not be necessary, and someday we - // we should figure out how to handle the "already open" - // response we get for the Desktop - // - // FIXME - halfOpen now seems to be handled in the Socket class... - // perhaps move this there if needed - // -/* - if( m_halfOpen ) { - dout("Controller object destroyed in halfopen state, resetting device"); - m_dev.Reset(); - } -*/ } /////////////////////////////////////////////////////////////////////////////// @@ -151,6 +115,20 @@ // uint16_t Controller::SelectMode(ModeType mode) { + return SelectMode(mode, NULL); +} +// +// Tells device which mode is desired, and returns the suggested +// socket ID to use for that mode. +// +// If explicitModeName is not NULL then it will be used as the mode name. +// Otherwise the default mode name for the given mode will be used. +// It should be a nul terminated string if it is provided. +// +// The RawChannel mode requires an explicitModeName to be specified. +// +uint16_t Controller::SelectMode(ModeType mode, const char *explicitModeName) +{ // select mode Protocol::Packet packet; packet.socket = 0; @@ -161,31 +139,49 @@ memset(packet.u.socket.u.mode.name, 0, sizeof(packet.u.socket.u.mode.name)); char *modeName = (char *) packet.u.socket.u.mode.name; - switch( mode ) - { - case Bypass: - strcpy(modeName, "RIM Bypass"); - break; - - case Desktop: - strcpy(modeName, "RIM Desktop"); - break; - - case JavaLoader: - strcpy(modeName, "RIM_JavaLoader"); - break; - - case UsbSerData: - strcpy(modeName, "RIM_UsbSerData"); - break; - - case UsbSerCtrl: - strcpy(modeName, "RIM_UsbSerCtrl"); - break; - - default: - throw std::logic_error("Controller: Invalid mode in SelectMode"); - break; + + if( explicitModeName ) { + if( strlen(explicitModeName) >= sizeof(packet.u.socket.u.mode.name) ) { + throw std::logic_error("Controller: explicit mode name too long"); + } + strcpy(modeName, explicitModeName); + } + else { + // No modeName given, use the default + switch( mode ) + { + case Bypass: + strcpy(modeName, "RIM Bypass"); + break; + + case Desktop: + strcpy(modeName, "RIM Desktop"); + break; + + case JavaLoader: + strcpy(modeName, "RIM_JavaLoader"); + break; + + case JVMDebug: + strcpy(modeName, "RIM_JVMDebug"); + break; + + case UsbSerData: + strcpy(modeName, "RIM_UsbSerData"); + break; + + case UsbSerCtrl: + strcpy(modeName, "RIM_UsbSerCtrl"); + break; + + case RawChannel: + throw std::logic_error("Controller: No channel name given with RawChannel mode"); + break; + + default: + throw std::logic_error("Controller: Invalid mode in SelectMode"); + break; + } } // send mode command before we open, as a default socket is socket 0 @@ -193,13 +189,15 @@ Data response; try { - m_zero.Send(command, response); + m_priv->m_zero.Send(command, response); // get the data socket number // indicates the socket number that // should be used below in the Open() call - Protocol::CheckSize(response, SB_MODE_PACKET_RESPONSE_SIZE); MAKE_PACKET(modepack, response); + if( modepack->command == SB_COMMAND_MODE_NOT_SELECTED ) { + throw Error("Controller: requested mode not supported"); + } if( modepack->command != SB_COMMAND_MODE_SELECTED ) { eeout(command, response); throw Error("Controller: mode not selected"); @@ -215,10 +213,35 @@ } } +// +// OpenSocket +// +/// Can be called multiple times, in case of password retries. +/// See also Mode::RetryPassword() +/// +SocketHandle Controller::OpenSocket(uint16_t socket, const char *password) +{ + return m_priv->m_zero.Open(socket, password); +} + /////////////////////////////////////////////////////////////////////////////// // public API +bool Controller::HasQueue() const +{ + return m_priv->m_queue; +} + +SocketRoutingQueue* Controller::GetQueue() +{ + return m_priv->m_queue; +} + +const ProbeResult& Controller::GetProbeResult() const +{ + return m_priv->m_result; +} } // namespace Barry diff -Nru barry-0.14/src/controller.h barry-0.0.20110506/src/controller.h --- barry-0.14/src/controller.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/controller.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,9 +23,7 @@ #define __BARRY_CONTROLLER_H__ #include "dll.h" -#include "usbwrap.h" #include "socket.h" -#include "probe.h" /// Project namespace, containing all related functions and classes. /// This is the only namespace applications should be concerned with, @@ -34,11 +32,17 @@ // forward declarations class SocketRoutingQueue; +class ProbeResult; + +class PrivateControllerData; namespace Mode { - class Desktop; + class Mode; class IpModem; class Serial; + class JavaLoader; + class JVMDebug; + class RawChannel; } // @@ -66,9 +70,12 @@ /// class BXEXPORT Controller { - friend class Barry::Mode::Desktop; + friend class Barry::Mode::Mode; friend class Barry::Mode::IpModem; friend class Barry::Mode::Serial; + friend class Barry::Mode::JavaLoader; + friend class Barry::Mode::JVMDebug; + friend class Barry::Mode::RawChannel; public: /// Handheld mode type @@ -77,34 +84,37 @@ Bypass, //< unsupported, unknown Desktop, //< desktop mode required for database //< operation - JavaLoader, //< unsupported + JavaLoader, //< experimental + JVMDebug, //< experimental UsbSerData, //< GPRS modem support over USB - UsbSerCtrl //< internally used behind the scenes + UsbSerCtrl, //< internally used behind the scenes + RawChannel //< raw channel }; private: - ProbeResult m_result; - Usb::Device m_dev; - Usb::Interface *m_iface; - uint32_t m_pin; - - SocketZero m_zero; - SocketRoutingQueue *m_queue; //< ptr to external object; no delete + std::auto_ptr m_priv; private: void SetupUsb(const ProbeResult &device); protected: uint16_t SelectMode(ModeType mode); // returns mode socket + uint16_t SelectMode(ModeType mode, const char *explicitModeName); // returns mode socket + SocketHandle OpenSocket(uint16_t socket, const char *password = 0); + PrivateControllerData* GetPrivate() { return m_priv.get(); } public: - explicit Controller(const ProbeResult &device); - Controller(const ProbeResult &device, SocketRoutingQueue &queue); + explicit Controller(const ProbeResult &device, + int default_timeout = USBWRAP_DEFAULT_TIMEOUT); + Controller(const ProbeResult &device, SocketRoutingQueue &queue, + int default_timeout = USBWRAP_DEFAULT_TIMEOUT); ~Controller(); - bool HasQueue() const { return m_queue; } + bool HasQueue() const; + SocketRoutingQueue* GetQueue(); // FIXME - not really ideal to have + // this exposed, but oh well - const ProbeResult& GetProbeResult() const { return m_result; } + const ProbeResult& GetProbeResult() const; }; } // namespace Barry diff -Nru barry-0.14/src/controllerpriv.h barry-0.0.20110506/src/controllerpriv.h --- barry-0.14/src/controllerpriv.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/controllerpriv.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,92 @@ +/// +/// \file controllerpriv.h +/// Private data for the Controller class +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_CONTROLLERPRIVATE_H__ +#define __BARRY_CONTROLLERPRIVATE_H__ + +#include "probe.h" +#include "usbwrap.h" +#include "pin.h" +#include "socket.h" +#include "router.h" +#include "m_ipmodem.h" + +namespace Barry { + +class Controller; + +class PrivateControllerData +{ + friend class Controller; + + // DO NOT add your Mode class to this list unless it *needs* + // low level access to things like Usb::Device. By adding + // your Mode class to this list, you are making it non-portable. + friend class Barry::Mode::IpModem; + + +private: + ProbeResult m_result; + Usb::Device m_dev; + Usb::Interface *m_iface; + Pin m_pin; + SocketZero m_zero; + SocketRoutingQueue *m_queue; //< ptr to external object; no delete + +private: + PrivateControllerData(const ProbeResult &device, int default_timeout) + : m_result(device) + , m_dev(device.m_dev, default_timeout) + , m_iface(0) + , m_pin(device.m_pin) + , m_zero(m_dev, device.m_ep.write, device.m_ep.read, device.m_zeroSocketSequence) + , m_queue(0) + { + } + + PrivateControllerData(const ProbeResult &device, + SocketRoutingQueue &queue, int default_timeout) + : m_result(device) + , m_dev(device.m_dev, default_timeout) + , m_iface(0) + , m_pin(device.m_pin) + , m_zero(queue, device.m_ep.write, device.m_zeroSocketSequence) + , m_queue(&queue) + { + } + +public: + ~PrivateControllerData() + { + // detach the router from our device + if( m_queue ) { + m_queue->ClearUsbDevice(); + m_queue = 0; + } + + // cleanup the interface + delete m_iface; + } +}; + +} // namespace Barry + +#endif diff -Nru barry-0.14/src/convo.awk barry-0.0.20110506/src/convo.awk --- barry-0.14/src/convo.awk 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/convo.awk 2011-05-06 12:20:17.000000000 +0000 @@ -24,6 +24,14 @@ print $0; } +/endpoint 0x00000002/ { + # only copy data going to the output endpoint + if( direction == 0 ) { + docopy = 1; + printf "\nsep: 2\n"; + } +} + /endpoint 0x00000005/ { # only copy data going to the output endpoint if( direction == 0 ) { diff -Nru barry-0.14/src/.cvsignore barry-0.0.20110506/src/.cvsignore --- barry-0.14/src/.cvsignore 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/.cvsignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -gmon.out -doxygen.log - diff -Nru barry-0.14/src/data.cc barry-0.0.20110506/src/data.cc --- barry-0.14/src/data.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/data.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,6 +27,7 @@ #include #include #include +#include //#define __DEBUG_MODE__ #include "debug.h" @@ -64,83 +65,133 @@ bool Data::bPrintAscii = true; Data::Data() - : m_data(new unsigned char[0x4000]), - m_bufsize(0x4000), - m_datasize(0), - m_endpoint(-1), - m_externalData(0), - m_external(false) -{ - memset(m_data, 0, m_bufsize); -} - -Data::Data(int endpoint, size_t startsize) - : m_data(new unsigned char[startsize]), - m_bufsize(startsize), - m_datasize(0), - m_endpoint(endpoint), - m_externalData(0), - m_external(false) + : m_memBlock(new unsigned char[0x4100]) + , m_blockSize(0x4100) + , m_dataStart(m_memBlock + 0x100) + , m_dataSize(0) + , m_externalData(0) + , m_external(false) + , m_endpoint(-1) +{ + memset(m_memBlock, 0, m_blockSize); +} + +Data::Data(int endpoint, size_t startsize, size_t prependsize) + : m_memBlock(new unsigned char[startsize + prependsize]) + , m_blockSize(startsize + prependsize) + , m_dataStart(m_memBlock + prependsize) + , m_dataSize(0) + , m_externalData(0) + , m_external(false) + , m_endpoint(endpoint) { - memset(m_data, 0, m_bufsize); + memset(m_memBlock, 0, m_blockSize); } Data::Data(const void *ValidData, size_t size) - : m_data(0), - m_bufsize(0), - m_datasize(size), - m_endpoint(-1), - m_externalData((const unsigned char*)ValidData), - m_external(true) + : m_memBlock(0) + , m_blockSize(0) + , m_dataStart(0) + , m_dataSize(size) + , m_externalData((const unsigned char*)ValidData) + , m_external(true) + , m_endpoint(-1) { } Data::Data(const Data &other) - : m_data(other.m_bufsize ? new unsigned char[other.m_bufsize] : 0), - m_bufsize(other.m_bufsize), - m_datasize(other.m_datasize), - m_endpoint(other.m_endpoint), - m_externalData(other.m_externalData), - m_external(other.m_external) + : m_memBlock(other.m_blockSize ? new unsigned char[other.m_blockSize] : 0) + , m_blockSize(other.m_blockSize) + , m_dataStart(m_memBlock + other.AvailablePrependSpace()) + , m_dataSize(other.m_dataSize) + , m_externalData(other.m_externalData) + , m_external(other.m_external) + , m_endpoint(other.m_endpoint) { // copy over the raw data if( !m_external ) - memcpy(m_data, other.m_data, other.m_bufsize); + memcpy(m_memBlock, other.m_memBlock, other.m_blockSize); } Data::~Data() { - delete [] m_data; + delete [] m_memBlock; } -void Data::MakeSpace(size_t desiredsize) +// +// MakeSpace +// +/// Reallocates buffers so that it is safe to write desiredsize data +/// to m_dataStart after it returns. All existing data is preserved. +/// +/// This function also performs any copy on write needed. +/// +/// If desiredprepend is nonzero, then at least desiredprepend bytes +/// of prepend space will exist in the buffer after return. +/// If desiredprepend is zero, defaults will be used if needed. +/// +void Data::MakeSpace(size_t desiredsize, size_t desiredprepend) { - if( m_bufsize < desiredsize ) { - desiredsize += 1024; // get a proper chunk - unsigned char *newbuf = new unsigned char[desiredsize]; - memcpy(newbuf, m_data, m_bufsize); - memset(newbuf + m_bufsize, 0, desiredsize - m_bufsize); - delete [] m_data; - m_data = newbuf; - m_bufsize = desiredsize; - } -} + // use a default prepend size if none currently available + size_t prepend = std::max(AvailablePrependSpace(), desiredprepend); + if( !prepend ) + prepend = 0x100; + + // GetBufSize() returns 0 if m_external is true + if( GetBufSize() < (desiredsize + prepend) || + (desiredprepend && AvailablePrependSpace() < desiredprepend) ) + { + // get a proper chunk to avoid future resizes + desiredsize += 1024 + prepend; -// perform the copy on write operation if needed -void Data::CopyOnWrite(size_t desiredsize) -{ - if( m_external ) { - // make room - MakeSpace(std::max(desiredsize, m_datasize)); + // desired size must be at least the size of our current + // data (in case of external data), as well as the size + // of our desired prepend space + if( desiredsize < (m_dataSize + prepend) ) + desiredsize = m_dataSize + prepend; + + // setup new zeroed buffer... reuse m_memBlock if it + // exists (see operator=()) + unsigned char *newbuf = 0; + if( m_memBlock && m_blockSize >= desiredsize ) { + newbuf = m_memBlock; + } + else { + newbuf = new unsigned char[desiredsize]; + memset(newbuf, 0, desiredsize); + } - // copy it over - memcpy(m_data, m_externalData, m_datasize); + // copy valid data over + if( m_external ) { + memcpy(newbuf + prepend, m_externalData, m_dataSize); - // not external anymore - m_external = false; + // not external anymore + m_external = false; + } + else { + memcpy(newbuf + prepend, m_dataStart, m_dataSize); + } + + // install new buffer if we've allocated a new one + if( m_memBlock != newbuf ) { + delete [] m_memBlock; + m_memBlock = newbuf; + m_blockSize = desiredsize; + } + + // update m_dataStart + m_dataStart = m_memBlock + prepend; } } +size_t Data::AvailablePrependSpace() const +{ + if( m_external ) + return 0; + else + return m_dataStart - m_memBlock; +} + void Data::InputHexLine(istream &is) { unsigned int values[16]; @@ -161,11 +212,10 @@ dout("InputHexLine: read " << index << " bytes"); - CopyOnWrite(address + index); MakeSpace(address + index); // make space for the new - m_datasize = std::max(address + index, m_datasize); + m_dataSize = std::max(address + index, m_dataSize); while( index-- ) - m_data[address + index] = (unsigned char) values[index]; + m_dataStart[address + index] = (unsigned char) values[index]; return; } @@ -196,7 +246,7 @@ os << ' '; for( size_t i = 0; i < size && (index+i) < GetSize(); i++ ) { ostream::traits_type::char_type c = GetData()[index + i]; - os << setbase(10) << (char) (isprint(c, loc) ? c : '.'); + os << setbase(10) << (char) (std::isprint(c, loc) ? c : '.'); } } @@ -213,49 +263,56 @@ unsigned char * Data::GetBuffer(size_t requiredsize) { - CopyOnWrite(requiredsize); - if( requiredsize > 0 ) - MakeSpace(requiredsize); - return m_data; + if( requiredsize == 0 ) { + // handle default, use data size + requiredsize = m_dataSize; + } + + MakeSpace(requiredsize); + return m_dataStart; } -void Data::ReleaseBuffer(int datasize) +/// Returns size of buffer returned by GetBuffer(). Note that this does not +/// include available prepend space. +size_t Data::GetBufSize() const { - assert( datasize >= 0 || datasize == -1 ); - assert( datasize == -1 || (unsigned int)datasize <= m_bufsize ); - assert( !m_external ); + if( m_external ) + return 0; + else + return m_blockSize - (m_dataStart - m_memBlock); +} +void Data::ReleaseBuffer(int datasize) +{ + if( datasize < 0 && datasize != -1) + throw std::logic_error("Data::ReleaseBuffer() argument must be -1 or >= 0"); if( m_external ) - return; - if( datasize >= 0 && (unsigned int)datasize > m_bufsize ) { - dout("ReleaseBuffer called with datasize(" - << std::dec << datasize << ") > m_bufsize(" - << m_bufsize << ")"); - return; - } + throw std::logic_error("Data::ReleaseBuffer() must be called after GetBuffer()"); + if( !(datasize == -1 || (unsigned int)datasize <= GetBufSize()) ) + throw std::logic_error("Data::ReleaseBuffer() must be called with a size smaller than the original buffer requested"); if( datasize >= 0 ) { - m_datasize = datasize; + m_dataSize = datasize; } else { // search for last non-zero value in buffer - m_datasize = m_bufsize - 1; - while( m_datasize && m_data[m_datasize] == 0 ) - --m_datasize; + m_dataSize = GetBufSize() - 1; + while( m_dataSize && m_dataStart[m_dataSize] == 0 ) + --m_dataSize; } } /// Append bytes of data based on str void Data::AppendHexString(const char *str) { - CopyOnWrite(m_datasize + 512); + MakeSpace(m_dataSize + 512); std::istringstream iss(str); unsigned int byte; while( iss >> hex >> byte ) { - MakeSpace(m_datasize + 1); - m_data[m_datasize] = (unsigned char) byte; - m_datasize++; + MakeSpace(m_dataSize + 1); + m_dataStart[m_dataSize] = (unsigned char) byte; + m_dataSize++; } } @@ -263,8 +320,8 @@ void Data::Zap() { if( !m_external ) - memset(m_data, 0, m_bufsize); - m_datasize = 0; + memset(m_memBlock, 0, m_blockSize); + m_dataSize = 0; } Data & Data::operator=(const Data &other) @@ -272,18 +329,72 @@ if( this == &other ) return *this; - // don't remove our current buffer, only grow it if needed - MakeSpace(other.m_bufsize); - memcpy(m_data, other.m_data, other.m_bufsize); - - // then copy over the data state - m_datasize = other.m_datasize; - m_endpoint = other.m_endpoint; - m_externalData = other.m_externalData; - m_external = other.m_external; + if( other.m_external ) { + // just copy over the pointers + m_externalData = other.m_externalData; + m_external = other.m_external; + m_dataSize = other.m_dataSize; + m_endpoint = other.m_endpoint; + } + else { + // don't remove our current buffer, only grow it if needed + MakeSpace(other.m_dataSize); + memcpy(m_dataStart, other.m_dataStart, other.m_dataSize); + + // then copy over the data state + m_dataSize = other.m_dataSize; + m_endpoint = other.m_endpoint; + } + return *this; } +void Data::MemCpy(size_t &offset, const void *src, size_t size) +{ + unsigned char *pd = GetBuffer(offset + size) + offset; + memcpy(pd, src, size); + offset += size; + + // if the new end of data is larger than m_dataSize, bump it + if( offset > m_dataSize ) + m_dataSize = offset; +} + +void Data::Append(const void *buf, size_t size) +{ + // MemCpy updates m_datasize via the offset reference + MemCpy(m_dataSize, buf, size); +} + +void Data::Prepend(const void *buf, size_t size) +{ + MakeSpace(0, size); + m_dataStart -= size; + m_dataSize += size; + memcpy(m_dataStart, (const unsigned char*) buf, size); +} + +/// Removes size bytes from the beginning of the buffer. +/// If GetSize() is less than size, then all bytes will be chopped +/// and GetSize() will end up 0. +void Data::Prechop(size_t size) +{ + // chopping all the bytes that we have? + if( size >= GetSize() ) { + QuickZap(); + return; + } + + if( m_external ) { + m_externalData += size; + m_dataSize -= size; + } + else { + m_dataStart += size; + m_dataSize -= size; + } +} + istream& operator>> (istream &is, Data &data) { data.InputHexLine(is); @@ -384,6 +495,100 @@ /////////////////////////////////////////////////////////////////////////////// +// DBData class + +/// Default constructor, constructs an empty local Data object +DBData::DBData() + : m_version(REC_VERSION_1) // a reasonable default for now + , m_localData(new Data) + , m_data(*m_localData) +{ +} + + +/// Constructs a local Data object that points to external memory +DBData::DBData(const void *ValidData, size_t size) + : m_version(REC_VERSION_1) // a reasonable default for now + , m_localData(new Data) + , m_data(*m_localData) +{ +} + +DBData::DBData(RecordFormatVersion ver, + const std::string &dbName, + uint8_t recType, + uint32_t uniqueId, + size_t offset, + const void *ValidData, + size_t size) + : m_version(ver) + , m_dbName(dbName) + , m_recType(recType) + , m_uniqueId(uniqueId) + , m_offset(offset) + , m_localData(new Data(ValidData, size)) + , m_data(*m_localData) +{ +} + +/// If copy == false, constructs an external Data object, no local. +/// If copy == true, constructs an internal Data object copy +DBData::DBData(Data &externalData, bool copy) + : m_version(REC_VERSION_1) // a reasonable default for now + , m_localData(copy ? new Data(externalData) : 0) + , m_data(copy ? *m_localData : externalData) +{ +} + +DBData::DBData(RecordFormatVersion ver, + const std::string &dbName, + uint8_t recType, + uint32_t uniqueId, + size_t offset, + Data &externalData, + bool copy) + : m_version(ver) + , m_dbName(dbName) + , m_recType(recType) + , m_uniqueId(uniqueId) + , m_offset(offset) + , m_localData(copy ? new Data(externalData) : 0) + , m_data(copy ? *m_localData : externalData) +{ +} + +DBData::~DBData() +{ + delete m_localData; +} + +Data& DBData::UseData() +{ + // make sure m_data is not external anymore + m_data.GetBuffer(); + return m_data; // return it +} + +// Note: this copy operator does not change what m_data references... +// whatever m_data references in the constructor is what will be changed +// in this copy. +// Note also that the copy *will* involve a memcpy, and maybe a memory +// allocation as well. +DBData& DBData::operator=(const DBData &other) +{ + if( this == &other ) + return *this; + + // copy the data block + m_data = other.m_data; + + // copy the metadata + CopyMeta(other); + + return *this; +} + +/////////////////////////////////////////////////////////////////////////////// // Utility functions static bool IsEndpointStart(const std::string &line, int &endpoint) @@ -441,46 +646,3 @@ } // namespace Barry - -#ifdef __TEST_MODE__ - -#include -#include -#include "data.h" - -using namespace std; - -int main() -{ - typedef std::vector DataVec; - DataVec array; - if( !LoadDataArray("data/parsed.log", array) ) { - cout << "Can't load file" << endl; - return 1; - } - - DataVec::iterator i = array.begin(); - Data::PrintAscii(false); - for( ; i != array.end(); i++ ) { - cout << "Endpoint: " << i->GetEndpoint() << endl; - cout << *i; - cout << "\n\n"; - } - - - Data one, two; - one.GetBuffer()[0] = 0x01; - one.ReleaseBuffer(1); - two.GetBuffer()[0] = 0x02; - two.ReleaseBuffer(2); - - cout << Diff(one, two) << endl; - cout << Diff(two, one) << endl; - - two.GetBuffer(); - two.ReleaseBuffer(32); - cout << Diff(one, two) << endl; -} - -#endif - diff -Nru barry-0.14/src/data.h barry-0.0.20110506/src/data.h --- barry-0.14/src/data.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/data.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -25,30 +25,42 @@ #include "dll.h" #include #include +#include +#include namespace Barry { class BXEXPORT Data { - unsigned char *m_data; - size_t m_bufsize; //< size of m_data buffer allocated - size_t m_datasize; //< number of bytes of actual data - int m_endpoint; + unsigned char *m_memBlock; //< pointer to full memory block + //< can be null if external + size_t m_blockSize; //< size of m_memBlock buffer allocated + + unsigned char *m_dataStart; //< pointer to start of internal data + //< can be null if external, and can + //< start somewhere in the middle of + //< m_memBlock if internal with a + //< prepend buffer + + size_t m_dataSize; //< number of bytes of actual data // copy on write feature const unsigned char *m_externalData; bool m_external; + // meta data + int m_endpoint; + // output format flags static bool bPrintAscii; protected: - void MakeSpace(size_t desiredsize); - void CopyOnWrite(size_t desiredsize); + void MakeSpace(size_t desiredsize, size_t desiredprepend = 0); + size_t AvailablePrependSpace() const; public: Data(); - explicit Data(int endpoint, size_t startsize = 0x4000); + explicit Data(int endpoint, size_t startsize = 0x4000, size_t prependsize = 0x100); Data(const void *ValidData, size_t size); Data(const Data &other); ~Data(); @@ -59,20 +71,45 @@ int GetEndpoint() const { return m_endpoint; } - const unsigned char * GetData() const { return m_external ? m_externalData : m_data; } - size_t GetSize() const { return m_datasize; } + const unsigned char * GetData() const { return m_external ? m_externalData : m_dataStart; } + size_t GetSize() const { return m_dataSize; } unsigned char * GetBuffer(size_t requiredsize = 0); - size_t GetBufSize() const { return m_bufsize; } + /// Returns size of buffer returned by GetBuffer() + size_t GetBufSize() const; void ReleaseBuffer(int datasize = -1); void AppendHexString(const char *str); - void Zap(); + /// set buffer to 0 size, but don't bother overwriting memory with 0 + void QuickZap() { m_dataSize = 0; } + void Zap(); // does a memset too Data& operator=(const Data &other); + // + // Utility functions + // + // Writing data... basically does a memcpy(dst,src,sizeof(src)) + // for each type. Does no endian conversions. + // dst is calculated as buffer + offset. + // The buffer is expanded automatically if needed. + // The offset is advanced by the size of the data. + // GetSize() will increase automatically if the result of + // the MemCpy() goes beyond the existing data size. + // + void MemCpy(size_t &offset, const void *src, size_t size); + void Append(const void *buf, size_t size); + void Prepend(const void *buf, size_t size); + void Prechop(size_t size); + template + void SetValue(size_t &offset, ValueT value) + { + this->MemCpy(offset, &value, sizeof(value)); + } + + // static functions static void PrintAscii(bool setting) { bPrintAscii = setting; } static bool PrintAscii() { return bPrintAscii; } @@ -101,6 +138,125 @@ BXEXPORT bool LoadDataArray(const std::string &filename, std::vector &array); BXEXPORT bool ReadDataArray(std::istream &is, std::vector &array); + +// +// DBData +// +/// Database record data class. The purpose of this class is to contain +/// the raw data that flows between low level activity such as device +/// read/writes, backup read/writes, and record parsing. +/// +/// This class contains the low level record data block, unparsed, as well +/// as the surrounding meta data, such as the database name it belongs +/// to, the Unique ID, the Rec Type, and format version/type based on what +/// commands were used to extract the data from the device. (When using +/// newer commands, the format of the records, potentially including the +/// individual field type codes, are different.) +/// +/// Possible bi-directional data flow in all of Barry: +/// Note that this class, DBData, represents the data+meta stage. +/// +/// data+meta <-> device +/// data+meta <-> backup file +/// data+meta <-> record object +/// record object <-> boost serialization +/// contact record object <-> ldif +/// +/// Possible uni-directional data flow in all of Barry: +/// +/// record object -> text dump +/// +class BXEXPORT DBData +{ +public: + enum RecordFormatVersion + { + REC_VERSION_1, + REC_VERSION_2 + }; + +private: + // record meta data + RecordFormatVersion m_version; + std::string m_dbName; + uint8_t m_recType; + uint32_t m_uniqueId; + size_t m_offset; + + // the raw data block, internal + Data *m_localData; + + // the data block to use... could be external or internal, + // and does not change for the life of the object + Data &m_data; + +public: + /// Default constructor, constructs an empty local Data object + DBData(); + + /// Constructs a local Data object that points to external memory + DBData(const void *ValidData, size_t size); + DBData(RecordFormatVersion ver, const std::string &dbName, + uint8_t recType, uint32_t uniqueId, size_t offset, + const void *ValidData, size_t size); + + /// If copy == false, constructs an external Data object, no local. + /// If copy == true, constructs an internal Data object copy + /// For speed, set copy to false. + /// If you want Copy On Write behaviour, similar to Data(buf,size), + /// then use the above (buf, size) constructor, not this one, + /// since this constructor uses Data's copy constructor. + DBData(Data &externalData, bool copy); + DBData(RecordFormatVersion ver, const std::string &dbName, + uint8_t recType, uint32_t uniqueId, size_t offset, + Data &externalData, bool copy); + + ~DBData(); + + // access meta data + RecordFormatVersion GetVersion() const { return m_version; } + const std::string& GetDBName() const { return m_dbName; } + uint8_t GetRecType() const { return m_recType; } + uint32_t GetUniqueId() const { return m_uniqueId; } + size_t GetOffset() const { return m_offset; } + + const Data& GetData() const { return m_data; } + Data& UseData(); + + // operations + void SetVersion(RecordFormatVersion ver) + { + m_version = ver; + } + + void SetDBName(const std::string &dbName) + { + m_dbName = dbName; + } + + void SetIds(uint8_t recType, uint32_t uniqueId) + { + m_recType = recType; + m_uniqueId = uniqueId; + } + + void SetOffset(size_t offset) + { + m_offset = offset; + } + + void CopyMeta(const DBData &src) + { + m_version = src.m_version; + m_dbName = src.m_dbName; + m_recType = src.m_recType; + m_uniqueId = src.m_uniqueId; + m_offset = src.m_offset; + } + + DBData& operator=(const DBData &other); +}; + } // namespace Barry #endif diff -Nru barry-0.14/src/dataqueue.cc barry-0.0.20110506/src/dataqueue.cc --- barry-0.14/src/dataqueue.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/dataqueue.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,8 +22,10 @@ #include "dataqueue.h" #include "scoped_lock.h" #include "data.h" -#include -#include +#include "time.h" +#include + +using namespace std; namespace Barry { @@ -43,11 +45,33 @@ scoped_lock lock(m_accessMutex); // FIXME - is this sane? while( m_queue.size() ) { - delete m_queue.front(); - m_queue.pop(); + delete raw_pop(); } } +// a push without locking - adds to the back +void DataQueue::raw_push(Data *data) +{ + try { + m_queue.push_back(data); + } + catch(...) { + delete data; + throw; + } +} + +// a pop without locking - removes from the front, and returns it +Data* DataQueue::raw_pop() +{ + if( m_queue.size() == 0 ) + return 0; + + Data *ret = m_queue.front(); + m_queue.pop_front(); + return ret; +} + // // push // @@ -59,21 +83,14 @@ /// void DataQueue::push(Data *data) { - try { - - { - scoped_lock lock(m_accessMutex); - m_queue.push(data); - } - - scoped_lock wait(m_waitMutex); - pthread_cond_broadcast(&m_waitCond); - - } - catch(...) { - delete data; - throw; + { + scoped_lock lock(m_accessMutex); + raw_push(data); } + + // on success, signal + scoped_lock wait(m_waitMutex); + pthread_cond_broadcast(&m_waitCond); } // @@ -87,13 +104,7 @@ Data* DataQueue::pop() { scoped_lock lock(m_accessMutex); - - if( m_queue.size() == 0 ) - return 0; - - Data *ret = m_queue.front(); - m_queue.pop(); - return ret; + return raw_pop(); } // @@ -108,15 +119,11 @@ /// Data* DataQueue::wait_pop(int timeout) { - Data *ret = 0; - // check if something's there already { scoped_lock access(m_accessMutex); if( m_queue.size() ) { - ret = m_queue.front(); - m_queue.pop(); - return ret; + return raw_pop(); } } @@ -136,33 +143,21 @@ size = m_queue.size(); if( size != 0 ) { // already have the lock, return now - ret = m_queue.front(); - m_queue.pop(); - return ret; + return raw_pop(); } } while( size == 0 ); } else { // timeout in conditional wait - struct timeval now; struct timespec to; - - gettimeofday(&now, NULL); - to.tv_sec = now.tv_sec + timeout / 1000; - to.tv_nsec = (now.tv_usec + timeout % 1000 * 1000) * 1000; - scoped_lock wait(m_waitMutex); - pthread_cond_timedwait(&m_waitCond, &m_waitMutex, &to); + pthread_cond_timedwait(&m_waitCond, &m_waitMutex, + ThreadTimeout(timeout, &to)); } scoped_lock access(m_accessMutex); - if( m_queue.size() == 0 ) - return 0; - - ret = m_queue.front(); - m_queue.pop(); - return ret; + return raw_pop(); } // @@ -185,11 +180,11 @@ scoped_lock them(other.m_accessMutex); while( other.m_queue.size() ) { - m_queue.push( other.m_queue.front() ); + raw_push( other.m_queue.front() ); // only pop after the copy, since in the // case of an exception we want to leave other intact - other.m_queue.pop(); + other.raw_pop(); } } @@ -215,6 +210,18 @@ return m_queue.size(); } +void DataQueue::DumpAll(std::ostream &os) const +{ + // queue is pushed to the back, and popped from the front + // (see raw_() functions) so this iterator direction will + // print the packets in the order they arrived + scoped_lock access(m_accessMutex); + queue_type::const_iterator b = m_queue.begin(), e = m_queue.end(); + for( ; b != e; ++b ) { + os << **b << endl; + } +} + } // namespace Barry diff -Nru barry-0.14/src/dataqueue.h barry-0.0.20110506/src/dataqueue.h --- barry-0.14/src/dataqueue.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/dataqueue.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,8 +22,9 @@ #ifndef __BARRY_DATAQUEUE_H__ #define __BARRY_DATAQUEUE_H__ -#include +#include #include +#include namespace Barry { @@ -39,7 +40,8 @@ /// class DataQueue { - typedef std::queue queue_type; + // always use the raw_push() and raw_pop() functions + typedef std::list queue_type; pthread_mutex_t m_waitMutex; pthread_cond_t m_waitCond; @@ -48,6 +50,10 @@ queue_type m_queue; +protected: + void raw_push(Data *data); + Data* raw_pop(); + public: DataQueue(); ~DataQueue(); // frees all data in the queue @@ -78,8 +84,16 @@ bool empty() const; // return true if empty size_t size() const; + + void DumpAll(std::ostream &os) const; }; +inline std::ostream& operator<< (std::ostream &os, const DataQueue &dq) +{ + dq.DumpAll(os); + return os; +} + } // namespace Barry #endif diff -Nru barry-0.14/src/debug.h barry-0.0.20110506/src/debug.h --- barry-0.14/src/debug.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/debug.h 2011-05-06 12:20:17.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -31,7 +31,7 @@ #endif // __BARRY_DEBUG_H__ // data dump output - controlled by command line -v switch -#define ddout(x) if(Barry::__data_dump_mode__) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; } +#define ddout(x) if(::Barry::__data_dump_mode__) { ::Barry::LogLock lock; (*::Barry::LogStream) << x << std::endl; } #ifdef __DEBUG_MODE__ // debugging on @@ -39,14 +39,14 @@ #undef eout // low level debug output - #define dout(x) if(Barry::__data_dump_mode__) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; } + #define dout(x) if(::Barry::__data_dump_mode__) { ::Barry::LogLock lock; (*::Barry::LogStream) << x << std::endl; } // #define dout(x) // exception output - #define eout(x) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; } + #define eout(x) { ::Barry::LogLock lock; (*::Barry::LogStream) << x << std::endl; } // easy exception output - #define eeout(c, r) { Barry::LogLock lock; (*Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; } + #define eeout(c, r) { ::Barry::LogLock lock; (*::Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; } // handle assert() #undef NDEBUG @@ -57,8 +57,8 @@ #undef eout #define dout(x) - #define eout(x) { Barry::LogLock lock; (*Barry::LogStream) << x << std::endl; } - #define eeout(c, r) { Barry::LogLock lock; (*Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; } + #define eout(x) { ::Barry::LogLock lock; (*::Barry::LogStream) << x << std::endl; } + #define eeout(c, r) { ::Barry::LogLock lock; (*::Barry::LogStream) << "Sent packet:\n" << c << "\n" << "Response packet:\n" << r << "\n"; } // handle assert() as well #define NDEBUG diff -Nru barry-0.14/src/dll.h barry-0.0.20110506/src/dll.h --- barry-0.14/src/dll.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/dll.h 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -60,5 +60,29 @@ #endif + +// +// Add this to the end of variable argument function declarations. +// For example: +// +// void log(const char *msg, ...) BARRY_GCC_FORMAT_CHECK(1, 2); +// +// This tells GCC that the first argument is the format string, and +// the second is the first variable argument to check. +// +// If you use this inside a class, you need to allow for the invisible +// 'this' pointer: +// +// class Trace { +// public: +// void logf(const char *msg, ...) BARRY_GCC_FORMAT_CHECK(2, 3); +// }; +// +#if __GNUC__ +#define BARRY_GCC_FORMAT_CHECK(a,b) __attribute__ ((format(printf, a, b))) +#else +#define BARRY_GCC_FORMAT_CHECK(a,b) +#endif + #endif diff -Nru barry-0.14/src/dp_codinfo.cc barry-0.0.20110506/src/dp_codinfo.cc --- barry-0.14/src/dp_codinfo.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/dp_codinfo.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,697 @@ +/** + * @file dp_codinfo.cc + * @author Nicolas VIVIEN + * @date 2009-08-01 + * + * @note CopyRight Nicolas VIVIEN + * + * @brief COD debug file parser + * RIM's JDE generates several files when you build a COD application. + * Indeed, with the COD files for the device, we have a ".debug" file. + * This file is usefull to debug an application from JVM. + * This tool is a parser to understand these ".debug" files. + * + * @par Modifications + * - 2009/08/01 : N. VIVIEN + * - First release + * + * @par Licences + * Copyright (C) 2009-2010, Nicolas VIVIEN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 in the COPYING file at the + * root directory of this project for more details. + */ + + +#include +#include + +#include +#include +#include + +#include "dp_parser.h" +#include "dp_codinfo.h" +#include "debug.h" + + +#define COD_DEBUG_APPNAME_HEADERFIELD 0x0 +#define COD_DEBUG_UNIQUEID_HEADERFIELD 0x8 + +#define COD_DEBUG_NONE_FIELD 0x0 +#define COD_DEBUG_BOOLEAN_FIELD 0x1 +#define COD_DEBUG_BYTE_FIELD 0x2 +#define COD_DEBUG_CHAR_FIELD 0x3 +#define COD_DEBUG_SHORT_FIELD 0x4 +#define COD_DEBUG_INT_FIELD 0x5 +#define COD_DEBUG_LONG_FIELD 0x6 +#define COD_DEBUG_CLASS_FIELD 0x7 +#define COD_DEBUG_ARRAY_FIELD 0x8 +#define COD_DEBUG_VOID_FIELD 0xA +#define COD_DEBUG_DOUBLE_FIELD 0xC + + +using namespace std; + + +namespace Barry { + +namespace JDG { + + +// Public API +//------------ + +#define DEBUG_FILE_EXT ".debug" + + +void SearchDebugFile(DebugFileList &list) +{ + DIR *path; + struct dirent *entry; + + path = opendir("."); + + while( (entry = readdir(path)) ) { + int offset; + + if (strlen(entry->d_name) < strlen(DEBUG_FILE_EXT)) + continue; + + offset = strlen(entry->d_name) - strlen(DEBUG_FILE_EXT); + + if (!strcmp(entry->d_name + offset, DEBUG_FILE_EXT)) { + ifstream file(entry->d_name); + + CodInfo info; + + // Parse header section + info.ParseHeaderSection(file); + + // Add element to list + list.AddElement(info.GetUniqueId(), info.GetAppName(), entry->d_name); + } + } + + closedir(path); +} + + +bool LoadDebugInfo(const DebugFileList &list, const char *filename, CodInfo &info) +{ + if (filename == NULL) + return false; + + DebugFileList::const_iterator b = list.begin(); + + for( ; b != list.end(); b++ ) { + const DebugFileEntry &entry = (*b); + + if( entry.fileName == filename ) { + info.LoadDebugFile(filename); + return true; + } + } + + return false; +} + + +bool LoadDebugInfo(const DebugFileList &list, const uint32_t uniqueId, const std::string module, CodInfo &info) +{ + DebugFileList::const_iterator b = list.begin(); + + for( ; b != list.end(); b++ ) { + const DebugFileEntry &entry = (*b); + + if ((entry.uniqueId == uniqueId) && (entry.appName == module)) { + info.LoadDebugFile(entry.fileName.c_str()); + return true; + } + } + + return false; +} + + +// DebugFileList class +//------------------------ + +void DebugFileList::AddElement(uint32_t uniqueid, + const std::string &appname, + const std::string &filename) +{ + DebugFileEntry entry; + + entry.uniqueId = uniqueid; + entry.appName = appname; + entry.fileName = filename; + + push_back(entry); +} + + +void DebugFileList::Dump(std::ostream &os) const +{ + const_iterator i = begin(), e = end(); + + os << " UniqueID " << "|"; + os << " Module Name " << "|"; + os << " File Name " << endl; + + os << "------------+"; + os << "--------------------------+"; + os << "--------------------------"; + os << endl; + + for( ; i != e; ++i ) { + (*i).Dump(os); + } +} + + +void DebugFileEntry::Dump(std::ostream &os) const +{ + os << " 0x" << setfill('0') << setw(8) << hex << uniqueId << " |"; + os << " " << appName << setfill(' ') << setw(24) << " |"; + os << " " << fileName << endl; +} + + +// ClassList class +//--------------------------- + + +void ClassList::CreateDefaultEntries() +{ + ClassEntry entry; + + // 1 + entry.classPath = "com.rim.resources"; + entry.className = "net_rim_rimsecuridlibRIMResources"; + push_back(entry); + + // 2 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimSecurIDLib"; + push_back(entry); + + // 3 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimDatabaseFullException"; + push_back(entry); + + // 4 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimDecryptFailException"; + push_back(entry); + + // 5 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimDuplicateNameException"; + push_back(entry); + + // 6 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimDuplicateTokenException"; + push_back(entry); + + // 7 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimInvalidParamException"; + push_back(entry); + + // 8 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimSecurIDLib"; + push_back(entry); + + // 9 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimWrongDeviceIDException"; + push_back(entry); + + // 10 + entry.classPath = "net.rim.device.cldc.impl.softtoken.rimsecuridlib"; + entry.className = "RimWrongFormFactorException"; + push_back(entry); +} + + +// CodInfo class +//------------------------ + +bool CodInfo::LoadDebugFile(const char *filename) +{ + uint32_t field; + + if (filename == NULL) + return false; + + ifstream file(filename); + + // Parse header file + ParseHeaderSection(file); + + // Parse type area zone + ParseTypeSection(file); + + // FIXME : ??? + field = ParseInteger(file); // Read 0x0 + field = ParseInteger(file); // Read 0x1 + + // FIXME : ??? + field = ParseInteger(file); // Read 0x0 + field = ParseInteger(file); // Read 0x0 or 0xA + + if (field == 0xA) { + // Parse ressource area zone + ParseResourceSection(file); + } + + return true; +} + + +uint32_t CodInfo::GetUniqueId() +{ + return uniqueId; +} + + +string CodInfo::GetAppName() +{ + return appName; +} + + +// Private API - Section parsing +//------------------------------- + +void CodInfo::ParseHeaderSection(istream &input) +{ + uint32_t type; + + type = ParseNextHeaderField(input); + + if (type != COD_DEBUG_UNIQUEID_HEADERFIELD) + return; + + type = ParseNextHeaderField(input); + + if (type != COD_DEBUG_APPNAME_HEADERFIELD) + return; +} + + +void CodInfo::ParseTypeSection(istream &input) +{ + uint32_t type; + uint32_t count; + uint32_t nbr, check; + + // Read number of declared type content into this section + nbr = ParseInteger(input); + + // Read each object + count = 0; + + while (!input.eof()) { + type = ParseNextTypeField(input); + + if (type == COD_DEBUG_NONE_FIELD) + break; + + count++; + } + + // Read again number of declared type content into this section + // We have to find the same value + check = ParseInteger(input); + + // Checking... + dout("Nbr = " << dec << nbr << " / Count = " << dec << count << " / check = " << check); +} + + +void CodInfo::ParseResourceSection(istream &input) +{ + uint32_t len; + uint32_t type; + uint32_t unknown01; + uint32_t unknown02; + uint32_t unknown03; + uint32_t unknown04; + uint32_t unknown05; + uint32_t unknown06; + uint32_t unknown07; + + string name; + + // type = 1 + for (int i=0; i<10; i++) { + type = ParseInteger(input); + + len = ParseInteger(input); + name = ParseString(input, len); + + unknown01 = ParseInteger(input); + unknown02 = ParseInteger(input); + unknown03 = ParseInteger(input); + + dout("JDGCodInfo::parseRessource" + << "\n Name : " << name + << "\n unknown01 : " << hex << unknown01 + << "\n unknown02 : " << hex << unknown02 + << "\n unknown03 : " << hex << unknown03); + } + + // type = 2 + type = ParseInteger(input); + + len = ParseInteger(input); + name = ParseString(input, len); + + unknown01 = ParseInteger(input); + unknown02 = ParseInteger(input); + unknown03 = ParseInteger(input); + unknown04 = ParseInteger(input); + unknown05 = ParseInteger(input); + unknown06 = ParseInteger(input); + unknown07 = ParseInteger(input); + + dout("JDGCodInfo::parseRessource" + << "\n Name : " << name + << "\n unknown01 : " << hex << unknown01 + << "\n unknown02 : " << hex << unknown02 + << "\n unknown03 : " << hex << unknown03 + << "\n unknown04 : " << hex << unknown04 + << "\n unknown05 : " << hex << unknown05 + << "\n unknown06 : " << hex << unknown06 + << "\n unknown07 : " << hex << unknown07); + + // type = 1 + type = ParseInteger(input); + + len = ParseInteger(input); + name = ParseString(input, len); + + unknown01 = ParseInteger(input); + unknown02 = ParseInteger(input); + unknown03 = ParseInteger(input); + unknown04 = ParseInteger(input); + + dout("JDGCodInfo::parseRessource" + << "\n Name : " << name + << "\n unknown01 : " << hex << unknown01 + << "\n unknown02 : " << hex << unknown02 + << "\n unknown03 : " << hex << unknown03 + << "\n unknown04 : " << hex << unknown04); + + // type = 0 + type = ParseInteger(input); + + len = ParseInteger(input); + name = ParseString(input, len); + + unknown01 = ParseInteger(input); + unknown02 = ParseInteger(input); + unknown03 = ParseInteger(input); + unknown04 = ParseInteger(input); + unknown05 = ParseInteger(input); + + dout("JDGCodInfo::parseRessource" + << "\n Name : " << name + << "\n unknown01 : " << hex << unknown01 + << "\n unknown02 : " << hex << unknown02 + << "\n unknown03 : " << hex << unknown03 + << "\n unknown04 : " << hex << unknown04 + << "\n unknown05 : " << hex << unknown05); +} + + + +// Private API - Field parsing +//------------------------------- + + +uint32_t CodInfo::ParseNextHeaderField(istream &input) +{ + uint32_t type = ParseInteger(input); + + switch (type) { + case COD_DEBUG_UNIQUEID_HEADERFIELD: + ParseUniqueId(input); + break; + + case COD_DEBUG_APPNAME_HEADERFIELD: + ParseAppName(input); + break; + + default: + type = 0xFFFFFFFF; + } + + return type; +} + + +uint32_t CodInfo::ParseNextTypeField(istream &input) +{ + uint32_t type = ParseInteger(input); + + switch (type) { + case COD_DEBUG_NONE_FIELD: + break; + + case COD_DEBUG_BOOLEAN_FIELD: + ParseBoolean(input); + break; + + case COD_DEBUG_BYTE_FIELD: + ParseByte(input); + break; + + case COD_DEBUG_CHAR_FIELD: + ParseChar(input); + break; + + case COD_DEBUG_SHORT_FIELD: + ParseShort(input); + break; + + case COD_DEBUG_INT_FIELD: + ParseInt(input); + break; + + case COD_DEBUG_LONG_FIELD: + ParseLong(input); + break; + + case COD_DEBUG_CLASS_FIELD: + ParseClass(input); + break; + + case COD_DEBUG_ARRAY_FIELD: + ParseArray(input); + break; + + case COD_DEBUG_VOID_FIELD: + ParseVoid(input); + break; + + case COD_DEBUG_DOUBLE_FIELD: + ParseDouble(input); + break; + + default: + dout("Type unknown ! " << hex << type); + type = 0xFFFFFFFF; + } + + return type; +} + + +void CodInfo::ParseUniqueId(istream &input) +{ + uniqueId = ParseInteger(input); +} + + +void CodInfo::ParseAppName(istream &input) +{ + uint32_t len = ParseInteger(input); + + appName = ParseString(input, len); +} + + +void CodInfo::ParseBoolean(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseBoolean\n name : " << str); +} + + +void CodInfo::ParseByte(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseByte\n name : " << str); +} + + +void CodInfo::ParseChar(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseChar\n name : " << str); +} + + +void CodInfo::ParseShort(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseShort\n name : " << str); +} + + +void CodInfo::ParseInt(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseInt\n name : " << str); +} + + +void CodInfo::ParseLong(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseLong\n name : " << str); +} + + +void CodInfo::ParseClass(istream &input) +{ + uint32_t len; + + ClassEntry object; + + dout("JDG::CodInfo::ParseClass"); + + len = ParseInteger(input); + + object.className = ParseString(input, len); + + object.type = ParseInteger(input); + object.unknown02 = ParseInteger(input); + object.unknown03 = ParseInteger(input); + object.id = ParseInteger(input); + + len = ParseInteger(input); + + if (len == 0) + object.classPath = "com.barry." + appName; + else if (len != 0xFFFFFF) + object.classPath = ParseString(input, len); + + len = ParseInteger(input); + + object.sourceFile = ParseString(input, len); + + object.unknown05 = ParseInteger(input); + object.unknown06 = ParseInteger(input); + object.unknown07 = ParseInteger(input); + object.unknown08 = ParseInteger(input); + + classList.push_back(object); + + dout("\n name : " << object.className + << "\n path : " << object.classPath + << "\n type : " << hex << object.type + << "\n unknown02 : " << hex << object.unknown02 + << "\n unknown03 : " << hex << object.unknown03 + << "\n id : " << hex << object.id + << "\n source file : " << object.sourceFile + << "\n unknown05 : " << hex << object.unknown05 + << "\n unknown06 : " << hex << object.unknown06 + << "\n unknown07 : " << hex << object.unknown07 + << "\n unknown08 : " << hex << object.unknown08); +} + + +void CodInfo::ParseArray(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseArray\n name : " << str); +} + + +void CodInfo::ParseVoid(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseVoid\n name : " << str); +} + + +void CodInfo::ParseDouble(istream &input) +{ + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("JDG::CodInfo::ParseDouble\n name : " << str); +} + +/* +void CodInfo::ParseType2(istream &input) { + uint32_t value; + uint32_t len = ParseInteger(input); + + string str = ParseString(input, len); + + dout("Type2 : " << str); + + value = ParseInteger(input); + value = ParseInteger(input); + value = ParseInteger(input); + value = ParseInteger(input); + value = ParseInteger(input); + value = ParseInteger(input); +} +*/ +} // namespace JDG + +} // namespace Barry + diff -Nru barry-0.14/src/dp_codinfo.h barry-0.0.20110506/src/dp_codinfo.h --- barry-0.14/src/dp_codinfo.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/dp_codinfo.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,160 @@ +/// +/// \file dp_codinfo.h +/// Debug file parsing +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYJDG_CODINFO_H__ +#define __BARRYJDG_CODINFO_H__ + + +#include "dll.h" +#include +#include +#include +#include + + +namespace Barry { + +namespace JDG { + + +class BXEXPORT DebugFileEntry +{ +private: +protected: + +public: + std::string fileName; + std::string appName; + uint32_t uniqueId; + + void Dump(std::ostream &os) const; +}; + + +class BXEXPORT DebugFileList : public std::vector +{ +public: + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + +public: + void AddElement(uint32_t uniqueid, const std::string &appname, const std::string &filename); + void Dump(std::ostream &os) const; +}; +inline std::ostream& operator<<(std::ostream &os, const DebugFileList &list) { + list.Dump(os); + return os; +} + + +class BXEXPORT ClassEntry +{ +private: +protected: + +public: + // For JDB + int index; + + // Read from the ".debug" file + std::string className; + std::string classPath; + std::string sourceFile; + + uint32_t type; + uint32_t unknown02; + uint32_t unknown03; + uint32_t id; + uint32_t unknown05; + uint32_t unknown06; + uint32_t unknown07; + uint32_t unknown08; + + std::string GetFullClassName() { return classPath + "." + className; }; +}; + + +class BXEXPORT ClassList : public std::vector +{ +public: + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + +public: + void CreateDefaultEntries(); +}; + + + + + +class BXEXPORT CodInfo +{ +private: + uint32_t ParseNextHeaderField(std::istream &input); + uint32_t ParseNextTypeField(std::istream &input); + + void ParseAppName(std::istream &input); + void ParseUniqueId(std::istream &input); + + void ParseBoolean(std::istream &input); + void ParseByte(std::istream &input); + void ParseChar(std::istream &input); + void ParseShort(std::istream &input); + void ParseInt(std::istream &input); + void ParseLong(std::istream &input); + void ParseClass(std::istream &input); + void ParseArray(std::istream &input); + void ParseVoid(std::istream &input); + void ParseDouble(std::istream &input); + +protected: + +public: + uint32_t uniqueId; + std::string appName; + ClassList classList; + + bool LoadDebugFile(const char *filename); + + void ParseHeaderSection(std::istream &input); + void ParseTypeSection(std::istream &input); + void ParseResourceSection(std::istream &input); + + uint32_t GetUniqueId(); + std::string GetAppName(); +}; + + +BXEXPORT void SearchDebugFile(DebugFileList &list); +BXEXPORT bool LoadDebugInfo(const DebugFileList &list, const char *filename, CodInfo &info); +BXEXPORT bool LoadDebugInfo(const DebugFileList &list, const uint32_t uniqueId, const std::string module, CodInfo &info); + + +} // namespace JDG + +} // namespace Barry + + +#endif + diff -Nru barry-0.14/src/dp_parser.cc barry-0.0.20110506/src/dp_parser.cc --- barry-0.14/src/dp_parser.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/dp_parser.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,81 @@ +/** + * @file dp_parser.cc + * @author Nicolas VIVIEN + * @date 2009-08-01 + * + * @note CopyRight Nicolas VIVIEN + * + * @brief COD debug file parser + * RIM's JDE generates several files when you build a COD application. + * Indeed, with the COD files for the device, we have a ".debug" file. + * This file is usefull to debug an application from JVM. + * This tool is a parser to understand these ".debug" files. + * Obviously, the file contents only some strings and 32 bits words. + * + * @par Modifications + * - 2009/08/01 : N. VIVIEN + * - First release + * + * @par Licences + * Copyright (C) 2009-2010, Nicolas VIVIEN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 in the COPYING file at the + * root directory of this project for more details. + */ + + +#include +#include +#include "dp_parser.h" +#include "endian.h" + + +using namespace std; + + +namespace Barry { + +namespace JDG { + + +string ParseString(istream &input, const int length) +{ + int i; + string str; + + for (i=0; i +#include +#include + +namespace Barry { + +namespace JDG { + +std::string ParseString(std::istream &input, const int length); +uint32_t ParseInteger(std::istream &input); + +} // namespace JDG + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/endian.h barry-0.0.20110506/src/endian.h --- barry-0.14/src/endian.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/endian.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,16 +24,8 @@ // The Blackberry is little endian in its USB data. Fortunately, // this makes conversion easy on the x86... -#include "config.h" - -#ifndef WORDS_BIGENDIAN -#define btohs(x) x // for uint16_t -#define btohl(x) x // for uint32_t -#define btohll(x) x // for uint64_t -#define htobs(x) x // for uint16_t -#define htobl(x) x // for uint32_t -#define htobll(x) x // for uint64_t -#else +#include "config.h" // endian.h is not installed, so this is safe +#include //#include @@ -43,25 +35,54 @@ // http://www.netstumbler.org/showpost.php?s=79764fd1526e4653d5cb4432225da6ee&p=190494&postcount=29 //#warning "byteswap.h is an unportable GNU extension! Don't use!" - -static inline unsigned short bswap_16(unsigned short x) { +static inline unsigned short bbswap_16(unsigned short x) { return (x>>8) | (x<<8); } -static inline unsigned int bswap_32(unsigned int x) { - return (bswap_16(x&0xffff)<<16) | (bswap_16(x>>16)); +static inline unsigned int bbswap_32(unsigned int x) { + return (bbswap_16(x&0xffff)<<16) | (bbswap_16(x>>16)); } -static inline unsigned long long bswap_64(unsigned long long x) { - return (((unsigned long long)bswap_32(x&0xffffffffull))<<32) | (bswap_32(x>>32)); +static inline uint64_t bbswap_64(uint64_t x) { + return (((uint64_t)bbswap_32(x&0xffffffffull))<<32) | (bbswap_32(x>>32)); } -#define btohs(x) bswap_16(x) // for uint16_t -#define btohl(x) bswap_32(x) // for uint32_t -#define btohll(x) bswap_64(x) // for uint64_t -#define htobs(x) bswap_16(x) // for uint16_t -#define htobl(x) bswap_32(x) // for uint32_t -#define htobll(x) bswap_64(x) // for uint64_t +#ifndef WORDS_BIGENDIAN + +// For when Blackberry needs little endian (most of the time) +#define btohs(x) x // for uint16_t +#define btohl(x) x // for uint32_t +#define btohll(x) x // for uint64_t +#define htobs(x) x // for uint16_t +#define htobl(x) x // for uint32_t +#define htobll(x) x // for uint64_t + +// For when Blackberry needs big endian (often in JavaLoader protocol) +#define be_btohs(x) bbswap_16(x) // for uint16_t +#define be_btohl(x) bbswap_32(x) // for uint32_t +#define be_btohll(x) bbswap_64(x) // for uint64_t +#define be_htobs(x) bbswap_16(x) // for uint16_t +#define be_htobl(x) bbswap_32(x) // for uint32_t +#define be_htobll(x) bbswap_64(x) // for uint64_t + +#else + +// For when Blackberry needs little endian (most of the time) +#define btohs(x) bbswap_16(x) // for uint16_t +#define btohl(x) bbswap_32(x) // for uint32_t +#define btohll(x) bbswap_64(x) // for uint64_t +#define htobs(x) bbswap_16(x) // for uint16_t +#define htobl(x) bbswap_32(x) // for uint32_t +#define htobll(x) bbswap_64(x) // for uint64_t + +// For when Blackberry needs big endian (often in JavaLoader protocol) +#define be_btohs(x) x // for uint16_t +#define be_btohl(x) x // for uint32_t +#define be_btohll(x) x // for uint64_t +#define be_htobs(x) x // for uint16_t +#define be_htobl(x) x // for uint32_t +#define be_htobll(x) x // for uint64_t + #endif #endif diff -Nru barry-0.14/src/error.cc barry-0.0.20110506/src/error.cc --- barry-0.14/src/error.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/error.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,6 +27,36 @@ namespace Barry { +////////////////////////////////////////////////////////////////////////////// +// BadSize exception + +BadSize::BadSize(const char *msg, unsigned int data_size, + unsigned int required_size) + : Barry::Error(GetMsg(msg, data_size, required_size)) + , m_packet_size(0) + , m_data_buf_size(data_size) + , m_required_size(required_size) +{ +} + +BadSize::BadSize(unsigned int packet_size, + unsigned int data_buf_size, + unsigned int required_size) + : Barry::Error(GetMsg(packet_size, data_buf_size, required_size)) + , m_packet_size(packet_size) + , m_data_buf_size(data_buf_size) + , m_required_size(required_size) +{ +} + +std::string BadSize::GetMsg(const char *msg, unsigned int d, unsigned int r) +{ + std::ostringstream oss; + oss << msg << ": Bad packet size, not enough data: DataSize(): " << d + << ". Required size: " << r; + return oss.str(); +} + std::string BadSize::GetMsg(unsigned int p, unsigned int d, unsigned int r) { std::ostringstream oss; @@ -36,6 +66,22 @@ return oss.str(); } + +////////////////////////////////////////////////////////////////////////////// +// ErrnoError exception + +ErrnoError::ErrnoError(const std::string &msg) + : Barry::Error(msg) + , m_errno(0) +{ +} + +ErrnoError::ErrnoError(const std::string &msg, int err) + : Barry::Error(GetMsg(msg, err)) + , m_errno(err) +{ +} + std::string ErrnoError::GetMsg(const std::string &msg, int err) { std::ostringstream oss; diff -Nru barry-0.14/src/error.h barry-0.0.20110506/src/error.h --- barry-0.14/src/error.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/error.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,7 +23,9 @@ #define __BARRY_ERROR_H__ #include "dll.h" +#include "pin.h" #include +#include namespace Barry { @@ -55,7 +57,7 @@ /// trying passwords if there are fewer than /// BARRY_MIN_PASSWORD_TRIES tries remaining. In this case, /// out_of_tries() will return true. -/// +/// /// class BXEXPORT BadPassword : public Barry::Error { @@ -74,6 +76,48 @@ }; // +// SocketCloseOnOpen +// +/// Thrown by the Socket class if it receives a CLOSE message in +/// response to an OPEN command. This can mean a number of things: +/// +/// - device is password protected, and the wrong password was given +/// - device thinks that the socket is already open +/// +/// This special exception thrown so the application can try again +/// with a fresh Socket::Open() call. +/// +class BXEXPORT SocketCloseOnOpen : public Barry::Error +{ +public: + SocketCloseOnOpen(const std::string &str) : Barry::Error(str) {} +}; + +// +// PinNotFound +// +/// Thrown by the Connector class when unable to find the requested Pin +/// If the attached pin is not Valid(), then unable to autodetect device. +/// If pin is Valid(), then the specified pin number was not available. +/// probe_count is the number of devices found during the probe. +/// +class BXEXPORT PinNotFound : public Barry::Error +{ + Barry::Pin m_pin; + int m_probe_count; + +public: + PinNotFound(Barry::Pin pin, int probe_count) + : Barry::Error("PIN not found: " + pin.Str()) + , m_pin(pin) + , m_probe_count(probe_count) + {} + + const Barry::Pin& pin() const { return m_pin; } + int probe_count() const { return m_probe_count; } +}; + +// // BadData // /// Thrown by record classes if their data is invalid and cannot be @@ -98,17 +142,14 @@ m_data_buf_size, m_required_size; + BXLOCAL static std::string GetMsg(const char *msg, unsigned int d, unsigned int r); BXLOCAL static std::string GetMsg(unsigned int p, unsigned int d, unsigned int r); public: + BadSize(const char *msg, unsigned int data_size, unsigned int required_size); BadSize(unsigned int packet_size, unsigned int data_buf_size, - unsigned int required_size) - : Barry::Error(GetMsg(packet_size, data_buf_size, required_size)), - m_packet_size(packet_size), - m_data_buf_size(data_buf_size), - m_required_size(required_size) - {} + unsigned int required_size); unsigned int packet_size() const { return m_packet_size; } unsigned int data_buf_size() const { return m_data_buf_size; } unsigned int required_size() const { return m_required_size; } @@ -119,21 +160,111 @@ // /// System error that provides an errno error code. /// -class ErrnoError : public Barry::Error +class BXEXPORT ErrnoError : public Barry::Error { int m_errno; - static std::string GetMsg(const std::string &msg, int err); + BXLOCAL static std::string GetMsg(const std::string &msg, int err); + +protected: + ErrnoError(const std::string &msg); // for derived classes public: - ErrnoError(const std::string &msg, int err) - : Barry::Error(GetMsg(msg, err)) - , m_errno(err) - {} + ErrnoError(const std::string &msg, int err); int error_code() const { return m_errno; } }; +// +// ConfigFileError +// +/// Thrown by the ConfigFile class when encountering a serious system +/// error while loading the global config file for a given PIN. +/// +class BXEXPORT ConfigFileError : public Barry::ErrnoError +{ +public: + ConfigFileError(const char *msg) : Barry::ErrnoError(msg) {} + ConfigFileError(const char *msg, int err) + : Barry::ErrnoError(msg, err) + {} +}; + +// +// BadPackedFormat +// +/// Thrown by record classes that don't recognize a given packed format code. +/// This exception is mostly handled internally, but is published here +/// just in case it escapes. +/// +class BXEXPORT BadPackedFormat : public Barry::Error +{ + uint8_t m_format; + +public: + BadPackedFormat(uint8_t format) + : Barry::Error("Bad packed format - internal exception") + , m_format(format) + {} + + uint8_t format() const { return m_format; } +}; + +// +// BadPacket +// +/// Thrown by the socket class if a packet command's response indicates +/// an error. Some commands may be able to recover inside the library, +/// so a special exception is used, that includes the response code. +/// +class BXEXPORT BadPacket : public Barry::Error +{ + uint8_t m_response; + +public: + BadPacket(uint8_t response, const std::string &msg) + : Barry::Error(msg) + , m_response(response) + {} + + uint8_t response() const { return m_response; } +}; + +// +// ConvertError +// +/// Thrown by the vformat related barrysync library classes. +/// +class BXEXPORT ConvertError : public Barry::Error +{ +public: + ConvertError(const std::string &msg) : Barry::Error(msg) {} +}; + +// +// BackupError +// +/// Thrown by the Backup parser class when there is a problem with the +/// low level file operation. +/// +class BXEXPORT BackupError : public Barry::Error +{ +public: + BackupError(const std::string &str) : Error(str) {} +}; + +// +// RestoreError +// +/// Thrown by the Restore builder class when there is a problem with the +/// low level file operation. +/// +class BXEXPORT RestoreError : public Barry::Error +{ +public: + RestoreError(const std::string &str) : Error(str) {} +}; + /// @} } // namespace Barry diff -Nru barry-0.14/src/iconv.cc barry-0.0.20110506/src/iconv.cc --- barry-0.14/src/iconv.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/iconv.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,174 @@ +/// +/// \file iconv.cc +/// iconv wrapper class, and pluggable interface for records +/// + +/* + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "iconv.h" +#include "common.h" +#include "error.h" +#include "config.h" +#include +#include +#include + +using namespace std; + +namespace Barry { + +////////////////////////////////////////////////////////////////////////////// +// IConvHandlePrivate class +class IConvHandlePrivate +{ +public: + iconv_t m_handle; + + IConvHandlePrivate() + { + } +}; + +////////////////////////////////////////////////////////////////////////////// +// IConvHandle class + +IConvHandle::IConvHandle(const char *fromcode, + const char *tocode, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ + m_priv->m_handle = iconv_open(tocode, fromcode); + if( m_priv->m_handle == (iconv_t)(-1) ) { + throw ErrnoError(std::string("iconv_open failed: from ") + fromcode + " to " + tocode, errno); + } +} + +IConvHandle::IConvHandle(const char *fromcode, + const IConverter &ic, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ + m_priv->m_handle = iconv_open(ic.m_tocode.c_str(), fromcode); + if( m_priv->m_handle == (iconv_t)(-1) ) { + throw ErrnoError(std::string("iconv_open failed: from ") + fromcode + " to " + ic.m_tocode, errno); + } +} + +IConvHandle::IConvHandle(const IConverter &ic, + const char *tocode, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ + m_priv->m_handle = iconv_open(tocode, ic.m_tocode.c_str()); + if( m_priv->m_handle == (iconv_t)(-1) ) { + throw ErrnoError(std::string("iconv_open failed: from ") + ic.m_tocode + " to " + tocode, errno); + } +} + +IConvHandle::~IConvHandle() +{ + iconv_close(m_priv->m_handle); +} + +std::string IConvHandle::Convert(Data &tmp, const std::string &str) const +{ + size_t target = str.size() * 2; + char *out = 0, *outstart = 0; + size_t outbytesleft = 0; + std::string ret; + iconv_t cd = m_priv->m_handle; + + // this loop is for the very odd case that the output string + // needs more than twice the input size + for( int tries = 0; ; tries++ ) { + + const char *in = str.data(); + size_t inbytesleft = str.size(); + out = outstart = (char*) tmp.GetBuffer(target); + outbytesleft = tmp.GetBufSize(); + + iconv(cd, NULL, NULL, NULL, NULL); // reset cd's state + size_t status = iconv(cd, (ICONV_CONST char**) &in, &inbytesleft, &out, &outbytesleft); + + if( status == (size_t)(-1) ) { + if( errno == E2BIG && tries < 2 ) { + target += inbytesleft * 2; + // try again with more memory... + continue; + } + + // should never happen :-) + // but if it does, and we get here, check + // whether the user wants to be notified by + // exception... if not, just fall through and + // store as much converted data as possible + ErrnoError e(string("iconv failed with string '") + str + "'", errno); + if( m_throw_on_conv_err ) { + throw e; + } + else { + cerr << e.what(); + // return the unconverted string + return str; + } + } + else { + // success + break; + } + } + + // store any available converted data + ret.assign(outstart, out - outstart); + return ret; +} + + +////////////////////////////////////////////////////////////////////////////// +// IConvHandle class + +IConverter::IConverter(const char *tocode, bool throw_on_conv_err) + : m_from(BLACKBERRY_CHARSET, tocode, throw_on_conv_err) + , m_to(tocode, BLACKBERRY_CHARSET, throw_on_conv_err) + , m_tocode(tocode) +{ +} + +IConverter::~IConverter() +{ +} + +std::string IConverter::FromBB(const std::string &str) const +{ + return m_from.Convert(m_buffer, str); +} + +std::string IConverter::ToBB(const std::string &str) const +{ + return m_to.Convert(m_buffer, str); +} + +std::string IConverter::Convert(const IConvHandle &custom, const std::string &str) const +{ + return custom.Convert(m_buffer, str); +} + +} // namespace Barry + diff -Nru barry-0.14/src/iconv.h barry-0.0.20110506/src/iconv.h --- barry-0.14/src/iconv.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/iconv.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,129 @@ +/// +/// \file iconv.h +/// iconv wrapper class, and pluggable interface for records +/// + +/* + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_ICONV_H__ +#define __BARRY_ICONV_H__ + +#include "dll.h" +#include "data.h" +#include +#include + +namespace Barry { + +class IConverter; +class IConvHandlePrivate; + +// +// IConvHandle class +// +/// Wrapper class for a two-way iconv_t handle pair. Automatically +/// handles closing in the destructor. +// +class BXEXPORT IConvHandle +{ + friend class IConverter; + + std::auto_ptr m_priv; + + bool m_throw_on_conv_err; + +private: + // no copying + IConvHandle(const IConvHandle &other); + IConvHandle& operator=(const IConvHandle &other); + + // private constructor, used only by IConverter + IConvHandle(const char *fromcode, const char *tocode, bool throwable); + + // the heart of the conversion + std::string Convert(Data &tmp, const std::string &str) const; + +public: + // custom conversions from any to IConverter's 'tocode' + IConvHandle(const char *fromcode, const IConverter &ic, + bool throw_on_conv_err = false); + // custom conversions from IConverter's 'tocode' to any + IConvHandle(const IConverter &ic, const char *tocode, + bool throw_on_conv_err = false); + ~IConvHandle(); +}; + +// +// IConverter +// +/// Main charset conversion class, primarily focused on converting +/// between the Blackberry charset and an application-specified one. +/// Additional conversions are possible through custom IConvHandle, +/// but the goal of this class design is to deal with _one_ +/// application defined charset, and provide a means to convert +/// to/from that charset to/from any other charset needed by +/// the Blackberry. +/// +/// By default, this class assumes the Blackberry's charset is +/// WINDOWS-1252, but some data, such as SMS message bodies, can have +/// custom charsets as specified by the records. To convert from +/// such a custom charset, use: +/// +/// // application sets up IConverter +/// IConverter ic("UTF-8"); +/// +/// // somewhere in the library, needing to convert +/// // from UCS2 to whatever the application selected +/// IConvHandle ucs2("UCS2", ic); +/// application_string = ic.Convert(ucs2, ucs2_string_data); +/// +/// // and to convert back... +/// IConvHandle ucs2_reverse(ic, "UCS2"); +/// ucs2_string = ic.Convert(ucs2_reverse, application_string_data); +/// +class BXEXPORT IConverter +{ + friend class IConvHandle; + + IConvHandle m_from; + IConvHandle m_to; + std::string m_tocode; + + // internal buffer for fast conversions + mutable Data m_buffer; + +public: + /// Always throws ErrnoError if unable to open iconv. + /// If throw_on_conv_err is true, then string conversion operations + /// that fail will also throw ErrnoError. + explicit IConverter(const char *tocode = "UTF-8", + bool throw_on_conv_err = false); + ~IConverter(); + + std::string FromBB(const std::string &str) const; + std::string ToBB(const std::string &str) const; + + // Custom override functions, meant for converting between + // non-BLACKBERRY_CHARSET charsets and the tocode set by the + // IConverter constructor + std::string Convert(const IConvHandle &custom, const std::string &str) const; +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/iconvwin.cc barry-0.0.20110506/src/iconvwin.cc --- barry-0.14/src/iconvwin.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/iconvwin.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,107 @@ +/// +/// \file iconvwin.cc +/// iconv wrapper class for Windows +/// + +/* + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "iconv.h" +#include "common.h" +#include "error.h" +#include +#include + +using namespace std; + +namespace Barry { + +////////////////////////////////////////////////////////////////////////////// +// IConvHandlePrivate class +class IConvHandlePrivate +{ +public: +}; + +////////////////////////////////////////////////////////////////////////////// +// IConvHandle class + +IConvHandle::IConvHandle(const char *fromcode, + const char *tocode, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ +} + +IConvHandle::IConvHandle(const char *fromcode, + const IConverter &ic, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ +} + +IConvHandle::IConvHandle(const IConverter &ic, + const char *tocode, + bool throw_on_conv_err) + : m_priv( new IConvHandlePrivate ) + , m_throw_on_conv_err(throw_on_conv_err) +{ +} + +IConvHandle::~IConvHandle() +{ +} + +std::string IConvHandle::Convert(Data &tmp, const std::string &str) const +{ + // FIXME - need to add Windows support + return str; +} + + +////////////////////////////////////////////////////////////////////////////// +// IConvHandle class + +IConverter::IConverter(const char *tocode, bool throw_on_conv_err) + : m_from(BLACKBERRY_CHARSET, tocode, throw_on_conv_err) + , m_to(tocode, BLACKBERRY_CHARSET, throw_on_conv_err) + , m_tocode(tocode) +{ +} + +IConverter::~IConverter() +{ +} + +std::string IConverter::FromBB(const std::string &str) const +{ + return m_from.Convert(m_buffer, str); +} + +std::string IConverter::ToBB(const std::string &str) const +{ + return m_to.Convert(m_buffer, str); +} + +std::string IConverter::Convert(const IConvHandle &custom, const std::string &str) const +{ + return custom.Convert(m_buffer, str); +} + +} // namespace Barry + diff -Nru barry-0.14/src/j_jdwp.cc barry-0.0.20110506/src/j_jdwp.cc --- barry-0.14/src/j_jdwp.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_jdwp.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,146 @@ +/// +/// \file j_jdwp.cc +/// JDWP socket communication implementation +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "j_jdwp.h" +#include "data.h" +#include +#include +#include + + +namespace Barry { namespace JDWP { + + +/////////////////////////////////////////////////////////////////////////////// +// JDWP::Error exception class + +static std::string GetErrorString(int errcode, const std::string &str) +{ + std::ostringstream oss; + oss << "("; + + if( errcode ) { + oss << std::setbase(10) << errcode << ", "; + } + +// oss << strerror(-libusb_errno) << "): " + oss << "): "; + oss << str; + return oss.str(); +} + + +Error::Error(const std::string &str) + : Barry::Error(GetErrorString(0, str)) + , m_errcode(0) +{ +} + + +Error::Error(int errcode, const std::string &str) + : Barry::Error(GetErrorString(errcode, str)) + , m_errcode(errcode) +{ +} + + + +/////////////////////////////////////////////////////////////////////////////// +// JDWP::JDWP communication class + +JDWP::JDWP() +{ +} + + +JDWP::~JDWP() +{ +} + + +bool JDWP::Read(int socket, Barry::Data &data, int timeout) +{ + int ret; + + do { + data.QuickZap(); + + ret = read(socket, (char*) data.GetBuffer(), data.GetBufSize()); + + if( ret < 0 ) { + ret = -errno; + if (ret != -EINTR && ret != -EAGAIN ) { + m_lasterror = ret; + if( ret == -ETIMEDOUT ) + throw Timeout(ret, "Timeout in read"); + else + throw Error(ret, "Error in read"); + } + } + else + data.ReleaseBuffer(ret); + } while( ret == -EINTR ); + + return ret >= 0; +} + + +bool JDWP::Write(int socket, const Barry::Data &data, int timeout) +{ + int ret; + + do { + ret = write(socket, (char*) data.GetData(), data.GetSize()); + + if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { + m_lasterror = ret; + if( ret == -ETIMEDOUT ) + throw Timeout(ret, "Timeout in write (1)"); + else + throw Error(ret, "Error in write (1)"); + } + } while( ret == -EINTR || ret == -EAGAIN ); + + return ret >= 0; +} + + +bool JDWP::Write(int socket, const void *data, size_t size, int timeout) +{ + int ret; + + do { + ret = write(socket, (char*) data, size); + + if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { + m_lasterror = ret; + if( ret == -ETIMEDOUT ) + throw Timeout(ret, "Timeout in write (2)"); + else + throw Error(ret, "Error in write (2)"); + } + } while( ret == -EINTR || ret == -EAGAIN ); + + return ret >= 0; +} + +}} // namespace JDWP + diff -Nru barry-0.14/src/j_jdwp.h barry-0.0.20110506/src/j_jdwp.h --- barry-0.14/src/j_jdwp.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_jdwp.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,81 @@ +/// +/// \file j_jdwp.h +/// JDWP classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYJDWP_JDWP_H__ +#define __BARRYJDWP_JDWP_H__ + +#include "error.h" + +namespace Barry { + +// forward declarations +class Data; + +namespace JDWP { + +/// \addtogroup exceptions +/// @{ + +/// Thrown on low level JDWP errors. +class BXEXPORT Error : public Barry::Error +{ + int m_errcode; + +public: + Error(const std::string &str); + Error(int errcode, const std::string &str); + + // can return 0 in some case, if unknown error code + int errcode() const { return m_errcode; } +}; + +class BXEXPORT Timeout : public Error +{ +public: + Timeout(const std::string &str) : Error(str) {} + Timeout(int errcode, const std::string &str) + : Error(errcode, str) {} +}; + +/// @} + + + +class JDWP +{ +private: + int m_lasterror; + +protected: + +public: + JDWP(); + ~JDWP(); + + bool Read(int socket, Barry::Data &data, int timeout = -1); + bool Write(int socket, const Barry::Data &data, int timeout = -1); + bool Write(int socket, const void *data, size_t size, int timeout = -1); +}; + +}} // namespace Barry::JDWP + +#endif + diff -Nru barry-0.14/src/j_manager.cc barry-0.0.20110506/src/j_manager.cc --- barry-0.14/src/j_manager.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_manager.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,49 @@ +/// +/// \file j_manager.cc +/// Application management classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "j_manager.h" +#include "dp_codinfo.h" +#include "debug.h" + + +namespace Barry { namespace JDWP { + + +// JDWAppInfo class +//------------------ + + +void JDWAppInfo::Load(JDG::CodInfo &info) +{ + dout("JDWAppInfo::load" << endl); + + // Assign uniqueId + uniqueId = info.GetUniqueId(); + + // Add Class (concat with a previous list) + JDG::ClassList *list = &(info.classList); + + classList.insert(classList.end(), list->begin(), list->end()); +} + + +}} // namespace Barry::JDWP + diff -Nru barry-0.14/src/j_manager.h barry-0.0.20110506/src/j_manager.h --- barry-0.14/src/j_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_manager.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,61 @@ +/// +/// \file j_manager.h +/// Application management classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYJDWP_MANAGER_H__ +#define __BARRYJDWP_MANAGER_H__ + +#include "dll.h" +#include "dp_codinfo.h" +#include +#include +#include + +namespace Barry { namespace JDWP { + +class BXEXPORT JDWAppInfo +{ +private: +protected: + +public: + uint32_t uniqueId; + std::string appName; + + Barry::JDG::ClassList classList; + + void Load(Barry::JDG::CodInfo &info); +}; + + +class BXEXPORT JDWAppList : public std::map +{ +public: + typedef std::map base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; +}; + + +}} // namespace Barry::JDWP + + +#endif + diff -Nru barry-0.14/src/j_message.cc barry-0.0.20110506/src/j_message.cc --- barry-0.14/src/j_message.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_message.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,84 @@ +/// +/// \file j_message.cc +/// JDWP USB message implementation +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "j_message.h" +#include "debug.h" +#include "data.h" + + +namespace Barry { namespace JDWP { + + +JDWMessage::JDWMessage(int socket) + : m_socket(socket) +{ +} + + +JDWMessage::~JDWMessage() +{ +} + + +void JDWMessage::RawSend(Data &send, int timeout) +{ + bool ret = m_jdwp.Write(m_socket, send, timeout); + + if (ret) + barryverbose("JDWMessage::RawSend: Socket ID " << m_socket + << "\nSent:\n" << send); +} + + +bool JDWMessage::RawReceive(Data &receive, int timeout) +{ + bool ret; + + ret = m_jdwp.Read(m_socket, receive, timeout); + + if (ret) + barryverbose("JDWMessage::RawReceive: Socket ID " << m_socket + << "\nReceived:\n" << receive); + + return ret; +} + + +void JDWMessage::Send(Data &send, int timeout) +{ + RawSend(send, timeout); +} + + +void JDWMessage::Send(Data &send, Data &receive, int timeout) +{ + RawSend(send, timeout); + RawReceive(receive, timeout); +} + + +bool JDWMessage::Receive(Data &receive, int timeout) +{ + return RawReceive(receive, timeout); +} + +}} // namespace Barry::JDWP + diff -Nru barry-0.14/src/j_message.h barry-0.0.20110506/src/j_message.h --- barry-0.14/src/j_message.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_message.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,53 @@ +/// +/// \file j_message.h +/// JDWP message classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYJDWP_MESSAGE_H__ +#define __BARRYJDWP_MESSAGE_H__ + +#include "j_jdwp.h" + +namespace Barry { namespace JDWP { + +class JDWMessage +{ +private: + int m_socket; + + JDWP m_jdwp; + + void RawSend(Barry::Data &send, int timeout = -1); + bool RawReceive(Barry::Data &receive, int timeout = -1); + +protected: + +public: + JDWMessage(int socket); + ~JDWMessage(); + + void Send(Barry::Data &send, int timeout = -1); // send only + void Send(Barry::Data &send, Barry::Data &receive, int timeout = -1); // send+recv + bool Receive(Barry::Data &receive, int timeout = -1); +}; + +}} // namespace Barry::JDWP + +#endif + diff -Nru barry-0.14/src/j_record.cc barry-0.0.20110506/src/j_record.cc --- barry-0.14/src/j_record.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_record.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,80 @@ +/// +/// \file j_record.cc +/// Internal record manipulation functions for JDWP classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "record-internal.h" +#include "data.h" +#include "protostructs.h" +#include + +using namespace Barry::Protocol; + +namespace Barry { + +////////////////////////////////////////////////////////////////////////////// +// JDWField builder helper functions + +void AddJDWByte(Data &data, size_t &size, const uint8_t value) +{ + size_t fieldsize = sizeof(uint8_t); + unsigned char *pd = data.GetBuffer(size + fieldsize) + size; + + uint8_t *field = (uint8_t *) pd; + + *field = value; + + size += sizeof(uint8_t); +} + + +void AddJDWInt(Data &data, size_t &size, const uint32_t value) +{ + size_t fieldsize = sizeof(uint32_t); + unsigned char *pd = data.GetBuffer(size + fieldsize) + size; + + uint32_t *field = (uint32_t *) pd; + + *field = value; + + size += sizeof(uint32_t); +} + + +void AddJDWChar(Data &data, size_t &size, const void *buf, size_t bufsize) +{ + size_t fieldsize = JDWP_FIELD_HEADER_SIZE + bufsize; + unsigned char *pd = data.GetBuffer(size + fieldsize) + size; + + JDWField *field = (JDWField *) pd; + + field->size = be_htobl(bufsize); + memcpy(field->u.raw, buf, bufsize); + + size += fieldsize; +} + + +void AddJDWString(Data &data, size_t &size, const std::string &str) +{ + AddJDWChar(data, size, str.c_str(), str.size()); +} + +} // namespace Barry + diff -Nru barry-0.14/src/j_server.cc barry-0.0.20110506/src/j_server.cc --- barry-0.14/src/j_server.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_server.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,847 @@ +/// +/// \file j_server.cc +/// Server protocol implementation +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "j_server.h" +#include "protocol.h" +#include "data.h" +#include "endian.h" +#include "debug.h" +#include "j_message.h" +#include "protostructs.h" +#include "record-internal.h" +#include "error.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace std; + +namespace Barry { namespace JDWP { + +static void * acceptThread(void *data); + + +JDWServer::JDWServer(Barry::Mode::JVMDebug &device, + const char *address, int port) + : jvmdebug(&device) + , acceptfd(-1) + , sockfd(-1) + , address(address) + , port(port) + , loop(false) + , targetrunning(false) + , printConsoleMessage(0) +{ + SearchDebugFile(debugFileList); +} + + +JDWServer::~JDWServer() +{ + Stop(); +} + + +void JDWServer::SetPasswordDevice(string password) +{ + this->password = password; +} + + +void JDWServer::SetConsoleCallback(ConsoleCallbackType callback) +{ + printConsoleMessage = callback; +} + +static const char* h_strerror(int code) +{ + // Codes and messages taken from the Linux gethostbyname(3) manpage + switch( code ) + { + case HOST_NOT_FOUND: + return "HOST_NOT_FOUND: The specified host is unknown"; + + case NO_ADDRESS: + return "NO_ADDRESS: The requested name is valid but does not have an IP address"; + + case NO_RECOVERY: + return "NO_RECOVERY: A non-recoverable name server error occurred"; + + case TRY_AGAIN: + return "TRY_AGAIN: A temporary error occurred on an authoritative name server. Try again later."; + + default: + return "Unknown network error code"; + } +} + +bool JDWServer::Start() +{ + int rc; + + struct hostent *hp; + struct sockaddr_in sad; + + + memset((char *) &sad, '\0', sizeof(struct sockaddr_in)); + + if (!address.size()) + sad.sin_addr.s_addr = INADDR_ANY; + else { + sad.sin_addr.s_addr = inet_addr(address.c_str()); + + if (sad.sin_addr.s_addr == INADDR_NONE) { + hp = gethostbyname(address.c_str()); + + if (hp == NULL) { + std::ostringstream oss; + oss << "JDWServer::Start: " << h_errno << h_strerror(h_errno); + throw Barry::Error(oss.str()); + } + + memcpy((char*) &sad.sin_addr, (char*) hp->h_addr, (size_t) hp->h_length); + } + } + + sad.sin_family = AF_INET; + sad.sin_port = htons((short) (port & 0xFFFF)); + + // Open socket + sockfd = socket(sad.sin_family, SOCK_STREAM, 0); + + if (sockfd < 0) { + throw Barry::ErrnoError("JDWServer::Start: Cannot open socket.", errno); + } + + // Bind + rc = bind(sockfd, (struct sockaddr *) &sad, sizeof(sad)); + + if (rc < 0) { + int code = errno; + + close(sockfd); + sockfd = -1; + + throw Barry::ErrnoError("JDWServer::Start: Cannot bind socket", code); + } + + // Listen + if (listen(sockfd, SOMAXCONN) < 0) { + int code = errno; + + close(sockfd); + sockfd = -1; + + throw Barry::ErrnoError("JDWServer::Start: Cannot listen on socket", code); + } + + handler.reset(new Thread(sockfd, acceptThread, (void*) this)); + + return true; +} + + +static void * acceptThread(void *data) +{ + JDWServer *s; + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + + s = (JDWServer *) data; + + while (1) { + if( s->AcceptConnection() && + s->AttachToDevice() && + s->InitVisibleClassList() && + s->Hello() ) + { + s->Run(); + s->DetachFromDevice(); + } + } + + return NULL; +} + + +// Returns true if a new connection was accepted and established +bool JDWServer::AcceptConnection() +{ + struct sockaddr_in addr; + struct sockaddr *sa = (struct sockaddr*) &addr; + socklen_t addrlen = sizeof(addr); + + acceptfd = accept(sockfd, sa, &addrlen); + if( acceptfd < 0 ) + return false; + + fcntl(acceptfd, F_SETFL, O_NONBLOCK); + return true; +} + + +bool JDWServer::AttachToDevice() +{ + targetrunning = false; + + jvmdebug->Open(password.c_str()); + jvmdebug->Attach(); + + jvmdebug->Unknown01(); + jvmdebug->Unknown02(); + jvmdebug->Unknown03(); + jvmdebug->Unknown04(); + jvmdebug->Unknown05(); + + jvmdebug->GetModulesList(modulesList); + dout(modulesList); + + // Check debug info for each modules + JVMModulesList::const_iterator b = modulesList.begin(); + for ( ; b != modulesList.end(); b++) { + JDG::CodInfo codInfo; + + const JVMModulesEntry &entry = *b; + + bool ret = LoadDebugInfo(debugFileList, entry.UniqueID, entry.Name, codInfo); + + if (ret == true) { + appList[entry.UniqueID].Load(codInfo); + } + else { + dout("No debug information found for '" << entry.Name); + dout("' (" << hex << setfill('0') << setw(8) << entry.UniqueID << ")." << endl) + } + } + + return true; +} + + +void JDWServer::DetachFromDevice() +{ + jvmdebug->Detach(); + jvmdebug->Close(); +} + + +#define JDWP_HELLO_STRING "JDWP-Handshake" + + + +bool JDWServer::Hello() +{ + bool ret; + + Barry::Data response; + + const size_t len = strlen(JDWP_HELLO_STRING); + + JDWMessage msg(acceptfd); + + do { + ret = msg.Receive(response); + } + while (!ret); + + size_t size = response.GetSize(); + char *str = (char *) response.GetBuffer(); + + if (size != len) + return false; + + if (!strncmp(str, JDWP_HELLO_STRING, len)) { + Data command(JDWP_HELLO_STRING, len); + + msg.Send(command); + + return true; + } + + return false; +} + + +void JDWServer::Run() +{ + string str; + JDWMessage msg(acceptfd); + + Barry::Data command; + + MAKE_JDWPPACKET(rpack, command); + + loop = true; + + while (loop) { + if (targetrunning) { + // Read JDWP message from device + int value = jvmdebug->GetConsoleMessage(str); + + if (value < 0) { + bool ret; + int status; + + ret = jvmdebug->GetStatus(status); + + while (!ret) { + // Read JDB message from host + msg.Receive(command); + + if (command.GetSize() > 0) { + // Convert to packet + rpack = (const Barry::Protocol::JDWP::Packet *) command.GetData(); + + if (command.GetSize() != be_btohl(rpack->length)) { + dout("Packet size error !!!" << endl); + + // TODO : add throw exception + + continue; + } + + CommandsetProcess(command); + + break; + } + else + ret = jvmdebug->WaitStatus(status); + } + } + else { + if (printConsoleMessage != NULL) + printConsoleMessage(str); + } + } + else { + // Read JDB message from host + msg.Receive(command); + + if (command.GetSize() > 0) { + // Convert to packet + rpack = (const Barry::Protocol::JDWP::Packet *) command.GetData(); + + if (command.GetSize() != be_btohl(rpack->length)) { + dout("Packet size error !!!" << endl); + + // TODO : add throw exception + + continue; + } + + CommandsetProcess(command); + } + + usleep(50); + } + } +} + + +bool JDWServer::Stop() +{ + if( handler.get() ) { + handler->Dispose(); + handler.reset(); + } + + if( sockfd >= 0 ) { + close(sockfd); + sockfd = -1; + } + + if( acceptfd >= 0 ) { + close(acceptfd); + acceptfd = -1; + } + + return true; +} + + +bool JDWServer::InitVisibleClassList() +{ + int index; + + // Skip the cell '0' + // it's very ugly, but I want use an index started at '1' inside of '0' + // JDB works from '1' :( + JDG::ClassEntry e; + visibleClassList.push_back(e); + + // Count and index the class (start to '1') + index = 1; + JDWAppList::iterator it; + + for (it = appList.begin(); it != appList.end(); it++) { + JDWAppInfo &appInfo = it->second; + JDG::ClassList &list = appInfo.classList; + + JDG::ClassList::iterator b; + + for (b = list.begin(); b != list.end(); b++) { + // FIXME + // I don't from class field, we have to filter the class view by JDB +// if ((b->type != 0x824) && (b->type != 0x64)) { + if (b->id == 0xffffffff) { + b->index = -1; + + continue; + } + + b->index = index; + + visibleClassList.push_back(*b); + + index++; + } + } + + visibleClassList.CreateDefaultEntries(); + + return true; +} + + +void JDWServer::CommandsetProcess(Data &cmd) +{ + MAKE_JDWPPACKET(rpack, cmd); + + switch (rpack->u.command.commandset) { + case JDWP_CMDSET_VIRTUALMACHINE: + CommandsetVirtualMachineProcess(cmd); + break; + + case JDWP_CMDSET_REFERECENTYPE: + break; + + case JDWP_CMDSET_CLASSTYPE: + break; + + case JDWP_CMDSET_ARRAYTYPE: + break; + + case JDWP_CMDSET_INTERFACETYPE: + break; + + case JDWP_CMDSET_METHOD: + break; + + case JDWP_CMDSET_FIELD: + break; + + case JDWP_CMDSET_OBJECTREFERENCE: + break; + + case JDWP_CMDSET_STRINGREFERENCE: + break; + + case JDWP_CMDSET_THREADREFERENCE: + break; + + case JDWP_CMDSET_THREADGROUPREFERENCE: + break; + + case JDWP_CMDSET_ARRAYREFERENCE: + break; + + case JDWP_CMDSET_CLASSLOADERREFERENCE: + break; + + case JDWP_CMDSET_EVENTREQUEST: + CommandsetEventRequestProcess(cmd); + break; + + case JDWP_CMDSET_STACKFRAME: + break; + + case JDWP_CMDSET_CLASSOBJECTREFERENCE: + break; + + case JDWP_CMDSET_EVENT: + break; + + default: + // TODO : add exception (or alert) + dout("Commandset unknown !!!" << endl); + } +} + + +void JDWServer::CommandsetVirtualMachineProcess(Data &cmd) +{ + MAKE_JDWPPACKET(rpack, cmd); + + switch (rpack->u.command.command) { + case JDWP_CMD_VERSION: + CommandVersion(cmd); + break; + + case JDWP_CMD_ALLCLASSES: + CommandAllClasses(cmd); + break; + + case JDWP_CMD_ALLTHREADS: + CommandAllThreads(cmd); + break; + + case JDWP_CMD_DISPOSE: + loop = false; + targetrunning = false; + close(acceptfd); + acceptfd = -1; + break; + + case JDWP_CMD_IDSIZES: + CommandIdSizes(cmd); + break; + + case JDWP_CMD_SUSPEND: + CommandSuspend(cmd); + targetrunning = false; + break; + + case JDWP_CMD_RESUME: + CommandResume(cmd); + targetrunning = true; + break; + + case JDWP_CMD_CLASSPATHS: + CommandClassPaths(cmd); + break; + } +} + + +void JDWServer::CommandsetEventRequestProcess(Data &cmd) +{ + MAKE_JDWPPACKET(rpack, cmd); + + switch (rpack->u.command.command) { + case JDWP_CMD_SET: + CommandSet(cmd); + break; + } +} + + +void JDWServer::CommandVersion(Data &cmd) +{ + JDWMessage msg(acceptfd); + + // Build packet data + Data response; + + size_t offset = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + AddJDWString(response, offset, string("RIM JVM")); + AddJDWInt(response, offset, be_htobl(1)); + AddJDWInt(response, offset, be_htobl(4)); + AddJDWString(response, offset, string("1.4")); + AddJDWString(response, offset, string("RIM JVM")); + + response.ReleaseBuffer(offset); + + + size_t total_size = response.GetSize(); + + // Fill in the header values + MAKE_JDWPPACKETPTR_BUF(cpack, response.GetBuffer(total_size)); + Barry::Protocol::JDWP::Packet &packet = *cpack; + + + MAKE_JDWPPACKET(rpack, cmd); + + packet.length = be_htobl(total_size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + response.ReleaseBuffer(total_size); + msg.Send(response); +} + + +void JDWServer::CommandAllClasses(Data &cmd) +{ + size_t i; + int size; + + JDWMessage msg(acceptfd); + + // Build packet data + Data response; + + size_t offset = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + // Size of known class list + size = visibleClassList.size() - 1; + + AddJDWInt(response, offset, be_htobl(size)); + + // Then, write the list of known class + for (i=1; i(),'.'), '/'); + + AddJDWByte(response, offset, 0x01); + AddJDWInt(response, offset, i); // Should be equal to visibleClassList[i].index + AddJDWString(response, offset, str); + AddJDWInt(response, offset, be_htobl(0x04)); + } + + response.ReleaseBuffer(offset); + + + size_t total_size = response.GetSize(); + + // Fill in the header values + MAKE_JDWPPACKETPTR_BUF(cpack, response.GetBuffer(total_size)); + Barry::Protocol::JDWP::Packet &packet = *cpack; + + + MAKE_JDWPPACKET(rpack, cmd); + + packet.length = be_htobl(total_size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + response.ReleaseBuffer(total_size); + msg.Send(response); +} + + +void JDWServer::CommandAllThreads(Data &cmd) +{ + JDWMessage msg(acceptfd); + + // Get threads list from device + JVMThreadsList list; + jvmdebug->GetThreadsList(list); + dout(list); + + // Build packet data + Data response; + + size_t offset = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + // Indicate the number of element + AddJDWInt(response, offset, be_htobl(list.size())); + + // Send all threads ID + JVMThreadsList::const_iterator b = list.begin(); + for( ; b != list.end(); b++ ) { + const JVMThreadsEntry &entry = *b; + + AddJDWInt(response, offset, be_htobl(entry.Id)); + } + + response.ReleaseBuffer(offset); + + + size_t total_size = response.GetSize(); + + // Fill in the header values + MAKE_JDWPPACKETPTR_BUF(cpack, response.GetBuffer(total_size)); + Barry::Protocol::JDWP::Packet &packet = *cpack; + + + MAKE_JDWPPACKET(rpack, cmd); + + packet.length = be_htobl(total_size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + response.ReleaseBuffer(total_size); + msg.Send(response); +} + + +void JDWServer::CommandIdSizes(Data &cmd) +{ + JDWMessage msg(acceptfd); + + MAKE_JDWPPACKET(rpack, cmd); + + size_t size; + + Barry::Protocol::JDWP::Packet packet; + + size = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE + + JDWP_PACKETVIRTUALMACHINEIDSIZES_DATA_SIZE; + + packet.length = be_htobl(size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + packet.u.response.u.virtualMachine.u.IDSizes.fieldIDSize = be_htobl(0x04); + packet.u.response.u.virtualMachine.u.IDSizes.methodIDSize = be_htobl(0x04); + packet.u.response.u.virtualMachine.u.IDSizes.objectIDSize = be_htobl(0x04); + packet.u.response.u.virtualMachine.u.IDSizes.referenceTypeIDSize = be_htobl(0x04); + packet.u.response.u.virtualMachine.u.IDSizes.frameIDSize = be_htobl(0x04); + + Data response(&packet, size); + + msg.Send(response); +} + + +void JDWServer::CommandSuspend(Data &cmd) +{ + JDWMessage msg(acceptfd); + + + // Suspend device + jvmdebug->Stop(); + + // Notify debugger + MAKE_JDWPPACKET(rpack, cmd); + + size_t size; + + Barry::Protocol::JDWP::Packet packet; + + size = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + packet.length = be_htobl(size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + Data response(&packet, size); + + msg.Send(response); +} + + +void JDWServer::CommandResume(Data &cmd) +{ + JDWMessage msg(acceptfd); + + + // Resume device + jvmdebug->Unknown06(); + jvmdebug->Unknown07(); + jvmdebug->Unknown08(); + jvmdebug->Unknown09(); + jvmdebug->Unknown10(); + jvmdebug->Go(); + + // Notify debugger + MAKE_JDWPPACKET(rpack, cmd); + + size_t size; + + Barry::Protocol::JDWP::Packet packet; + + size = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + packet.length = be_htobl(size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + Data response(&packet, size); + + msg.Send(response); +} + + +void JDWServer::CommandClassPaths(Data &cmd) +{ + JDWMessage msg(acceptfd); + + // Build packet data + Data response; + + size_t offset = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE; + + AddJDWString(response, offset, string("")); + AddJDWInt(response, offset, be_htobl(0)); + AddJDWInt(response, offset, be_htobl(0)); + + response.ReleaseBuffer(offset); + + + size_t total_size = response.GetSize(); + + // Fill in the header values + MAKE_JDWPPACKETPTR_BUF(cpack, response.GetBuffer(total_size)); + Barry::Protocol::JDWP::Packet &packet = *cpack; + + + MAKE_JDWPPACKET(rpack, cmd); + + packet.length = be_htobl(total_size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + + response.ReleaseBuffer(total_size); + msg.Send(response); +} + + + +void JDWServer::CommandSet(Data &cmd) +{ + static int value = 2; + + JDWMessage msg(acceptfd); + + MAKE_JDWPPACKET(rpack, cmd); + + size_t size; + + Barry::Protocol::JDWP::Packet packet; + + size = JDWP_PACKET_HEADER_SIZE + JDWP_RESPONSE_HEADER_SIZE + sizeof(uint32_t); + + packet.length = be_htobl(size); + packet.id = rpack->id; + packet.flags = 0x80; + packet.u.response.errorcode = be_htobs(0); + packet.u.response.u.value = be_htobl(value); + + Data response(&packet, size); + + msg.Send(response); + + value++; +} + + +}} // namespace Barry::JDWP + diff -Nru barry-0.14/src/j_server.h barry-0.0.20110506/src/j_server.h --- barry-0.14/src/j_server.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/j_server.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,105 @@ +/// +/// \file j_server.h +/// Java Debug server classes +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYJDWP_SERVER_H__ +#define __BARRYJDWP_SERVER_H__ + +#include "dll.h" +#include "j_manager.h" +#include "dp_codinfo.h" +#include "m_jvmdebug.h" +#include "threadwrap.h" +#include +#include + + +namespace Barry { namespace JDWP { + +class BXEXPORT JDWServer +{ +public: + typedef void (*ConsoleCallbackType)(const std::string &); + +private: + Barry::Mode::JVMDebug *jvmdebug; + + int acceptfd; + int sockfd; + + std::string address; + int port; + + bool loop; + bool targetrunning; + + std::string password; + + Barry::JVMModulesList modulesList; // List of COD applications installed on the device + Barry::JDG::DebugFileList debugFileList; // List of debug file on the host + + JDWAppList appList; // List of BlackBerry application (an application contents several COD files) + Barry::JDG::ClassList visibleClassList; // Visible class list from JDB + + std::auto_ptr handler; + ConsoleCallbackType printConsoleMessage; + + void CommandsetProcess(Barry::Data &cmd); + + void CommandsetVirtualMachineProcess(Barry::Data &cmd); + void CommandsetEventRequestProcess(Barry::Data &cmd); + + void CommandVersion(Barry::Data &cmd); + void CommandIdSizes(Barry::Data &cmd); + void CommandAllClasses(Barry::Data &cmd); + void CommandAllThreads(Barry::Data &cmd); + void CommandSuspend(Barry::Data &cmd); + void CommandResume(Barry::Data &cmd); + void CommandClassPaths(Barry::Data &cmd); + + void CommandSet(Barry::Data &cmd); + +// void BackgroundDeviceProcess(); + +protected: + +public: + JDWServer(Barry::Mode::JVMDebug &device, const char *address, int port); + ~JDWServer(); + + void SetPasswordDevice(std::string password); + + void SetConsoleCallback(ConsoleCallbackType callback); + + bool Start(); // starts new thread + bool AcceptConnection(); + bool AttachToDevice(); + bool InitVisibleClassList(); + bool Hello(); + void Run(); + void DetachFromDevice(); + bool Stop(); // cancels thread if still running, and + // cleans up Start() +}; + +}} // namespace Barry::JDWP + +#endif + diff -Nru barry-0.14/src/ldif.cc barry-0.0.20110506/src/ldif.cc --- barry-0.14/src/ldif.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/ldif.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -21,6 +21,7 @@ #include "ldif.h" #include "record.h" +#include "r_contact.h" #include "base64.h" #include #include @@ -57,28 +58,32 @@ &ContactLdif::Company, &ContactLdif::SetCompany }, { "DefaultCommunicationsMethod", "Default communications method", &ContactLdif::DefaultCommunicationsMethod, &ContactLdif::SetDefaultCommunicationsMethod }, - { "Address1", "Address, line 1", - &ContactLdif::Address1, &ContactLdif::SetAddress1 }, - { "Address2", "Address, line 2", - &ContactLdif::Address2, &ContactLdif::SetAddress2 }, - { "Address3", "Address, line 3", - &ContactLdif::Address3, &ContactLdif::SetAddress3 }, - { "City", "City", - &ContactLdif::City, &ContactLdif::SetCity }, - { "Province", "Province / State", - &ContactLdif::Province, &ContactLdif::SetProvince }, - { "PostalCode", "Postal / ZIP code", - &ContactLdif::PostalCode, &ContactLdif::SetPostalCode }, - { "Country", "Country", - &ContactLdif::Country, &ContactLdif::SetCountry }, + { "WorkAddress1", "Work Address, line 1", + &ContactLdif::WorkAddress1, &ContactLdif::SetWorkAddress1 }, + { "WorkAddress2", "Work Address, line 2", + &ContactLdif::WorkAddress2, &ContactLdif::SetWorkAddress2 }, + { "WorkAddress3", "Work Address, line 3", + &ContactLdif::WorkAddress3, &ContactLdif::SetWorkAddress3 }, + { "WorkCity", "WorkCity", + &ContactLdif::WorkCity, &ContactLdif::SetWorkCity }, + { "WorkProvince", "WorkProvince / State", + &ContactLdif::WorkProvince, &ContactLdif::SetWorkProvince }, + { "WorkPostalCode", "Work Postal / ZIP code", + &ContactLdif::WorkPostalCode, &ContactLdif::SetWorkPostalCode }, + { "WorkCountry", "WorkCountry", + &ContactLdif::WorkCountry, &ContactLdif::SetWorkCountry }, { "JobTitle", "Job Title", &ContactLdif::JobTitle, &ContactLdif::SetJobTitle }, { "PublicKey", "Public key", &ContactLdif::PublicKey, &ContactLdif::SetPublicKey }, { "Notes", "Notes", &ContactLdif::Notes, &ContactLdif::SetNotes }, - { "PostalAddress", "Mailing address (includes address lines, city, province, country, and postal code)", - &ContactLdif::PostalAddress, &ContactLdif::SetPostalAddress }, + { "Image", "Contact photo", + &ContactLdif::Image, &ContactLdif::SetImage }, + { "WorkPostalAddress", "Mailing Work address (includes address lines, city, province, country, and postal code)", + &ContactLdif::WorkPostalAddress, &ContactLdif::SetWorkPostalAddress }, + { "HomePostalAddress", "Mailing home address (includes address lines, city, province, country, and postal code)", + &ContactLdif::HomePostalAddress, &ContactLdif::SetHomePostalAddress }, { "FullName", "First + Last names", &ContactLdif::FullName, &ContactLdif::SetFullName }, { "FQDN", "Fully qualified domain name", @@ -121,11 +126,11 @@ Map("homePhone", &ContactLdif::HomePhone, &ContactLdif::SetHomePhone); Map("mobile", &ContactLdif::MobilePhone, &ContactLdif::SetMobilePhone); Map("pager", &ContactLdif::Pager, &ContactLdif::SetPager); - Map("l", &ContactLdif::City, &ContactLdif::SetCity); - Map("st", &ContactLdif::Province, &ContactLdif::SetProvince); - Map("postalCode", &ContactLdif::PostalCode, &ContactLdif::SetPostalCode); + Map("l", &ContactLdif::WorkCity, &ContactLdif::SetWorkCity); + Map("st", &ContactLdif::WorkProvince, &ContactLdif::SetWorkProvince); + Map("postalCode", &ContactLdif::WorkPostalCode, &ContactLdif::SetWorkPostalCode); Map("o", &ContactLdif::Company, &ContactLdif::SetCompany); - Map("c", &ContactLdif::Country, &ContactLdif::SetCountry); + Map("c", &ContactLdif::WorkCountry, &ContactLdif::SetWorkCountry); SetObjectClass("c", "country"); Map("title", &ContactLdif::JobTitle, &ContactLdif::SetJobTitle); @@ -134,9 +139,18 @@ Map("cn", &ContactLdif::FullName, &ContactLdif::SetFullName); Map("sn", &ContactLdif::LastName, &ContactLdif::SetLastName); Map("givenName", &ContactLdif::FirstName, &ContactLdif::SetFirstName); - Map("street", &ContactLdif::Address1, &ContactLdif::SetAddress1); - Map("postalAddress", &ContactLdif::PostalAddress, &ContactLdif::SetPostalAddress); + Map("street", &ContactLdif::WorkAddress1, &ContactLdif::SetWorkAddress1); + Map("postalAddress", &ContactLdif::WorkPostalAddress, &ContactLdif::SetWorkPostalAddress); + Map("homePostalAddress", &ContactLdif::HomePostalAddress, &ContactLdif::SetHomePostalAddress); Map("note", &ContactLdif::Notes, &ContactLdif::SetNotes); + // FIXME - jpegPhoto looks like the only LDIF field for photo + // images... it is unknown which format will come from the + // BlackBerry in the Image field, so we can't guarantee + // that Image will be in JPG. This mapping can be done manually + // from the btool command line with "-m jpegPhoto,Image,Image" + // Reading photos from LDIF should be fine, since the BlackBerry + // seems to handle most formats. +// Map("jpegPhoto", &ContactLdif::Image, &ContactLdif::SetImage); // add heuristics hooks Hook("cn", &m_cn); @@ -338,37 +352,37 @@ return con.DefaultCommunicationsMethod; } -std::string ContactLdif::Address1(const Barry::Contact &con) const +std::string ContactLdif::WorkAddress1(const Barry::Contact &con) const { return con.WorkAddress.Address1; } -std::string ContactLdif::Address2(const Barry::Contact &con) const +std::string ContactLdif::WorkAddress2(const Barry::Contact &con) const { return con.WorkAddress.Address2; } -std::string ContactLdif::Address3(const Barry::Contact &con) const +std::string ContactLdif::WorkAddress3(const Barry::Contact &con) const { return con.WorkAddress.Address3; } -std::string ContactLdif::City(const Barry::Contact &con) const +std::string ContactLdif::WorkCity(const Barry::Contact &con) const { return con.WorkAddress.City; } -std::string ContactLdif::Province(const Barry::Contact &con) const +std::string ContactLdif::WorkProvince(const Barry::Contact &con) const { return con.WorkAddress.Province; } -std::string ContactLdif::PostalCode(const Barry::Contact &con) const +std::string ContactLdif::WorkPostalCode(const Barry::Contact &con) const { return con.WorkAddress.PostalCode; } -std::string ContactLdif::Country(const Barry::Contact &con) const +std::string ContactLdif::WorkCountry(const Barry::Contact &con) const { return con.WorkAddress.Country; } @@ -388,11 +402,21 @@ return con.Notes; } -std::string ContactLdif::PostalAddress(const Barry::Contact &con) const +std::string ContactLdif::Image(const Barry::Contact &con) const +{ + return con.Image; +} + +std::string ContactLdif::WorkPostalAddress(const Barry::Contact &con) const { return con.WorkAddress.GetLabel(); } +std::string ContactLdif::HomePostalAddress(const Barry::Contact &con) const +{ + return con.HomeAddress.GetLabel(); +} + std::string ContactLdif::FullName(const Barry::Contact &con) const { return con.GetFullName(); @@ -489,37 +513,37 @@ con.DefaultCommunicationsMethod = val; } -void ContactLdif::SetAddress1(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkAddress1(Barry::Contact &con, const std::string &val) const { con.WorkAddress.Address1 = val; } -void ContactLdif::SetAddress2(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkAddress2(Barry::Contact &con, const std::string &val) const { con.WorkAddress.Address2 = val; } -void ContactLdif::SetAddress3(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkAddress3(Barry::Contact &con, const std::string &val) const { con.WorkAddress.Address3 = val; } -void ContactLdif::SetCity(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkCity(Barry::Contact &con, const std::string &val) const { con.WorkAddress.City = val; } -void ContactLdif::SetProvince(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkProvince(Barry::Contact &con, const std::string &val) const { con.WorkAddress.Province = val; } -void ContactLdif::SetPostalCode(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkPostalCode(Barry::Contact &con, const std::string &val) const { con.WorkAddress.PostalCode = val; } -void ContactLdif::SetCountry(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetWorkCountry(Barry::Contact &con, const std::string &val) const { con.WorkAddress.Country = val; } @@ -539,11 +563,23 @@ con.Notes = val; } -void ContactLdif::SetPostalAddress(Barry::Contact &con, const std::string &val) const +void ContactLdif::SetImage(Barry::Contact &con, const std::string &val) const +{ + con.Image = val; +} + +void ContactLdif::SetWorkPostalAddress(Barry::Contact &con, const std::string &val) const +{ + // FIXME; +// throw std::runtime_error("SetWorkPostalAddress() not implemented"); +// std::cout << "SetWorkPostalAddress() not implemented: " << val << std::endl; +} + +void ContactLdif::SetHomePostalAddress(Barry::Contact &con, const std::string &val) const { - // fixme; -// throw std::runtime_error("SetPostalAddress() not implemented"); -// std::cout << "SetPostalAddress() not implemented: " << val << std::endl; + // FIXME; +// throw std::runtime_error("SetHomePostalAddress() not implemented"); +// std::cout << "SetHomePostalAddress() not implemented: " << val << std::endl; } void ContactLdif::SetFullName(Barry::Contact &con, const std::string &val) const diff -Nru barry-0.14/src/ldif.h barry-0.0.20110506/src/ldif.h --- barry-0.14/src/ldif.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/ldif.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -165,18 +165,20 @@ virtual std::string LastName(const Barry::Contact &con) const; virtual std::string Company(const Barry::Contact &con) const; virtual std::string DefaultCommunicationsMethod(const Barry::Contact &con) const; - virtual std::string Address1(const Barry::Contact &con) const; - virtual std::string Address2(const Barry::Contact &con) const; - virtual std::string Address3(const Barry::Contact &con) const; - virtual std::string City(const Barry::Contact &con) const; - virtual std::string Province(const Barry::Contact &con) const; - virtual std::string PostalCode(const Barry::Contact &con) const; - virtual std::string Country(const Barry::Contact &con) const; + virtual std::string WorkAddress1(const Barry::Contact &con) const; + virtual std::string WorkAddress2(const Barry::Contact &con) const; + virtual std::string WorkAddress3(const Barry::Contact &con) const; + virtual std::string WorkCity(const Barry::Contact &con) const; + virtual std::string WorkProvince(const Barry::Contact &con) const; + virtual std::string WorkPostalCode(const Barry::Contact &con) const; + virtual std::string WorkCountry(const Barry::Contact &con) const; virtual std::string JobTitle(const Barry::Contact &con) const; virtual std::string PublicKey(const Barry::Contact &con) const; virtual std::string Notes(const Barry::Contact &con) const; + virtual std::string Image(const Barry::Contact &con) const; // calculated values... - virtual std::string PostalAddress(const Barry::Contact &con) const; + virtual std::string WorkPostalAddress(const Barry::Contact &con) const; + virtual std::string HomePostalAddress(const Barry::Contact &con) const; virtual std::string FullName(const Barry::Contact &con) const; virtual std::string FQDN(const Barry::Contact &con) const; @@ -203,17 +205,19 @@ virtual void SetLastName(Barry::Contact &con, const std::string &val) const; virtual void SetCompany(Barry::Contact &con, const std::string &val) const; virtual void SetDefaultCommunicationsMethod(Barry::Contact &con, const std::string &val) const; - virtual void SetAddress1(Barry::Contact &con, const std::string &val) const; - virtual void SetAddress2(Barry::Contact &con, const std::string &val) const; - virtual void SetAddress3(Barry::Contact &con, const std::string &val) const; - virtual void SetCity(Barry::Contact &con, const std::string &val) const; - virtual void SetProvince(Barry::Contact &con, const std::string &val) const; - virtual void SetPostalCode(Barry::Contact &con, const std::string &val) const; - virtual void SetCountry(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkAddress1(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkAddress2(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkAddress3(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkCity(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkProvince(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkPostalCode(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkCountry(Barry::Contact &con, const std::string &val) const; virtual void SetJobTitle(Barry::Contact &con, const std::string &val) const; virtual void SetPublicKey(Barry::Contact &con, const std::string &val) const; virtual void SetNotes(Barry::Contact &con, const std::string &val) const; - virtual void SetPostalAddress(Barry::Contact &con, const std::string &val) const; + virtual void SetImage(Barry::Contact &con, const std::string &val) const; + virtual void SetWorkPostalAddress(Barry::Contact &con, const std::string &val) const; + virtual void SetHomePostalAddress(Barry::Contact &con, const std::string &val) const; virtual void SetFullName(Barry::Contact &con, const std::string &val) const; virtual void SetFQDN(Barry::Contact &con, const std::string &val) const; diff -Nru barry-0.14/src/ldifio.cc barry-0.0.20110506/src/ldifio.cc --- barry-0.14/src/ldifio.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/ldifio.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,93 @@ +/// +/// \file ldifio.cc +/// Storage, parser, and builder classes for ldif operations. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "ldifio.h" + +namespace Barry { + +LdifStore::LdifStore(const std::string &filename) + : m_ifs( new std::ifstream(filename.c_str()) ) + , m_is(*m_ifs) + , m_os(*m_ofs) // yes, this is a reference to a null ptr + // but will never be used (see below as well) + , m_end_of_file(false) + , m_ldif("") +{ +} + +LdifStore::LdifStore(std::istream &is) + : m_is(is) + , m_os(*m_ofs) + , m_end_of_file(false) + , m_ldif("") +{ +} + +// output constructors +LdifStore::LdifStore(const std::string &filename, + const std::string &baseDN, + const std::string &dnattr) + : m_ofs( new std::ofstream(filename.c_str()) ) + , m_is(*m_ifs) + , m_os(*m_ofs) + , m_end_of_file(false) + , m_ldif(baseDN) +{ + m_ldif.SetDNAttr(dnattr); +} + +LdifStore::LdifStore(std::ostream &os, + const std::string &baseDN, + const std::string &dnattr) + : m_is(*m_ifs) + , m_os(os) + , m_end_of_file(false) + , m_ldif(baseDN) +{ + m_ldif.SetDNAttr(dnattr); +} + +// storage operator +void LdifStore::operator() (const Contact &rec) +{ + m_ldif.DumpLdif(m_os, rec); +} + +// retrieval operator +bool LdifStore::operator() (Contact &rec, const Barry::Builder &builder) +{ + if( m_end_of_file ) + return false; + + // there may be LDIF records in the input that generate + // invalid Contact records, but valid Contact records + // may come after.. so keep processing until end of stream + while( m_is ) { + if( m_ldif.ReadLdif(m_is, rec) ) + return true; + } + + m_end_of_file = true; + return false; +} + +} // namespace Barry + diff -Nru barry-0.14/src/ldifio.h barry-0.0.20110506/src/ldifio.h --- barry-0.14/src/ldifio.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/ldifio.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,81 @@ +/// +/// \file ldifio.h +/// Storage, parser, and builder classes for ldif operations. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_LDIFIO_H__ +#define __BARRY_LDIFIO_H__ + +#include "dll.h" +#include "ldif.h" +#include +#include +#include + +namespace Barry { + +class Builder; + +// +// LdifStore +// +/// Storage class suitable for use in a RecordParser<> or RecordBuilder<>. +/// Be sure to use the input constructors for RecordBuilder<> objects +/// and output constructors for RecordParser<> objects. +/// +/// Examples: +/// Read contacts from an ldif stream on stdin: +/// new RecordBuilder( new LdifStore(cin) ); +/// +/// Write contacts to an ldif stream on stdout: +/// new RecordParser( +/// new LdifStore(cout, baseDN, dnAttr) ); +/// +class BXEXPORT LdifStore +{ + std::auto_ptr m_ifs; + std::auto_ptr m_ofs; + std::istream &m_is; + std::ostream &m_os; + bool m_end_of_file; + + Barry::ContactLdif m_ldif; + +public: + // input constructors + LdifStore(const std::string &filename); + LdifStore(std::istream &is); + + // output constructors + LdifStore(const std::string &filename, const std::string &baseDN, + const std::string &dnattr); + LdifStore(std::ostream &os, const std::string &baseDN, + const std::string &dnattr); + + // storage operator + void operator() (const Contact &rec); + + // retrieval operator + bool operator() (Contact &rec, const Builder &builder); +}; + +} + +#endif + diff -Nru barry-0.14/src/legal.txt barry-0.0.20110506/src/legal.txt --- barry-0.14/src/legal.txt 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/legal.txt 2011-05-06 12:20:17.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/log.cc barry-0.0.20110506/src/log.cc --- barry-0.14/src/log.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/log.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,7 +20,12 @@ */ #include "log.h" +#include "clog.h" #include +#include +#include +#include +#include namespace Barry { @@ -52,3 +57,36 @@ } // namespace Barry +// Callable from C: + +void BarryLogf(int verbose, const char *msg, ...) +{ + va_list vl; + va_start(vl, msg); + char buffer[2048]; + char *output = buffer; + int buflen = sizeof(buffer); + int n = vsnprintf(buffer, buflen, msg, vl); + if( n < 0 || n >= buflen ) { + buflen = n + 100; + output = new char [buflen]; + n = vsnprintf(output, buflen, msg, vl); + if( n < 0 || n >= buflen ) { + delete [] output; + output = buffer; + strcpy(buffer, "BarryLog: (trace error, output too long for buffer)"); + } + } + va_end(vl); + + if( verbose ) { + barryverbose(output); + } + else { + barrylog(output); + } + + if( output != buffer ) + delete [] output; +} + diff -Nru barry-0.14/src/log.h barry-0.0.20110506/src/log.h --- barry-0.14/src/log.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/log.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -47,10 +47,10 @@ } // namespace Barry -#define barrylog(x) { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; } +#define barrylog(x) { ::Barry::LogLock lock; (*::Barry::GetLogStream()) << x << std::endl; } // controlled by command line -v switch -#define barryverbose(x) if(Barry::LogVerbose()) { Barry::LogLock lock; (*Barry::GetLogStream()) << x << std::endl; } +#define barryverbose(x) if(::Barry::LogVerbose()) { ::Barry::LogLock lock; (*::Barry::GetLogStream()) << x << std::endl; } #endif // __BARRY_LOG_H__ diff -Nru barry-0.14/src/Makefile.am barry-0.0.20110506/src/Makefile.am --- barry-0.14/src/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/Makefile.am 2011-05-06 12:20:17.000000000 +0000 @@ -23,7 +23,9 @@ # two digit version number, and leave age as 0, always. # # Only ever increment the first 2 numbers in this version: -LIB_BARRY_VERSION = 0:14:0 +# The first number represents libmajor, the second libminor. +# So version 0.17.1 will look like 17:1:0 +LIB_BARRY_VERSION = 18:0:0 # Disable the default -I. -I$(srcdir) -I$(topdir), etc, but $(top_builddir) is # needed for config.h @@ -32,8 +34,8 @@ #INCLUDES = $(LIBUSB_CFLAGS) $(OPENSSL_CFLAGS) INCLUDES = $(LIBUSB_CFLAGS) #AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g -D__DEBUG_MODE__ -AM_CFLAGS = -Wall -fno-strict-aliasing -g -AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g +AM_CFLAGS = -Wall -fno-strict-aliasing -g -D__BARRY_LIBRARY_BUILD__ +AM_CXXFLAGS = -Wall -fno-strict-aliasing -g -D__BARRY_LIBRARY_BUILD__ AM_LDFLAGS = if WITH_GCCVISIBILITY AM_CFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden @@ -58,94 +60,253 @@ #LDFLAGS = ../../external/rootdir/libusb/lib/libusb.a $(LDBOOST) -lpthread $(LDDEBUG) -lib_LTLIBRARIES = libbarry.la +# To use gettext +datadir = @datadir@ +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ -include_barry_HEADERS = barry.h \ +# +# libbarry - main USB protocol interface library +# libbarryalx - ALX library +# libbarrydp - '.debug' parser library +# libbarryjdwp - java debug server library +# libbarrysync - utility functions and classes for syncing and vformats +# libbarrybackup - utility classes for reading/writing Barry backup files +# +lib_LTLIBRARIES = libbarry.la libbarrydp.la libbarryjdwp.la +if WITH_SYNC +lib_LTLIBRARIES += libbarrysync.la +endif +if WITH_BACKUP +lib_LTLIBRARIES += libbarrybackup.la +endif +if WITH_ALX +lib_LTLIBRARIES += libbarryalx.la +endif + +include_barry_HEADERS = barry.h barrysync.h barrybackup.h barryalx.h \ dll.h \ + publiccfg.h \ builder.h \ common.h \ + configfile.h \ controller.h \ + xmlparser.h \ + a_common.h \ + a_codsection.h \ + a_library.h \ + a_application.h \ + a_osloader.h \ + a_alxparser.h \ + m_mode_base.h \ m_desktop.h \ + m_raw_channel.h \ m_desktoptmpl.h \ m_ipmodem.h \ m_serial.h \ + m_javaloader.h \ + m_jvmdebug.h \ data.h \ error.h \ ldif.h \ + ldifio.h \ log.h \ parser.h \ + pin.h \ probe.h \ protocol.h \ record.h \ modem.h \ + r_recur_base.h \ r_calendar.h \ + r_calllog.h \ + r_bookmark.h \ r_contact.h \ + r_cstore.h \ r_folder.h \ + r_hhagent.h \ r_memo.h \ + r_message_base.h \ r_message.h \ r_pin_message.h \ r_saved_message.h \ r_servicebook.h \ + r_sms.h \ r_task.h \ r_timezone.h \ dataqueue.h \ router.h \ socket.h \ time.h \ + threadwrap.h \ + vsmartptr.h \ usbwrap.h \ version.h \ pppfilter.h \ sha1.h \ - s11n-boost.h + iconv.h \ + cod.h \ + bmp.h \ + s11n-boost.h \ + dp_codinfo.h \ + j_manager.h \ + j_server.h \ + vformat.h \ + vbase.h \ + vcard.h \ + vevent.h \ + vjournal.h \ + vtodo.h \ + mimeio.h \ + scoped_lock.h \ + semaphore.h \ + backup.h \ + restore.h \ + pipe.h \ + connector.h \ + trim.h \ + tzwrapper.h +noinst_HEADERS = cbarry.h \ + base64.h \ + record-internal.h \ + bmp-internal.h \ + cod-internal.h \ + controllerpriv.h \ + packet.h \ + protostructs.h \ + debug.h \ + endian.h \ + strnlen.h \ + platform.h \ + dp_parser.h \ + j_message.h \ + j_jdwp.h \ + tarfile.h \ + clog.h -libbarry_la_SOURCES = time.cc \ - base64.cc base64.h \ - parser.cc \ - data.cc \ - usbwrap.cc \ - probe.cc \ - common.cc \ - error.cc \ - ldif.cc \ - log.cc \ +# Include the windows-only code files here too +EXTRA_DIST = convo.awk \ + legal.txt \ + iconvwin.cc + +libbarry_la_SOURCES = dll.h \ + builder.h builder.cc \ + parser.h parser.cc \ + time.h time.cc \ + base64.h base64.cc \ + bmp.h bmp-internal.h bmp.cc \ + cod.h cod-internal.h cod.cc \ + data.h data.cc \ + usbwrap.h usbwrap.cc \ + pin.h pin.cc \ + probe.h probe.cc \ + common.h common.cc \ + configfile.h configfile.cc \ + error.h error.cc \ + ldif.h ldif.cc \ + ldifio.h ldifio.cc \ + log.h log.cc \ socket.cc \ router.cc \ dataqueue.cc \ - protocol.cc \ - record.cc \ - r_calendar.cc \ - r_contact.cc \ - r_folder.cc \ - r_memo.cc \ - r_message.cc \ - r_pin_message.cc \ - r_saved_message.cc \ - r_servicebook.cc \ - r_task.cc \ - r_timezone.cc \ - packet.cc packet.h \ - controller.cc \ - m_desktop.cc \ - m_ipmodem.cc \ - m_serial.cc \ - version.cc \ - pppfilter.cc \ - sha1.cc \ - scoped_lock.h \ - protostructs.h \ - debug.h \ - endian.h + threadwrap.cc \ + protocol.h protostructs.h protocol.cc \ + record.h record-internal.h record.cc \ + r_recur_base.h r_recur_base.cc \ + r_calendar.h r_calendar.cc \ + r_calllog.h r_calllog.cc \ + r_bookmark.h r_bookmark.cc \ + r_command.cc \ + r_contact.h r_contact.cc \ + r_cstore.h r_cstore.cc \ + r_hhagent.h r_hhagent.cc \ + r_dbdb.cc \ + r_folder.h r_folder.cc \ + r_memo.h r_memo.cc \ + r_message_base.h r_message_base.cc \ + r_recordstate.cc \ + r_servicebook.h r_servicebook.cc \ + r_sms.h r_sms.cc \ + r_task.h r_task.cc \ + r_timezone.h r_timezone.cc \ + packet.h packet.cc \ + controller.h controller.cc \ + pipe.h pipe.cc \ + m_mode_base.h m_mode_base.cc \ + m_desktop.h m_desktop.cc \ + m_raw_channel.h m_raw_channel.cc \ + m_ipmodem.h m_ipmodem.cc \ + m_serial.h m_serial.cc \ + m_javaloader.h m_javaloader.cc \ + m_jvmdebug.h m_jvmdebug.cc \ + connector.h connector.cc \ + version.h version.cc \ + pppfilter.h pppfilter.cc \ + sha1.h sha1.cc \ + iconv.h iconv.cc #libbarry_la_LIBADD = $(LTLIBOBJS) $(LIBUSB_LIBS) $(OPENSSL_LIBS) -libbarry_la_LIBADD = $(LTLIBOBJS) $(LIBUSB_LIBS) +libbarry_la_LIBADD = $(LTLIBOBJS) $(LIBUSB_LIBS) $(ZLIB_LIBS) @LTLIBICONV@ libbarry_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} -noinst_HEADERS = cbarry.h \ - record-internal.h \ - strnlen.h +libbarrydp_la_SOURCES = \ + dp_parser.h dp_parser.cc \ + dp_codinfo.h dp_codinfo.cc +libbarrydp_la_LIBADD = libbarry.la +libbarrydp_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} + +libbarryjdwp_la_SOURCES = \ + j_record.cc \ + j_jdwp.h j_jdwp.cc \ + j_message.h j_message.cc \ + j_server.h j_server.cc \ + j_manager.h j_manager.cc +libbarryjdwp_la_LIBADD = libbarry.la libbarrydp.la $(LIBUSB_LIBS) +libbarryjdwp_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} + +if WITH_SYNC +libbarrysync_la_SOURCES = \ + vformat.h vformat.c \ + vbase.h vbase.cc \ + vcard.h vcard.cc \ + vevent.h vevent.cc \ + vjournal.h vjournal.cc \ + vtodo.h vtodo.cc \ + mimeio.h mimeio.cc \ + tzwrapper.h tzwrapper.cc +# if we set CFLAGS and CXXFLAGS ourselves, we need to include +# AM_*FLAGS as well... this only seems to matter for compile flags, +# not link flags +libbarrysync_la_CFLAGS = $(AM_CFLAGS) $(GLIB2_CFLAGS) +libbarrysync_la_CXXFLAGS = $(AM_CXXFLAGS) $(GLIB2_CFLAGS) +libbarrysync_la_LIBADD = libbarry.la $(GLIB2_LIBS) +libbarrysync_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} +endif -EXTRA_DIST = convo.awk \ - legal.txt +if WITH_BACKUP +libbarrybackup_la_SOURCES = \ + tarfile.cc tarfile-ops-nt.cc \ + backup.h backup.cc \ + restore.h restore.cc +libbarrybackup_la_CFLAGS = $(AM_CFLAGS) $(LIBTAR_CFLAGS) $(LIBZ_CFLAGS) +libbarrybackup_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBTAR_CFLAGS) $(LIBZ_CFLAGS) +libbarrybackup_la_LIBADD = libbarry.la $(LIBTAR_LIBS) $(LIBZ_LIBS) +libbarrybackup_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} +endif + +if WITH_ALX +libbarryalx_la_SOURCES = \ + xmlparser.h xmlparser.cc \ + a_common.h \ + a_codsection.h a_codsection.cc \ + a_library.h a_library.cc \ + a_application.h a_application.cc \ + a_osloader.h a_osloader.cc \ + a_alxparser.h a_alxparser.cc +libbarryalx_la_CXXFLAGS = $(AM_CXXFLAGS) $(LIBXMLXX_CFLAGS) +libbarryalx_la_LIBADD = libbarry.la $(LIBXMLXX_LIBS) +libbarryalx_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} +endif ##if DO_TEST ## bin_PROGRAMS += test-base64 test-data test-time diff -Nru barry-0.14/src/Makefile.in barry-0.0.20110506/src/Makefile.in --- barry-0.14/src/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,699 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -@WITH_GCCVISIBILITY_TRUE@am__append_1 = -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -#AM_CXXFLAGS += -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -fvisibility-inlines-hidden -@WITH_GCCVISIBILITY_TRUE@am__append_2 = -D__BARRY_HAVE_GCCVISIBILITY__ -fvisibility=hidden -#AM_LDFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -@WITH_GCCVISIBILITY_TRUE@am__append_3 = -fvisibility=hidden -subdir = src -DIST_COMMON = $(include_barry_HEADERS) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in strnlen.c -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \ - $(top_srcdir)/m4/ax_cxx_check_flag.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 = -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 = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" \ - "$(DESTDIR)$(include_barrydir)" -libLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = @LTLIBOBJS@ -am__DEPENDENCIES_2 = -libbarry_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) -am_libbarry_la_OBJECTS = time.lo base64.lo parser.lo data.lo \ - usbwrap.lo probe.lo common.lo error.lo ldif.lo log.lo \ - socket.lo router.lo dataqueue.lo protocol.lo record.lo \ - r_calendar.lo r_contact.lo r_folder.lo r_memo.lo r_message.lo \ - r_pin_message.lo r_saved_message.lo r_servicebook.lo r_task.lo \ - r_timezone.lo packet.lo controller.lo m_desktop.lo \ - m_ipmodem.lo m_serial.lo version.lo pppfilter.lo sha1.lo -libbarry_la_OBJECTS = $(am_libbarry_la_OBJECTS) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libbarry_la_SOURCES) -DIST_SOURCES = $(libbarry_la_SOURCES) -include_barryHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(include_barry_HEADERS) $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_INC_PATH = @BOOST_INC_PATH@ -BOOST_LIB_PATH = @BOOST_LIB_PATH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LIBS = @LIBUSB_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ -WITH_BOOST_PATHS_FALSE = @WITH_BOOST_PATHS_FALSE@ -WITH_BOOST_PATHS_TRUE = @WITH_BOOST_PATHS_TRUE@ -WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -# The following version numbers are: current:revision:age -# -# See also: http://sources.redhat.com/autobook/autobook/autobook_91.html -# -# Current - number of the current interface of the library -# Revision - implementation number of most recent interface -# Age - number of previous additional interfaces supported by this library -# -# Libtool uses the following calculation for Linux: -# -# major = current - age -# suffix = major.age.revision -# -# Therefore a libtool version of 1.4.0 will translate to a filename of: -# libbarry.so.1.0.4 -# -# Other operating systems just use current.revision, most of the time, -# and age is only used to subtract from current. -# -# Therefore, if you are careful never to increment the major version -# unless there is an incompatible break, you can get away with a -# two digit version number, and leave age as 0, always. -# -# Only ever increment the first 2 numbers in this version: -LIB_BARRY_VERSION = 0:14:0 - -# Disable the default -I. -I$(srcdir) -I$(topdir), etc, but $(top_builddir) is -# needed for config.h -DEFAULT_INCLUDES = -I$(top_builddir) -#INCLUDES = @PACKAGE_CXXFLAGS@ -I@LIBUSB_INC_PATH@ -#INCLUDES = $(LIBUSB_CFLAGS) $(OPENSSL_CFLAGS) -INCLUDES = $(LIBUSB_CFLAGS) -#AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g -D__DEBUG_MODE__ -AM_CFLAGS = -Wall -fno-strict-aliasing -g $(am__append_1) -AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g $(am__append_2) -AM_LDFLAGS = $(am__append_3) -include_barrydir = ${includedir}/barry - -#BOOSTFLAG = -D__BARRY_BOOST_MODE__ -I../../../../boost/rootdir/include/boost-1_33_1 -#LDBOOST = ../../../../boost/rootdir/lib/libboost_serialization-gcc-mt-1_33_1.a - -# Heavy duty C++ warnings -#WARNFLAGS = -ansi -pedantic -Wall -W -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-long-long -#WARNFLAGS = -ansi -pedantic -Wall -W -Weffc++ -Woverloaded-virtual -Wold-style-cast -Wfloat-equal -Wwrite-strings -Wno-long-long -Werror - -#LDFLAGS = ../../external/rootdir/libusb/lib/libusb.a $(LDBOOST) -lpthread $(LDDEBUG) -lib_LTLIBRARIES = libbarry.la -include_barry_HEADERS = barry.h \ - dll.h \ - builder.h \ - common.h \ - controller.h \ - m_desktop.h \ - m_desktoptmpl.h \ - m_ipmodem.h \ - m_serial.h \ - data.h \ - error.h \ - ldif.h \ - log.h \ - parser.h \ - probe.h \ - protocol.h \ - record.h \ - modem.h \ - r_calendar.h \ - r_contact.h \ - r_folder.h \ - r_memo.h \ - r_message.h \ - r_pin_message.h \ - r_saved_message.h \ - r_servicebook.h \ - r_task.h \ - r_timezone.h \ - dataqueue.h \ - router.h \ - socket.h \ - time.h \ - usbwrap.h \ - version.h \ - pppfilter.h \ - sha1.h \ - s11n-boost.h - -libbarry_la_SOURCES = time.cc \ - base64.cc base64.h \ - parser.cc \ - data.cc \ - usbwrap.cc \ - probe.cc \ - common.cc \ - error.cc \ - ldif.cc \ - log.cc \ - socket.cc \ - router.cc \ - dataqueue.cc \ - protocol.cc \ - record.cc \ - r_calendar.cc \ - r_contact.cc \ - r_folder.cc \ - r_memo.cc \ - r_message.cc \ - r_pin_message.cc \ - r_saved_message.cc \ - r_servicebook.cc \ - r_task.cc \ - r_timezone.cc \ - packet.cc packet.h \ - controller.cc \ - m_desktop.cc \ - m_ipmodem.cc \ - m_serial.cc \ - version.cc \ - pppfilter.cc \ - sha1.cc \ - scoped_lock.h \ - protostructs.h \ - debug.h \ - endian.h - -#libbarry_la_LIBADD = $(LTLIBOBJS) $(LIBUSB_LIBS) $(OPENSSL_LIBS) -libbarry_la_LIBADD = $(LTLIBOBJS) $(LIBUSB_LIBS) -libbarry_la_LDFLAGS = -version-info ${LIB_BARRY_VERSION} -noinst_HEADERS = cbarry.h \ - record-internal.h \ - strnlen.h - -EXTRA_DIST = convo.awk \ - legal.txt - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .cc .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - 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 -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ - 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 -libbarry.la: $(libbarry_la_OBJECTS) $(libbarry_la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libbarry_la_LDFLAGS) $(libbarry_la_OBJECTS) $(libbarry_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strnlen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/controller.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dataqueue.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ldif.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_desktop.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_ipmodem.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_serial.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pppfilter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/probe.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_calendar.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_contact.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_folder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_memo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_message.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_pin_message.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_saved_message.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_servicebook.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_task.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_timezone.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/record.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/router.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbwrap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@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 $@ $< - -.cc.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -install-include_barryHEADERS: $(include_barry_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(include_barrydir)" || $(mkdir_p) "$(DESTDIR)$(include_barrydir)" - @list='$(include_barry_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(include_barryHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(include_barrydir)/$$f'"; \ - $(include_barryHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(include_barrydir)/$$f"; \ - done - -uninstall-include_barryHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_barry_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(include_barrydir)/$$f'"; \ - rm -f "$(DESTDIR)$(include_barrydir)/$$f"; \ - 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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(include_barrydir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf $(DEPDIR) ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-include_barryHEADERS - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf $(DEPDIR) ./$(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-include_barryHEADERS uninstall-info-am \ - uninstall-libLTLIBRARIES - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-include_barryHEADERS install-info \ - install-info-am install-libLTLIBRARIES install-man \ - 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-include_barryHEADERS uninstall-info-am \ - uninstall-libLTLIBRARIES - -# 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 barry-0.14/src/m_desktop.cc barry-0.0.20110506/src/m_desktop.cc --- barry-0.14/src/m_desktop.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_desktop.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,6 +28,7 @@ #include "error.h" #include "usbwrap.h" #include "controller.h" +#include "parser.h" #include #include @@ -40,8 +41,14 @@ // Desktop Mode class Desktop::Desktop(Controller &con) - : m_con(con) - , m_ModeSocket(0) + : Mode(con, Controller::Desktop) + , m_ic(0) +{ +} + +Desktop::Desktop(Controller &con, const IConverter &ic) + : Mode(con, Controller::Desktop) + , m_ic(&ic) { } @@ -55,24 +62,22 @@ void Desktop::LoadCommandTable() { char rawCommand[] = { 6, 0, 0x0a, 0, 0x40, 0, 0, 1, 0, 0 }; - *((uint16_t*) rawCommand) = htobs(m_socket->GetSocket()); Data command(rawCommand, sizeof(rawCommand)); - Data response; try { - m_socket->Packet(command, response); + m_socket->Packet(command, m_response); - MAKE_PACKET(rpack, response); + MAKE_PACKET(rpack, m_response); while( rpack->command != SB_COMMAND_DB_DONE ) { - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); - rpack = (const Protocol::Packet *) response.GetData(); + rpack = (const Protocol::Packet *) m_response.GetData(); if( rpack->command == SB_COMMAND_DB_DATA && btohs(rpack->size) > 10 ) { // second packet is generally large, and contains // the command table m_commandTable.Clear(); - m_commandTable.Parse(response, 6); + m_commandTable.Parse(m_response, 6); } } @@ -81,15 +86,14 @@ } catch( Usb::Error & ) { eout("Desktop: error getting command table"); - eeout(command, response); + eeout(command, m_response); throw; } } void Desktop::LoadDBDB() { - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); packet.GetDBDB(); m_socket->Packet(packet); @@ -97,87 +101,24 @@ while( packet.Command() != SB_COMMAND_DB_DONE ) { if( packet.Command() == SB_COMMAND_DB_DATA ) { m_dbdb.Clear(); - m_dbdb.Parse(response); + m_dbdb.Parse(m_response); } // advance! - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); } } - - -/////////////////////////////////////////////////////////////////////////////// -// public API - -// -// Open -// -/// Select device mode. This is required before using any other mode-based -/// operations, such as GetDBDB() and LoadDatabase(). -/// -/// This function opens a socket to the device for communicating in Desktop -/// mode. If the device requires it, specify the password with a const char* -/// string in password. The password will not be stored in memory -/// inside this class, only a hash will be generated from it. After -/// using the hash, the hash memory will be set to 0. The application -/// is responsible for safely handling the raw password data. -/// -/// You can retry the password by catching Barry::BadPassword and -/// calling RetryPassword() with the new password. -/// -/// \exception Barry::Error -/// Thrown on protocol error. -/// -/// \exception std::logic_error() -/// Thrown if unsupported mode is requested, or if socket -/// already open. -/// -/// \exception Barry::BadPassword -/// Thrown when password is invalid or if not enough retries -/// left in the device. -/// -void Desktop::Open(const char *password) -{ - if( m_ModeSocket ) { - m_socket->Close(); - m_socket.reset(); - m_ModeSocket = 0; - } - - m_ModeSocket = m_con.SelectMode(Controller::Desktop); - RetryPassword(password); -} - -// -// RetryPassword -// -/// Retry a failed password attempt from the first call to Open(). -/// Only call this function in response to Barry::BadPassword exceptions -/// that are thrown from Open(). -/// -/// \exception Barry::Error -/// Thrown on protocol error. -/// -/// \exception std::logic_error() -/// Thrown if in unsupported mode, or if socket already open. -/// -/// \exception Barry::BadPassword -/// Thrown when password is invalid or if not enough retries -/// left in the device. -/// -void Desktop::RetryPassword(const char *password) +void Desktop::OnOpen() { - if( m_socket.get() != 0 ) - throw std::logic_error("Socket alreay open in RetryPassword"); - - m_socket = m_con.m_zero.Open(m_ModeSocket, password); - // get command table and database database LoadCommandTable(); LoadDBDB(); } +/////////////////////////////////////////////////////////////////////////////// +// public API + // // GetDBID // @@ -229,6 +170,11 @@ return cmd; } +void Desktop::SetIConverter(const IConverter &ic) +{ + m_ic = ⁣ +} + // // GetRecordStateTable // @@ -243,16 +189,15 @@ // start fresh result.Clear(); - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); packet.GetRecordStateTable(dbId); m_socket->Packet(packet); - result.Parse(response); + result.Parse(m_response); // flush the command sequence while( packet.Command() != SB_COMMAND_DB_DONE ) - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); } // @@ -260,17 +205,16 @@ // /// Adds a record to the specified database. RecordId is /// retrieved from build, and duplicate IDs are allowed by the device -/// (i.e. you can have two records with the same ID) +/// (i.e. you can have two records with the same ID) /// but *not* recommended! // void Desktop::AddRecord(unsigned int dbId, Builder &build) { dout("Database ID: " << dbId); - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); - if( packet.SetRecord(dbId, build) ) { + if( packet.SetRecord(dbId, build, m_ic) ) { std::ostringstream oss; @@ -305,24 +249,26 @@ { dout("Database ID: " << dbId); - Data command, response; - DBPacket packet(*this, command, response); + std::string dbName; + m_dbdb.GetDBName(dbId, dbName); + + DBPacket packet(*this, m_command, m_response); packet.GetRecordByIndex(dbId, stateTableIndex); m_socket->Packet(packet); // perform copious packet checks - if( response.GetSize() < SB_PACKET_RESPONSE_HEADER_SIZE ) { - eeout(command, response); + if( m_response.GetSize() < SB_PACKET_RESPONSE_HEADER_SIZE ) { + eeout(m_command, m_response); std::ostringstream oss; oss << "Desktop: invalid response packet size of " - << std::dec << response.GetSize(); + << std::dec << m_response.GetSize(); eout(oss.str()); throw Error(oss.str()); } if( packet.Command() != SB_COMMAND_DB_DATA ) { - eeout(command, response); + eeout(m_command, m_response); std::ostringstream oss; oss << "Desktop: unexpected command of 0x" @@ -334,11 +280,11 @@ } // grab that data - packet.Parse(parser); + packet.Parse(parser, dbName, m_ic); // flush the command sequence while( packet.Command() != SB_COMMAND_DB_DONE ) - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); } // @@ -352,11 +298,10 @@ { dout("Database ID: " << dbId << " Index: " << stateTableIndex); - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); - // loop until builder object has no more data - if( !packet.SetRecordByIndex(dbId, stateTableIndex, build) ) { + // write only if builder object has data + if( !packet.SetRecordByIndex(dbId, stateTableIndex, build, m_ic) ) { throw std::logic_error("Desktop: no data available in SetRecord"); } @@ -388,15 +333,14 @@ { dout("Database ID: " << dbId); - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); packet.SetRecordFlags(dbId, stateTableIndex, 0); m_socket->Packet(packet); // flush the command sequence while( packet.Command() != SB_COMMAND_DB_DONE ) - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); } // @@ -408,15 +352,14 @@ { dout("Database ID: " << dbId); - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); packet.DeleteRecordByIndex(dbId, stateTableIndex); m_socket->Packet(packet); // flush the command sequence while( packet.Command() != SB_COMMAND_DB_DONE ) - m_socket->NextRecord(response); + m_socket->NextRecord(m_response); } // @@ -444,39 +387,23 @@ /// void Desktop::LoadDatabase(unsigned int dbId, Parser &parser) { - dout("Database ID: " << dbId); - - Data command, response; - DBPacket packet(*this, command, response); - packet.GetRecords(dbId); - - m_socket->Packet(packet); - - while( packet.Command() != SB_COMMAND_DB_DONE ) { - if( packet.Command() == SB_COMMAND_DB_DATA ) { - // this size is the old header size, since using - // old command above - packet.Parse(parser); - } + DBData data; + DBLoader loader(*this); + bool loading = loader.StartDBLoad(dbId, data); + while( loading ) { + // manual parser call + parser.ParseRecord(data, m_ic); // advance! - m_socket->NextRecord(response); + loading = loader.GetNextRecord(data); } } -void Desktop::SaveDatabase(unsigned int dbId, Builder &builder) +void Desktop::ClearDatabase(unsigned int dbId) { dout("Database ID: " << dbId); - // Protocol note: so far in testing, this CLEAR_DATABASE operation is - // required, since every record sent via SET_RECORD - // is treated like a hypothetical "ADD_RECORD" (perhaps - // SET_RECORD should be renamed)... I don't know if - // there is a real SET_RECORD... all I know is from - // the Windows USB captures, which uses this same - // technique. - Data command, response; - DBPacket packet(*this, command, response); + DBPacket packet(*this, m_command, m_response); packet.ClearDatabase(dbId); // wait up to a minute here for old, slower devices with lots of data @@ -491,13 +418,29 @@ // check response to clear command was successful if( packet.Command() != SB_COMMAND_DB_DONE ) { - eeout(command, response); + eeout(m_command, m_response); throw Error("Desktop: error clearing database, bad response"); } +} + +void Desktop::SaveDatabase(unsigned int dbId, Builder &builder) +{ + dout("Database ID: " << dbId); + + // Protocol note: so far in testing, this CLEAR_DATABASE operation is + // required, since every record sent via SET_RECORD + // is treated like a hypothetical "ADD_RECORD" (perhaps + // SET_RECORD should be renamed)... I don't know if + // there is a real SET_RECORD... all I know is from + // the Windows USB captures, which uses this same + // technique. + ClearDatabase(dbId); + + DBPacket packet(*this, m_command, m_response); // loop until builder object has no more data bool first = true; - while( packet.SetRecord(dbId, builder) ) { + while( packet.SetRecord(dbId, builder, m_ic) ) { dout("Database ID: " << dbId); m_socket->Packet(packet, first ? 60000 : -1); @@ -520,5 +463,314 @@ } } -}} // namespace Barry::Mode + + +////////////////////////////////////////////////////////////////////////////// +// DBLoader class + +struct DBLoaderData +{ + DBPacket m_packet; + DBLoaderData(Desktop &desktop, Data &command, Data &response) + : m_packet(desktop, command, response) + { + } +}; + +DBLoader::DBLoader(Desktop &desktop) + : m_desktop(desktop) + , m_loading(false) + , m_loader(new DBLoaderData(desktop, m_send, m_send)) +{ +} + +DBLoader::~DBLoader() +{ + delete m_loader; +} + +bool DBLoader::StartDBLoad(unsigned int dbId, DBData &data) +{ + dout("Database ID: " << dbId); + + m_loading = true; + m_desktop.m_dbdb.GetDBName(dbId, m_dbName); + + DBPacket &packet = m_loader->m_packet; + packet.SetNewReceive(data.UseData()); + packet.GetRecords(dbId); + m_desktop.m_socket->Packet(packet); + + while( packet.Command() != SB_COMMAND_DB_DONE ) { + if( packet.Command() == SB_COMMAND_DB_DATA ) { + packet.ParseMeta(data); + data.SetDBName(m_dbName); + return true; + } + + // advance! (use the same data block as in packet) + m_desktop.m_socket->NextRecord(data.UseData()); + } + + m_loading = false; + return false; +} + +bool DBLoader::GetNextRecord(DBData &data) +{ + if( !m_loading ) + return false; + + DBPacket &packet = m_loader->m_packet; + packet.SetNewReceive(data.UseData()); + + do { + // advance! (use same data as in packet) + m_desktop.m_socket->NextRecord(data.UseData()); + + if( packet.Command() == SB_COMMAND_DB_DATA ) { + packet.ParseMeta(data); + return true; + } + } while( m_loader->m_packet.Command() != SB_COMMAND_DB_DONE ); + + m_loading = false; + return false; +} + +} // namespace Barry::Mode + + + + + +////////////////////////////////////////////////////////////////////////////// +// DeviceBuilder class + +DeviceBuilder::DeviceBuilder(Mode::Desktop &desktop) + : m_started(false) + , m_desktop(desktop) + , m_loader(desktop) +{ + Restart(); +} + +// searches the dbdb from the desktop to find the dbId, +// returns false if not found, and adds it to the list of +// databases to retrieve if found +bool DeviceBuilder::Add(const std::string &dbname) +{ + try { + DBLabel id(m_desktop.GetDBID(dbname), dbname); + m_dbIds.push_back(id); + return true; + } + catch( Barry::Error & ) { + // GetDBID() throws on error... + return false; + } +} + +void DeviceBuilder::Add(const Barry::DatabaseDatabase &dbdb) +{ + DatabaseDatabase::DatabaseArrayType::const_iterator + b = dbdb.Databases.begin(), + e = dbdb.Databases.end(); + + for( ; b != e; ++b ) { + // hmmm, could optimize this and only add ids + // with RecordCount > 0, but let's stick with this + // for now... it might flush bugs out of the system + DBLabel id(b->Number, b->Name); + m_dbIds.push_back(id); + } +} + +bool DeviceBuilder::BuildRecord(DBData &data, + size_t &offset, + const IConverter *ic) +{ + DBData temp; + if( !FetchRecord(temp, ic) ) + return false; + + // copy the metadata + data.SetVersion(temp.GetVersion()); + data.SetDBName(temp.GetDBName()); + data.SetIds(temp.GetRecType(), temp.GetUniqueId()); + data.SetOffset(offset); + + // copy data from temp into the given offset + size_t tempsize = temp.GetData().GetSize() - temp.GetOffset(); + data.UseData().MemCpy(offset, + temp.GetData().GetData() + temp.GetOffset(), tempsize); + data.UseData().ReleaseBuffer(offset + tempsize); + return true; +} + +bool DeviceBuilder::FetchRecord(DBData &data, const IConverter *ic) +{ + bool ret; + + if( !m_dbIds.size() ) + return false; // nothing to do + + if( !m_started ) { + m_current = m_dbIds.begin(); + ret = m_loader.StartDBLoad(m_current->id, data); + m_started = true; + } + else if( m_loader.IsBusy() ) { + ret = m_loader.GetNextRecord(data); + } + else { + // don't do anything if we're at the end of our rope + if( EndOfFile() ) + return false; + + // advance and check again... m_current always points + // to our current DB + ++m_current; + if( EndOfFile() ) + return false; + + ret = m_loader.StartDBLoad(m_current->id, data); + } + + // fill in the DBname if successful + if( ret ) { + data.SetDBName(m_current->name); + } + return ret; +} + +bool DeviceBuilder::EndOfFile() const +{ + return m_current == m_dbIds.end(); +} + + + +////////////////////////////////////////////////////////////////////////////// +// DeviceParser class + +DeviceParser::DeviceParser(Mode::Desktop &desktop, WriteMode mode) + : m_desktop(desktop) + , m_mode(mode) +{ +} + +DeviceParser::~DeviceParser() +{ +} + +void DeviceParser::StartDB(const DBData &data, const IConverter *ic) +{ + // start fresh + m_rstate.Clear(); + m_current_db = data.GetDBName(); + if( !m_desktop.GetDBDB().GetDBNumber(m_current_db, m_current_dbid) ) { + // doh! This database does not exist in this device + dout("Database '" << m_current_db << "' does not exist in this device. Dropping record."); + m_current_db.clear(); + m_current_dbid = 0; + return; + } + + // determine mode + WriteMode mode = m_mode; + if( mode == DECIDE_BY_CALLBACK ) + mode = DecideWrite(data); + + switch( mode ) + { + case ERASE_ALL_WRITE_ALL: + m_desktop.ClearDatabase(m_current_dbid); + WriteNext(data, ic); + break; + + case INDIVIDUAL_OVERWRITE: + case ADD_BUT_NO_OVERWRITE: + case ADD_WITH_NEW_ID: + m_desktop.GetRecordStateTable(m_current_dbid, m_rstate); + WriteNext(data, ic); + break; + + case DROP_RECORD: + break; + + case DECIDE_BY_CALLBACK: + default: + throw std::logic_error("DeviceParser: unknown mode"); + } +} + +void DeviceParser::WriteNext(const DBData &data, const IConverter *ic) +{ + // determine mode + WriteMode mode = m_mode; + if( mode == DECIDE_BY_CALLBACK ) + mode = DecideWrite(data); + + // create fast copy with our own metadata + DBData local(data.GetVersion(), data.GetDBName(), + data.GetRecType(), data.GetUniqueId(), data.GetOffset(), + data.GetData().GetData(), data.GetData().GetSize()); + DBDataBuilder dbuild(local); + + RecordStateTable::IndexType index; + + switch( mode ) + { + case ERASE_ALL_WRITE_ALL: + // just do an AddRecord() + m_desktop.AddRecord(m_current_dbid, dbuild); + break; + + case INDIVIDUAL_OVERWRITE: + // search the state table, overwrite existing, and add new + if( m_rstate.GetIndex(local.GetUniqueId(), &index) ) { + // found this record ID, use the index + m_desktop.SetRecord(m_current_dbid, index, dbuild); + } + else { + // new record + m_desktop.AddRecord(m_current_dbid, dbuild); + } + break; + + case ADD_BUT_NO_OVERWRITE: + if( !m_rstate.GetIndex(local.GetUniqueId()) ) { + // no such record ID, so safe to add as new + m_desktop.AddRecord(m_current_dbid, dbuild); + } + // else, drop record + break; + + case ADD_WITH_NEW_ID: + // use state table to create new id, and add as new + local.SetIds(local.GetRecType(), m_rstate.MakeNewRecordId()); + m_desktop.AddRecord(m_current_dbid, dbuild); + break; + + case DROP_RECORD: + break; + + case DECIDE_BY_CALLBACK: + default: + throw std::logic_error("DeviceParser: unknown mode"); + } +} + +void DeviceParser::ParseRecord(const DBData &data, const IConverter *ic) +{ + if( data.GetDBName() == m_current_db ) { + WriteNext(data, ic); + } + else { + StartDB(data, ic); + } +} + +} // namespace Barry diff -Nru barry-0.14/src/m_desktop.h barry-0.0.20110506/src/m_desktop.h --- barry-0.14/src/m_desktop.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_desktop.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,18 +23,23 @@ #define __BARRY_M_DESKTOP_H__ #include "dll.h" +#include "m_mode_base.h" +#include "data.h" #include "socket.h" #include "record.h" +#include "parser.h" +#include "builder.h" namespace Barry { // forward declarations class Parser; -class Builder; -class Controller; +class IConverter; namespace Mode { +class DBLoader; + // // Desktop class // @@ -50,37 +55,38 @@ /// - Call GetDBID() to get a database ID by name /// - Call LoadDatabase() to retrieve and store a database /// -class BXEXPORT Desktop +class BXEXPORT Desktop : public Mode { + friend class DBLoader; + public: enum CommandType { Unknown, DatabaseAccess }; private: - Controller &m_con; - - SocketHandle m_socket; + // packet data + Data m_command, m_response; CommandTable m_commandTable; DatabaseDatabase m_dbdb; - uint16_t m_ModeSocket; // socket recommended by device - // when mode was selected + // external objects (optional, can be null) + const IConverter *m_ic; protected: void LoadCommandTable(); void LoadDBDB(); + ////////////////////////////////// + // overrides + + virtual void OnOpen(); + public: Desktop(Controller &con); + Desktop(Controller &con, const IConverter &ic); ~Desktop(); ////////////////////////////////// - // primary operations - required before anything else - - void Open(const char *password = 0); - void RetryPassword(const char *password); - - ////////////////////////////////// // meta access /// Returns DatabaseDatabase object for this connection. @@ -89,6 +95,8 @@ unsigned int GetDBID(const std::string &name) const; unsigned int GetDBCommand(CommandType ct); + void SetIConverter(const IConverter &ic); + ////////////////////////////////// // Desktop mode - database specific @@ -104,6 +112,7 @@ // pure load/save operations void LoadDatabase(unsigned int dbId, Parser &parser); + void ClearDatabase(unsigned int dbId); void SaveDatabase(unsigned int dbId, Builder &builder); template void LoadDatabaseByType(StorageT &store); @@ -116,7 +125,189 @@ }; -}} // namespace Barry::Mode +// used to hold internal-only state +struct DBLoaderData; + +// +// DBLoader +// +/// Database Loader operation class. Encapsulates the load / save +/// logic of Desktop::LoadDatabase() and someday Desktop::SaveDatabase() +/// in such a way that the loading of individual records is +/// controllable by the user, instead of using the parser callback mechanism. +/// +/// This class can be reused to load / save multiple databases, but +/// do not call Desktop members while a load operation is in progress. +/// +class BXEXPORT DBLoader +{ + Desktop &m_desktop; + Data m_send; + bool m_loading; + std::string m_dbName; + DBLoaderData *m_loader; + +public: + explicit DBLoader(Desktop &desktop); + ~DBLoader(); + + /// Do not call Desktop members if this is true. + bool IsBusy() const { return m_loading; } + + // caller-controllable load/save operations... if + // these functions return true, then new data has + // just been loaded into the data object passed to + // the constructor + // + // Both of these functions use a DBData object in order + // to pass buffers from application code all the way down + // to the socket level, to avoid copies wherever possible. + bool StartDBLoad(unsigned int dbId, DBData &data); + bool GetNextRecord(DBData &data); +}; + +} // namespace Barry::Mode + + + + + +// +// DeviceBuilder +// +/// Takes a list of database dbId's and behaves like a Builder, +/// trying to avoid copies where possible on the device loading end. +/// +class BXEXPORT DeviceBuilder : public Builder +{ + typedef unsigned int dbid_type; + + struct DBLabel + { + dbid_type id; + std::string name; + + DBLabel(dbid_type id, const std::string &name) + : id(id) + , name(name) + { + } + }; + + typedef std::vector list_type; + + // list of databases to fetch during build + list_type m_dbIds; + list_type::iterator m_current; + bool m_started; + + Mode::Desktop &m_desktop; + + // loader object to use optimized batch loading while + // giving per-record control + Mode::DBLoader m_loader; + +public: + explicit DeviceBuilder(Mode::Desktop &desktop); + + // searches the dbdb from the desktop to find the dbId, + // returns false if not found, and adds it to the list of + // databases to retrieve if found + bool Add(const std::string &dbname); + + // adds all databases found in the given dbdb + void Add(const Barry::DatabaseDatabase &dbdb); + + /// sets the internal iterator to the start of the list + /// in order to perform a fresh run + void Restart() { m_current = m_dbIds.begin(); m_started = false; } + + // + // Builder overrides + // + + // has both BuildRecord() and Retrieve() functionality, + // and uses data all the way down to the socket level copy + virtual bool BuildRecord(DBData &data, size_t &offset, + const IConverter *ic); + virtual bool FetchRecord(DBData &data, const IConverter *ic); + virtual bool EndOfFile() const; +}; + + +// +// DeviceParser +// +/// A parser class that "parses" raw data into a device. Basically this +/// is a pipe-oriented way to call SaveDatabase(). +/// +/// Note that this is a multi-record parser. For each incoming DBData +/// that has a new DBName, a new save will be started. There is no +/// way to filter out records, except via the callback, so the easiest +/// way to filter out records by database name is on the Builder side. +/// +class BXEXPORT DeviceParser : public Barry::Parser +{ +public: + enum WriteMode { + /// Similar to SaveDatabase(). Erases all records from + /// the existing database and then uploads all new records. + ERASE_ALL_WRITE_ALL, + + /// Adds any new records, and for records with Unique IDs + /// that already exist, overwrite them. + INDIVIDUAL_OVERWRITE, + + /// Adds any new records, but if a record exists with the + /// current Unique ID, skip that record and don't write it + /// to the device. + ADD_BUT_NO_OVERWRITE, + + /// Adds all incoming records as brand new records, generating + /// a new Unique ID for each one, and leaving any existing + /// records intact. + ADD_WITH_NEW_ID, + + /// Calls the virtual function DecideWrite(...) for each + /// record, passing in the data. DecideWrite() returns one + /// of these WriteMode values. + DECIDE_BY_CALLBACK, + + /// Primarily used by DecideWrite(), and causes the current + /// record to not be written. + DROP_RECORD + }; + +private: + Mode::Desktop &m_desktop; + WriteMode m_mode; + + std::string m_current_db; + unsigned int m_current_dbid; + RecordStateTable m_rstate; + +protected: + void StartDB(const DBData &data, const IConverter *ic); + void WriteNext(const DBData &data, const IConverter *ic); + +public: + DeviceParser(Mode::Desktop &desktop, WriteMode mode); + virtual ~DeviceParser(); + + /// Callback... you must derive and override this if you use + /// the DECIDE_BY_CALLBACK mode. + /// May be called multiple times per record. + virtual WriteMode DecideWrite(const DBData &record) const + { + return DROP_RECORD; + } + + /// Parser overrides + virtual void ParseRecord(const DBData &data, const IConverter *ic); +}; + + +} // namespace Barry #endif diff -Nru barry-0.14/src/m_desktoptmpl.h barry-0.0.20110506/src/m_desktoptmpl.h --- barry-0.14/src/m_desktoptmpl.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_desktoptmpl.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -57,6 +57,8 @@ LoadDatabaseByType(store); else if( name == Calendar::GetDBName() ) LoadDatabaseByType(store); + else if( name == CalendarAll::GetDBName() ) + LoadDatabaseByType(store); else throw Error("Unknown database name in LoadDatabaseByName: " + name); } @@ -70,6 +72,8 @@ SaveDatabaseByType(store); else if( name == Calendar::GetDBName() ) SaveDatabaseByType(store); + else if( name == CalendarAll::GetDBName() ) + SaveDatabaseByType(store); else throw Error("Unknown database name in SaveDatabaseByName: " + name); } diff -Nru barry-0.14/src/mimeio.cc barry-0.0.20110506/src/mimeio.cc --- barry-0.14/src/mimeio.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/mimeio.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,167 @@ +/// +/// \file mimeio.cc +/// Storage, parser, builder classes for MIME objects +/// (vcard, vevent, vtodo, vjournal) +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "mimeio.h" +#include "vcard.h" +#include "vevent.h" +#include "vtodo.h" +#include "vjournal.h" +#include +#include +#include + +using namespace std; + +namespace Barry { + +MimeBuilder::MimeBuilder(const std::string &filename) + : m_ifs( new std::ifstream(filename.c_str()) ) + , m_is(*m_ifs) +{ +} + +MimeBuilder::MimeBuilder(std::istream &is) + : m_is(is) +{ +} + +bool MimeBuilder::BuildRecord(DBData &data, size_t &offset, + const IConverter *ic) +{ + string vrec; + vector types; + while( ReadMimeRecord(m_is, vrec, types) ) { + if( !vrec.size() ) { + // end of file + return false; + } + else if( IsMember(Sync::vCard::GetVName(), types) ) { + Sync::vCard vcard; + SetDBData(vcard.ToBarry(vrec.c_str(), 0), + data, offset, ic); + return true; + } + else if( IsMember(Sync::vCalendar::GetVName(), types) ) { + Sync::vTimeConverter vtc; + Sync::vCalendar vcal(vtc); + SetDBData(vcal.ToBarry(vrec.c_str(), 0), + data, offset, ic); + return true; + } + else if( IsMember(Sync::vTodo::GetVName(), types) ) { + Sync::vTimeConverter vtc; + Sync::vTodo vtodo(vtc); + SetDBData(vtodo.ToBarry(vrec.c_str(), 0), + data, offset, ic); + return true; + } + else if( IsMember(Sync::vJournal::GetVName(), types) ) { + Sync::vJournal vjournal; + SetDBData(vjournal.ToBarry(vrec.c_str(), 0), + data, offset, ic); + return true; + } + else { + // read the next one + } + } + + // end of file + return false; +} + +bool MimeBuilder::FetchRecord(DBData &data, const IConverter *ic) +{ + size_t offset = 0; + return BuildRecord(data, offset, ic); +} + +bool MimeBuilder::EndOfFile() const +{ + return !m_is; +} + +// return false at end of file, true if a record was read +bool MimeBuilder::ReadMimeRecord(std::istream &is, std::string &vrec, + std::vector &types) +{ + vrec.clear(); + types.clear(); + + string line; + + // ignore whitespace + while( getline(is, line) ) { + if( strcasecmp(line.substr(0, 6).c_str(), "BEGIN:") == 0 ) { + vrec += line; + vrec += "\n"; + types.push_back(line.substr(6)); + break; + } + } + + if( !vrec.size() ) + return false; + + // load until end + int count = 0; + while( getline(is, line) ) { + // end on blank lines + if( !line.size() ) + return true; + + vrec += line; + vrec += "\n"; + + // pick up innermost BEGIN line + if( strcasecmp(line.substr(0, 6).c_str(), "BEGIN:") == 0 ) { + string type = line.substr(6); + while( type.size() && type[type.size()-1] == '\r' ) { + type = type.substr(0, type.size()-1); + } + types.push_back(type); + } + + // place an upper limit on the number of lines... + // since a MIME data block shouldn't be more than + // a few pages of lines! + count++; + if( count > 200 ) + return false; + } + // assume that end of file is the same as "blank line" + return true; +} + +bool MimeBuilder::IsMember(const std::string &item, + const std::vector &types) +{ + std::vector::const_iterator i = types.begin(); + for( ; i != types.end(); ++i ) { + if( strcasecmp(i->c_str(), item.c_str()) == 0 ) + return true; + } + return false; +} + +} // namespace Barry + diff -Nru barry-0.14/src/mimeio.h barry-0.0.20110506/src/mimeio.h --- barry-0.14/src/mimeio.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/mimeio.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,60 @@ +/// +/// \file mimeio.h +/// Storage, parser, builder classes for MIME objects +/// (vcard, vevent, vtodo, vjournal) +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_MIMEIO_H__ +#define __BARRY_MIMEIO_H__ + +#include "dll.h" +#include "builder.h" +#include +#include +#include +#include + +namespace Barry { + +class BXEXPORT MimeBuilder : public Barry::Builder +{ + std::auto_ptr m_ifs; + std::istream &m_is; + +public: + explicit MimeBuilder(const std::string &filename); + explicit MimeBuilder(std::istream &is); + + bool BuildRecord(DBData &data, size_t &offset, const IConverter *ic); + bool FetchRecord(DBData &data, const IConverter *ic); + bool EndOfFile() const; + + // return false at end of file, true if a record was read + static bool ReadMimeRecord(std::istream &is, std::string &vrec, + std::vector &types); + // returns true if item is a member of types, doing a + // case-insensitive compare + static bool IsMember(const std::string &item, + const std::vector &types); +}; + +} + +#endif + diff -Nru barry-0.14/src/m_ipmodem.cc barry-0.0.20110506/src/m_ipmodem.cc --- barry-0.14/src/m_ipmodem.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_ipmodem.cc 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,6 +22,7 @@ #include "m_ipmodem.h" #include "controller.h" +#include "controllerpriv.h" #include "data.h" #include "debug.h" #include @@ -42,7 +43,7 @@ DeviceDataCallback callback, void *callback_context) : m_con(con) - , m_dev(con.m_dev) + , m_dev(con.GetPrivate()->m_dev) , m_continue_reading(false) , m_callback(callback) , m_callback_context(callback_context) @@ -60,95 +61,95 @@ } } -bool IpModem::SendPassword(const char *password) +bool IpModem::SendPassword( const char *password, uint32_t seed ) { if( !password || strlen(password) == 0 ) { - throw BadPassword("No password provided.", 0, false); + throw BadPassword("Logic error: No password provided in SendPassword.", 0, false); } int read_ep = m_con.GetProbeResult().m_epModem.read; int write_ep = m_con.GetProbeResult().m_epModem.write; + unsigned char pwdigest[SHA_DIGEST_LENGTH]; + unsigned char prefixedhash[SHA_DIGEST_LENGTH + 4]; + unsigned char pw_response[SHA_DIGEST_LENGTH + 8]; + uint32_t new_seed; Data data; - m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start)); - m_dev.BulkRead(read_ep, data); - ddout("IPModem read packet.\n" << data); - - // Need to add checks for other packet types. - // check for 02 00 00 00 SS SS SS SS RR 00 00 00 0a 00 00 00 PP PP PP PP PP 00 00 00 78 56 34 12 - if( data.GetSize() >= 9 && data.GetData()[0] == 0x02 && - memcmp(data.GetData() + data.GetSize() - 4, special_flag, sizeof(special_flag))== 0 ) { - // Got a password request packet - ddout("IPModem password request packet:\n" << data); + if( !password || strlen(password) == 0 ) { + throw BadPassword("No password provided.", 0, false); + } - // Check how many retries are left - if( data.GetData()[8] < BARRY_MIN_PASSWORD_TRIES ) { - throw BadPassword("Fewer than " BARRY_MIN_PASSWORD_TRIES_ASC " password tries remaining in device. Refusing to proceed, to avoid device zapping itself. Use a Windows client, or re-cradle the device.", - data.GetData()[8], - true); - } + // Build the password hash + // first, hash the password by itself + SHA1((unsigned char *) password, strlen(password), pwdigest); + + // prefix the resulting hash with the provided seed + memcpy(&prefixedhash[0], &seed, sizeof(uint32_t)); + memcpy(&prefixedhash[4], pwdigest, SHA_DIGEST_LENGTH); + + // hash again + SHA1((unsigned char *) prefixedhash, SHA_DIGEST_LENGTH + 4, pwdigest); + + // Build the response packet + const char pw_rsphdr[] = { 0x03, 0x00, 0x00, 0x00 }; + memcpy(&pw_response[0], pw_rsphdr, sizeof(pw_rsphdr)); + memcpy(&pw_response[4], pwdigest, SHA_DIGEST_LENGTH); + memcpy(&pw_response[24], special_flag, sizeof(special_flag)); - // Build the password hash - unsigned char pwdigest[SHA_DIGEST_LENGTH]; - unsigned char prefixedhash[SHA_DIGEST_LENGTH + 4]; - unsigned char pw_response[SHA_DIGEST_LENGTH + 8]; - unsigned char seed[4]; - - // first, hash the password by itself - SHA1((unsigned char *) password, strlen(password), pwdigest); - - // prefix the resulting hash with the provided seed - memcpy(&seed[0], data.GetData() + 4, sizeof(uint32_t)); - memcpy(&prefixedhash[0], &seed, sizeof(uint32_t)); - memcpy(&prefixedhash[4], pwdigest, SHA_DIGEST_LENGTH); - - // hash again - SHA1((unsigned char *) prefixedhash, SHA_DIGEST_LENGTH + 4, pwdigest); - - // Build the response packet - const char pw_rsphdr[] = { 0x03, 0x00, 0x00, 0x00 }; - memcpy(&pw_response[0], pw_rsphdr, sizeof(pw_rsphdr)); - memcpy(&pw_response[4], pwdigest, SHA_DIGEST_LENGTH); - memcpy(&pw_response[24], special_flag, sizeof(special_flag)); + // Send the password response packet + m_dev.BulkWrite(write_ep, pw_response, sizeof(pw_response)); + m_dev.BulkRead(read_ep, data); + ddout("IPModem: Read password response.\n" << data); - // Send the password response packet - m_dev.BulkWrite(write_ep, pw_response, sizeof(pw_response)); - m_dev.BulkRead(read_ep, data); - ddout("IPModem read password response.\n" << data); + // Added for the BB Storm 9000's second password request + if( data.GetSize() >= 16 && data.GetData()[0] == 0x00 ) { + try { + m_dev.BulkRead(read_ep, data, 500); + ddout("IPModem: Null Response Packet:\n" << data); + } + catch( Usb::Timeout &to ) { + // do nothing on timeouts + ddout("IPModem: Null Response Timeout"); + } + } - // check response 04 00 00 00 ....... - // On the 8703e the seed is incremented, retries are reset to 10 when the password is accepted. - // if( data.GetData()[0] == 0x04 && data.GetData()[8] == 0x0a ) { - if( data.GetSize() >= 9 && data.GetData()[0] == 0x04 ) { - if( memcmp(data.GetData() + 4, seed, sizeof(seed)) == 0 ) { - ddout("IPModem invalid password.\n" << data); - throw BadPassword("Password rejected by device.", data.GetData()[8], false); - } - ddout("IPModem password accepted.\n"); - // send "start"? packet - m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start)); - - // send packet with the last 8 bytes of the password hash (session_key?) - //unsigned char pw_response[SHA_DIGEST_LENGTH + 8]; - unsigned char pw_rsphdr[] = { 0x00, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0xc2, 1, 0 }; - memcpy(&m_session_key[0], pwdigest + 12, sizeof(m_session_key)); - memcpy(&pw_response[0], pw_rsphdr, sizeof(pw_rsphdr)); - memcpy(&pw_response[16], pwdigest + 12, 8); - //memcpy(&pw_response[16], m_session_key, 8); - memcpy(&pw_response[24], special_flag, sizeof(special_flag)); - m_dev.BulkWrite(write_ep, pw_response, sizeof(pw_response)); + // + // check response 04 00 00 00 ....... + // On the 8703e the seed is incremented, retries are reset to 10 + // when the password is accepted. + // + // If data.GetData() + 4 is = to the orginal seed +1 or 00 00 00 00 + // then the password was acceppted. + // + // When data.GetData() + 4 is not 00 00 00 00 then data.GetData()[8] + // contains the number of password retrys left. + // + if( data.GetSize() >= 9 && data.GetData()[0] == 0x04 ) { + memcpy(&new_seed, data.GetData() + 4, sizeof(uint32_t)); + seed++; + if( seed == new_seed || new_seed == 0 ) { + ddout("IPModem: Password accepted.\n"); + +#if SHA_DIGEST_LENGTH < SB_IPMODEM_SESSION_KEY_LENGTH +#error Session key field must be smaller than SHA digest +#endif + // Create session key - last 8 bytes of the password hash + memcpy(&m_session_key[0], + pwdigest + SHA_DIGEST_LENGTH - sizeof(m_session_key), + sizeof(m_session_key)); // blank password hashes as we don't need these anymore memset(pwdigest, 0, sizeof(pwdigest)); memset(prefixedhash, 0, sizeof(prefixedhash)); - - // The modem should be ready to accept AT commands return true; } - - // Unknown packet - ddout("IPModem Error unknown packet.\n" << data); + else { + ddout("IPModem: Invalid password.\n" << data); + throw BadPassword("Password rejected by device.", data.GetData()[8], false); + } } + // Unknown packet + ddout("IPModem: Error unknown packet.\n" << data); return false; } @@ -172,7 +173,7 @@ if( data.GetSize() > 4 && memcmp(data.GetData() + data.GetSize() - 4, special_flag, sizeof(special_flag)) == 0 ) { // log, then drop it on the floor for now - ddout("IPModem special packet:\n" << data); + ddout("IPModem: Special packet:\n" << data); continue; } @@ -190,7 +191,7 @@ } catch( Usb::Timeout &to ) { // do nothing on timeouts - ddout("Timeout in DataReadThread!"); + ddout("IPModem: Timeout in DataReadThread!"); } catch( std::exception &e ) { eout("Exception in IpModem::DataReadThread: " << e.what()); @@ -207,7 +208,10 @@ { int read_ep = m_con.GetProbeResult().m_epModem.read; int write_ep = m_con.GetProbeResult().m_epModem.write; + unsigned char response[28]; + uint32_t seed; Data data; + // check that we have endpoints for the modem const Usb::EndpointPair &pair = m_con.GetProbeResult().m_epModem; if( !pair.IsComplete() ) { @@ -220,17 +224,80 @@ throw Barry::Error(oss.str()); } - // clear halt when starting out - m_dev.ClearHalt(pair.read); - m_dev.ClearHalt(pair.write); - - if( !password || strlen(password) == 0 ) { - Data block(start, sizeof(start)); - Write(block); - } - else { - if( !SendPassword(password) ) { - throw Barry::Error("IpModem:: Error sending password."); + // clear halt when starting out only if needed + if( m_con.GetProbeResult().m_needClearHalt ) { + m_dev.ClearHalt(pair.read); + m_dev.ClearHalt(pair.write); + } + + // Send stop command + ddout("IPModem: Sending Stop Response:\n"); + m_dev.BulkWrite(write_ep, stop, sizeof(stop)); + try { + m_dev.BulkRead(read_ep, data, 500); + ddout("IPModem: Stop Response Packet:\n" << data); + } + catch( Usb::Timeout &to ) { + // do nothing on timeouts + ddout("IPModem: Stop Response Timeout"); + } + + // Send start commands to figure out if the device needs a password. + ddout("IPModem: Sending Start Response:\n"); + m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start)); + m_dev.BulkRead(read_ep, data, 5000); + ddout("IPModem: Start Response Packet:\n" << data); + + // check for 02 00 00 00 SS SS SS SS RR 00 00 00 0a 00 00 00 PP PP PP PP PP 00 00 00 78 56 34 12 + if( data.GetSize() >= 9 && data.GetData()[0] == 0x02 && + memcmp(data.GetData() + data.GetSize() - 4, special_flag, sizeof(special_flag))== 0 ) { + // Got a password request packet + ddout("IPModem: Password request packet:\n" << data); + + // Check how many retries are left + if( data.GetData()[8] < BARRY_MIN_PASSWORD_TRIES ) { + throw BadPassword("Fewer than " BARRY_MIN_PASSWORD_TRIES_ASC " password tries remaining in device. Refusing to proceed, to avoid device zapping itself. Use a Windows client, or re-cradle the device.", + data.GetData()[8], + true); + } + memcpy(&seed, data.GetData() + 4, sizeof(seed)); + // Send password + if( !SendPassword(password, seed) ) { + throw Barry::Error("IpModem: Error sending password."); + } + + // Re-send "start" packet + ddout("IPModem: Re-sending Start Response:\n"); + m_dev.BulkWrite(write_ep, pw_start, sizeof(pw_start)); + m_dev.BulkRead(read_ep, data); + ddout("IPModem: Start Response Packet:\n" << data); + } + + // send packet with the session_key + unsigned char response_header[] = { 0x00, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0xc2, 1, 0 }; + memcpy(&response[0], response_header, sizeof(response_header)); + memcpy(&response[16], m_session_key, sizeof(m_session_key)); + memcpy(&response[24], special_flag, sizeof(special_flag)); + ddout("IPModem: Sending Session key:\n"); + m_dev.BulkWrite(write_ep, response, sizeof(response)); + if( data.GetSize() >= 16 ) { + switch(data.GetData()[0]) + { + case 0x00: // Null packet + break; + + case 0x02: // password seed received + memcpy(&seed, data.GetData() + 4, sizeof(uint32_t)); + if( !SendPassword( password, seed ) ) { + throw Barry::Error("IpModem: Error sending password."); + } + break; + case 0x04: // command accepted + break; + + default: // ??? + ddout("IPModem: Unknown response.\n"); + break; } } @@ -238,14 +305,33 @@ const char modem_command[] = { "AT\r" }; m_dev.BulkWrite(write_ep, modem_command, strlen(modem_command)); m_dev.BulkRead(read_ep, data); - ddout("IPModem:: AT command response.\n" << data); + ddout("IPModem: Test command response.\n" << data); if( data.GetSize() >= 1 ) { switch(data.GetData()[0]) { - case 0x02: // password seed received - throw BadPassword("This device requested a password.", - data.GetSize() >= 9 ? data.GetData()[8] : 0, false); + case 0x00: // Null packet + try { + m_dev.BulkRead(read_ep, data, 5000); + ddout("IPModem: AT Response Packet:\n" << data); + } + catch( Usb::Timeout &to ) { + // do nothing on timeouts + ddout("IPModem: AT Response Timeout"); + } + break; + case 0x02: // password seed received + if( !password || strlen(password) == 0 ) { + throw BadPassword("This device requested a password.", + data.GetSize() >= 9 ? data.GetData()[8] : 0, false); + } + else { // added for the Storm 9000 + memcpy(&seed, data.GetData() + 4, sizeof(seed)); + if( !SendPassword( password, seed ) ) { + throw Barry::Error("IpModem: Error sending password."); + } + } + break; case 0x04: // command accepted break; @@ -253,17 +339,24 @@ throw BadPassword("This device requires a password.", 0, false); default: // ??? - ddout("IPModem:: unknown AT command response.\n"); + ddout("IPModem: Unknown AT command response.\n"); + // treat this unknown data as a serial response + if( m_callback ) { + (*m_callback)(m_callback_context, + data.GetData(), + data.GetSize()); + } break; } } + ddout("IPModem: Modem Ready.\n"); // spawn read thread m_continue_reading = true; int ret = pthread_create(&m_modem_read_thread, NULL, &IpModem::DataReadThread, this); if( ret ) { m_continue_reading = false; - throw Barry::ErrnoError("IpModem:: Error creating USB read thread.", ret); + throw Barry::ErrnoError("IpModem: Error creating USB read thread.", ret); } } @@ -293,7 +386,7 @@ Data data; //0 0 0 0 b0 0 0 0 0 0 0 0 0 c2 1 0 + session_key + special_flag - ddout("IpModem:: Closing connection."); + ddout("IpModem: Closing connection."); memset(end, 0, sizeof(end)); end[4] = 0xb0; end[13] = 0xc2; @@ -324,18 +417,18 @@ m_dev.BulkWrite(write_ep, stop, sizeof(stop)); try { m_dev.BulkRead(read_ep, data, 5000); - ddout("IPModem:: Close read packet:\n" << data); + ddout("IPModem: Close read packet:\n" << data); } catch( Usb::Timeout &to ) { // do nothing on timeouts - ddout("IPModem:: Close Read Timeout"); + ddout("IPModem: Close Read Timeout"); } // stop the read thread if( m_continue_reading ) { m_continue_reading = false; pthread_join(m_modem_read_thread, NULL); } - ddout("IPmodem:: Closed!"); + ddout("IPmodem: Closed!"); } diff -Nru barry-0.14/src/m_ipmodem.h barry-0.0.20110506/src/m_ipmodem.h --- barry-0.14/src/m_ipmodem.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_ipmodem.h 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -30,6 +30,8 @@ #include "pppfilter.h" #include +#define SB_IPMODEM_SESSION_KEY_LENGTH 8 + namespace Barry { // forward declarations @@ -56,10 +58,10 @@ DeviceDataCallback m_callback; void *m_callback_context; - unsigned char m_session_key[8]; // = { 0x00, 0, 0, 0, 0, 0, 0, 0 }; + unsigned char m_session_key[SB_IPMODEM_SESSION_KEY_LENGTH]; // = { 0x00, 0, 0, 0, 0, 0, 0, 0 }; private: - BXLOCAL bool SendPassword(const char *password = 0); + BXLOCAL bool SendPassword(const char *password, uint32_t seed); protected: static void *DataReadThread(void *userptr); diff -Nru barry-0.14/src/m_javaloader.cc barry-0.0.20110506/src/m_javaloader.cc --- barry-0.14/src/m_javaloader.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_javaloader.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,1021 @@ +/// +/// \file m_javaloader.cc +/// Mode class for the JavaLoader mode +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + + Some parts are inspired from m_desktop.h + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "m_javaloader.h" +#include "data.h" +#include "protocol.h" +#include "protostructs.h" +#include "packet.h" +#include "endian.h" +#include "error.h" +#include "usbwrap.h" +#include "controller.h" +#include "cod.h" +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" + +using namespace std; + +namespace Barry { + + +/////////////////////////////////////////////////////////////////////////////// +// JLScreenInfo class + +JLScreenInfo::JLScreenInfo() +{ +} + +JLScreenInfo::~JLScreenInfo() +{ +} + + + +/////////////////////////////////////////////////////////////////////////////// +// JLDirectory class + +JLDirectory::JLDirectory(int level) + : m_level(level) +{ +} + +JLDirectory::~JLDirectory() +{ +} + +void JLDirectory::ParseTable(const Data &table_packet) +{ + m_idTable.clear(); + + size_t count = table_packet.GetSize() / 2; + uint16_t *item = (uint16_t*) table_packet.GetData(); + for( size_t i = 0; i < count; i++, item++ ) { + m_idTable.push_back( be_btohs(*item) ); + } +} + +void JLDirectory::Dump(std::ostream &os) const +{ + int indent = m_level * 2; + + os << setfill(' ') << setw(indent) << ""; + os << "Directory: " << m_idTable.size() << "/" << size() << " entries\n"; + + const_iterator i = begin(), e = end(); + for( ; i != e; ++i ) { + os << setfill(' ') << setw(indent + 2) << ""; + os << *i << "\n"; + } +} + + + +/////////////////////////////////////////////////////////////////////////////// +// JLDirectoryEntry class + +JLDirectoryEntry::JLDirectoryEntry(int level) + : m_level(level) + , SubDir(level + 1) +{ +} + +void JLDirectoryEntry::Parse(uint16_t id, const Data &entry_packet) +{ + size_t needed = SB_JLDIRENTRY_HEADER_SIZE; + size_t have = entry_packet.GetSize(); + if( have < needed ) + throw BadSize("JLDE:Parse(1)", have, needed); + + const unsigned char *ptr = entry_packet.GetData(); + Protocol::JLDirEntry *entry = (Protocol::JLDirEntry*) ptr; + + Id = id; + Timestamp = be_btohl(entry->timestamp); + + uint16_t len = be_btohs(entry->filename_size); + needed += len; + if( have < needed ) + throw BadSize("JLDE:Parse(2)", have, needed); + Name.assign((char *)entry->filename, len); + + // need parsed data + string size + ptr += needed; + needed += 2; + if( have < needed ) + throw BadSize("JLDE:Parse(3)", have, needed); + + len = be_btohs( *((uint16_t*)(ptr)) ); + ptr += sizeof(uint16_t); + needed += len; + if( have < needed ) + throw BadSize("JLDE:Parse(4)", have, needed); + Version.assign((char*)ptr, len); + + // need parsed data + string size + ptr += len; + needed += sizeof(uint32_t); + if( have < needed ) + throw BadSize("JLDE:Parse(5)", have, needed); + CodSize = be_btohl( *((uint32_t*)(ptr)) ); +} + +void JLDirectoryEntry::Dump(std::ostream &os) const +{ + os << left << setfill(' ') << setw(50) << Name; + + os << "\n"; + os << left << setw(28) << " "; + + os << "0x" << setfill('0') << setw(4) << hex << Id; + os << " " << setw(10) << Version; + os << " " << setw(7) << std::dec << CodSize; + + std::string ts = ctime(&Timestamp); + ts.erase(ts.size() - 1); + os << " " << ts; + + if( SubDir.size() ) + os << "\n" << SubDir; +} + + +/////////////////////////////////////////////////////////////////////////////// +// JLEventlog class + +void JLEventlog::Dump(std::ostream &os) const +{ + const_iterator i = begin(), e = end(); + for( ; i != e; ++i ) { + (*i).Dump(os); + } +} + + +/////////////////////////////////////////////////////////////////////////////// +// JLEventlogEntry class, static members + +// +// Note! These functions currently only pass the same values through. +// In actuality, these are technically two different values: +// one on the raw protocol side, and the other part of the +// guaranteed Barry API. If the Blackberry ever changes the +// meanings for these codes, do the translation here. +// + +JLEventlogEntry::Severity_t JLEventlogEntry::SeverityProto2Rec(unsigned int s) +{ + return (Severity_t)s; +} + +unsigned int JLEventlogEntry::SeverityRec2Proto(Severity_t s) +{ + return s; +} + +JLEventlogEntry::ViewerType_t JLEventlogEntry::ViewerTypeProto2Rec(unsigned int v) +{ + return (ViewerType_t)v; +} + +unsigned int JLEventlogEntry::ViewerTypeRec2Proto(ViewerType_t v) +{ + return v; +} + + +/////////////////////////////////////////////////////////////////////////////// +// JLEventlogEntry class + +void JLEventlogEntry::Parse(uint16_t size, const char* buf) +{ + // example of a single log entry + //guid:92E11214401C3 time:0x11F133E6470 severity:0 type:2 app:UI data:GS-D 2c89868b + + std::string src = std::string(buf, size); + std::istringstream ss(src); + + ss.ignore(5); // skip "guid:" + ss >> Guid; + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad guid field"); + + ss.ignore(6); // skip " time:" + ss >> hex >> MSTimestamp; + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad time field"); + + ss.ignore(10); // skip " severity:" + unsigned int severity; + ss >> severity; + Severity = SeverityProto2Rec(severity); + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad severity field"); + + ss.ignore(6); // skip " type:" + unsigned int type; + ss >> type; + Type = ViewerTypeProto2Rec(type); + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad type field"); + + ss.ignore(5); // skip " app:" + ss >> App; + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad app field"); + + ss.ignore(6); // skip " data:" + + // use stringbuf to extract rest of data from stream + stringbuf databuf; + ss >> &databuf; + if( ss.fail() ) + throw BadData("JLEventlogEntry:Parse bad data field"); + + Data = databuf.str(); +} + +std::string JLEventlogEntry::GetFormattedTimestamp() const +{ + char buf[21]; + struct tm split; + time_t timestamp = (time_t) (MSTimestamp / 1000); + + if( localtime_r(×tamp, &split) == NULL ) + return ""; + + if( strftime(buf, sizeof(buf), "%Y/%m/%d %H:%M:%S.", &split) == 0 ) + return ""; + + std::ostringstream oss; + oss << buf << (MSTimestamp % 1000); + return oss.str(); +} + +void JLEventlogEntry::Dump(std::ostream &os) const +{ + static const char *SeverityNames[] = { "Always Log", "Severe Error", "Error", + "Warning", "Information", "Debug Info"}; + static const char *ViewerTypes[] = { "", "Number", "String", "Exception" }; + + os << "guid:" << Guid; + os << " time:" << GetFormattedTimestamp(); + os << " severity:" << SeverityNames[Severity]; + os << " type:" << ViewerTypes[Type]; + os << " app:" << App; + os << " data:" << Data << endl; +} + + +/////////////////////////////////////////////////////////////////////////////// +// JLDeviceInfo class + +void JLDeviceInfo::Dump(std::ostream &os) const +{ + os << left << setfill(' ') << setw(17) << "Hardware Id:"; + os << "0x" << hex << HardwareId << endl; + + os << left << setfill(' ') << setw(17) << "PIN:"; + os << "0x" << Pin.Str() << endl; + + os << left << setfill(' ') << setw(17) << "OS Version:"; + os << dec << OsVersion.Major << '.' << OsVersion.Minor << '.' << OsVersion.SubMinor << '.' << OsVersion.Build << endl; + + os << left << setfill(' ') << setw(17) << "VM Version:"; + os << dec << VmVersion.Major << '.' << VmVersion.Minor << '.' << VmVersion.SubMinor << '.' << VmVersion.Build << endl; + + os << left << setfill(' ') << setw(17) << "Radio ID:"; + os << "0x" << hex << RadioId << endl; + + os << left << setfill(' ') << setw(17) << "Vendor ID:"; + os << dec << VendorId << endl; + + os << left << setfill(' ') << setw(17) << "Active WAFs:"; + os << "0x" << hex << ActiveWafs << endl; + + os << left << setfill(' ') << setw(17) << "OS Metrics:" << endl; + os << OsMetrics; + + os << left << setfill(' ') << setw(17) << "Bootrom Metrics:" << endl; + os << BootromMetrics; +} + + +namespace Mode { + +/////////////////////////////////////////////////////////////////////////////// +// JavaLoader Mode class + +JavaLoader::JavaLoader(Controller &con) + : Mode(con, Controller::JavaLoader) + , m_StreamStarted(false) +{ +} + +JavaLoader::~JavaLoader() +{ + if( m_StreamStarted ) + StopStream(); +} + +/////////////////////////////////////////////////////////////////////////////// +// protected members + + +/////////////////////////////////////////////////////////////////////////////// +// public API + +void JavaLoader::OnOpen() +{ + Data response; + m_socket->Receive(response, -1); +} + +// These commands are sent to prepare the data stream +void JavaLoader::StartStream() +{ + Data cmd(-1, 8), data(-1, 8), response; + JLPacket packet(cmd, data, response); + + packet.Hello(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_HELLO_ACK ) { + ThrowJLError("JavaLoader::StartStream Hello", packet.Command()); + } + + packet.SetUnknown1(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::StartStream Unknown1", packet.Command()); + } + + m_StreamStarted = true; +} + + +// This function permits to send a COD application +// WARNING : Before, you have to call the "Start" function, +// After, you have to call the "Stop" function. +// +// From the USB traces, the max size of packet is : 0x07FC +// Packet header : +// 04 00 08 00 68 00 F8 07 +// ^^^^^ : about size +// ^^ : command +// ^^ : size of packet header +// ^^^^^ : socket +// Response : +// 00 00 0C 00 13 04 01 00 0A 00 00 00 +// Packet format : +// 04 00 FC 07 DB 9D 95 2B 57 .... E6 FD +// ^^^^^ ............. ^^^^^ : data (the file content) +// ^^^^^ : packet size +// ^^^^^ : socket +// +// +// WARNING : A COD file starts with the integer 0xDEC0FFFF (FIXME) +// An application can contain several COD parts. In this case we can read a header (start with PK) +// In this sample, we have to skip the file header : +// 00000000 50 4B 03 04 0A 00 00 00 00 00 A0 00 51 35 BA 9F 99 5D 30 CE PK..........Q5...]0. +// 00000014 00 00 30 CE 00 00 15 00 04 00 4D 65 74 72 6F 56 69 65 77 65 ..0.......MetroViewe +// 00000028 72 2E 50 61 72 69 73 2E 63 6F 64 FE CA 00 00 DE C0 FF FF 00 r.Paris.cod......... +// ^^ Start of data sent ! +// 0000003C 00 00 00 00 00 00 00 0F 10 34 45 00 00 00 00 00 00 00 00 21 .........4E........! +// 00000050 00 FF FF FF FF FF FF FF FF FF FF 4E 00 9C 08 68 C5 00 00 F0 ...........N...h.... +// 00000064 B8 BC C0 A1 C0 14 00 81 00 00 01 01 04 0E 3F 6D 00 02 00 6D ..............?m...m +void JavaLoader::SendStream(std::istream &input, size_t module_size) +{ + char buffer[MAX_PACKET_DATA_SIZE - SB_JLPACKET_HEADER_SIZE]; + size_t max_data_size = sizeof(buffer); + + size_t remaining = module_size; + + Data cmd(-1, 8), data(-1, 8), response; + JLPacket packet(cmd, data, response); + + packet.SetCodSize(module_size); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::SendStream set code size", packet.Command()); + } + + while( remaining > 0 ) { + size_t size = min(remaining, max_data_size); + + input.read(buffer, size); + if( input.fail() || (size_t)input.gcount() != size ) { + throw Error("JavaLoader::SendStream input stream read failed"); + } + + packet.PutData(buffer, size); + m_socket->Packet(packet); + + if( packet.Command() == SB_COMMAND_JL_NOT_ENOUGH_MEMORY ) { + throw Error("JavaLoader::SendStream not enough memory to install the application"); + } + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::SendStream send data", packet.Command()); + } + + remaining -= size; + } +} + +void JavaLoader::LoadApp(std::istream &input) +{ + uint32_t module_size; + while( (module_size = SeekNextCod(input)) != 0 ) { + SendStream(input, module_size); + } +} + +// +// StopStream +// +/// Must be called at the end of a JavaLoader session. The JL_GOODBYE +/// command is sent to the device. When the device responds with +/// RESET_REQUIRED the device reset command will be sent when the +/// socket is closed. +/// +/// \return true when a device reset was required +/// +bool JavaLoader::StopStream() +{ + Data cmd(-1, 8), data(-1, 8), response; + + JLPacket packet(cmd, data, response); + packet.Goodbye(); + try { + m_socket->Packet(packet); + } catch( BadPacket &bp ) { + // on some devices, such as the 7750 and the 7130, + // the Goodbye command receives NOT_SUPPORTED + // instead of the usual ACK... this is not an + // error, so catch that case here and ignore it. + // otherwise, throw it to higher levels + if( bp.response() != SB_COMMAND_JL_NOT_SUPPORTED ) + throw; + } + + m_StreamStarted = false; + + if( packet.Command() == SB_COMMAND_JL_RESET_REQUIRED ) { + m_socket->ResetOnClose(true); + return true; + } + else if( packet.Command() != SB_COMMAND_JL_ACK && + packet.Command() != SB_COMMAND_JL_NOT_SUPPORTED ) + { + ThrowJLError("JavaLoader::StopStream", packet.Command()); + } + + return false; +} + +void JavaLoader::SetTime(time_t when) +{ + Data cmd(-1, 8), data(-1, 8), response; + + JLPacket packet(cmd, data, response); + packet.SetTime(when); + m_socket->Packet(packet); + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::SetTime", packet.Command()); + } +} + +void JavaLoader::ThrowJLError(const std::string &msg, uint8_t cmd) +{ + std::ostringstream oss; + oss << msg << ": unexpected packet command code: 0x" + << std::hex << (unsigned int) cmd; + throw Error(oss.str()); +} + +void JavaLoader::GetDirectoryEntries(JLPacket &packet, + uint8_t entry_cmd, + JLDirectory &dir, + bool include_subdirs) +{ + JLDirectory::TableIterator i = dir.TableBegin(), e = dir.TableEnd(); + for( ; i != e; ++i ) { + packet.GetDirEntry(entry_cmd, *i); + m_socket->Packet(packet); + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::GetDirectoryEntries", packet.Command()); + } + + Data &response = packet.GetReceive(); + m_socket->Receive(response); + JLDirectoryEntry entry(dir.Level()); + Protocol::CheckSize(response, 4); + entry.Parse(*i, Data(response.GetData() + 4, response.GetSize() - 4)); + + if( include_subdirs ) { + packet.GetSubDir(*i); + GetDir(packet, SB_COMMAND_JL_GET_SUBDIR_ENTRY, entry.SubDir, false); + } + + // add to list + dir.push_back(entry); + } +} + +void JavaLoader::GetDir(JLPacket &packet, + uint8_t entry_cmd, + JLDirectory &dir, + bool include_subdirs) +{ + m_socket->Packet(packet); + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::GetDir", packet.Command()); + } + + // ack response will contain length of module ID array in next packet + unsigned int expect = packet.Size(); + + if( expect > 0 ) { + Data &response = packet.GetReceive(); + m_socket->Receive(response); + Protocol::CheckSize(response, 4); + dir.ParseTable(Data(response.GetData() + 4, response.GetSize() - 4)); + GetDirectoryEntries(packet, entry_cmd, dir, include_subdirs); + } +} + +void JavaLoader::GetDirectory(JLDirectory &dir, bool include_subdirs) +{ + Data cmd(-1, 8), data(-1, 8), response; + JLPacket packet(cmd, data, response); + + packet.GetDirectory(); + GetDir(packet, SB_COMMAND_JL_GET_DATA_ENTRY, dir, include_subdirs); +} + + +// This function permits to receive a ScreenShot (maybe other...) +// WARNING : Before, you have to call the "Start" function, +// After, you have to call the "Stop" function. +// +// From the USB traces, the max size of packet is : 0x07FC +// When you are ready, we send the packet : +// 04 00 08 00 68 00 00 00 +// Then, we receive an acknoledge and the data. +// The data is composed of two packets : header and content. +// Packet header : +// 04 00 08 00 6E 00 F8 07 +// ^^^^^ : size + 4 bytes +// ^^ : command +// ^^^^^ : size of packet header +// ^^^^^ : socket +// Packet content : +// 04 00 FC 07 DB 9D 95 2B 57 .... E6 FD +// ^^^^^ ............. ^^^^^ : data (the file content) +// ^^^^^ : packet size (0x07FC = 0x7F8 + 4) +// ^^^^^ : socket +// +// +// GetScreenshot +// +/// Downloads screenshot from device, and fills info with size data +/// and the given Data buffer image with the bitmap. +/// +void JavaLoader::GetScreenshot(JLScreenInfo &info, Data &image) +{ + // start fresh + image.Zap(); + + Data cmd(-1, 8), data(-1, 8), response; + JLPacket packet(cmd, data, response); + + // Send the screenshot command : + // 00000000: 04 00 08 00 87 00 04 00 + packet.GetScreenshot(); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::GetScreenshot", packet.Command()); + } + + // Get Info : + // 00000000: 04 00 14 00 00 05 46 00 40 03 01 68 01 e0 00 10 ......F.@..h.... + // ^^^^^x^^^^^ : width x height + // ^^^^^ : packet size + // ^^^^^ : socket ID + // 00000010: 00 00 00 00 .... + + m_socket->Receive(response); + + // Parse response... + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + SB_JLSCREENINFO_SIZE); + MAKE_JLPACKET(rpack, response); + + info.width = be_btohs(rpack->u.screeninfo.width); + info.height = be_btohs(rpack->u.screeninfo.height); + + + // Read stream + for (;;) { + // Send the packet : + // 04 00 08 00 68 00 00 00 + packet.GetData(); + + m_socket->Packet(packet); + + // Read and parse the response + // 04 00 08 00 64 00 00 00 + // or + // 04 00 08 00 6e 00 f8 07 + + if( packet.Command() == SB_COMMAND_JL_ACK ) + return; + + if( packet.Command() != SB_COMMAND_JL_GET_DATA_ENTRY ) { + ThrowJLError("JavaLoader::GetScreenShot ", packet.Command()); + } + + // Read the size of next packet + size_t expect = packet.Size(); + + + // Read the stream + m_socket->Receive(response); + + + // Save data in buffer + Protocol::CheckSize(response, 4); + const unsigned char *pd = response.GetData(); + size_t bytereceived = response.GetSize() - 4; + + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJLError("JavaLoader::GetScreenShot expect", expect); + } + + + // Copy data + unsigned char *buffer = image.GetBuffer(image.GetSize() + bytereceived); + memcpy(buffer + image.GetSize(), pd + 4, bytereceived); + + // New size + image.ReleaseBuffer(image.GetSize() + bytereceived); + } +} + +void JavaLoader::DoErase(uint8_t cmd, const std::string &cod_name) +{ + Data command(-1, 8), data(-1, 8), response; + + JLPacket packet(command, data, response); + + // set filename, device responds with an ID + packet.SetCodFilename(cod_name); + m_socket->Packet(packet); + if( packet.Command() == SB_COMMAND_JL_COD_NOT_FOUND ) { + throw Error(string("JavaLoader::DoErase: module ") + cod_name + " not found"); + } + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::DoErase", packet.Command()); + } + + // make sure there is an ID coming + if( packet.Size() != 2 ) + throw Error("JavaLoader::DoErase: expected code not available"); + + // get ID + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + sizeof(uint16_t)); + MAKE_JLPACKET(jpack, response); + uint16_t id = be_btohs(jpack->u.id); + + // send erase command, with application ID + packet.Erase(cmd, id); + m_socket->Packet(packet); + if( packet.Command() == SB_COMMAND_JL_COD_IN_USE ) { + throw Error("JavaLoader::DoErase: COD file in use."); + } + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::DoErase", packet.Command()); + } +} + +void JavaLoader::Erase(const std::string &cod_name) +{ + DoErase(SB_COMMAND_JL_ERASE, cod_name); +} + +void JavaLoader::ForceErase(const std::string &cod_name) +{ + DoErase(SB_COMMAND_JL_FORCE_ERASE, cod_name); +} + +void JavaLoader::GetEventlog(JLEventlog &log) +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + packet.GetEventlog(); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::GetEventlog", packet.Command()); + } + + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + sizeof(uint16_t)); + + // number of eventlog entries + MAKE_JLPACKET(jpack, response); + uint16_t count = be_btohs(jpack->u.response.expect); + + for( uint16_t i = 0; i < count; ++ i ) { + packet.GetEventlogEntry(i); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::GetEventlog", packet.Command()); + } + + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + SB_JLEVENTLOG_ENTRY_HEADER_SIZE); + + MAKE_JLPACKET(jpack, response); + uint16_t size = be_btohs(jpack->u.logentry.size); + + JLEventlogEntry entry; + entry.Parse(size, (const char *)(response.GetData() + SB_JLPACKET_HEADER_SIZE + SB_JLEVENTLOG_ENTRY_HEADER_SIZE)); + + log.push_back(entry); + } +} + +void JavaLoader::ClearEventlog() +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + packet.ClearEventlog(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::ClearEventlog", packet.Command()); + } +} + +void JavaLoader::SaveData(JLPacket &packet, uint16_t id, CodFileBuilder &builder, std::ostream &output) +{ + packet.SaveModule(id); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::SaveData", packet.Command()); + } + + // get total size of cod file or this sibling cod file + Data &response = packet.GetReceive(); + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + sizeof(uint32_t)); + MAKE_JLPACKET(jpack, response); + uint32_t total_size = be_btohl(jpack->u.cod_size); + + // allocate buffer to hold data for this sibling + Data buffer(-1, total_size); + uint32_t offset = 0; + + for( ;; ) { + packet.GetData(); + m_socket->Packet(packet); + + if( packet.Command() == SB_COMMAND_JL_ACK ) + break; + + if( packet.Command() != SB_COMMAND_JL_GET_DATA_ENTRY ) { + ThrowJLError("JavaLoader::SaveData", packet.Command()); + } + + // expected size of data in response packet + unsigned int expect = packet.Size(); + + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + expect); + + memcpy(buffer.GetBuffer(offset + expect) + offset, + response.GetData() + SB_JLPACKET_HEADER_SIZE, + expect); + + offset += expect; + buffer.ReleaseBuffer(offset); + } + + builder.WriteNextHeader(output, buffer.GetData(), buffer.GetSize()); + output.write((const char *)buffer.GetData(), buffer.GetSize()); +} + +void JavaLoader::Save(const std::string &cod_name, std::ostream &output) +{ + Data command(-1, 8), data(-1, 8), response; + + JLPacket packet(command, data, response); + + // set filename, device responds with an ID + packet.SetCodFilename(cod_name); + m_socket->Packet(packet); + + if( packet.Command() == SB_COMMAND_JL_COD_NOT_FOUND ) { + throw Error(string("JavaLoader::Save: module ") + cod_name + " not found"); + } + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::Save", packet.Command()); + } + + // make sure there is an ID coming + if( packet.Size() != 2 ) + throw Error("JavaLoader::Save: expected module ID"); + + // get ID + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + sizeof(uint16_t)); + MAKE_JLPACKET(jpack, response); + uint16_t id = be_btohs(jpack->u.id); + + // get list of sibling modules + packet.GetSubDir(id); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::Save", packet.Command()); + } + + // expected number of module ID's + unsigned int expect = packet.Size(); + + // get list of sibling module ID's + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + expect); + + // copy array of module ID's since we reuse the response packet buffer + size_t count = expect / 2; + const uint16_t *begin = (const uint16_t*) (response.GetData() + SB_JLPACKET_HEADER_SIZE); + const uint16_t *end = begin + count; + vector ids(begin, end); + + CodFileBuilder builder(cod_name, count); + + // save each block of data + for( size_t i = 0; i < count; i++ ) { + SaveData(packet, be_btohs(ids[i]), builder, output); + } + + builder.WriteFooter(output); +} + +void JavaLoader::DeviceInfo(JLDeviceInfo &info) +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + packet.DeviceInfo(); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::DeviceInfo", packet.Command()); + } + + m_socket->Receive(response); + + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE + SB_JLDEVICEINFO_SIZE); + MAKE_JLPACKET(rpack, response); + + info.HardwareId = be_btohl(rpack->u.devinfo.hardware_id); + info.Pin = be_btohl(rpack->u.devinfo.pin); + info.OsVersion = be_btohl(rpack->u.devinfo.os_version); + info.VmVersion = be_btohl(rpack->u.devinfo.vm_version); + info.RadioId = be_btohl(rpack->u.devinfo.radio_id); + info.VendorId = be_btohl(rpack->u.devinfo.vendor_id); + info.ActiveWafs = be_btohl(rpack->u.devinfo.active_wafs); + + packet.OsMetrics(); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::DeviceInfo", packet.Command()); + } + + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE); + + size_t offset = SB_JLPACKET_HEADER_SIZE; + size_t size = response.GetSize()-offset; + unsigned char* buf = info.OsMetrics.GetBuffer(size); + memcpy(buf, response.GetData()+offset, size); + info.OsMetrics.ReleaseBuffer(size); + + packet.BootromMetrics(); + + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::DeviceInfo", packet.Command()); + } + + m_socket->Receive(response); + Protocol::CheckSize(response, SB_JLPACKET_HEADER_SIZE); + + offset = SB_JLPACKET_HEADER_SIZE; + size = response.GetSize()-offset; + buf = info.BootromMetrics.GetBuffer(size); + memcpy(buf, response.GetData()+offset, size); + info.BootromMetrics.ReleaseBuffer(size); +} + +void JavaLoader::Wipe(bool apps, bool fs) +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + if( apps ) { + packet.WipeApps(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::WipeApps", packet.Command()); + } + } + + if( fs ) { + packet.WipeFs(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::WipeFs", packet.Command()); + } + } +} + +void JavaLoader::LogStackTraces() +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + packet.LogStackTraces(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::LogStackTraces", packet.Command()); + } +} + +void JavaLoader::ResetToFactory() +{ + Data command(-1, 8), data(-1, 8), response; + JLPacket packet(command, data, response); + + packet.ResetToFactory(); + m_socket->Packet(packet); + + if( packet.Command() != SB_COMMAND_JL_ACK ) { + ThrowJLError("JavaLoader::ResetToFactory", packet.Command()); + } +} + +}} // namespace Barry::Mode + diff -Nru barry-0.14/src/m_javaloader.h barry-0.0.20110506/src/m_javaloader.h --- barry-0.14/src/m_javaloader.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_javaloader.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,267 @@ +/// +/// \file m_javaloader.h +/// Mode class for the JavaLoader mode +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + + Some parts are inspired from m_desktop.h + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_M_JAVALOADER_H__ +#define __BARRY_M_JAVALOADER_H__ + +#include "dll.h" +#include "m_mode_base.h" +#include "data.h" +#include "pin.h" + +namespace Barry { + +// forward declarations +class Parser; +class Builder; +class Controller; +class CodFileBuilder; + +class JLDirectoryEntry; + +class JLEventlogEntry; + +class BXEXPORT JLDirectory : public std::vector +{ +public: + typedef std::vector BaseType; + typedef BaseType::iterator BaseIterator; + typedef std::vector TableType; + typedef TableType::iterator TableIterator; + +private: + TableType m_idTable; + + int m_level; + +public: + JLDirectory(int level = 0); + ~JLDirectory(); + + int Level() const { return m_level; } + TableIterator TableBegin() { return m_idTable.begin(); } + TableIterator TableEnd() { return m_idTable.end(); } + + void ParseTable(const Data &table_packet); + + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JLDirectory &d) { + d.Dump(os); + return os; +} + +class BXEXPORT JLDirectoryEntry +{ +private: + int m_level; + +public: + uint16_t Id; + std::string Name; + std::string Version; + uint32_t CodSize; + time_t Timestamp; + + JLDirectory SubDir; + +public: + explicit JLDirectoryEntry(int level); + + void Parse(uint16_t id, const Data &entry_packet); + + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JLDirectoryEntry &e) { + e.Dump(os); + return os; +} + + +class BXEXPORT JLScreenInfo { +public: + uint16_t width; + uint16_t height; + +public: + JLScreenInfo(); + ~JLScreenInfo(); +}; + + +class BXEXPORT JLEventlog : public std::vector +{ +public: + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JLEventlog &log) { + log.Dump(os); + return os; +} + + +class BXEXPORT JLEventlogEntry +{ +public: + typedef enum { + JES_ALWAYS_LOG, + JES_SEVERE_ERROR, + JES_ERROR, + JES_WARNING, + JES_INFORMATION, + JES_DEBUG_INFO + } Severity_t; + + typedef enum { + JEVT_NUMBER = 1, + JEVT_STRING, + JEVT_EXCEPTION + } ViewerType_t; + + std::string Guid; + uint64_t MSTimestamp; // time_t in milliseconds + Severity_t Severity; + ViewerType_t Type; + std::string App; + std::string Data; + +protected: + static Severity_t SeverityProto2Rec(unsigned int s); + static unsigned int SeverityRec2Proto(Severity_t s); + + static ViewerType_t ViewerTypeProto2Rec(unsigned int v); + static unsigned int ViewerTypeRec2Proto(ViewerType_t v); + +public: + void Parse(uint16_t size, const char* str); + + std::string GetFormattedTimestamp() const; + + void Dump(std::ostream &os) const; +}; + + +class BXEXPORT JLDeviceInfo +{ +public: + struct VersionQuad { + VersionQuad() { } + VersionQuad(uint32_t v) { + Major = (v & 0xff000000) >> 24; + Minor = (v & 0xff0000) >> 16; + SubMinor = (v & 0xff00) >> 8; + Build = (v & 0xff); + } + + unsigned int Major; + unsigned int Minor; + unsigned int SubMinor; + unsigned int Build; + }; + +public: + uint32_t HardwareId; + struct Pin Pin; + VersionQuad OsVersion; + VersionQuad VmVersion; + uint32_t RadioId; + uint32_t VendorId; + uint32_t ActiveWafs; + Data OsMetrics; + Data BootromMetrics; + +public: + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JLDeviceInfo &info) { + info.Dump(os); + return os; +} + + +namespace Mode { + +// +// JavaLoader class +// +/// The main interface class to the java program loader protocol +/// +/// To use this class, use the following steps: +/// +/// - Create a Controller object (see Controller class for more details) +/// - Create this Mode::JavaLoader object, passing in the Controller +/// object during construction +/// - Call Open() to open database socket and finish constructing. +/// - Call LoadDatabase() to retrieve and store a database +/// +class BXEXPORT JavaLoader : public Mode +{ +private: + bool m_StreamStarted; + +protected: + void GetDirectoryEntries(JLPacket &packet, uint8_t entry_cmd, + JLDirectory &dir, bool include_subdirs); + void GetDir(JLPacket &packet, uint8_t entry_cmd, JLDirectory &dir, + bool include_subdirs); + void ThrowJLError(const std::string &msg, uint8_t cmd); + void DoErase(uint8_t cmd, const std::string &cod_name); + void SaveData(JLPacket &packet, uint16_t, CodFileBuilder &builder, + std::ostream &output); + + ////////////////////////////////// + // overrides + + virtual void OnOpen(); + +public: + JavaLoader(Controller &con); + ~JavaLoader(); + + ////////////////////////////////// + // API + void StartStream(); + bool StopStream(); + + // mid-stream operations + void SendStream(std::istream &input, size_t module_size); + void LoadApp(std::istream &input); + void SetTime(time_t when); + void GetDirectory(JLDirectory &dir, bool include_subdirs); + void GetScreenshot(JLScreenInfo &info, Data &image); + void Erase(const std::string &cod_name); + void ForceErase(const std::string &cod_name); + void GetEventlog(JLEventlog &log); + void ClearEventlog(); + void Save(const std::string &cod_name, std::ostream &output); + void DeviceInfo(JLDeviceInfo &info); + void Wipe(bool apps = true, bool fs = true); + void LogStackTraces(); + void ResetToFactory(); +}; + +}} // namespace Barry::Mode + +#endif + diff -Nru barry-0.14/src/m_jvmdebug.cc barry-0.0.20110506/src/m_jvmdebug.cc --- barry-0.14/src/m_jvmdebug.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_jvmdebug.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,1029 @@ +/// +/// \file m_jvmdebug.cc +/// Mode class for the JVMDebug mode +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "m_jvmdebug.h" +#include "data.h" +#include "protocol.h" +#include "protostructs.h" +#include "packet.h" +#include "endian.h" +#include "error.h" +#include "usbwrap.h" +#include "controller.h" +#include "cod.h" +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// JDModulesList class + +void JVMModulesList::Parse(const Data &entry_packet) +{ + uint16_t count = 0; + + size_t size = entry_packet.GetSize(); + + while (count < size) { + uint16_t len = 0; + + const unsigned char *ptr = (entry_packet.GetData() + count); + Protocol::JVMModulesEntry *e = (Protocol::JVMModulesEntry *) ptr; + + len = SB_JVMMODULES_ENTRY_HEADER_SIZE + be_btohs(e->sizename); + if( (count + len) > size ) + break; + + JVMModulesEntry entry; + + entry.Id = be_btohl(e->id); + entry.UniqueID = be_btohl(e->uniqueId); + (entry.Name).assign((char *) (ptr + SB_JVMMODULES_ENTRY_HEADER_SIZE), be_btohs(e->sizename)); + + push_back(entry); + + count += len; + } +} + + +void JVMModulesList::Dump(std::ostream &os) const +{ + const_iterator i = begin(), e = end(); + + os << " ID " << "|"; + os << " UniqueID " << "|"; + os << " Module Name" << endl; + + os << "------------+"; + os << "------------+"; + os << "-------------"; + os << endl; + + for( ; i != e; ++i ) { + (*i).Dump(os); + } +} + + +/////////////////////////////////////////////////////////////////////////////// +// JVMModulesEntry class + +void JVMModulesEntry::Dump(std::ostream &os) const +{ + os << " 0x" << setfill('0') << setw(8) << hex << Id << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << UniqueID << " |"; + os << " " << Name << endl; +} + + +/////////////////////////////////////////////////////////////////////////////// +// JVMThreadsList class + +void JVMThreadsList::Parse(const Data &entry_packet) +{ + uint16_t count = 0; + + size_t size = entry_packet.GetSize(); + + while (count < size) { + uint16_t len = 0; + + const unsigned char *ptr = (entry_packet.GetData() + count); + uint32_t *e = (uint32_t *) ptr; + + len = sizeof(uint32_t); + if( (count + len) > size ) + break; + + JVMThreadsEntry entry; + + entry.Id = be_btohl(*e); + + push_back(entry); + + count += len; + } +} + + +void JVMThreadsList::Dump(std::ostream &os) const +{ + const_iterator i = begin(), e = end(); + + os << " Thread " << "|"; + os << " Address " << "|"; + os << " Byte " << "|"; + os << " Unknown01 " << "|"; + os << " Unknown02 " << "|"; + os << " Unknown03 " << "|"; + os << " Unknown04 " << "|"; + os << " Unknown05 " << "|"; + os << " Unknown06 " << "|"; + + os << "------------+"; + os << "------------+"; + os << "------+"; + os << "------------+"; + os << "------------+"; + os << "------------+"; + os << "------------+"; + os << "------------+"; + os << "-------------"; + os << endl; + + for(int k=0 ; i != e; ++i, k++ ) { + (*i).Dump(os, k); + } +} + + +void JVMThreadsEntry::Dump(std::ostream &os, int num) const +{ + os << " " << setfill(' ') << setw(8) << dec << num << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Id) << " |"; + os << " 0x" << setfill('0') << setw(2) << hex << (Byte) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Address) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown01) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown02) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown03) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown04) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown05) << " |"; + os << " 0x" << setfill('0') << setw(8) << hex << (Unknown06) << endl; +} + + +namespace Mode { + +/////////////////////////////////////////////////////////////////////////////// +// JVMDebug Mode class + +JVMDebug::JVMDebug(Controller &con) + : Mode(con, Controller::JVMDebug) + , m_Attached(false) +{ +} + +JVMDebug::~JVMDebug() +{ + if( m_Attached ) + Detach(); +} + +/////////////////////////////////////////////////////////////////////////////// +// protected members + + +/////////////////////////////////////////////////////////////////////////////// +// public API + +void JVMDebug::OnOpen() +{ +} + +// FIXME - is this necessary? and if it is, wouldn't it be better +// in the m_jvmdebug mode class? I'm not convinced that applications +// should have to bother with socket-level details. +void JVMDebug::Close() +{ + if( m_ModeSocket ) { + m_socket->Close(); + m_socket.reset(); + m_ModeSocket = 0; + } +} + +// +// Attach +// +/// These commands are sent to prepare the debug communication. +/// Must be called at the start of a JVMDebug session. +/// +void JVMDebug::Attach() +{ +} + +// +// Detach +// +/// Must be called at the end of a JVMDebug session. The JVM_GOODBYE +/// command is sent to the device. +/// +void JVMDebug::Detach() +{ +} + + +void JVMDebug::ThrowJVMError(const std::string &msg, uint8_t cmd) +{ + std::ostringstream oss; + oss << msg << ": unexpected packet command code: 0x" + << std::hex << (unsigned int) cmd; + throw Error(oss.str()); +} + + +// +// Unknown 01 ??? +// +void JVMDebug::Unknown01() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown01(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 02 ??? +// +void JVMDebug::Unknown02() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown02(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 03 ??? +// +void JVMDebug::Unknown03() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown03(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 04 ??? +// +void JVMDebug::Unknown04() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown04(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 05 ??? +// +void JVMDebug::Unknown05() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown05(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 06 ??? +// +void JVMDebug::Unknown06() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown06(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 07 ??? +// +void JVMDebug::Unknown07() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown07(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 08 ??? +// +void JVMDebug::Unknown08() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown08(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 09 ??? +// +void JVMDebug::Unknown09() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown09(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Unknown 10 ??? +// +void JVMDebug::Unknown10() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Unknown10(); + m_socket->Packet(packet); + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Get Status +// +bool JVMDebug::GetStatus(int &status) +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.GetStatus(); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return false; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetModulesList expect", expect); + } + + // Make sure we have a header to read + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.status)); + + // Return status + status = dpack->u.status; + + return true; +} + + +// +// Wait Status +// +bool JVMDebug::WaitStatus(int &status) +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Prepare the command packet + packet.GetStatus(); + + try { + m_socket->Receive(packet.GetReceive(), 100); + } catch (Usb::Timeout &to ) { + return false; + } + + expect = packet.Size(); + + if (expect == 0) + return false; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetModulesList expect", expect); + } + + // Make sure we have a header to read + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.status)); + + // Return status + status = dpack->u.status; + + return true; +} + + +// +// Get Console Message +// Sample, display the output of System.out.println(...) and all JVM messages output +// +// Return the length message or -1 if message doesn't exit or is empty +// +int JVMDebug::GetConsoleMessage(std::string &message) +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.GetConsoleMessage(); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return -1; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetModulesList expect", expect); + } + + // Make sure we have a header to read + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.msglength)); + + // Length of message + uint16_t length = be_btohs(dpack->u.msglength); + + if (length == 0) + return -1; + + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.msglength) + length); + + // Parse the ID of nextmodules + const unsigned char *ptr = (response.GetData() + SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.msglength)); + + message.assign((char *) ptr, length); + + return length; +} + + +// +// Get list of Java modules +// +void JVMDebug::GetModulesList(JVMModulesList &mylist) +{ + uint32_t size = 0; + uint32_t count = 0; + uint32_t offset = 0; + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + do { + // Send the command packet + packet.GetModulesList(offset); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + break; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetModulesList expect", expect); + } + + // Make sure there's enough for packet header + module list + // header + 4 bytes of ID + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + SB_JVMMODULES_LIST_HEADER_SIZE + 4); + + // Number of modules entries in the list + count = be_btohl(dpack->u.moduleslist.nbr); + + // Size of modules list + // I remove the header of packet (contains the field 'number of modules') + // and 4 bytes (contains the field 'ID of next modules') + size = bytereceived - SB_JVMMODULES_LIST_HEADER_SIZE - 4; + + // Parse the modules list + mylist.Parse(Data(response.GetData() + SB_JVMPACKET_HEADER_SIZE + SB_JVMMODULES_LIST_HEADER_SIZE, size)); + + // Parse the ID of nextmodules + size_t id_offset = SB_JVMPACKET_HEADER_SIZE + SB_JVMMODULES_LIST_HEADER_SIZE + size; + const unsigned char *ptr = (response.GetData() + id_offset); + CheckSize(response, id_offset + sizeof(uint32_t)); + uint32_t *poffset = (uint32_t *) ptr; + + offset = be_btohl(*poffset); + } while (offset != 0); // When the offset != 0, there is some modules +} + + +// +// Get list of Java threads +// +void JVMDebug::GetThreadsList(JVMThreadsList &mylist) +{ + uint32_t size = 0; + uint32_t count = 0; + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.GetThreadsList(); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList expect", expect); + } + + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + SB_JVMTHREADS_LIST_HEADER_SIZE); + + // Number of threads entries in the list + count = be_btohl(dpack->u.threadslist.nbr); + + // Size of threads list + // I remove the header of packet (contains the field 'number of threads') + size = bytereceived - SB_JVMTHREADS_LIST_HEADER_SIZE; + + // Parse the threads list + mylist.Parse(Data(response.GetData() + SB_JVMPACKET_HEADER_SIZE + SB_JVMTHREADS_LIST_HEADER_SIZE, size)); + + // Complete threads list + JVMThreadsList::iterator b = mylist.begin(); + for( ; b != mylist.end(); b++ ) { + JVMThreadsEntry entry = (*b); + + // 1°/ + // Send the command packet + packet.Unknown11(entry.Id); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList (1) expect", expect); + } + + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + SB_JVMUNKNOWN01_HEADER_SIZE); + + // Save values + entry.Byte = dpack->u.unknown01.byte; + entry.Address = be_btohl(dpack->u.unknown01.address); + + // 2°/ + if (entry.Address != 0) { + // Send the command packet + packet.Unknown12(entry.Address); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + MAKE_JVMPACKET(dpack, response); + + bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList (2) expect", expect); + } + + + // Save values + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.address)); + entry.Unknown01 = be_btohl(dpack->u.address); + } + else + entry.Unknown01 = 0; + + // 3°/ + // Send the command packet + packet.Unknown13(entry.Id); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + dpack = (const Protocol::JVMPacket *) response.GetData(); + + bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList (2) expect", expect); + } + + // Save values + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + sizeof(dpack->u.address)); + entry.Unknown02 = be_btohl(dpack->u.address); + + // 4°/ + // Send the command packet + packet.Unknown14(entry.Id); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + dpack = (const Protocol::JVMPacket *) response.GetData(); + + bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList (2) expect", expect); + } + + // Save values + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + SB_JVMUNKNOWN02_HEADER_SIZE); + entry.Unknown03 = be_btohl(dpack->u.unknown02.address1); + entry.Unknown04 = be_btohl(dpack->u.unknown02.address2); + + // 5°/ + // Send the command packet + packet.Unknown15(entry.Id); + + m_socket->Packet(packet); + + expect = packet.Size(); + + if (expect == 0) + return; + + // Read the data stream + m_socket->Receive(response); + + dpack = (const Protocol::JVMPacket *) response.GetData(); + + bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::GetThreadsList (2) expect", expect); + } + + // Save values + CheckSize(response, SB_JVMPACKET_HEADER_SIZE + SB_JVMUNKNOWN02_HEADER_SIZE); + entry.Unknown05 = be_btohl(dpack->u.unknown02.address1); + entry.Unknown06 = be_btohl(dpack->u.unknown02.address2); + + // Save... + (*b) = entry; + } +} + + +// +// Go +// +void JVMDebug::Go() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Go(); + m_socket->Packet(packet); + expect = packet.Size(); + + while (expect == 0) { + m_socket->Receive(packet.GetReceive()); + + expect = packet.Size(); + } + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +// +// Stop +// +void JVMDebug::Stop() +{ + uint16_t expect = 0; + + Data command(-1, 8), response; + JVMPacket packet(command, response); + + // Send the command packet + packet.Stop(); + m_socket->Packet(packet); + expect = packet.Size(); + + while (expect == 0) { + m_socket->Receive(packet.GetReceive()); + + expect = packet.Size(); + } + + // Read the data stream + m_socket->Receive(response); + + size_t bytereceived = response.GetSize() - SB_JVMPACKET_HEADER_SIZE; + + // Check the size read into the previous packet + if( expect != bytereceived ) { + ThrowJVMError("JVMDebug::Attach expect", expect); + } +} + + +}} // namespace Barry::Mode + diff -Nru barry-0.14/src/m_jvmdebug.h barry-0.0.20110506/src/m_jvmdebug.h --- barry-0.14/src/m_jvmdebug.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_jvmdebug.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,174 @@ +/// +/// \file m_jvmdebug.h +/// Mode class for the JVMDebug mode +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_M_JVMDEBUG_H__ +#define __BARRY_M_JVMDEBUG_H__ + +#include "dll.h" +#include "m_mode_base.h" +#include "socket.h" +#include "record.h" +#include "data.h" + +namespace Barry { + +// forward declarations +class Parser; +class Builder; +class Controller; + +class JVMModulesEntry; +class JVMThreadsEntry; + + +class BXEXPORT JVMModulesList : public std::vector +{ +public: + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + +public: + void Parse(const Data &entry_packet); + + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JVMModulesList &list) { + list.Dump(os); + return os; +} + + +class BXEXPORT JVMModulesEntry +{ +public: + uint32_t Id; + uint32_t UniqueID; + std::string Name; + +public: + void Dump(std::ostream &os) const; +}; + + +class BXEXPORT JVMThreadsList : public std::vector +{ +public: + typedef std::vector base_type; + typedef base_type::iterator iterator; + typedef base_type::const_iterator const_iterator; + +public: + void Parse(const Data &entry_packet); + + void Dump(std::ostream &os) const; +}; +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JVMThreadsList &list) { + list.Dump(os); + return os; +} + + +class BXEXPORT JVMThreadsEntry +{ +public: + uint32_t Id; + uint8_t Byte; + uint32_t Address; + uint32_t Unknown01; // FIXME - perhaps should not expose + // these to the app level, until we + // have a name for them, since they + // might change without notice + uint32_t Unknown02; + uint32_t Unknown03; + uint32_t Unknown04; + uint32_t Unknown05; + uint32_t Unknown06; + +public: + void Dump(std::ostream &os, int num) const; +}; + + +namespace Mode { + +// +// JVMDebug class +// +/// The main interface class to the java program debugger protocol +/// +/// To use this class, use the following steps: +/// +/// - Create a Controller object (see Controller class for more details) +/// - Create this Mode::JVMDebug object, passing in the Controller +/// object during construction +/// - Call Open() to open database socket and finish constructing. +/// +class BXEXPORT JVMDebug : public Mode +{ +private: + bool m_Attached; + +protected: + void ThrowJVMError(const std::string &msg, uint8_t cmd); + + ////////////////////////////////// + // overrides + + virtual void OnOpen(); + +public: + JVMDebug(Controller &con); + ~JVMDebug(); + + ////////////////////////////////// + // API + void Close(); + + void Attach(); + void Detach(); + + // mid-attachment operations + void Unknown01(); // FIXME - make these into a proper API, or + // hide under protected: + void Unknown02(); + void Unknown03(); + void Unknown04(); + void Unknown05(); + void Unknown06(); + void Unknown07(); + void Unknown08(); + void Unknown09(); + void Unknown10(); + void GetModulesList(JVMModulesList &mylist); + void GetThreadsList(JVMThreadsList &mylist); + int GetConsoleMessage(std::string &msg); + bool GetStatus(int &status); + bool WaitStatus(int &status); + void Go(); + void Stop(); +}; + +}} // namespace Barry::Mode + +#endif + diff -Nru barry-0.14/src/m_mode_base.cc barry-0.0.20110506/src/m_mode_base.cc --- barry-0.14/src/m_mode_base.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_mode_base.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,168 @@ +/// +/// \file m_mode_base.cc +/// Base for mode classes +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "m_mode_base.h" + +namespace Barry { namespace Mode { + +////////////////////////////////////////////////////////////////////////////// +// Mode base class + +Mode::Mode(Controller &con, Controller::ModeType type) + : m_con(con) + , m_modetype(type) + , m_ModeSocket(0) +{ +} + +Mode::~Mode() +{ +} + +// +// Open +// +/// Select device mode. This is required before using any other mode-based +/// operations, such as GetDBDB() and LoadDatabase(). +/// +/// This function opens a socket to the device for communicating in Desktop +/// mode. If the device requires it, specify the password with a const char* +/// string in password. The password will not be stored in memory +/// inside this class, only a hash will be generated from it. After +/// using the hash, the hash memory will be set to 0. The application +/// is responsible for safely handling the raw password data. +/// +/// You can retry the password by catching Barry::BadPassword and +/// calling RetryPassword() with the new password. +/// +/// \exception Barry::Error +/// Thrown on protocol error. +/// +/// \exception std::logic_error() +/// Thrown if unsupported mode is requested, or if socket +/// already open. +/// +/// \exception Barry::BadPassword +/// Thrown when password is invalid or if not enough retries +/// left in the device. +/// +void Mode::Open(const char *password) +{ + if( m_ModeSocket ) { + m_socket->Close(); + m_socket.reset(); + m_ModeSocket = 0; + } + + m_ModeSocket = m_con.SelectMode(m_modetype); + RetryPassword(password); +} + +// +// Open +// +/// Select device mode. This is required before using any other mode-based +/// operations, such as GetDBDB() and LoadDatabase(). +/// +/// This function opens a socket to the device for communicating in Desktop +/// mode. If the device requires it, specify the password with a const char* +/// string in password. The password will not be stored in memory +/// inside this class, only a hash will be generated from it. After +/// using the hash, the hash memory will be set to 0. The application +/// is responsible for safely handling the raw password data. +/// +/// It uses the provided name as the name for the socket used in this mode. +/// Usually this shouldn't be needed unless using the raw channel mode. +/// +/// You can retry the password by catching Barry::BadPassword and +/// calling RetryPassword() with the new password. +/// +/// \exception Barry::Error +/// Thrown on protocol error. +/// +/// \exception std::logic_error() +/// Thrown if unsupported mode is requested, or if socket +/// already open. +/// +/// \exception Barry::BadPassword +/// Thrown when password is invalid or if not enough retries +/// left in the device. +/// +void Mode::Open(const char *password, const char *name) +{ + if( m_ModeSocket ) { + m_socket->Close(); + m_socket.reset(); + m_ModeSocket = 0; + } + + m_ModeSocket = m_con.SelectMode(m_modetype, name); + RetryPassword(password); +} + +// +// RetryPassword +// +/// Retry a failed password attempt from the first call to Open(). +/// Only call this function in response to Barry::BadPassword exceptions +/// that are thrown from Open(). +/// +/// \exception Barry::Error +/// Thrown on protocol error. +/// +/// \exception std::logic_error() +/// Thrown if in unsupported mode, or if socket already open. +/// +/// \exception Barry::BadPassword +/// Thrown when password is invalid or if not enough retries +/// left in the device. +/// +void Mode::RetryPassword(const char *password) +{ + if( m_socket.get() != 0 ) + throw std::logic_error("Socket alreay open in RetryPassword"); + + m_socket = m_con.OpenSocket(m_ModeSocket, password); + + // success... perform open-oriented setup + OnOpen(); +} + + +void Mode::OnOpen() +{ +} + + +// FIXME - is this necessary? and if it is, wouldn't it be better +// in the m_jvmdebug mode class? I'm not convinced that applications +// should have to bother with socket-level details. +//void Mode::Close() +//{ +// if( m_ModeSocket ) { +// m_socket->Close(); +// m_socket.reset(); +// m_ModeSocket = 0; +// } +//} + +}} // namespace Barry::Mode + diff -Nru barry-0.14/src/m_mode_base.h barry-0.0.20110506/src/m_mode_base.h --- barry-0.14/src/m_mode_base.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_mode_base.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,69 @@ +/// +/// \file m_mode_base.h +/// Base for mode classes +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_M_MODE_BASE_H__ +#define __BARRY_M_MODE_BASE_H__ + +#include "dll.h" +#include "controller.h" + +namespace Barry { + +namespace Mode { + +// +// Mode class +// +/// Base class for simple mode classes. Put common code here. +/// +class BXEXPORT Mode +{ +protected: + Controller &m_con; + Controller::ModeType m_modetype; + SocketHandle m_socket; + + uint16_t m_ModeSocket; // socket recommended by device + // when mode was selected + +public: + Mode(Controller &con, Controller::ModeType type); + virtual ~Mode(); + + ////////////////////////////////// + // primary operations - required before anything else + + void Open(const char *password = 0); + void Open(const char *password, const char *name); + void RetryPassword(const char *password); +// void Close(); + +protected: + ////////////////////////////////// + // overrides + + virtual void OnOpen(); +}; + +}} // namespace Barry::Mode + +#endif + diff -Nru barry-0.14/src/modem.h barry-0.0.20110506/src/modem.h --- barry-0.14/src/modem.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/modem.h 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/m_raw_channel.cc barry-0.0.20110506/src/m_raw_channel.cc --- barry-0.14/src/m_raw_channel.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_raw_channel.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,301 @@ +/// +/// \file m_raw_channel.cc +/// Mode class for a raw channel +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Portions Copyright (C) 2010 RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "m_raw_channel.h" +#include "semaphore.h" +#include "data.h" +#include "protocol.h" +#include "protostructs.h" +#include "packet.h" +#include "endian.h" +#include "error.h" +#include "usbwrap.h" +#include "controller.h" +#include +#include +#include +#include +#include "protostructs.h" + +#include "debug.h" + +namespace Barry { namespace Mode { + +/////////////////////////////////////////////////////////////////////////////// +// RawChannel SocketDataHandler callback class for data socket +class RawChannelSocketHandler: public SocketRoutingQueue::SocketDataHandler +{ + RawChannel &m_raw_channel; +public: + RawChannelSocketHandler(RawChannel &raw_channel) + : m_raw_channel(raw_channel) + {} + virtual void DataReceived(Data &data) + { + m_raw_channel.HandleReceivedData(data); + } + virtual void Error(Barry::Error &error) + { + SocketDataHandler::Error(error); + m_raw_channel.HandleError(error); + } + virtual ~RawChannelSocketHandler() + {} +}; + +/////////////////////////////////////////////////////////////////////////////// +// RawChannel SocketDataHandler callback class for zero socket +class RawChannelZeroSocketHandler: public SocketRoutingQueue::SocketDataHandler +{ + RawChannel &m_raw_channel; +public: + RawChannelZeroSocketHandler(RawChannel &raw_channel) + : m_raw_channel(raw_channel) + {} + virtual void DataReceived(Data &data) + { + m_raw_channel.HandleReceivedZeroPacket(data); + } + virtual void Error(Barry::Error &error) + { + SocketDataHandler::Error(error); + m_raw_channel.HandleError(error); + } + virtual ~RawChannelZeroSocketHandler() + {} +}; + +/////////////////////////////////////////////////////////////////////////////// +// RawChannel Mode class + +RawChannel::RawChannel(Controller &con, RawChannelDataCallback &callback) + : Mode(con, Controller::RawChannel) + , m_callback(&callback) + , m_send_buffer(NULL) + , m_zero_registered(false) + , m_pending_error(NULL) +{ + CheckQueueAvailable(); + InitBuffer(); +} + +RawChannel::RawChannel(Controller &con) + : Mode(con, Controller::RawChannel) + , m_callback(NULL) + , m_send_buffer(NULL) + , m_zero_registered(false) + , m_pending_error(NULL) +{ + CheckQueueAvailable(); + InitBuffer(); +} + +void RawChannel::CheckQueueAvailable() +{ + if( !m_con.HasQueue() ) { + throw Barry::Error("RawChannel: No routing queue set in controller"); + } +} + +void RawChannel::InitBuffer() +{ + m_send_buffer = new unsigned char[SB_CHANNELPACKET_HEADER_SIZE + SB_CHANNELPACKET_MAX_DATA_SIZE]; +} + +RawChannel::~RawChannel() +{ + UnregisterZeroSocketInterest(); + + delete[] m_send_buffer; + + delete m_pending_error; +} + +void RawChannel::OnOpen() +{ + // Enable sequence packets so that DataSendAck callback and close can be + // implemented + m_zero_registered = true; + SocketRoutingQueue::SocketDataHandlerPtr zeroCallback; + zeroCallback.reset(new RawChannelZeroSocketHandler(*this)); + m_con.GetQueue()->RegisterInterest(0, zeroCallback); + // Get socket data packets routed to this class as well if a + // callback was provided, otherside just get the data packets + // placed into a queue for the socket. + if( m_callback ) { + SocketRoutingQueue::SocketDataHandlerPtr callback; + callback.reset(new RawChannelSocketHandler(*this)); + m_socket->UnregisterInterest(); + m_socket->RegisterInterest(callback); + } + else { + // sockets already register themselves by default, + // so no need to do anything in this case + } +} + + +void RawChannel::HandleReceivedZeroPacket(Data &data) +{ + Protocol::CheckSize(data, SB_PACKET_HEADER_SIZE); + MAKE_PACKETPTR_BUF(packet, data.GetData()); + + if( packet->socket != 0 ) { + UnregisterZeroSocketInterest(); + SetPendingError("RawChannel: Got packet not for socket-zero"); + } + + switch( btohs(packet->command) ) + { + case SB_COMMAND_CLOSE_SOCKET: + case SB_COMMAND_REMOTE_CLOSE_SOCKET: + // Stop listening to socket 0 messages + // so that socket close work. + UnregisterZeroSocketInterest(); + if( m_callback ) { + m_callback->ChannelClose(); + } + + break; + default: + UnregisterZeroSocketInterest(); + if( m_callback ) { + m_callback->ChannelError("RawChannel: Got unexpected socket zero packet"); + } + else { + SetPendingError("RawChannel: Got unexpected socket zero packet"); + } + break; + } + +} + +void RawChannel::HandleReceivedData(Data &data) +{ + // Only ever called in callback mode + ValidateDataPacket(data); + MAKE_CHANNELPACKETPTR_BUF(packet, data.GetData()); + + // Should be a socket packet for us, so remove packet headers + Data partial(packet->u.data, data.GetSize() - SB_CHANNELPACKET_HEADER_SIZE); + if( m_callback ) { + m_callback->DataReceived(partial); + } + else { + SetPendingError("RawChannel: Received data to handle when in non-callback mode"); + } +} + +void RawChannel::HandleError(Barry::Error &error) +{ + std::ostringstream errorOss; + errorOss << "RawChannel: Socket error received, what: " << error.what(); + + if( m_callback ) { + m_callback->ChannelError(errorOss.str().c_str()); + } + else { + SetPendingError(errorOss.str().c_str()); + } +} + +void RawChannel::UnregisterZeroSocketInterest() +{ + if( m_zero_registered ) { + m_con.GetQueue()->UnregisterInterest(0); + m_zero_registered = false; + } +} + +void RawChannel::SetPendingError(const char *msg) +{ + if( !m_pending_error ) { + m_pending_error = new std::string(msg); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// public API + +void RawChannel::Send(Data &data, int timeout) +{ + size_t packetSize = SB_CHANNELPACKET_HEADER_SIZE + data.GetSize(); + + if( packetSize > SB_CHANNELPACKET_HEADER_SIZE + SB_CHANNELPACKET_MAX_DATA_SIZE ) { + throw Barry::Error("RawChannel: send data size larger than MaximumPacketSize"); + } + + if( m_pending_error ) { + throw Barry::Error(*m_pending_error); + } + + // setup header and copy data in + MAKE_CHANNELPACKETPTR_BUF(packet, m_send_buffer); + packet->size = htobs(packetSize); + std::memcpy(packet->u.data, data.GetData(), data.GetSize()); + + Data toSend(m_send_buffer, packetSize); + m_socket->SyncSend(toSend, timeout); + + if( m_pending_error ) { + throw Barry::Error(*m_pending_error); + } +} + +void RawChannel::Receive(Data &data,int timeout) +{ + if( m_callback ) { + throw std::logic_error("RawChannel: Receive called when channel was created with a callback"); + } + + if( m_pending_error ) { + throw Barry::Error(*m_pending_error); + } + + // Receive into a buffer + m_socket->Receive(m_receive_data, timeout); + // Then transfer across, skipping the header + ValidateDataPacket(m_receive_data); + MAKE_CHANNELPACKETPTR_BUF(packet, m_receive_data.GetData()); + + size_t len = packet->size - SB_CHANNELPACKET_HEADER_SIZE; + memcpy(data.GetBuffer(), packet->u.data, len); + data.ReleaseBuffer(len); + +} + +void RawChannel::ValidateDataPacket(Data &data) +{ + Protocol::CheckSize(data, SB_CHANNELPACKET_HEADER_SIZE); + MAKE_CHANNELPACKETPTR_BUF(packet, data.GetData()); + if( packet->size != data.GetSize() ) { + + throw std::logic_error("RawChannel: Data size doesn't match packet size"); + } +} + +size_t RawChannel::MaximumSendSize() +{ + return SB_CHANNELPACKET_MAX_DATA_SIZE; +} + +}} // namespace Barry::Mode diff -Nru barry-0.14/src/m_raw_channel.h barry-0.0.20110506/src/m_raw_channel.h --- barry-0.14/src/m_raw_channel.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/m_raw_channel.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,167 @@ +/// +/// \file m_raw_channel.h +/// Mode class for a raw channel +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Portions Copyright (C) 2010 RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_M_RAW_CHANNEL_H__ +#define __BARRY_M_RAW_CHANNEL_H__ + +#include "dll.h" +#include "m_mode_base.h" +#include "socket.h" +#include "data.h" + +#include +#include + +namespace Barry { + +class semaphore; + +namespace Mode { + +// Forward declaration of internal classes +class RawChannelSocketHandler; +class RawChannelZeroSocketHandler; + +// Callback from the raw channel. + +class BXEXPORT RawChannelDataCallback +{ +public: + virtual ~RawChannelDataCallback() {} + + // Called when data has been received on the channel + virtual void DataReceived(Data &data) = 0; + // Called when the channel has an error + virtual void ChannelError(std::string msg) = 0; + // Called when the channel has been asked to close by the other side + virtual void ChannelClose() = 0; +}; + +// +// Raw channel class +// +/// The main class for creating a raw channel session. +/// +/// To use this class, use the following steps: +/// +/// - Implement RawChannelDataCallback +/// - Create a Controller object (see Controller class for more details) +/// - Create this Mode::RawChannel object, passing in the Controller +/// object during construction +/// - Call Open() to open the channel and finish constructing. +/// - Call GetData() to fetch data +/// - Call SendData() to send data +/// +class BXEXPORT RawChannel : public Mode +{ + friend class RawChannelSocketHandler; + friend class RawChannelZeroSocketHandler; + + RawChannelDataCallback *m_callback; + unsigned char *m_send_buffer; + bool m_zero_registered; + std::string *m_pending_error; + + Data m_receive_data; + +protected: + void CheckQueueAvailable(); + void InitBuffer(); + void SetPendingError(const char *msg); + void UnregisterZeroSocketInterest(); + + // Used to validate a packet is a valid channel data packet + void ValidateDataPacket(Data &data); + + // Not intended for use by users of this class. + // Used for handling zero-socket packets. + void HandleReceivedZeroPacket(Data &data); + + // Not intended for use by users of this class. + // Instead data received will come in via the + // RawChannelDataCallback::DataReceived callback + // or using Receive(). + void HandleReceivedData(Data &data); + + // Not intended for use by users of this class. + void HandleError(Barry::Error &data); + + // Not intended for use by users of this class. + // This method is called by the internals of + // Barry when setting up a connection. + void OnOpen(); +public: + // Creates a raw channel in non-callback mode. + // This requires all data to be sent and received + // via calls to Send and Receive. + // As there are no notifications of data being + // available to send or receive, this is only recommended + // for use with synchronous protocols over the channel. + // + // Will throw a Barry::Error if the provided controller + // doesn't have a routing queue set. + RawChannel(Controller &con); + + // Creates a raw channel in callback mode. + // This requires all data to be sent via calls to Send, but + // the Receive method must never be called. + // Instead the DataReceive + // + // Will throw a Barry::Error if the provided controller + // doesn't have a routing queue set. + RawChannel(Controller &con, RawChannelDataCallback &callback); + + virtual ~RawChannel(); + + ////////////////////////////////// + // Raw channel mode specific methods + + // Send some data on the raw channel. + // Will throw a Barry::Error if data is longer than + // MaximumPacketContentsSize or a Usb::Error if there + // is an underlying USB error. + // + // If using a raw channel in callback mode then care must be + // taken to ensure another thread is running during any calls + // to Send. See the comment in the constructor of RawChannel + // for further information. + void Send(Data &data, int timeout = -1); + + // Receive some data on the raw channel. + // Will throw a Barry::Error if a disconnect occurs + // or a Usb::Error if there is an underlying USB error + // or a Usb::Timeout if the receive times out. + // + // Only valid to call this if the raw channel was created in non-callback + // mode. If this is called when the raw channel was created with a + // callback then a std::logic_error will be thrown. + void Receive(Data &data, int timeout = -1); + + // Returns the maximum quantity of data which + // can be sent + size_t MaximumSendSize(); +}; + +}} // namespace Barry::Mode + +#endif + diff -Nru barry-0.14/src/m_serial.cc barry-0.0.20110506/src/m_serial.cc --- barry-0.14/src/m_serial.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_serial.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -52,18 +52,16 @@ ////////////////////////////////////////////////////////////////////////////// // protected API / static functions -void Serial::DataCallback(void *context, Data *data) +void Serial::DataCallback(Serial &ser, Data *data) { ddout("Serial::DataCallback called"); - Serial *ser = (Serial*) context; - if( data->GetSize() <= 4 ) return; // nothing to do // call callback if available - if( ser->m_callback ) { - (*ser->m_callback)(ser->m_callback_context, + if( ser.m_callback ) { + (*ser.m_callback)(ser.m_callback_context, data->GetData() + 4, data->GetSize() - 4); } @@ -73,10 +71,8 @@ // } } -void Serial::CtrlCallback(void *context, Data *data) +void Serial::CtrlCallback(Serial &ser, Data *data) { -// Serial *ser = (Serial*) context; - // just dump to stdout, and do nothing ddout("CtrlCallback received:\n" << *data); } @@ -99,19 +95,23 @@ } m_ModeSocket = m_con.SelectMode(Controller::UsbSerData); - m_data = m_con.m_zero.Open(m_ModeSocket, password); + m_data = m_con.OpenSocket(m_ModeSocket, password); m_CtrlSocket = m_con.SelectMode(Controller::UsbSerCtrl); - m_ctrl = m_con.m_zero.Open(m_CtrlSocket, password); + m_ctrl = m_con.OpenSocket(m_CtrlSocket, password); // register callback for incoming data, for speed - m_data->RegisterInterest(DataCallback, this); - m_ctrl->RegisterInterest(CtrlCallback, this); + SocketRoutingQueue::SocketDataHandlerPtr data_callback + (new SocketRoutingQueue::SimpleSocketDataHandler(*this, DataCallback)); + m_data->RegisterInterest(data_callback); + SocketRoutingQueue::SocketDataHandlerPtr ctrl_callback + (new SocketRoutingQueue::SimpleSocketDataHandler(*this, CtrlCallback)); + m_ctrl->RegisterInterest(ctrl_callback); const unsigned char start[] = { 0, 0, 0x0a, 0, 0x01, 0x01, 0xc2, 0x00, 0x40, 0x00 }; Data block(start, sizeof(start)); - m_ctrl->Send(block); + m_ctrl->RawSend(block); } void Serial::Close() @@ -160,7 +160,7 @@ spack->size = htobs(filtered.GetSize()); // send via appropriate socket - m_data->Send(filtered, timeout); + m_data->RawSend(filtered, timeout); } }} // namespace Barry::Mode diff -Nru barry-0.14/src/m_serial.h barry-0.0.20110506/src/m_serial.h --- barry-0.14/src/m_serial.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/m_serial.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -61,8 +61,8 @@ void *m_callback_context; protected: - static void DataCallback(void *context, Data *data); - static void CtrlCallback(void *context, Data *data); + static void DataCallback(Serial &context, Data *data); + static void CtrlCallback(Serial &context, Data *data); public: Serial(Controller &con, DeviceDataCallback callback, void *callback_context); diff -Nru barry-0.14/src/packet.cc barry-0.0.20110506/src/packet.cc --- barry-0.14/src/packet.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/packet.cc 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -49,8 +49,8 @@ /// unsigned int Packet::Command() const { - Protocol::CheckSize(m_receive); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return rpack->command; } @@ -81,7 +81,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size)); Protocol::Packet &packet = *cpack; - packet.socket = 0; + // socket class sets socket for us packet.size = htobs(size); packet.command = SB_COMMAND_FETCH_ATTRIBUTE; packet.u.socket.socket = htobs(0x00ff); // default non-socket request @@ -92,51 +92,94 @@ m_send.ReleaseBuffer(size); } +// +// Echo +// +/// Builds command packet for sending echo request. The parameter +/// to this command is the number of microseconds elapsed since host +/// computer startup. +/// +void ZeroPacket::Echo(uint64_t us_ticks) +{ + size_t size = SB_SOCKET_PACKET_HEADER_SIZE + ECHO_COMMAND_SIZE; + MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size)); + Protocol::Packet &packet = *cpack; + + packet.size = htobs(size); + packet.command = SB_COMMAND_ECHO; + packet.u.socket.socket = htobs(0x00ff); // default non-socket request + packet.u.socket.sequence = 0; // filled in by Socket class + packet.u.socket.u.echo.ticks = htobl(us_ticks); + + m_send.ReleaseBuffer(size); +} + +void ZeroPacket::Reset() +{ + size_t size = SB_SOCKET_PACKET_HEADER_SIZE; + MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size)); + Protocol::Packet &packet = *cpack; + + packet.size = htobs(size); + packet.command = SB_COMMAND_RESET; + packet.u.socket.socket = htobs(0x00ff); // default non-socket request + packet.u.socket.sequence = 0; // filled in by Socket class + + m_send.ReleaseBuffer(size); +} + unsigned int ZeroPacket::ObjectID() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return btohs(rpack->u.socket.u.fetch.object); } unsigned int ZeroPacket::AttributeID() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return btohs(rpack->u.socket.u.fetch.attribute); } uint32_t ZeroPacket::ChallengeSeed() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE + + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE + PASSWORD_CHALLENGE_SEED_SIZE); - MAKE_PACKET(rpack, m_receive); + MAKE_PACKET(rpack, *m_receive); return btohl(rpack->u.socket.u.password.u.seed); } unsigned int ZeroPacket::RemainingTries() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE + + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE + PASSWORD_CHALLENGE_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + MAKE_PACKET(rpack, *m_receive); // this is a byte, so no byte swapping needed return rpack->u.socket.u.password.remaining_tries; } unsigned int ZeroPacket::SocketResponse() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return btohs(rpack->u.socket.socket); } unsigned char ZeroPacket::SocketSequence() const { - Protocol::CheckSize(m_receive, SB_SOCKET_PACKET_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return rpack->u.socket.sequence; // sequence is a byte } +uint8_t ZeroPacket::CommandResponse() const +{ + Protocol::CheckSize(*m_receive, SB_SOCKET_PACKET_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); + return rpack->command; +} + ////////////////////////////////////////////////////////////////////////////// @@ -164,8 +207,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(9); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -188,8 +230,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(7)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(7); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -212,8 +253,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(9); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -242,8 +282,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(size); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -270,8 +309,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(size)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(size); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -295,8 +333,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(11)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(11); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -320,23 +357,22 @@ /// - false means no data available from Builder object /// bool DBPacket::SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex, - Builder &build) + Builder &build, const IConverter *ic) { - // get new data if available - if( !build.Retrieve(dbId) ) - return false; - // build packet data + DBData send(m_send, false); // send is just a reference to m_send, + // so it is safe to use m_send later + size_t header_size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_INDEXED_UPLOAD_HEADER_SIZE; - build.BuildFields(m_send, header_size); + if( !build.BuildRecord(send, header_size, ic) ) + return false; // no data available size_t total_size = m_send.GetSize(); // fill in the header values MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(total_size)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(total_size); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -362,8 +398,7 @@ MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(9)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(9); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); @@ -385,31 +420,29 @@ /// - true means success /// - false means no data available from Builder object /// -bool DBPacket::SetRecord(unsigned int dbId, Builder &build) +bool DBPacket::SetRecord(unsigned int dbId, Builder &build, const IConverter *ic) { - // get new data if available - if( !build.Retrieve(dbId) ) - return false; - // build packet data + DBData send(m_send, false); // send is just a reference to m_send, + // so it is safe to use m_send later + size_t header_size = SB_PACKET_COMMAND_HEADER_SIZE + DBC_TAGGED_UPLOAD_HEADER_SIZE; - build.BuildHeader(m_send, header_size); - build.BuildFields(m_send, header_size); + if( !build.BuildRecord(send, header_size, ic) ) + return false; // no data available size_t total_size = m_send.GetSize(); // fill in the header values MAKE_PACKETPTR_BUF(cpack, m_send.GetBuffer(total_size)); Protocol::Packet &packet = *cpack; - // socket class should override this for us -// packet.socket = htobs(m_con.m_socket->GetSocket()); + // socket class sets socket for us packet.size = htobs(total_size); packet.command = SB_COMMAND_DB_DATA; packet.u.db.tableCmd = m_con.GetDBCommand(Mode::Desktop::DatabaseAccess); packet.u.db.u.command.operation = SB_DBOP_SET_RECORD; packet.u.db.u.command.databaseId = htobs(dbId); - packet.u.db.u.command.u.tag_upload.rectype = build.GetRecType(); - packet.u.db.u.command.u.tag_upload.uniqueId = htobl(build.GetUniqueId()); + packet.u.db.u.command.u.tag_upload.rectype = send.GetRecType(); + packet.u.db.u.command.u.tag_upload.uniqueId = htobl(send.GetUniqueId()); packet.u.db.u.command.u.tag_upload.unknown2 = 1; // unknown observed value m_send.ReleaseBuffer(total_size); @@ -423,8 +456,8 @@ unsigned int DBPacket::ReturnCode() const { if( Command() == SB_COMMAND_DB_DONE ) { - Protocol::CheckSize(m_receive, SB_PACKET_DBACCESS_HEADER_SIZE + SB_DBACCESS_RETURN_CODE_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_PACKET_DBACCESS_HEADER_SIZE + SB_DBACCESS_RETURN_CODE_SIZE); + MAKE_PACKET(rpack, *m_receive); return rpack->u.db.u.return_code; } else { @@ -441,8 +474,8 @@ /// unsigned int DBPacket::DBOperation() const { - Protocol::CheckSize(m_receive, SB_PACKET_RESPONSE_HEADER_SIZE); - MAKE_PACKET(rpack, m_receive); + Protocol::CheckSize(*m_receive, SB_PACKET_RESPONSE_HEADER_SIZE); + MAKE_PACKET(rpack, *m_receive); return rpack->u.db.u.response.operation; } @@ -456,27 +489,59 @@ /// \returns bool true - packet was recognized and parse was attempted /// false - packet was not recognized /// -bool DBPacket::Parse(Parser &parser) +bool DBPacket::Parse(Parser &parser, const std::string &dbname, + const IConverter *ic) { size_t offset = 0; - MAKE_PACKET(rpack, m_receive); + MAKE_PACKET(rpack, *m_receive); switch( m_last_dbop ) { case SB_DBOP_OLD_GET_RECORDS: case SB_DBOP_GET_RECORD_BY_INDEX: - parser.Clear(); + offset = SB_PACKET_RESPONSE_HEADER_SIZE + DBR_OLD_TAGGED_RECORD_HEADER_SIZE; + Protocol::CheckSize(*m_receive, offset); + + // FIXME - this may need adjustment for email records... they + // don't seem to have uniqueID's + { + DBData block(DBData::REC_VERSION_1, dbname, + rpack->u.db.u.response.u.tagged.rectype, + btohl(rpack->u.db.u.response.u.tagged.uniqueId), + offset, *m_receive, false); + parser.ParseRecord(block, ic); + } + return true; + + default: // unknown command + return false; + } +} + +// +// ParseMeta +// +/// Fills DBData's meta data based on its data block, and the last dbop. +/// +bool DBPacket::ParseMeta(DBData &data) +{ + size_t offset = 0; + MAKE_PACKET(rpack, data.GetData()); + + switch( m_last_dbop ) + { + case SB_DBOP_OLD_GET_RECORDS: + case SB_DBOP_GET_RECORD_BY_INDEX: + data.SetVersion(DBData::REC_VERSION_1); offset = SB_PACKET_RESPONSE_HEADER_SIZE + DBR_OLD_TAGGED_RECORD_HEADER_SIZE; - Protocol::CheckSize(m_receive, offset); + Protocol::CheckSize(data.GetData(), offset); + data.SetOffset(offset); + // FIXME - this may need adjustment for email records... they // don't seem to have uniqueID's - parser.SetIds(rpack->u.db.u.response.u.tagged.rectype, + data.SetIds(rpack->u.db.u.response.u.tagged.rectype, btohl(rpack->u.db.u.response.u.tagged.uniqueId)); - - parser.ParseHeader(m_receive, offset); - parser.ParseFields(m_receive, offset); - parser.Store(); return true; default: // unknown command @@ -484,5 +549,357 @@ } } + + +////////////////////////////////////////////////////////////////////////////// +// JLPacket class + +JLPacket::JLPacket(Data &cmd, Data &send, Data &receive) + : Packet(send, receive) + , m_cmd(cmd) + , m_data(send) + , m_last_set_size(0) +{ +} + +JLPacket::~JLPacket() +{ +} + +unsigned int JLPacket::Size() +{ + Protocol::CheckSize(*m_receive, SB_JLPACKET_HEADER_SIZE + SB_JLRESPONSE_HEADER_SIZE); + MAKE_JLPACKET(rpack, *m_receive); + return btohs(rpack->u.response.expect); +} + + +// returns 1 or 2 depending on whether cmd or cmd+send are available +int JLPacket::SimpleCmd(uint8_t cmd, uint8_t unknown, uint16_t size) +{ + MAKE_JLPACKETPTR_BUF(cpack, m_cmd.GetBuffer(8)); + Protocol::JLPacket &packet = *cpack; + + // socket class sets socket for us + packet.size = htobs(8); + packet.u.command.command = cmd; + packet.u.command.unknown = unknown; + packet.u.command.size = htobs(size); + + m_cmd.ReleaseBuffer(8); + + return m_last_set_size = 1; +} + +int JLPacket::SimpleData(const void *data, uint16_t size) +{ + uint16_t total = size + 4; + + MAKE_JLPACKETPTR_BUF(dpack, m_data.GetBuffer(total)); + + // socket class sets socket for us + dpack->size = htobs(total); + memcpy(dpack->u.raw, data, size); + + m_data.ReleaseBuffer(total); + + return m_last_set_size = 2; +} + +int JLPacket::BigEndianData(uint16_t value) +{ + value = be_htobs(value); + return SimpleData(&value, sizeof(value)); +} + +int JLPacket::BigEndianData(uint32_t value) +{ + value = be_htobl(value); + return SimpleData(&value, sizeof(value)); +} + +int JLPacket::SetUnknown1() +{ + SimpleCmd(SB_COMMAND_JL_SET_UNKNOWN1, 0, 1); + uint8_t arg = 0; + return SimpleData(&arg, 1); +} + +int JLPacket::SetCodFilename(const std::string &filename) +{ + SimpleCmd(SB_COMMAND_JL_SET_COD_FILENAME, 0, filename.size()); + return SimpleData(filename.data(), filename.size()); +} + +int JLPacket::SetCodSize(off_t size) +{ + SimpleCmd(SB_COMMAND_JL_SET_COD_SIZE, 1, 4); + return BigEndianData((uint32_t)size); +} + +int JLPacket::SetTime(time_t when) +{ + SimpleCmd(SB_COMMAND_JL_SET_TIME, 0, 4); + return BigEndianData((uint32_t)when); +} + +int JLPacket::GetSubDir(uint16_t id) +{ + SimpleCmd(SB_COMMAND_JL_GET_SUBDIR, 0, 2); + return BigEndianData(id); +} + +int JLPacket::GetDirEntry(uint8_t entry_cmd, uint16_t id) +{ + SimpleCmd(entry_cmd, 0, 2); + return BigEndianData(id); +} + +int JLPacket::GetScreenshot() +{ + SimpleCmd(SB_COMMAND_JL_GET_SCREENSHOT, 0, 4); + return BigEndianData((uint32_t) 0); +} + +int JLPacket::Erase(uint16_t cmd, uint16_t id) +{ + SimpleCmd(cmd, 0, 2); + return BigEndianData(id); +} + +int JLPacket::GetEventlogEntry(uint16_t entry_num) +{ + SimpleCmd(SB_COMMAND_JL_GET_LOG_ENTRY, 0, 2); + return BigEndianData(entry_num); +} + +int JLPacket::SaveModule(uint16_t id) +{ + SimpleCmd(SB_COMMAND_JL_SAVE_MODULE, 0, 2); + return BigEndianData(id); +} + +int JLPacket::PutData(const void *data, uint16_t size) +{ + SimpleCmd(SB_COMMAND_JL_SEND_DATA, 0, size); + return SimpleData(data, size); +} + + +////////////////////////////////////////////////////////////////////////////// +// JVMPacket class + +JVMPacket::JVMPacket(Data &send, Data &receive) + : Packet(send, receive) + , m_cmd(send) +{ +} + +JVMPacket::~JVMPacket() +{ +} + + +unsigned int JVMPacket::Size() +{ + MAKE_JVMPACKET(rpack, *m_receive); + Protocol::CheckSize(*m_receive, SB_JVMPACKET_HEADER_SIZE + sizeof(rpack->u.expect)); + return be_btohs(rpack->u.expect); +} + + +// Command format (param is optionnal) : +// 00000000: 05 00 07 00 00 01 8a +// ^^ : command +// ^^^^^ : size of commd + param +// ^^^^^ : packet size +// ^^^^^ : socket ID +void JVMPacket::SimpleCmd(uint8_t cmd) +{ + // 4 : socket id field + packet size field + // 2 : size field + // 1 : command field + const uint16_t total = 4 + 2 + 1; + + MAKE_JVMPACKETPTR_BUF(cpack, m_cmd.GetBuffer(total)); + Protocol::JVMPacket &packet = *cpack; + + // socket class sets socket for us + packet.size = htobs(total); + packet.u.command.size = be_htobs(1); + packet.u.command.command = cmd; + + m_cmd.ReleaseBuffer(total); +} + +// Command with parameter format : +// 00000000: 05 00 0b 00 00 05 8d 00 00 00 00 +// ^^^^^^^^^^^ : param +// ^^ : command +// ^^^^^ : size of commd + param +// ^^^^^ : packet size +// ^^^^^ : socket ID +void JVMPacket::ComplexCmd(uint8_t cmd, const void *param, uint16_t size) +{ + // 4 : socket id field + packet size field + // 2 : size field + // 1 : command field + uint16_t total = 4 + 2 + 1 + size; + + MAKE_JVMPACKETPTR_BUF(cpack, m_cmd.GetBuffer(total)); + Protocol::JVMPacket &packet = *cpack; + + // socket class sets socket for us + packet.size = htobs(total); + packet.u.command.size = be_htobs(1 + size); + packet.u.command.command = cmd; + + if ((size > 0) && (param != NULL)) + memcpy(cpack->u.command.raw, param, size); + + m_cmd.ReleaseBuffer(total); +} + + +void JVMPacket::Unknown01() { + SimpleCmd(SB_COMMAND_JVM_UNKNOWN01); +} + + +void JVMPacket::Unknown02() { + SimpleCmd(SB_COMMAND_JVM_UNKNOWN02); +} + + +void JVMPacket::Unknown03() { + SimpleCmd(SB_COMMAND_JVM_UNKNOWN03); +} + + +void JVMPacket::Unknown04() { + SimpleCmd(SB_COMMAND_JVM_UNKNOWN04); +} + + +void JVMPacket::Unknown05() { + SimpleCmd(SB_COMMAND_JVM_UNKNOWN05); +} + + +void JVMPacket::Unknown06() { + uint32_t param = 0; + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN06, ¶m, sizeof(param)); +} + + +void JVMPacket::Unknown07() { + uint32_t param = 0; + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN07, ¶m, sizeof(param)); +} + + +void JVMPacket::Unknown08() { + uint32_t param = 0; + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN08, ¶m, sizeof(param)); +} + + +void JVMPacket::Unknown09() { + uint32_t param = be_htobl(0x09); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN09, ¶m, sizeof(param)); +} + + +void JVMPacket::Unknown10() { + uint32_t param = be_htobl(0x01); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN10, ¶m, sizeof(param)); +} + + +void JVMPacket::Unknown11(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN11, &id, sizeof(id)); +} + + +void JVMPacket::Unknown12(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN12, &id, sizeof(id)); +} + + +void JVMPacket::Unknown13(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN13, &id, sizeof(id)); +} + + +void JVMPacket::Unknown14(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN14, &id, sizeof(id)); +} + + +void JVMPacket::Unknown15(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_UNKNOWN15, &id, sizeof(id)); +} + + +void JVMPacket::GetModulesList(uint32_t id) { + id = be_htobl(id); + + ComplexCmd(SB_COMMAND_JVM_GET_MODULES_LIST, &id, sizeof(id)); +} + + +void JVMPacket::GetThreadsList() { + SimpleCmd(SB_COMMAND_JVM_GET_THREADS_LIST); +} + + +void JVMPacket::GetConsoleMessage() { + SimpleCmd(SB_COMMAND_JVM_GET_CONSOLE_MSG); +} + + +void JVMPacket::Go() +{ + SimpleCmd(SB_COMMAND_JVM_GO); +} + + +void JVMPacket::Stop() +{ + // 4 : socket id field + packet size field + // 2 : value field + const uint16_t total = 4 + 2; + + MAKE_JVMPACKETPTR_BUF(cpack, m_cmd.GetBuffer(total)); + Protocol::JVMPacket &packet = *cpack; + + // socket class sets socket for us + packet.size = htobs(total); + packet.u.value = be_htobs(SB_COMMAND_JVM_STOP); + + m_cmd.ReleaseBuffer(total); +} + + +void JVMPacket::GetStatus() +{ + SimpleCmd(SB_COMMAND_JVM_GET_STATUS); +} + } // namespace Barry diff -Nru barry-0.14/src/packet.h barry-0.0.20110506/src/packet.h --- barry-0.14/src/packet.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/packet.h 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,7 +24,10 @@ #ifndef __BARRY_PACKET_H__ #define __BARRY_PACKET_H__ +#include #include +#include "protocol.h" +#include "data.h" namespace Barry { class Data; } @@ -35,27 +38,36 @@ class Builder; class SocketZero; class Socket; +class IConverter; namespace Mode { class Desktop; + class JavaLoader; } class Packet { friend class SocketZero; - friend class Socket; + friend class SocketBase; protected: - Data &m_send, &m_receive; + Data &m_send; + Data *m_receive; Data& GetSend() { return m_send; } - Data& GetReceive() { return m_receive; } + Data& GetReceive() { return *m_receive; } public: Packet(Data &send, Data &receive) - : m_send(send), m_receive(receive) + : m_send(send), m_receive(&receive) {} virtual ~Packet() {} + // allow user to override the receive buffer for + // optimization purposes, to reduce copies... be + // careful with this, since this new Data object + // must outlive any usage of it via this Packet class + void SetNewReceive(Data &receive) { m_receive = &receive; } + ////////////////////////////////// // common response analysis @@ -69,7 +81,7 @@ /// This class relies on 2 external objects: a send and receive Data buffer. /// /// Note that the receive buffer may be modified -/// during a packet send, and this DBPacket class provides API helpers +/// during a packet send, and this class provides API helpers /// to analyze the results. /// class ZeroPacket : public Packet @@ -87,6 +99,8 @@ // packet building void GetAttribute(unsigned int object, unsigned int attribute); + void Echo(uint64_t us_ticks); + void Reset(); ////////////////////////////////// @@ -98,6 +112,7 @@ unsigned int RemainingTries() const; unsigned int SocketResponse() const; unsigned char SocketSequence() const; + uint8_t CommandResponse() const; }; @@ -143,9 +158,9 @@ void SetRecordFlags(unsigned int dbId, unsigned int stateTableIndex, uint8_t flag1); void DeleteRecordByIndex(unsigned int dbId, unsigned int stateTableIndex); void GetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex); - bool SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex, Builder &build); + bool SetRecordByIndex(unsigned int dbId, unsigned int stateTableIndex, Builder &build, const IConverter *ic); void GetRecords(unsigned int dbId); - bool SetRecord(unsigned int dbId, Builder &build); + bool SetRecord(unsigned int dbId, Builder &build, const IConverter *ic); ////////////////////////////////// @@ -155,11 +170,157 @@ unsigned int ReturnCode() const; // throws FIXME if packet doesn't support it unsigned int DBOperation() const; // throws Error on size trouble - bool Parse(Parser &parser); // switches based on last m_send command + bool Parse(Parser &parser, const std::string &dbname, + const IConverter *ic); // switches based on last m_send command + bool ParseMeta(DBData &data); // response parsers }; + +// +// JLPacket class +// +/// Provides an API for building and analyzing raw Javaloader protocol packets. +/// This class relies on 3 external objects: +/// a command send Data buffer (which can be fairly small), a data +/// or argument send Data buffer, and a receive data buffer. Socket and +/// connection details are retrieved on a readonly basis from the +/// Mode::JavaLoader object, but all buffers can be modified. +/// +/// Note that the receive buffer may be modified +/// during a packet send, and this JLPacket class provides API helpers +/// to analyze the results. +/// +class JLPacket : public Packet +{ + friend class SocketBase; + +private: + Data &m_cmd, &m_data; + int m_last_set_size; + +public: + JLPacket(Data &cmd, Data &send, Data &receive); + ~JLPacket(); + + ////////////////////////////////// + // meta access + + bool HasData() const { return m_last_set_size == 2; } + Data& GetReceive() { return *m_receive; } + + ////////////////////////////////// + // packet building + + // commands that correspond to the operation + // constants in protocol.h + + // returns 1 or 2 depending on whether cmd or cmd+send are available + int SimpleCmd(uint8_t cmd, uint8_t unknown = 0, uint16_t size = 0); + int SimpleData(const void *data, uint16_t size); + int BigEndianData(uint16_t value); + int BigEndianData(uint32_t value); + + int Hello() { return SimpleCmd(SB_COMMAND_JL_HELLO); } + int Goodbye() { return SimpleCmd(SB_COMMAND_JL_GOODBYE); } + int SetUnknown1(); + int SetCodFilename(const std::string &filename); + int SetCodSize(off_t size); + int SetTime(time_t when); + int GetScreenshot(); + int GetData() { return SimpleCmd(SB_COMMAND_JL_SEND_DATA); } + int DeviceInfo() { return SimpleCmd(SB_COMMAND_JL_DEVICE_INFO); } + int OsMetrics() { return SimpleCmd(SB_COMMAND_JL_OS_METRICS); } + int BootromMetrics() { return SimpleCmd(SB_COMMAND_JL_BOOTROM_METRICS); } + int GetDirectory() { return SimpleCmd(SB_COMMAND_JL_GET_DIRECTORY); } + int GetSubDir(uint16_t id); + int GetDirEntry(uint8_t entry_cmd, uint16_t id); + int Erase(uint16_t cmd, uint16_t id); + int GetEventlog() { return SimpleCmd(SB_COMMAND_JL_GET_LOG); } + int GetEventlogEntry(uint16_t entry_num); + int ClearEventlog() { return SimpleCmd(SB_COMMAND_JL_CLEAR_LOG); } + int SaveModule(uint16_t id); + int PutData(const void *data, uint16_t size); + int WipeApps() { return SimpleCmd(SB_COMMAND_JL_WIPE_APPS); } + int WipeFs() { return SimpleCmd(SB_COMMAND_JL_WIPE_FS); } + int LogStackTraces() { return SimpleCmd(SB_COMMAND_JL_LOG_STRACES); } + int ResetToFactory() { return SimpleCmd(SB_COMMAND_JL_RESET_FACTORY); } + + ////////////////////////////////// + // response analysis + unsigned int Size(); +}; + + +// +// JVMPacket class +// +/// Provides an API for building and analyzing raw JavaDebug protocol packets. +/// This class relies on 3 external objects: +/// a command send Data buffer (which can be fairly small), a data +/// or argument send Data buffer, and a receive data buffer. Socket and +/// connection details are retrieved on a readonly basis from the +/// Mode::JavaDebug object, but all buffers can be modified. +/// +/// Note that the receive buffer may be modified +/// during a packet send, and this JVMPacket class provides API helpers +/// to analyze the results. +/// +class JVMPacket : public Packet +{ + friend class SocketBase; + +private: + Data &m_cmd; + +public: + JVMPacket(Data &cmd, Data &receive); + ~JVMPacket(); + + ////////////////////////////////// + // meta access + + Data& GetReceive() { return *m_receive; } + + ////////////////////////////////// + // packet building + + // commands that correspond to the operation + // constants in protocol.h + + // returns 1 or 2 depending on whether cmd or cmd+send are available + void SimpleCmd(uint8_t cmd); + void ComplexCmd(uint8_t cmd, const void *param, uint16_t size = 0); + + void Unknown01(); // Command 0x53 + void Unknown02(); // Command 0x01 + void Unknown03(); // Command 0x6f + void Unknown04(); // Command 0x8a + void Unknown05(); // Command 0x90 + void Unknown06(); // Command 0x44 + void Unknown07(); // Command 0x45 + void Unknown08(); // Command 0x54 + void Unknown09(); // Command 0x33 + void Unknown10(); // Command 0x46 + void Unknown11(uint32_t id); // Command 0x0e + void Unknown12(uint32_t id); // Command 0x50 + void Unknown13(uint32_t id); // Command 0x0d + void Unknown14(uint32_t id); // Command 0x85 + void Unknown15(uint32_t id); // Command 0x84 + void GetModulesList(uint32_t id); // Command 0x8d + void GetThreadsList(); // Command 0x08 + void GetConsoleMessage(); + void Go(); // Command mal formed :) + void Stop(); // Command 0x02 + void GetStatus(); // Command 0x06 + + ////////////////////////////////// + // response analysis + unsigned int Size(); +}; + + } // namespace Barry #endif diff -Nru barry-0.14/src/parser.cc barry-0.0.20110506/src/parser.cc --- barry-0.14/src/parser.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/parser.cc 2011-05-06 12:20:17.000000000 +0000 @@ -1,11 +1,10 @@ /// /// \file parser.cc -/// Virtual parser functor class. Also, all protocol-specific -/// parser code goes in here. +/// Virtual parser wrapper /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -21,11 +20,266 @@ */ #include "parser.h" -#include "protocol.h" -#include "protostructs.h" +#include "r_calendar.h" +#include "r_calllog.h" +#include "r_bookmark.h" +#include "r_contact.h" +#include "r_memo.h" +#include "r_message.h" +#include "r_servicebook.h" +#include "r_task.h" +#include "r_pin_message.h" +#include "r_saved_message.h" +#include "r_sms.h" +#include "r_folder.h" +#include "r_timezone.h" +#include "r_cstore.h" +#include "r_hhagent.h" + +#include +#include + +using namespace std; namespace Barry { +////////////////////////////////////////////////////////////////////////////// +// HexDumpParser class + +HexDumpParser::HexDumpParser(std::ostream &os) + : m_os(os) +{ +} + +void HexDumpParser::ParseRecord(const Barry::DBData &data, + const IConverter *ic) +{ + if( m_last_dbname != data.GetDBName() ) { + m_os << "Records for database: " << data.GetDBName() << endl; + m_last_dbname = data.GetDBName(); + } + + m_os << "Raw record dump for record: 0x" + << hex << data.GetUniqueId() + << ", type: 0x" << hex << (unsigned int) data.GetRecType() + << ", offset: 0x" << hex << data.GetOffset() + << endl; + m_os << data.GetData() << endl; +} + + +////////////////////////////////////////////////////////////////////////////// +// MultiRecordParser class + +// takes ownership of default_parser! +MultiRecordParser::MultiRecordParser(Parser *default_parser) + : m_delete_default(default_parser) // takes ownership + , m_default(default_parser) +{ +} + +// does not take ownership of the default_parser +MultiRecordParser::MultiRecordParser(Parser &default_parser) + : m_delete_default(0) // no ownership of reference + , m_default(&default_parser) +{ +} + +MultiRecordParser::~MultiRecordParser() +{ + map_type::iterator i = m_parsers.begin(); + for( ; i != m_parsers.end(); ++i ) { + delete i->second; + } + + // and the default parser + delete m_delete_default; +} + +void MultiRecordParser::Add(const std::string &dbname, Parser *parser) +{ + std::auto_ptr p(parser); + + map_type::iterator i = m_parsers.find(dbname); + if( i != m_parsers.end() ) { + // found existing parser, so delete it first + delete i->second; + + // assign it + i->second = p.release(); + } + else { + m_parsers[dbname] = p.get(); + p.release(); + } +} + +// takes ownership of parser! +void MultiRecordParser::Add(RecordParserBase *parser) +{ + std::auto_ptr p(parser); + std::string name = parser->GetDBName(); + Add(name, p.release()); +} + +bool MultiRecordParser::Add(const std::string &dbname, + std::ostream &os) +{ + std::auto_ptr p; + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) if( dbname == tname::GetDBName() ) { p.reset( new RecordParser > (new DumpStore(os)) ); } + + // check for recognized database names + ALL_KNOWN_PARSER_TYPES + + if( !p.get() ) { + // name not known + return false; + } + + Add(dbname, p.release()); + return true; +} + +bool MultiRecordParser::Add(const std::string &dbname, AllRecordStore &store) +{ +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + if( dbname == tname::GetDBName() ) { \ + Add(dbname, new RecordParser(store)); \ + return true; \ + } + + // check for recognized database names + ALL_KNOWN_PARSER_TYPES + + // if we get here, record was not found + return false; +} + +// Parser overrides +void MultiRecordParser::ParseRecord(const DBData &data, const IConverter *ic) +{ + // search for a named parser + map_type::iterator i = m_parsers.find(data.GetDBName()); + if( i != m_parsers.end() ) { + // found one, use it + i->second->ParseRecord(data, ic); + } + else if( m_default ) { + // use default parser + m_default->ParseRecord(data, ic); + } +} + + +////////////////////////////////////////////////////////////////////////////// +// AllRecordDumpStore class + +// Use the macro here to implement the overrides, so that +// the compiler will catch if we are missing any. +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + void AllRecordDumpStore::operator() (const Barry::tname &r) \ + { \ + m_os << r << std::endl; \ + } + +ALL_KNOWN_PARSER_TYPES + + +////////////////////////////////////////////////////////////////////////////// +// AllRecordDumpParser class + +AllRecordParser::AllRecordParser(std::ostream &os, + Parser *default_parser, + AllRecordStore *store) + : MultiRecordParser(default_parser) + , m_store(store) // takes ownership here +{ + AddRecords(&os, store); +} + +// does not take ownership of default_parser or store +AllRecordParser::AllRecordParser(Parser &default_parser, AllRecordStore &store) + : MultiRecordParser(default_parser) + , m_store(0) +{ + AddRecords(0, &store); +} + +AllRecordParser::~AllRecordParser() +{ + delete m_store; +} + +void AllRecordParser::AddRecords(std::ostream *os, AllRecordStore *store) +{ + // Does not allow RecordParser<> to own store, since we're using + // it multiple times as the same store for each record type. +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + if( store ) { \ + Add( new RecordParser(*store)); \ + } else if( os ) { \ + Add(tname::GetDBName(), *os); \ + } + + ALL_KNOWN_PARSER_TYPES; +} + + +////////////////////////////////////////////////////////////////////////////// +// TeeParser class + +TeeParser::TeeParser() +{ +} + +TeeParser::~TeeParser() +{ + // free all the owned parser pointers + for( parser_list_type::iterator i = m_owned_parsers.begin(); + i != m_owned_parsers.end(); + ++i ) + { + delete *i; + } +} + +// takes ownership of the pointer! +void TeeParser::Add(Parser *p) +{ + std::auto_ptr ap(p); + m_owned_parsers.push_back(ap.get()); + ap.release(); +} + +// does NOT take ownership +void TeeParser::Add(Parser &p) +{ + m_external_parsers.push_back(&p); +} + +void TeeParser::ParseRecord(const DBData &data, const IConverter *ic) +{ + // call all owned parsers + for( parser_list_type::iterator i = m_owned_parsers.begin(); + i != m_owned_parsers.end(); + ++i ) + { + (*i)->ParseRecord(data, ic); + } + + // call all external parsers + for( parser_list_type::iterator i = m_external_parsers.begin(); + i != m_external_parsers.end(); + ++i ) + { + (*i)->ParseRecord(data, ic); + } +} } // namespace Barry diff -Nru barry-0.14/src/parser.h barry-0.0.20110506/src/parser.h --- barry-0.14/src/parser.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/parser.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,53 +26,228 @@ #include "data.h" #include "protocol.h" #include // for uint32_t +#include +#include // forward declarations -namespace Barry { class Data; } +namespace Barry { + class IConverter; + class Contact; + class Message; + class Calendar; + class CalendarAll; + class CallLog; + class Bookmark; + class ServiceBook; + class Memo; + class Task; + class PINMessage; + class SavedMessage; + class Sms; + class Folder; + class Timezone; + class ContentStore; + class HandheldAgent; +} + +// +// This macro can be used to automatically generate code for all known +// record types. Just #undef HANDLE_PARSER, then #define it to whatever +// you need, then use ALL_KNOWN_PARSER_TYPES. See parser.cc for +// various examples. +// +// These are sorted so their GetDBName()'s will display in alphabetical order. +// +#define ALL_KNOWN_PARSER_TYPES \ + HANDLE_PARSER(Contact) \ + HANDLE_PARSER(Bookmark) \ + HANDLE_PARSER(Calendar) \ + HANDLE_PARSER(CalendarAll) \ + HANDLE_PARSER(ContentStore) \ + HANDLE_PARSER(Folder) \ + HANDLE_PARSER(HandheldAgent) \ + HANDLE_PARSER(Memo) \ + HANDLE_PARSER(Message) \ + HANDLE_PARSER(CallLog) \ + HANDLE_PARSER(PINMessage) \ + HANDLE_PARSER(SavedMessage) \ + HANDLE_PARSER(ServiceBook) \ + HANDLE_PARSER(Sms) \ + HANDLE_PARSER(Task) \ + HANDLE_PARSER(Timezone) namespace Barry { -// also acts as a null parser // // Parser class // -/// Base class for the parser hierarchy. If in debug mode, this -/// class can be used as a null parser. Call Init() and the protocol -/// will be dumped to stdout and no parsing will be done. +/// Base class for the parser hierarchy. /// /// This class provides the interface that the Controller class uses /// to pass raw data it reads from the device. The Controller, along /// with the Packet class, calls each of the virtual functions below /// in the same order. /// +/// This class is kept as a pure abstract class, in order to make sure +/// that the compiler will catch any API changes, for code derived +/// from it. +/// class BXEXPORT Parser { public: Parser() {} virtual ~Parser() {} - /// Reset and prepare for a new raw data packet - virtual void Clear() {} + /// Called to parse sub fields in the raw data packet. + virtual void ParseRecord(const DBData &data, const IConverter *ic) = 0; +}; - /// Stores the IDs - virtual void SetIds(uint8_t RecType, uint32_t UniqueId) {} - /// Called to parse the header portion of the raw data packet. - /// data contains the entire packet, and offset contains the - /// location at which to start parsing. - virtual void ParseHeader(const Data &data, size_t &offset) {} +// +// NullParser class +// +/// If in debug mode, this class can be used as a null parser. +/// Call Init() and the protocol will be dumped to stdout and +/// no parsing will be done. +/// +/// Do NOT derive your own personal parser classes from this, +/// unless you are perfectly confident that you will catch +/// future API changes on the devel tree without the compiler's +/// help. +/// +class BXEXPORT NullParser : public Parser +{ +public: + NullParser() {} + virtual ~NullParser() {} - /// Called to parse sub fields in the raw data packet. - /// The same data is passed as was passed in ParseHeader, - /// only the offset will be updated if it was advanced during - /// the header parsing. - virtual void ParseFields(const Data &data, size_t &offset) {} - - /// Called at the very end of record parsing, and used to - /// store the final packet somewhere, either in memory, disk, etc. - virtual void Store() {} + virtual void ParseRecord(const DBData &data, const IConverter *ic) {} +}; + +// +// HexDumpParser +// +/// Dumps raw hex of the given DBData to the given stream. +/// +/// Do NOT derive your own personal parser classes from this, +/// unless you are perfectly confident that you will catch +/// future API changes on the devel tree without the compiler's +/// help. +/// +class BXEXPORT HexDumpParser : public Parser +{ + std::ostream &m_os; + std::string m_last_dbname; + +public: + explicit HexDumpParser(std::ostream &os); + + virtual void ParseRecord(const Barry::DBData &data, + const IConverter *ic); +}; + +// +// RecordParserBase +// +/// Abstract base class for the following RecordParser template, that exposes +/// some information on the specifics that the record parser can handle. +/// Specifically, it exposes the database name it is able to parse +/// +class BXEXPORT RecordParserBase : public Parser +{ +public: + // These functions are always valid, regardless of the + // state of the parser. + virtual const char * GetDBName() const = 0; + virtual uint8_t GetDefaultRecType() const = 0; + + // These functions depend on the parser having just parsed + // a record successfully. + virtual bool IsRecordValid() const = 0; + virtual uint8_t GetRecType() const = 0; + virtual uint32_t GetUniqueId() const = 0; + virtual void Dump(std::ostream &os) const = 0; +}; + + +// +// Note: Store classes take parsed Record objects as a functor. +// Parser classes deal with raw data, while Store classes deal with +// parsed Record objects. +// + +// +// NullStore +// +/// A Storage class for RecordParser<> that does nothing, for the cases +/// where you only want to dump parsed record data to a stream. +/// +template +class NullStore +{ +public: + void operator() (const RecordT &r) + { + } }; +// +// DumpStore +// +/// A Storage class for RecordParser<> that dumps the parsed record data +/// to the given stream. +/// +template +class DumpStore +{ + std::ostream &m_os; + +public: + explicit DumpStore(std::ostream &os) + : m_os(os) + { + } + + void operator() (const RecordT &r) + { + r.Dump(m_os); + } +}; + +// +// RecordStore +// +/// A Storage class for RecordParser that stores a copy of the parsed record. +/// +template +class RecordStore +{ +public: + RecordT m_rec; + + void operator() (const RecordT &r) + { + m_rec = r; + } +}; + +// +// ParseDBData +// +/// Contains the proper way to convert a DBData object into a record. +/// +template +void ParseDBData(const DBData &data, RecordT &rec, const IConverter *ic) +{ + // start fresh + rec = RecordT(); + + // parse + rec.SetIds(data.GetRecType(), data.GetUniqueId()); + size_t offset = data.GetOffset(); + rec.ParseHeader(data.GetData(), offset); + rec.ParseFields(data.GetData(), offset, ic); +} // // RecordParser template class @@ -108,23 +283,32 @@ /// /// template -class RecordParser : public Parser +class RecordParser : public RecordParserBase { StorageT *m_store; bool m_owned; RecordT m_rec; + bool m_record_valid; public: /// Constructor that references an externally managed storage object. RecordParser(StorageT &storage) - : m_store(&storage), m_owned(false) {} + : m_store(&storage) + , m_owned(false) + , m_record_valid(false) + { + } /// Constructor that references a locally managed storage object. /// The pointer passed in will be stored, and freed when this class /// is destroyed. It is safe to call this constructor with /// a 'new'ly created storage object. - RecordParser(StorageT *storage) - : m_store(storage), m_owned(true) {} + RecordParser(StorageT *storage = 0) + : m_store(storage) + , m_owned(true) + , m_record_valid(false) + { + } ~RecordParser() { @@ -132,30 +316,258 @@ delete m_store; } - virtual void Clear() + virtual StorageT* GetStore() + { + return m_store; + } + + virtual const StorageT* GetStore() const + { + return m_store; + } + + virtual void ParseRecord(const DBData &data, const IConverter *ic) + { + m_record_valid = false; + ParseDBData(data, m_rec, ic); + m_record_valid = true; + + if( m_store ) + (*m_store)(m_rec); + } + + // + // RecordParserBase overrides + // + + // These functions are always valid, regardless of the + // state of the parser. + virtual const char * GetDBName() const + { + return RecordT::GetDBName(); + } + + virtual uint8_t GetDefaultRecType() const + { + return RecordT::GetDefaultRecType(); + } + + // These functions depend on the parser having just parsed + // a record successfully. + virtual bool IsRecordValid() const + { + return m_record_valid; + } + + virtual const RecordT& GetRecord() const + { + return m_rec; + } + + virtual uint8_t GetRecType() const + { + return m_rec.GetRecType(); + } + + virtual uint32_t GetUniqueId() const { - m_rec = RecordT(); + return m_rec.GetUniqueId(); } - virtual void SetIds(uint8_t RecType, uint32_t UniqueId) + virtual void Dump(std::ostream &os) const + { + m_rec.Dump(os); + } +}; + +// +// AllRecordStore +// +/// Base class with overloaded functor behaviour for all available +/// record classes. To be used with AllRecordParser. +/// +class BXEXPORT AllRecordStore +{ +public: + AllRecordStore() {} + virtual ~AllRecordStore() {} + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + virtual void operator() (const Barry::tname &) = 0; + + ALL_KNOWN_PARSER_TYPES +}; + +// +// MultiRecordParser +// +/// Container parser class that accepts multiple Parser objects +/// (often RecordParser<> objects but they don't have to be) and +/// automatically routes incoming records to the appropriate parser. +/// Note that this container owns *all* Parser objects, and will +/// free them upon destruction. +/// +/// Incoming records that have no matching parser are passed to the +/// default parser object, if one exists, otherwise they are dropped +/// silently. The default parser object is also owned by the container, +/// and will be freed on destruction. +/// +/// Do NOT derive your own personal parser classes from this, +/// unless you are perfectly confident that you will catch +/// future API changes on the devel tree without the compiler's +/// help. +/// +class BXEXPORT MultiRecordParser : public Parser +{ + typedef std::map map_type; + + Parser *m_delete_default; // if set, will be freed + Parser *m_default; // used by all code for actual work + // and may or may not be "owned" by us + map_type m_parsers; + +public: + // takes ownership of default_parser! + explicit MultiRecordParser(Parser *default_parser = 0); + + // does not take ownership of the default_parser + explicit MultiRecordParser(Parser &default_parser); + + ~MultiRecordParser(); + + /// Adds given parser to list and takes ownership of it + void Add(const std::string &dbname, Parser *parser); + + /// Adds given parser to list and takes ownership of it + void Add(RecordParserBase *parser); + + /// Creates a RecordParser<> object using the given record + /// type and AllRecordStore. Does NOT take ownership of the + /// store object, since it can be used multiple times for + /// multiple records. + template + void Add(AllRecordStore &store) { - m_rec.SetIds(RecType, UniqueId); + Add( RecordT::GetDBName(), + new RecordParser(store) ); } - virtual void ParseHeader(const Data &data, size_t &offset) + /// Two helper template functions that create the RecordParser<> + /// automatically based on the function call. Both pointer and + /// reference versions. + template + void Add(StorageT *store) { - m_rec.ParseHeader(data, offset); + Add( RecordT::GetDBName(), + new RecordParser(store) ); } - virtual void ParseFields(const Data &data, size_t &offset) + template + void Add(StorageT &store) { - m_rec.ParseFields(data, offset); + Add( RecordT::GetDBName(), + new RecordParser(store) ); } - virtual void Store() + /// Creates a RecordParser<> object for the given database name, + /// using DumpStore<> with the given stream for the output, + /// and adds it to list. + /// Returns false if there is no known Record class for dbname. + bool Add(const std::string &dbname, std::ostream &os); + + /// Creates a RecordParser<> object for the given database name, + /// using the given store object. + /// Returns false if there is no known Record class for dbname. + bool Add(const std::string &dbname, AllRecordStore &store); + + // Parser overrides + virtual void ParseRecord(const DBData &data, const IConverter *ic); +}; + +// +// AllRecordDumpStore +// +/// Derived from AllRecordStore, which just calls each record's +/// Dump() member with the given stream. +/// +class BXEXPORT AllRecordDumpStore : public AllRecordStore +{ +protected: + std::ostream &m_os; + +public: + explicit AllRecordDumpStore(std::ostream &os) + : m_os(os) { - (*m_store)(m_rec); } + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + virtual void operator() (const Barry::tname &); + + ALL_KNOWN_PARSER_TYPES +}; + +// +// AllRecordParser +// +/// Convenience parser that creates a MultiRecordParser with all known +/// record parsers added. If an AllRecordStore pointer is passed in, +/// this class takes ownership of it, and uses it as the store object +/// for all the RecordParser<> objects it creates. If not, then +/// a custom DumpStore<> object is created with the given stream +/// for each RecordParser<> added. +/// +/// The default parser object behaves just like MultiRecordParser +/// +/// This class takes ownership of all pointers passed in. +/// +class BXEXPORT AllRecordParser : public MultiRecordParser +{ + AllRecordStore *m_store; + +protected: + // does not take ownership of store, by itself, + // but the constructor that calls it might + void AddRecords(std::ostream *os, AllRecordStore *store); + +public: + // takes ownership of default_parser and store! + explicit AllRecordParser(std::ostream &os, + Parser *default_parser = 0, + AllRecordStore *store = 0); + + // does not take ownership of default_parser or store + AllRecordParser(Parser &default_parser, AllRecordStore &store); + + ~AllRecordParser(); +}; + +// +// TeeParser +// +/// Sends incoming DBData objects to all the parsers in its list. +/// This parser container does NOT own the parsers added. +/// +class BXEXPORT TeeParser : public Parser +{ + typedef std::vector parser_list_type; + + parser_list_type m_external_parsers, m_owned_parsers; + +public: + TeeParser(); + ~TeeParser(); + + /// Adds parser to internal list, and takes ownership of the + /// pointer. + void Add(Parser *p); + + /// Adds parser to internal list. Does NOT own the parser reference. + void Add(Parser &p); + + void ParseRecord(const DBData &data, const IConverter *ic); }; } // namespace Barry diff -Nru barry-0.14/src/pin.cc barry-0.0.20110506/src/pin.cc --- barry-0.14/src/pin.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/pin.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,50 @@ +/// +/// \file pin.cc +/// class for device PIN notation +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include "pin.h" + +namespace Barry { + +std::ostream& operator<<(std::ostream &os, const Pin &pin) +{ + os << pin.Str(); + return os; +} + +std::istream& operator>>(std::istream &is, Pin &pin) +{ + uint32_t newpin; + is >> std::hex >> newpin; + if( is ) + pin = newpin; + return is; +} + +std::string Pin::Str() const +{ + std::ostringstream oss; + oss << std::hex << pin; + return oss.str(); +} + +} + diff -Nru barry-0.14/src/pin.h barry-0.0.20110506/src/pin.h --- barry-0.14/src/pin.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/pin.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,59 @@ +/// +/// \file pin.h +/// class for device PIN notation +/// + +/* + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PIN_H__ +#define __BARRY_PIN_H__ + +#include "dll.h" +#include +#include + +namespace Barry { + +class BXEXPORT Pin +{ + uint32_t pin; + +public: + Pin(uint32_t pin__ = 0) : pin(pin__) {} + + bool Valid() const { return pin != 0; } + void Clear() { pin = 0; } + std::string Str() const; + uint32_t Value() const { return pin; } + + Pin& operator=(uint32_t p) { pin = p; return *this; } + + bool operator==(uint32_t rhs) const { return pin == rhs; } + bool operator==(const Pin &rhs) const { return pin == rhs.pin; } + + bool operator!=(uint32_t rhs) const { return pin != rhs; } + bool operator!=(const Pin &rhs) const { return pin != rhs.pin; } +}; + +// no ostream operator, since we want to encourage users to call str()... +// but istream may be useful +BXEXPORT std::istream& operator>>(std::istream &is, Pin &pin); + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/pipe.cc barry-0.0.20110506/src/pipe.cc --- barry-0.14/src/pipe.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/pipe.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,64 @@ +/// +/// \file pipe.cc +/// Connector class to join parsers and builders together +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "pipe.h" + +namespace Barry { + +Pipe::Pipe(Builder &builder) + : m_builder(builder) +{ +} + +Pipe::~Pipe() +{ +} + +bool Pipe::PumpEntry(Parser &parser, const IConverter *ic) +{ + // if false, end of series, so pass that on to the caller + if( !m_builder.FetchRecord(m_buffer, ic) ) + return false; + + // pass the data into the parser + parser.ParseRecord(m_buffer, ic); + return true; +} + +/// Reads all items from builder, feeding them into the parser, +/// until the builder's Retrieve() signals the end of the series. +void Pipe::PumpSeries(Parser &parser, const IConverter *ic) +{ + while( PumpEntry(parser, ic) ) + ; +} + +/// Reads all series from the builder, feeding them into the parser, +/// until the builder's EndOfFile() is true. +void Pipe::PumpFile(Parser &parser, const IConverter *ic) +{ + while( !m_builder.EndOfFile() ) { + PumpSeries(parser, ic); + } +} + +} // namespace Barry + diff -Nru barry-0.14/src/pipe.h barry-0.0.20110506/src/pipe.h --- barry-0.14/src/pipe.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/pipe.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,67 @@ +/// +/// \file pipe.h +/// Connector class to join parsers and builders together +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PIPE_H__ +#define __BARRY_PIPE_H__ + +#include "dll.h" +#include "builder.h" +#include "parser.h" + +namespace Barry { + +// +// class Pipe +// +/// Reads data from a builder and feeds it into a parser. +/// +class BXEXPORT Pipe +{ + Builder &m_builder; + + DBData m_buffer; + +public: + explicit Pipe(Builder &builder); + ~Pipe(); + + /// Access the builder... mostly useful for finding out + /// the database name for the next series, if using multiple + /// parser objects. + const Builder& GetBuilder() const { return m_builder; } + + /// Reads one item from the builder and feeds it into the parser + /// and returns the builder Retrieve status. + bool PumpEntry(Parser &parser, const IConverter *ic = 0); + + /// Reads all items from builder, feeding them into the parser, + /// until the builder's Retrieve() signals the end of the series. + void PumpSeries(Parser &parser, const IConverter *ic = 0); + + /// Reads all series from the builder, feeding them into the parser, + /// until the builder's EndOfFile() is true. + void PumpFile(Parser &parser, const IConverter *ic = 0); +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/platform.h barry-0.0.20110506/src/platform.h --- barry-0.14/src/platform.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/platform.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,76 @@ +/// +/// \file platform.h +/// Platform-specific details +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2010, RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PLATFORM_H__ +#define __BARRY_PLATFORM_H__ + +#include "usbwrap.h" // USB specific details and windows.h +#include // threading and struct timespec + +////////////////////////////////////////////////////////////////////////////// +// All GCC specific detail +#if defined( __GNUC__ ) + +#define ATTRIBUTE_PACKED __attribute__ ((packed)) +#define USE_PACK_PRAGMA 0 + +#else + +#define ATTRIBUTE_PACKED +#define USE_PACK_PRAGMA 1 + +#endif + +////////////////////////////////////////////////////////////////////////////// +// All Windows specific detail +#if defined( WIN32 ) + +// On Windows, we must call usb_set_configuration() before claim_interface() +#define MUST_SET_CONFIGURATION 1 + +#else + +#define MUST_SET_CONFIGURATION 0 + +#endif + + + +////////////////////////////////////////////////////////////////////////////// +// All FreeBSD / BSD specific detail +#if defined( __FreeBSD__ ) + +#endif + + + + +////////////////////////////////////////////////////////////////////////////// +// All Mac OS X specific detail +#if defined( __APPLE__ ) && defined( __MACH__ ) + +#endif + + + +#endif + diff -Nru barry-0.14/src/pppfilter.cc barry-0.0.20110506/src/pppfilter.cc --- barry-0.14/src/pppfilter.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/pppfilter.cc 2011-05-06 12:20:17.000000000 +0000 @@ -7,7 +7,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/pppfilter.h barry-0.0.20110506/src/pppfilter.h --- barry-0.14/src/pppfilter.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/pppfilter.h 2011-05-06 12:20:17.000000000 +0000 @@ -7,7 +7,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/probe.cc barry-0.0.20110506/src/probe.cc --- barry-0.14/src/probe.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/probe.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -31,6 +31,8 @@ #include "protocol.h" #include "record-internal.h" #include "strnlen.h" +#include "configfile.h" +#include "platform.h" #include #include #include @@ -122,9 +124,15 @@ return true; } -Probe::Probe(const char *busname, const char *devname) +Probe::Probe(const char *busname, const char *devname, + const Usb::EndpointPair *epp) : m_fail_count(0) + , m_epp_override(epp) { + if( m_epp_override ) { + m_epp = *epp; + } + // let the programmer pass in "" as well as 0 if( busname && !strlen(busname) ) busname = 0; @@ -144,6 +152,11 @@ // And a special case, which behaves similar to the PEARL_DUAL, // but with a unique Product ID. ProbeMatching(VENDOR_RIM, PRODUCT_RIM_PEARL_8120, busname, devname); + // And one more! The Pearl Flip + ProbeMatching(VENDOR_RIM, PRODUCT_RIM_PEARL_FLIP, busname, devname); + + // And one more time, for the Blackberry Storm + ProbeMatching(VENDOR_RIM, PRODUCT_RIM_STORM, busname, devname); } void Probe::ProbeMatching(int vendor, int product, @@ -213,7 +226,7 @@ if( !dev.GetConfiguration(cfg) ) throw Usb::Error(dev.GetLastError(), "Probe: GetConfiguration failed"); - if( cfg != BLACKBERRY_CONFIGURATION ) { + if( cfg != BLACKBERRY_CONFIGURATION || MUST_SET_CONFIGURATION ) { if( !dev.SetConfiguration(BLACKBERRY_CONFIGURATION) ) throw Usb::Error(dev.GetLastError(), "Probe: SetConfiguration failed"); @@ -222,46 +235,37 @@ // open interface Interface iface(dev, InterfaceNumber); - // find the first bulk read/write endpoint pair that answers - // to our probe commands - // Start with second pair, since evidence indicates the later pairs - // are the ones we need. - size_t i; - for(i = ed.GetEndpointPairs().size() > 1 ? 1 : 0; - i < ed.GetEndpointPairs().size(); - i++ ) - { - const EndpointPair &ep = ed.GetEndpointPairs()[i]; - if( ep.type == USB_ENDPOINT_TYPE_BULK ) { - - uint32_t pin; - uint8_t zeroSocketSequence; - std::string desc; - if( ProbePair(dev, ep, pin, desc, zeroSocketSequence) ) { - result.m_ep = ep; - result.m_pin = pin; - result.m_description = desc; - result.m_zeroSocketSequence = zeroSocketSequence; - break; - } - } - else { - dout("Probe: Skipping non-bulk endpoint pair (offset: " - << i-1 << ") "); - } - } + // Try the initial probing of endpoints + ProbeDeviceEndpoints(dev, ed, result); - // check for ip modem endpoints - i++; - if( i < ed.GetEndpointPairs().size() ) { - const EndpointPair &ep = ed.GetEndpointPairs()[i]; - if( ProbeModem(dev, ep) ) { - result.m_epModem = ep; - } + if( !result.m_ep.IsComplete() ) { + // Probing of end-points failed, so try reprobing + // after calling usb_set_altinterface(). + // + // Calling usb_set_altinterface() should be harmless + // and can help the host and device to synchronize the + // USB state, especially on FreeBSD and Mac OS X. + // However it can cause usb-storage URBs to be lost + // on some devices, so is only used if necessary. + dout("Probe: probing endpoints failed, retrying after setting alternate interface"); + dev.SetAltInterface(InterfaceNumber); + result.m_needSetAltInterface = true; + ProbeDeviceEndpoints(dev, ed, result); } // add to list if( result.m_ep.IsComplete() ) { + // before adding to list, try to load the device's + // friendly name from the configfile... but don't + // fail if we can't do it + try { + ConfigFile cfg(result.m_pin); + result.m_cfgDeviceName = cfg.GetDeviceName(); + } + catch( Barry::ConfigFileError & ) { + // ignore... + } + m_results.push_back(result); ddout("Using ReadEndpoint: " << (unsigned int)result.m_ep.read); ddout(" WriteEndpoint: " << (unsigned int)result.m_ep.write); @@ -271,20 +275,113 @@ } } +void Probe::ProbeDeviceEndpoints(Device &dev, EndpointDiscovery &ed, ProbeResult &result) +{ + if( m_epp_override ) { + // user has given us endpoints to try... so try them + uint32_t pin; + uint8_t zeroSocketSequence; + std::string desc; + bool needClearHalt; + if( ProbePair(dev, m_epp, pin, desc, zeroSocketSequence, needClearHalt) ) { + // looks good, finish filling out the result + result.m_ep = m_epp; + result.m_pin = pin; + result.m_description = desc; + result.m_zeroSocketSequence = zeroSocketSequence; + result.m_needClearHalt = needClearHalt; + } + } + else { + // find the first bulk read/write endpoint pair that answers + // to our probe commands + // Start with second pair, since evidence indicates the later pairs + // are the ones we need. + size_t i; + for(i = ed.GetEndpointPairs().size() > 1 ? 1 : 0; + i < ed.GetEndpointPairs().size(); + i++ ) + { + const EndpointPair &ep = ed.GetEndpointPairs()[i]; + if( ep.type == USB_ENDPOINT_TYPE_BULK ) { + + uint32_t pin; + uint8_t zeroSocketSequence; + std::string desc; + bool needClearHalt; + if( ProbePair(dev, ep, pin, desc, zeroSocketSequence, needClearHalt) ) { + result.m_ep = ep; + result.m_pin = pin; + result.m_description = desc; + result.m_zeroSocketSequence = zeroSocketSequence; + result.m_needClearHalt = needClearHalt; + break; + } + } + else { + dout("Probe: Skipping non-bulk endpoint pair (offset: " + << i-1 << ") "); + } + } + + // check for ip modem endpoints + i++; + if( i < ed.GetEndpointPairs().size() ) { + const EndpointPair &ep = ed.GetEndpointPairs()[i]; + if( ProbeModem(dev, ep) ) { + result.m_epModem = ep; + } + } + } +} + bool Probe::ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep, uint32_t &pin, std::string &desc, - uint8_t &zeroSocketSequence) + uint8_t &zeroSocketSequence, + bool &needClearHalt) { - dev.ClearHalt(ep.read); - dev.ClearHalt(ep.write); + // Initially assume that clear halt isn't needed as it causes some + // devices to drop packets. The suspicion is that the toggle bits + // get out of sync, but this hasn't been confirmed with hardware + // tracing. + // + // It is possible to always use clear halt, as long as SET + // INTERFACE has been sent before, via usb_set_altinterface(). + // However this has the side affect that any outstanding URBs + // on other interfaces (i.e. usb-storage) timeout and lose + // their data. This is not a good thing as it can corrupt the + // file system exposed over usb-storage. This also has the + // side-affect that usb-storage issues a port reset after the + // 30 second timeout, which kills any current Barry + // connection. + // + // To further complicate matters some devices, such as the + // 8830, always need clear halt before they will respond to + // probes. + // + // So to work with all these device quirks the probe is first + // attempted without calling clear halt. If that probe fails + // then a clear halt is issued followed by a retry on the + // probing. + needClearHalt = false; Data data; dev.BulkDrain(ep.read); if( !Intro(0, ep, dev, data) ) { - dout("Probe: Intro(0) failed"); - return false; + // Try clearing halt and then reprobing + dout("Probe: Intro(0) failed, retrying after clearing halt"); + dev.ClearHalt(ep.read); + dev.ClearHalt(ep.write); + needClearHalt = true; + // Retry + dev.BulkDrain(ep.read); + if( !Intro(0, ep, dev, data) ) { + // Still no response so fail the probe + dout("Probe: Intro(0) still failed after clearing halt"); + return false; + } } SocketZero socket(dev, ep.write, ep.read); @@ -369,18 +466,31 @@ // return false; } -int Probe::FindActive(uint32_t pin) const +int Probe::FindActive(Barry::Pin pin) const { - for( int i = 0; i < GetCount(); i++ ) { - if( Get(i).m_pin == pin ) - return i; - } - if( pin == 0 ) { + return FindActive(m_results, pin); +} + +int Probe::FindActive(const Barry::Probe::Results &results, Barry::Pin pin) +{ + int i = Find(results, pin); + + if( i == -1 && pin == 0 ) { // can we default to a single device? - if( GetCount() == 1 ) + if( results.size() == 1 ) return 0; // yes! } + return i; +} + +int Probe::Find(const Results &results, Barry::Pin pin) +{ + Barry::Probe::Results::const_iterator ci = results.begin(); + for( int i = 0; ci != results.end(); i++, ++ci ) { + if( ci->m_pin == pin ) + return i; + } // PIN not found return -1; } @@ -398,8 +508,10 @@ std::ostream& operator<< (std::ostream &os, const ProbeResult &pr) { os << "Device ID: " << pr.m_dev - << std::hex << ". PIN: " << pr.m_pin + << ". PIN: " << pr.m_pin.Str() << ", Description: " << pr.m_description; + if( pr.m_cfgDeviceName.size() ) + os << ", Name: " << pr.m_cfgDeviceName; return os; } diff -Nru barry-0.14/src/probe.h barry-0.0.20110506/src/probe.h --- barry-0.14/src/probe.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/probe.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,27 +24,63 @@ #include "dll.h" #include "usbwrap.h" +#include "pin.h" #include #include #include namespace Barry { +class Probe; + struct BXEXPORT ProbeResult { + friend class Probe; + Usb::DeviceIDType m_dev; unsigned char m_interface; - uint32_t m_pin; + Barry::Pin m_pin; Usb::EndpointPair m_ep; Usb::EndpointPair m_epModem; + // Specifies if it's necessary to clear halt on the + // endpoints before using them. On some devices such + // as the 8830 it's essential to clear halt. On other + // devices such as the Curve 8520 calling clear halt + // can cause them to get into a state where they drop + // packets. + bool m_needClearHalt; + // Specifies if it's necessary to call usb_set_altinterface() + // before attempting to use the end points for this device. + // + // This can help to re-synchronize the state between the USB + // host and the device. However it can also cause usb-storage + // URBs to be lost on some device, so it's only used as a + // last resort. + bool m_needSetAltInterface; uint8_t m_zeroSocketSequence; std::string m_description; + // data from a possible ConfigFile (filled in automatically by + // the probe code if available) + std::string m_cfgDeviceName; + +private: + // All ProbeResult objects should come from Probe, therefore + // this constructor is private to force the issue. ProbeResult() - : m_dev(0), m_interface(0), m_pin(0), m_zeroSocketSequence(0) + : m_dev(0), m_interface(0), m_pin(0) + , m_needClearHalt(false), m_needSetAltInterface(false) + , m_zeroSocketSequence(0) {} + +public: void DumpAll(std::ostream &os) const; bool HasIpModem() const { return m_epModem.IsComplete(); } + + bool operator==(const Barry::Pin &pin) const + { + return m_pin == pin; + } }; BXEXPORT std::ostream& operator<< (std::ostream &os, const ProbeResult &pr); @@ -52,11 +88,18 @@ class BXEXPORT Probe { - std::vector m_results; +public: + typedef std::vector Results; + +private: + Results m_results; std::vector m_fail_msgs; int m_fail_count; + bool m_epp_override; + Usb::EndpointPair m_epp; + BXLOCAL bool CheckSize(const Data &data, unsigned int required); BXLOCAL bool ParsePIN(const Data &data, uint32_t &pin); BXLOCAL bool ParseDesc(const Data &data, std::string &desc); @@ -65,21 +108,28 @@ void ProbeMatching(int vendor, int product, const char *busname, const char *devname); void ProbeDevice(Usb::DeviceIDType devid); + void ProbeDeviceEndpoints(Usb::Device &dev, Usb::EndpointDiscovery &ed, ProbeResult &result); bool ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep, - uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequence); + uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequence, + bool &needClearHalt); bool ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep); public: - Probe(const char *busname = 0, const char *devname = 0); + Probe(const char *busname = 0, const char *devname = 0, + const Usb::EndpointPair *epp = 0); + + const Results& GetResults() const { return m_results; } int GetCount() const { return m_results.size(); } int GetFailCount() const { return m_fail_count; } - const std::string& GetFailMsg(int index) const { return m_fail_msgs[index]; } - const ProbeResult& Get(int index) const { return m_results[index]; } + const std::string& GetFailMsg(int index) const { return m_fail_msgs.at(index); } + const ProbeResult& Get(int index) const { return m_results.at(index); } - int FindActive(uint32_t pin = 0) const; // returns -1 if pin not found + int FindActive(Barry::Pin pin = 0) const; // returns -1 if pin not found // or if no devices + static int FindActive(const Results &results, Barry::Pin pin = 0); + static int Find(const Results &results, Barry::Pin pin = 0); }; diff -Nru barry-0.14/src/protocol.cc barry-0.0.20110506/src/protocol.cc --- barry-0.14/src/protocol.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/protocol.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -30,17 +30,21 @@ namespace Barry { namespace Protocol { +// This function is only valid for Packet, JLPacket, and JVMPacket structs, +// as long as they don't differ from each other in header layout, when +// it comes to the .size field. (see protostructs.h) void CheckSize(const Data &packet, size_t requiredsize) { const Packet *p = (const Packet *) packet.GetData(); // when packets are larger than 0xFFFF bytes, packet->size is no // longer reliable, so we go with the Data class size - if( (btohs(p->size) != packet.GetSize() && packet.GetSize() <= 0xFFFF) || + if( (packet.GetSize() >= 4 && btohs(p->size) != packet.GetSize() && packet.GetSize() <= 0xFFFF) || packet.GetSize() < requiredsize ) { - BadSize bs(btohs(p->size), packet.GetSize(), requiredsize); + BadSize bs(packet.GetSize() >= 4 ? btohs(p->size) : 0, + packet.GetSize(), requiredsize); eout(bs.what()); eout(packet); throw bs; @@ -62,5 +66,18 @@ } } +bool IsSequencePacket(const Barry::Data &data) +{ + if( data.GetSize() == SB_SEQUENCE_PACKET_SIZE ) { + MAKE_PACKET(rpack, data); + if( rpack->socket == 0 && + rpack->command == SB_COMMAND_SEQUENCE_HANDSHAKE ) + { + return true; + } + } + return false; // not a sequence packet +} + }} // namespace Barry::Protocol diff -Nru barry-0.14/src/protocol.h barry-0.0.20110506/src/protocol.h --- barry-0.14/src/protocol.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/protocol.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,13 +23,19 @@ #define __BARRY_PROTOCOL_H__ // packet commands (Packet.command: has response codes too) +#define SB_COMMAND_ECHO 0x01 +#define SB_COMMAND_ECHO_REPLY 0x02 +#define SB_COMMAND_RESET 0x03 +#define SB_COMMAND_RESET_REPLY 0x04 #define SB_COMMAND_FETCH_ATTRIBUTE 0x05 #define SB_COMMAND_FETCHED_ATTRIBUTE 0x06 #define SB_COMMAND_SELECT_MODE 0x07 #define SB_COMMAND_MODE_SELECTED 0x08 +#define SB_COMMAND_MODE_NOT_SELECTED 0x09 #define SB_COMMAND_OPEN_SOCKET 0x0a #define SB_COMMAND_CLOSE_SOCKET 0x0b #define SB_COMMAND_CLOSED_SOCKET 0x0c +#define SB_COMMAND_REMOTE_CLOSE_SOCKET 0x0d #define SB_COMMAND_PASSWORD_CHALLENGE 0x0e #define SB_COMMAND_PASSWORD 0x0f #define SB_COMMAND_OPENED_SOCKET 0x10 @@ -39,6 +45,112 @@ #define SB_COMMAND_DB_FRAGMENTED 0x60 #define SB_COMMAND_DB_DONE 0x41 +// JavaLoader commands +#define SB_COMMAND_JL_HELLO 0x64 // This could be a general ACK in both directions +#define SB_COMMAND_JL_HELLO_ACK 0x65 // From device after host HELLO +#define SB_COMMAND_JL_GOODBYE 0x8d +#define SB_COMMAND_JL_SET_UNKNOWN1 0x70 // Initial sequence, 0 +#define SB_COMMAND_JL_SET_COD_FILENAME 0x80 +#define SB_COMMAND_JL_SET_COD_SIZE 0x67 // Always big endian +#define SB_COMMAND_JL_SEND_DATA 0x68 +#define SB_COMMAND_JL_SET_TIME 0x7c +#define SB_COMMAND_JL_GET_SCREENSHOT 0x87 +#define SB_COMMAND_JL_DEVICE_INFO 0x71 +#define SB_COMMAND_JL_OS_METRICS 0x78 +#define SB_COMMAND_JL_BOOTROM_METRICS 0x79 +#define SB_COMMAND_JL_GET_DIRECTORY 0x6d +#define SB_COMMAND_JL_GET_DATA_ENTRY 0x6e // Used for both DIR and SCREENSHOT +#define SB_COMMAND_JL_GET_SUBDIR 0x7f +#define SB_COMMAND_JL_GET_SUBDIR_ENTRY 0x7d +#define SB_COMMAND_JL_ERASE 0x69 +#define SB_COMMAND_JL_FORCE_ERASE 0x7b +#define SB_COMMAND_JL_UNKNOWN3 0x63 +#define SB_COMMAND_JL_GET_LOG 0x73 +#define SB_COMMAND_JL_GET_LOG_ENTRY 0x74 +#define SB_COMMAND_JL_CLEAR_LOG 0x88 +#define SB_COMMAND_JL_SAVE_MODULE 0x7e +#define SB_COMMAND_JL_WIPE_APPS 0x6a +#define SB_COMMAND_JL_WIPE_FS 0x6b +#define SB_COMMAND_JL_LOG_STRACES 0x8e +#define SB_COMMAND_JL_RESET_FACTORY 0x91 + +// JavaLoader response +#define SB_COMMAND_JL_ACK 0x64 +#define SB_COMMAND_JL_READY 0x01 +#define SB_COMMAND_JL_RESET_REQUIRED 0x78 // Occurs after GOODBYE when handheld reset is required +#define SB_COMMAND_JL_COD_IN_USE 0x6c // Perhaps "BUSY" is also a good name? +#define SB_COMMAND_JL_COD_NOT_FOUND 0x69 +#define SB_COMMAND_JL_NOT_ENOUGH_MEMORY 0x6a // Occurs when the internal memory isn't enough to install the new COD file +#define SB_COMMAND_JL_NOT_SUPPORTED 0x71 // Occurs when device does not support a command + +// JavaLoader data +#define SB_DATA_JL_SUCCESS 0x64 // Device has accepted the data packet +#define SB_DATA_JL_INVALID 0x68 // Device returns this code if the application isn't valid. + + +// JDWP Command set list +#define JDWP_CMDSET_VIRTUALMACHINE 1 +#define JDWP_CMDSET_REFERECENTYPE 2 +#define JDWP_CMDSET_CLASSTYPE 3 +#define JDWP_CMDSET_ARRAYTYPE 4 +#define JDWP_CMDSET_INTERFACETYPE 5 +#define JDWP_CMDSET_METHOD 6 +#define JDWP_CMDSET_FIELD 8 +#define JDWP_CMDSET_OBJECTREFERENCE 9 +#define JDWP_CMDSET_STRINGREFERENCE 10 +#define JDWP_CMDSET_THREADREFERENCE 11 +#define JDWP_CMDSET_THREADGROUPREFERENCE 12 +#define JDWP_CMDSET_ARRAYREFERENCE 13 +#define JDWP_CMDSET_CLASSLOADERREFERENCE 14 +#define JDWP_CMDSET_EVENTREQUEST 15 +#define JDWP_CMDSET_STACKFRAME 16 +#define JDWP_CMDSET_CLASSOBJECTREFERENCE 17 +#define JDWP_CMDSET_EVENT 64 + +// JDWP Command list - VirtualMachine +#define JDWP_CMD_VERSION 1 +#define JDWP_CMD_ALLCLASSES 3 +#define JDWP_CMD_ALLTHREADS 4 +#define JDWP_CMD_DISPOSE 6 +#define JDWP_CMD_IDSIZES 7 +#define JDWP_CMD_SUSPEND 8 +#define JDWP_CMD_RESUME 9 +#define JDWP_CMD_CLASSPATHS 13 + +// JDWP Command list - EventRequest +#define JDWP_CMD_SET 1 + +// JVMDebug commands +#define SB_COMMAND_JVM_UNKNOWN01 0x53 +#define SB_COMMAND_JVM_UNKNOWN02 0x01 +#define SB_COMMAND_JVM_UNKNOWN03 0x6f +#define SB_COMMAND_JVM_UNKNOWN04 0x8a +#define SB_COMMAND_JVM_UNKNOWN05 0x90 +#define SB_COMMAND_JVM_UNKNOWN06 0x44 +#define SB_COMMAND_JVM_UNKNOWN07 0x45 +#define SB_COMMAND_JVM_UNKNOWN08 0x54 +#define SB_COMMAND_JVM_UNKNOWN09 0x33 +#define SB_COMMAND_JVM_UNKNOWN10 0x46 + +#define SB_COMMAND_JVM_UNKNOWN11 0x0e +#define SB_COMMAND_JVM_UNKNOWN12 0x50 +#define SB_COMMAND_JVM_UNKNOWN13 0x0d +#define SB_COMMAND_JVM_UNKNOWN14 0x85 +#define SB_COMMAND_JVM_UNKNOWN15 0x84 + +#define SB_COMMAND_JVM_GET_MODULES_LIST 0x8d // Get all Java modules list with their address and ID +#define SB_COMMAND_JVM_GET_THREADS_LIST 0x08 // Get all threads currently running in the virtual machine +#define SB_COMMAND_JVM_GET_CONSOLE_MSG 0x40 // Get console message +#define SB_COMMAND_JVM_GO 0x02 // Go +#define SB_COMMAND_JVM_GET_STATUS 0x06 // Get status +#define SB_COMMAND_JVM_SET_BREAKPOINT 0x21 // Set breakpoint +#define SB_COMMAND_JVM_RM_BREAKPOINT 0x22 // Remove breakpoint + +#define SB_COMMAND_JVM_STOP 0xa502 + +// JavaDebug response +#define SB_COMMAND_JVM_GET_DATA_ENTRY 0x06 + // mode constants #define SB_MODE_REQUEST_SOCKET 0x00ff diff -Nru barry-0.14/src/protostructs.h barry-0.0.20110506/src/protostructs.h --- barry-0.14/src/protostructs.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/protostructs.h 2011-05-06 12:20:17.000000000 +0000 @@ -12,7 +12,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -32,6 +32,12 @@ #include #include +#include "platform.h" // safe to include platform.h here, since + // protostructs.h is not installed either + +#if USE_PACK_PRAGMA +#pragma pack(push, 1) +#endif // forward declarations namespace Barry { class Data; } @@ -43,7 +49,7 @@ { uint16_t size; char buffer[4]; -} __attribute__ ((packed)); +} ATTRIBUTE_PACKED; /////////////////////////////////////////////////////////////////////////////// @@ -53,7 +59,7 @@ { uint32_t uniqueId; uint16_t unknown; -} __attribute__ ((packed)); +} ATTRIBUTE_PACKED; struct MessageAddress // used for Message records { @@ -61,7 +67,37 @@ uint8_t addr[1]; // 2 null terminated strings: first // contains full name, second contains // the email address -} __attribute__ ((packed)); +} ATTRIBUTE_PACKED; + + +/////////////////////////////////////////////////////////////////////////////// +// SMS Message field and record structures + +struct SMSMetaData +{ + uint8_t recv; // if received, this is set to 1; otherwise 0 + uint8_t flags; +#define SMS_FLG_NEW_CONVERSATION 0x20 +#define SMS_FLG_SAVED 0x10 +#define SMS_FLG_DELETED 0x08 +#define SMS_FLG_OPENED 0x01 + + uint8_t new_flag; + uint16_t zero; // constantly 0 + uint32_t status; +#define SMS_STA_RECEIVED 0x000007ff +#define SMS_STA_DRAFT 0x7fffffff + + uint32_t error_id; + uint64_t timestamp; + uint64_t service_center_timestamp; + uint8_t dcs; +#define SMS_DCS_7BIT 0x00 +#define SMS_DCS_8BIT 0x01 +#define SMS_DCS_UCS2 0x02 + +} ATTRIBUTE_PACKED; +#define SMS_METADATA_SIZE (sizeof(::Barry::Protocol::SMSMetaData)) @@ -78,16 +114,19 @@ GroupLink link; MessageAddress addr; + SMSMetaData sms_metadata; + uint64_t timestamp; + uint64_t uint64; uint32_t uint32; int32_t min1900; uint16_t code; uint8_t raw[1]; int16_t int16; - } __attribute__ ((packed)) u; + } ATTRIBUTE_PACKED u; -} __attribute__ ((packed)); -#define COMMON_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::CommonField) - sizeof(Barry::Protocol::CommonField::CommonFieldData)) +} ATTRIBUTE_PACKED; +#define COMMON_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::CommonField) - sizeof(::Barry::Protocol::CommonField::CommonFieldData)) #define COMMON_FIELD_MIN1900_SIZE (sizeof(int32_t)) struct CommandTableField @@ -95,8 +134,8 @@ uint8_t size; // no null terminator uint8_t code; uint8_t name[1]; -} __attribute__ ((packed)); -#define COMMAND_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::CommandTableField) - 1) +} ATTRIBUTE_PACKED; +#define COMMAND_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::CommandTableField) - 1) struct OldDBDBField { @@ -108,8 +147,8 @@ uint16_t unknown2; uint16_t nameSize; // includes null terminator uint8_t name[1]; -} __attribute__ ((packed)); -#define OLD_DBDB_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::OldDBDBField) - 1) +} ATTRIBUTE_PACKED; +#define OLD_DBDB_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::OldDBDBField) - 1) struct DBDBField { @@ -125,8 +164,8 @@ uint16_t unknown; // this comes after the // null terminated name, but // is here for size calcs -} __attribute__ ((packed)); -#define DBDB_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::DBDBField) - 1) +} ATTRIBUTE_PACKED; +#define DBDB_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::DBDBField) - 1) struct RecordStateTableField { @@ -144,7 +183,7 @@ // are used #define BARRY_RSTF_DIRTY 0x01 uint8_t unknown2[4]; -} __attribute__ ((packed)); +} ATTRIBUTE_PACKED; struct CalendarRecurrenceDataField // as documented in the Cassis project spec { @@ -168,14 +207,14 @@ struct Day { uint8_t day[6]; // always zeros! - } __attribute__ ((packed)) day; + } ATTRIBUTE_PACKED day; struct MonthByDate { uint8_t monthDay; // day of month to recur on // (1-31) uint8_t blank[5]; - } __attribute__ ((packed)) month_by_date; + } ATTRIBUTE_PACKED month_by_date; struct MonthByDay { @@ -184,7 +223,7 @@ // (1 to 5, first week, second // week, etc) uint8_t blank[4]; - } __attribute__ ((packed)) month_by_day; + } ATTRIBUTE_PACKED month_by_day; struct YearByDate { @@ -193,7 +232,7 @@ uint8_t blank; uint8_t month; // month to recur on (1-12) uint8_t blank_[3]; - } __attribute__ ((packed)) year_by_date; + } ATTRIBUTE_PACKED year_by_date; struct YearByDay { @@ -201,7 +240,7 @@ uint8_t week; // week of month (1 to 5) uint8_t month; // (1-12) uint8_t blank[3]; - } __attribute__ ((packed)) year_by_day; + } ATTRIBUTE_PACKED year_by_day; struct Week { @@ -215,14 +254,144 @@ #define CRDF_WD_SAT 0x40 uint8_t blank[5]; - } __attribute__ ((packed)) week; + } ATTRIBUTE_PACKED week; + + } ATTRIBUTE_PACKED u; - } __attribute__ ((packed)) u; +} ATTRIBUTE_PACKED; +#define CALENDAR_RECURRENCE_DATA_FIELD_SIZE sizeof(::Barry::Protocol::CalendarRecurrenceDataField) -} __attribute__ ((packed)); -#define CALENDAR_RECURRENCE_DATA_FIELD_SIZE sizeof(Barry::Protocol::CalendarRecurrenceDataField) +// +// Calendar record: field constants +// + +#define CR_FREEBUSY_FREE 0 +#define CR_FREEBUSY_TENTATIVE 1 +#define CR_FREEBUSY_BUSY 2 +#define CR_FREEBUSY_OUT_OF_OFFICE 3 +#define CR_FREEBUSY_RANGE_LOW 0 +#define CR_FREEBUSY_RANGE_HIGH 3 + +#define CR_CLASS_PUBLIC 0 +#define CR_CLASS_CONFIDENTIAL 1 +#define CR_CLASS_PRIVATE 2 +#define CR_CLASS_RANGE_LOW 0 +#define CR_CLASS_RANGE_HIGH 2 +// +// Task record: field constants +// + +#define TR_ALARM_DATE 1 +#define TR_ALARM_RELATIVE 2 +#define TR_ALARM_RANGE_LOW 1 +#define TR_ALARM_RANGE_HIGH 2 + +#define TR_PRIORITY_HIGH 0 +#define TR_PRIORITY_NORMAL 1 +#define TR_PRIORITY_LOW 2 +#define TR_PRIORITY_RANGE_LOW 0 +#define TR_PRIORITY_RANGE_HIGH 2 + +#define TR_STATUS_NOT_STARTED 0 +#define TR_STATUS_IN_PROGRESS 1 +#define TR_STATUS_COMPLETED 2 +#define TR_STATUS_WAITING 3 +#define TR_STATUS_DEFERRED 4 +#define TR_STATUS_RANGE_LOW 0 +#define TR_STATUS_RANGE_HIGH 4 + +// +// Phone Call Logs record: field constants +// +// +#define CLL_DIRECTION_RECEIVER 0 +#define CLL_DIRECTION_EMITTER 1 +#define CLL_DIRECTION_FAILED 2 +#define CLL_DIRECTION_MISSING 3 +#define CLL_DIRECTION_RANGE_LOW 0 +#define CLL_DIRECTION_RANGE_HIGH 3 + +#define CLL_PHONETYPE_UNDEFINED 0 +#define CLL_PHONETYPE_OFFICE 1 +#define CLL_PHONETYPE_HOME 2 +#define CLL_PHONETYPE_MOBILE 3 +#define CLL_PHONETYPE_RANGE_LOW 0 +#define CLL_PHONETYPE_RANGE_HIGH 3 + +// +// Browser Bookmarks record: field constants +// +// +#define BMK_BROWSER_AUTO 0 +#define BMK_BROWSER_BLACKBERRY 1 +#define BMK_BROWSER_FIREFOX 2 +#define BMK_BROWSER_INTERNET_EXPLORER 3 + +#define BMK_DISPLAY_AUTO 0 +#define BMK_DISPLAY_COLOMN 1 +#define BMK_DISPLAY_PAGE 2 + +#define BMK_JAVASCRIPT_AUTO 0 +#define BMK_JAVASCRIPT_ENABLED 1 +#define BMK_JAVASCRIPT_DISABLED 2 + +struct StringField +{ + uint16_t be_size; // may or may not have a null term. + // big-endian + uint8_t data[1]; +} ATTRIBUTE_PACKED; +#define STRING_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::StringField) - 1) + +struct BookmarkId +{ + uint32_t bookmark_id; + uint8_t index; +} ATTRIBUTE_PACKED; +#define BOOKMARK_ID_SIZE (sizeof(::Barry::Protocol::BookmarkId)) + +struct VarStringField +{ + uint8_t present; + uint16_t be_size; // big-endian + uint8_t data[1]; +} ATTRIBUTE_PACKED; +#define VARSTRING_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::VarStringField) - 1) + +struct BookmarkFolders +{ + uint32_t id1; // these two fields contain + uint32_t id2; // b9 fc f8 f6 c2 e3 a4 d5 + // whenever there is a record in + // the Blackberry Bookmarks folder, + // even across multiple devices! + // this was true for the 9550 and + // the oooold 7750, and the 8700 + uint8_t unknown; // may be a section code? seems to + // always be 0x08 + uint8_t flag; // unknown flag +} ATTRIBUTE_PACKED; +#define BOOKMARK_FOLDERS_HEADER_SIZE (sizeof(::Barry::Protocol::BookmarkFolders)) + + +// +// Folder record: field constants +// + +#define FR_TYPE_SUBTREE 0x00 +#define FR_TYPE_DELETED 0x01 +#define FR_TYPE_INBOX 0x02 +#define FR_TYPE_OUTBOX 0x03 +#define FR_TYPE_SENT 0x04 +#define FR_TYPE_OTHER 0x05 +#define FR_TYPE_DRAFT 0x0a + +#define FR_STATUS_ORPHAN 0x50 +#define FR_STATUS_UNFILED 0x51 +#define FR_STATUS_FILED 0x52 + /////////////////////////////////////////////////////////////////////////////// // Packed field structures - odd format used with Service Book records @@ -233,16 +402,16 @@ uint8_t size; uint8_t type; uint8_t raw[1]; -} __attribute__ ((packed)); -#define PACKED_FIELD_02_HEADER_SIZE (sizeof(Barry::Protocol::PackedField_02) - 1) +} ATTRIBUTE_PACKED; +#define PACKED_FIELD_02_HEADER_SIZE (sizeof(::Barry::Protocol::PackedField_02) - 1) struct PackedField_10 { uint8_t type; uint8_t size; uint8_t raw[1]; -} __attribute__ ((packed)); -#define PACKED_FIELD_10_HEADER_SIZE (sizeof(Barry::Protocol::PackedField_10) - 1) +} ATTRIBUTE_PACKED; +#define PACKED_FIELD_10_HEADER_SIZE (sizeof(::Barry::Protocol::PackedField_10) - 1) @@ -254,8 +423,8 @@ { uint8_t format; uint8_t fields[1]; -} __attribute__ ((packed)); -#define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE (sizeof(Barry::Protocol::ServiceBookConfigField) - 1) +} ATTRIBUTE_PACKED; +#define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::ServiceBookConfigField) - 1) /////////////////////////////////////////////////////////////////////////////// @@ -265,16 +434,16 @@ { uint16_t recordIndex; // index comes from RecordStateTable uint8_t data[1]; -} __attribute__ ((packed)); -#define DBC_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::DBC_Record) - 1) +} ATTRIBUTE_PACKED; +#define DBC_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::DBC_Record) - 1) struct DBC_RecordFlags { uint8_t unknown; uint16_t index; uint8_t unknown2[5]; -} __attribute__ ((packed)); -#define DBC_RECORD_FLAGS_SIZE (sizeof(Barry::Protocol::DBC_RecordFlags)) +} ATTRIBUTE_PACKED; +#define DBC_RECORD_FLAGS_SIZE (sizeof(::Barry::Protocol::DBC_RecordFlags)) struct DBC_TaggedUpload { @@ -287,16 +456,16 @@ uint32_t uniqueId; uint8_t unknown2; uint8_t data[1]; -} __attribute__ ((packed)); -#define DBC_TAGGED_UPLOAD_HEADER_SIZE (sizeof(Barry::Protocol::DBC_TaggedUpload) - 1) +} ATTRIBUTE_PACKED; +#define DBC_TAGGED_UPLOAD_HEADER_SIZE (sizeof(::Barry::Protocol::DBC_TaggedUpload) - 1) struct DBC_IndexedUpload { uint8_t unknown; // observed: 00 or 05 uint16_t index; uint8_t data[1]; -} __attribute__ ((packed)); -#define DBC_INDEXED_UPLOAD_HEADER_SIZE (sizeof(Barry::Protocol::DBC_IndexedUpload) - 1) +} ATTRIBUTE_PACKED; +#define DBC_INDEXED_UPLOAD_HEADER_SIZE (sizeof(::Barry::Protocol::DBC_IndexedUpload) - 1) struct PasswordChallenge { @@ -318,20 +487,20 @@ { uint32_t seed; uint8_t hash[20]; - } __attribute__ ((packed)) u; + } ATTRIBUTE_PACKED u; -} __attribute__ ((packed)); -#define PASSWORD_CHALLENGE_HEADER_SIZE (sizeof(Barry::Protocol::PasswordChallenge) - sizeof(Barry::Protocol::PasswordChallenge::Hash)) +} ATTRIBUTE_PACKED; +#define PASSWORD_CHALLENGE_HEADER_SIZE (sizeof(::Barry::Protocol::PasswordChallenge) - sizeof(::Barry::Protocol::PasswordChallenge::Hash)) #define PASSWORD_CHALLENGE_SEED_SIZE (PASSWORD_CHALLENGE_HEADER_SIZE + sizeof(uint32_t)) -#define PASSWORD_CHALLENGE_SIZE (sizeof(Barry::Protocol::PasswordChallenge)) +#define PASSWORD_CHALLENGE_SIZE (sizeof(::Barry::Protocol::PasswordChallenge)) struct AttributeFetch { uint16_t object; uint16_t attribute; uint8_t raw[1]; // used only in response -} __attribute__ ((packed)); -#define ATTRIBUTE_FETCH_COMMAND_SIZE (sizeof(Barry::Protocol::AttributeFetch) - 1) +} ATTRIBUTE_PACKED; +#define ATTRIBUTE_FETCH_COMMAND_SIZE (sizeof(::Barry::Protocol::AttributeFetch) - 1) struct ModeSelect { @@ -339,8 +508,15 @@ struct ResponseBlock { uint8_t unknown[20]; - } __attribute__ ((packed)) response; -} __attribute__ ((packed)); + } ATTRIBUTE_PACKED response; +} ATTRIBUTE_PACKED; + +struct Echo +{ + uint64_t ticks; // number of microseconds since + // host system startup +} ATTRIBUTE_PACKED; +#define ECHO_COMMAND_SIZE (sizeof(::Barry::Protocol::Echo)) /////////////////////////////////////////////////////////////////////////////// @@ -360,18 +536,19 @@ AttributeFetch fetch; ModeSelect mode; uint8_t raw[1]; + Echo echo; - } __attribute__ ((packed)) u; -} __attribute__ ((packed)); -#define SOCKET_COMMAND_HEADER_SIZE (sizeof(Barry::Protocol::SocketCommand) - sizeof(Barry::Protocol::SocketCommand::PacketData)) + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define SOCKET_COMMAND_HEADER_SIZE (sizeof(::Barry::Protocol::SocketCommand) - sizeof(::Barry::Protocol::SocketCommand::PacketData)) struct SequenceCommand { - uint8_t unknown1; + uint8_t socket; // socket number, single byte uint8_t unknown2; uint8_t unknown3; uint32_t sequenceId; -} __attribute__ ((packed)); +} ATTRIBUTE_PACKED; struct DBCommand { @@ -387,9 +564,9 @@ DBC_IndexedUpload index_upload; uint8_t raw[1]; - } __attribute__ ((packed)) u; -} __attribute__ ((packed)); -#define DB_COMMAND_HEADER_SIZE (sizeof(Barry::Protocol::DBCommand) - sizeof(Barry::Protocol::DBCommand::Parameters)) + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define DB_COMMAND_HEADER_SIZE (sizeof(::Barry::Protocol::DBCommand) - sizeof(::Barry::Protocol::DBCommand::Parameters)) @@ -400,16 +577,16 @@ { uint16_t count; // number of fields in record OldDBDBField field[1]; -} __attribute__ ((packed)); -#define OLD_DBDB_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::DBR_OldDBDBRecord) - sizeof(Barry::Protocol::OldDBDBField)) +} ATTRIBUTE_PACKED; +#define OLD_DBDB_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::DBR_OldDBDBRecord) - sizeof(::Barry::Protocol::OldDBDBField)) struct DBR_DBDBRecord { uint16_t count; uint8_t unknown[3]; DBDBField field[1]; -} __attribute__ ((packed)); -#define DBDB_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::DBR_DBDBRecord) - sizeof(Barry::Protocol::DBDBField)) +} ATTRIBUTE_PACKED; +#define DBDB_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::DBR_DBDBRecord) - sizeof(::Barry::Protocol::DBDBField)) // Records with a uniqueId. This covers the following records: // @@ -427,9 +604,9 @@ union TaggedData { CommonField field[1]; - } __attribute__ ((packed)) u; -} __attribute__ ((packed)); -#define DBR_OLD_TAGGED_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::DBR_OldTaggedRecord) - sizeof(Barry::Protocol::DBR_OldTaggedRecord::TaggedData)) + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define DBR_OLD_TAGGED_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::DBR_OldTaggedRecord) - sizeof(::Barry::Protocol::DBR_OldTaggedRecord::TaggedData)) struct MessageRecord { @@ -444,14 +621,14 @@ uint32_t field7; // always 0x00000000 uint32_t field8; // always 0x00000000 uint16_t field9; // always 0x0000 - + uint16_t dateReceived; // the first two of these time fields are always the same - uint16_t timeReceived; // + uint16_t timeReceived; // uint16_t dateDuplicate; // On mail sent from the BB all three fields are identical uint16_t timeDuplicate; // (time sent) - uint16_t dateSent; + uint16_t dateSent; uint16_t timeSent; - + uint16_t priority; // priority field uint32_t field14; // always 0x00000000 uint32_t field15; // always 0x00000000 @@ -465,18 +642,18 @@ uint32_t inReplyTo; // reply to message? uint32_t field22; // always 0x00000000 uint16_t field23; // FIXME - + uint32_t folderOne; // these are the 'folders' the message is in uint32_t folderTwo; // - + uint16_t replyMessageFlags; // 0xfffe on recvd messages // 0x001b on reply // 0x0015 on send // 0x3 pin send // 0x2 on pin recv uint16_t field27; // set to 0x00000004 on PIN reply, 0x00000005 otherwise - uint32_t headerUID; // yet another copy of the UID (RecId) - + uint32_t headerUID; // yet another copy of the UID (RecId) + uint32_t field29; // always 0x00000000 uint16_t field30; // always 0x0002 uint16_t field31; // always 0x00000000 @@ -485,8 +662,8 @@ uint8_t field33; // always 'd' uint32_t timeBlock; // FIXME CommonField field[1]; -} __attribute__ ((packed)); -#define MESSAGE_RECORD_HEADER_SIZE (sizeof(Barry::Protocol::MessageRecord) - sizeof(Barry::Protocol::CommonField)) +} ATTRIBUTE_PACKED; +#define MESSAGE_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::MessageRecord) - sizeof(::Barry::Protocol::CommonField)) @@ -504,10 +681,10 @@ DBR_OldDBDBRecord old_dbdb; DBR_DBDBRecord dbdb; - } __attribute__ ((packed)) u; + } ATTRIBUTE_PACKED u; -} __attribute__ ((packed)); -#define DB_RESPONSE_HEADER_SIZE (sizeof(Barry::Protocol::DBResponse) - sizeof(Barry::Protocol::DBResponse::Parameters)) +} ATTRIBUTE_PACKED; +#define DB_RESPONSE_HEADER_SIZE (sizeof(::Barry::Protocol::DBResponse) - sizeof(::Barry::Protocol::DBResponse::Parameters)) @@ -527,14 +704,299 @@ uint8_t return_code; uint8_t fragment[1]; - } __attribute__ ((packed)) u; -} __attribute__ ((packed)); -#define SB_DBACCESS_HEADER_SIZE (sizeof(Barry::Protocol::DBAccess) - sizeof(Barry::Protocol::DBAccess::DBData)) + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define SB_DBACCESS_HEADER_SIZE (sizeof(::Barry::Protocol::DBAccess) - sizeof(::Barry::Protocol::DBAccess::DBData)) #define SB_DBACCESS_RETURN_CODE_SIZE (1) /////////////////////////////////////////////////////////////////////////////// +// Javaloader protocol structure + +struct JLDirEntry +{ + uint16_t unknown; + uint32_t timestamp; + uint16_t filename_size; + uint8_t filename[1]; + // the rest of the packet is variable length + // another string for version, then: + // uint32_t cod_size; + +} ATTRIBUTE_PACKED; +#define SB_JLDIRENTRY_HEADER_SIZE (sizeof(::Barry::Protocol::JLDirEntry) - 1) + +struct JLCommand +{ + uint8_t command; + uint8_t unknown; // nearly always 0, might be top half of command + uint16_t size; +} ATTRIBUTE_PACKED; +#define SB_JLCOMMAND_HEADER_SIZE (sizeof(::Barry::Protocol::JLCommand)) + +struct JLResponse +{ + uint8_t command; + uint8_t unknown; + uint16_t expect; +} ATTRIBUTE_PACKED; +#define SB_JLRESPONSE_HEADER_SIZE (sizeof(::Barry::Protocol::JLResponse)) + +struct JLScreenInfo +{ + uint16_t unknown1; + uint16_t unknown2; + uint16_t unknown3; + uint16_t width; + uint16_t height; + uint16_t unknown4; + uint16_t unknown5; + uint16_t unknown6; +} ATTRIBUTE_PACKED; +#define SB_JLSCREENINFO_SIZE (sizeof(::Barry::Protocol::JLScreenInfo)) + +struct JLEventlogEntry +{ + uint16_t size; + // remainder of packet is variable + // it contains the log data as an ASCII (UTF-8?) string +} ATTRIBUTE_PACKED; +#define SB_JLEVENTLOG_ENTRY_HEADER_SIZE (sizeof(::Barry::Protocol::JLEventlogEntry)) + +struct JLDeviceInfo +{ + uint32_t hardware_id; + uint32_t pin; + uint32_t os_version; + uint32_t vm_version; + uint32_t radio_id; + uint32_t vendor_id; + uint32_t active_wafs; + // older devices (such as 7130) don't this extra data in the + // device info packet and will therefore fail the size check + //uint8_t raw[4]; +} ATTRIBUTE_PACKED; +#define SB_JLDEVICEINFO_SIZE (sizeof(::Barry::Protocol::JLDeviceInfo)) + +struct JLPacket +{ + uint16_t socket; + uint16_t size; // total size of data packet + + union PacketData + { + JLCommand command; + JLResponse response; + JLScreenInfo screeninfo; + JLEventlogEntry logentry; + JLDeviceInfo devinfo; + uint8_t raw[1]; + char filename[1]; + uint32_t cod_size; + uint32_t timestamp; + uint16_t id; + } ATTRIBUTE_PACKED u; + +} ATTRIBUTE_PACKED; +#define SB_JLPACKET_HEADER_SIZE (sizeof(::Barry::Protocol::JLPacket) - sizeof(::Barry::Protocol::JLPacket::PacketData)) + + +/////////////////////////////////////////////////////////////////////////////// +// JavaDebug protocol structures + +namespace JDWP { + + // Packet command + //---------------- + + struct PacketEventRequestSet { + uint8_t eventKind; + uint8_t suspendPolicy; + uint32_t modifiers; + } ATTRIBUTE_PACKED; + + + struct PacketEventRequest { + union PacketEventRequestData { + PacketEventRequestSet set; + } ATTRIBUTE_PACKED u; + } ATTRIBUTE_PACKED; + + + struct PacketCommand { + uint8_t commandset; + uint8_t command; + + union PacketCommandData { + PacketEventRequest eventRequest; + } ATTRIBUTE_PACKED u; + } ATTRIBUTE_PACKED; + #define JDWP_COMMAND_HEADER_SIZE (sizeof(::Barry::Protocol::JDWP::PacketCommand)) + + + // Packet response + //----------------- + + struct PacketVirtualMachineIDSizes { + uint32_t fieldIDSize; + uint32_t methodIDSize; + uint32_t objectIDSize; + uint32_t referenceTypeIDSize; + uint32_t frameIDSize; + } ATTRIBUTE_PACKED; + + #define JDWP_PACKETVIRTUALMACHINEIDSIZES_DATA_SIZE sizeof(::Barry::Protocol::JDWP::PacketVirtualMachineIDSizes) + + + struct PacketVirtualMachine { + union PacketVirtualMachineData { + PacketVirtualMachineIDSizes IDSizes; + } ATTRIBUTE_PACKED u; + } ATTRIBUTE_PACKED; + + + struct PacketResponse { + uint16_t errorcode; + + union PacketResponseData { + PacketVirtualMachine virtualMachine; + uint32_t value; + uint8_t raw[1]; + } ATTRIBUTE_PACKED u; + } ATTRIBUTE_PACKED; + #define JDWP_RESPONSE_HEADER_SIZE (sizeof(::Barry::Protocol::JDWP::PacketResponse) - sizeof(::Barry::Protocol::JDWP::PacketResponse::PacketResponseData)) + + + // Generic packet + //---------------- + + struct Packet { + uint32_t length; + uint32_t id; + uint8_t flags; + + union PacketType { + PacketCommand command; + PacketResponse response; + } ATTRIBUTE_PACKED u; + } ATTRIBUTE_PACKED; + #define JDWP_PACKET_HEADER_SIZE (sizeof(::Barry::Protocol::JDWP::Packet) - sizeof(::Barry::Protocol::JDWP::Packet::PacketType)) + + + #define MAKE_JDWPPACKET(var, data) const ::Barry::Protocol::JDWP::Packet *var = (const ::Barry::Protocol::JDWP::Packet *) (data).GetData() + #define MAKE_JDWPPACKETPTR_BUF(var, ptr) ::Barry::Protocol::JDWP::Packet *var = (::Barry::Protocol::JDWP::Packet *)ptr + + +} // namespace JDWP + +struct JDWField { + uint32_t size; + + union JDWFieldData { + uint8_t raw[1]; + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define JDWP_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::JDWField) - sizeof(::Barry::Protocol::JDWField::JDWFieldData)) + +struct JVMCommand +{ + uint16_t size; + uint8_t command; + uint8_t raw[1]; +} ATTRIBUTE_PACKED; +#define SB_JVMCOMMAND_HEADER_SIZE (sizeof(::Barry::Protocol::JVMCommand)) + +struct JVMResponse +{ + uint8_t command; + uint8_t unknown; + uint16_t expect; +} ATTRIBUTE_PACKED; +#define SB_JVMRESPONSE_HEADER_SIZE (sizeof(::Barry::Protocol::JVMResponse)) + +struct JVMModulesList +{ + uint32_t nbr; + // remainder of packet is variable + // it contains the modules list +} ATTRIBUTE_PACKED; +#define SB_JVMMODULES_LIST_HEADER_SIZE (sizeof(::Barry::Protocol::JVMModulesList)) + +struct JVMModulesEntry +{ + uint32_t id; + uint32_t uniqueId; + uint16_t sizename; + // remainder of packet is variable + // it contains the module name +} ATTRIBUTE_PACKED; +#define SB_JVMMODULES_ENTRY_HEADER_SIZE (sizeof(::Barry::Protocol::JVMModulesEntry)) + +struct JVMThreadsList +{ + uint32_t nbr; + // remainder of packet is variable + // it contains the threads list +} ATTRIBUTE_PACKED; +#define SB_JVMTHREADS_LIST_HEADER_SIZE (sizeof(::Barry::Protocol::JVMThreadsList)) + +struct JVMUnknown01 +{ + uint8_t byte; + uint32_t address; +} ATTRIBUTE_PACKED; +#define SB_JVMUNKNOWN01_HEADER_SIZE (sizeof(::Barry::Protocol::JVMUnknown01)) + +struct JVMUnknown02 +{ + uint32_t address1; + uint32_t address2; +} ATTRIBUTE_PACKED; +#define SB_JVMUNKNOWN02_HEADER_SIZE (sizeof(::Barry::Protocol::JVMUnknown02)) + +struct JVMPacket +{ + uint16_t socket; + uint16_t size; // total size of data packet + + union PacketData + { + JVMCommand command; + JVMResponse response; + JVMModulesList moduleslist; + JVMThreadsList threadslist; + JVMUnknown01 unknown01; + JVMUnknown02 unknown02; + uint32_t address; + uint16_t expect; + uint16_t msglength; + uint16_t value; + uint8_t status; + uint8_t raw[1]; + } ATTRIBUTE_PACKED u; + +} ATTRIBUTE_PACKED; +#define SB_JVMPACKET_HEADER_SIZE (sizeof(::Barry::Protocol::JVMPacket) - sizeof(::Barry::Protocol::JVMPacket::PacketData)) + + +///////////////////////////////////////////////////////////////////////////// +// Raw channel packet structure +struct ChannelPacket +{ + uint16_t socket; // socket ID... 0 exists by default + uint16_t size; // total size of data packet + + union PacketData + { + uint8_t data[1]; + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define SB_CHANNELPACKET_HEADER_SIZE (sizeof(::Barry::Protocol::ChannelPacket) - sizeof(::Barry::Protocol::ChannelPacket::PacketData)) + +#define SB_CHANNELPACKET_MAX_DATA_SIZE 0x3FFC + +/////////////////////////////////////////////////////////////////////////////// // Main packet struct struct Packet @@ -551,17 +1013,19 @@ DBAccess db; uint8_t raw[1]; - } __attribute__ ((packed)) u; -} __attribute__ ((packed)); -#define SB_PACKET_HEADER_SIZE (sizeof(Barry::Protocol::Packet) - sizeof(Barry::Protocol::Packet::PacketData)) - -// minimum required sizes for various responses -#define MIN_PACKET_SIZE 6 + } ATTRIBUTE_PACKED u; +} ATTRIBUTE_PACKED; +#define SB_PACKET_SOCKET_SIZE (sizeof(uint16_t)) // size needed to read the socket in a packet +#define SB_PACKET_HEADER_SIZE (sizeof(::Barry::Protocol::Packet) - sizeof(::Barry::Protocol::Packet::PacketData)) + +// WARNING : For JavaLoader we have some packet with 5 size ! +#define MIN_PACKET_SIZE 5 +#define MIN_PACKET_DATA_SIZE 4 // maximum sizes -#define MAX_PACKET_SIZE 0x400 // anything beyond this needs to be - // fragmented +#define MAX_PACKET_SIZE 0x400 // anything beyond this needs to be fragmented +#define MAX_PACKET_DATA_SIZE 0x7FC // for data packet (JavaLoader) ///////////////////////////////////////////////////////////////////////////// // @@ -579,17 +1043,23 @@ #define SB_PACKET_UPLOAD_HEADER_SIZE (SB_PACKET_DBACCESS_HEADER_SIZE + UPLOAD_HEADER_SIZE) -#define SB_SEQUENCE_PACKET_SIZE (SB_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::SequenceCommand)) +#define SB_SEQUENCE_PACKET_SIZE (SB_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::SequenceCommand)) #define SB_SOCKET_PACKET_HEADER_SIZE (SB_PACKET_HEADER_SIZE + SOCKET_COMMAND_HEADER_SIZE) -#define SB_MODE_PACKET_COMMAND_SIZE (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect) - sizeof(Barry::Protocol::ModeSelect::ResponseBlock)) -#define SB_MODE_PACKET_RESPONSE_SIZE (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(Barry::Protocol::ModeSelect)) +#define SB_MODE_PACKET_COMMAND_SIZE (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::ModeSelect) - sizeof(::Barry::Protocol::ModeSelect::ResponseBlock)) +#define SB_MODE_PACKET_RESPONSE_SIZE (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::ModeSelect)) // Macros -#define COMMAND(data) (((const Barry::Protocol::Packet *)data.GetData())->command) +#define COMMAND(data) (((const ::Barry::Protocol::Packet *)data.GetData())->command) #define IS_COMMAND(data, cmd) (COMMAND(data) == cmd) -#define MAKE_PACKET(var, data) const Barry::Protocol::Packet *var = (const Barry::Protocol::Packet *) (data).GetData() -#define MAKE_PACKETPTR_BUF(var, ptr) Barry::Protocol::Packet *var = (Barry::Protocol::Packet *)ptr +#define MAKE_PACKET(var, data) const ::Barry::Protocol::Packet *var = (const ::Barry::Protocol::Packet *) (data).GetData() +#define MAKE_JLPACKET(var, data) const ::Barry::Protocol::JLPacket *var = (const ::Barry::Protocol::JLPacket *) (data).GetData() +#define MAKE_JVMPACKET(var, data) const ::Barry::Protocol::JVMPacket *var = (const ::Barry::Protocol::JVMPacket *) (data).GetData() +#define MAKE_CHANNELPACKET(var, data) const ::Barry::Protocol::ChannelPacket *var = (const ::Barry::Protocol::ChannelPacket *) (data).GetData() +#define MAKE_PACKETPTR_BUF(var, ptr) ::Barry::Protocol::Packet *var = (::Barry::Protocol::Packet *)ptr +#define MAKE_JLPACKETPTR_BUF(var, ptr) ::Barry::Protocol::JLPacket *var = (::Barry::Protocol::JLPacket *)ptr +#define MAKE_JVMPACKETPTR_BUF(var, ptr) ::Barry::Protocol::JVMPacket *var = (::Barry::Protocol::JVMPacket *)ptr +#define MAKE_CHANNELPACKETPTR_BUF(var, ptr) ::Barry::Protocol::ChannelPacket *var = (::Barry::Protocol::ChannelPacket *)ptr #define MAKE_RECORD(type,var,data,off) type *var = (type *) ((data).GetData() + (off)) #define MAKE_RECORD_PTR(type,var,data,off) type *var = (type *) ((data) + (off)) @@ -605,10 +1075,16 @@ // checks packet size and throws BError if not right -void CheckSize(const Barry::Data &packet, size_t requiredsize = MIN_PACKET_SIZE); +void CheckSize(const Barry::Data &packet, size_t requiredsize); unsigned int GetSize(const Barry::Data &packet); +bool IsSequencePacket(const Barry::Data &data); + }} // namespace Barry::Protocol +#if USE_PACK_PRAGMA +#pragma pack(pop) +#endif + #endif diff -Nru barry-0.14/src/publiccfg.h.in barry-0.0.20110506/src/publiccfg.h.in --- barry-0.14/src/publiccfg.h.in 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/publiccfg.h.in 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,31 @@ +/// +/// \file publiccfg.h.in +/// Configuration details that get installed. +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PUBLICCFG_H__ +#define __BARRY_PUBLICCFG_H__ + +// When ./configure runs in Linux, this always gets set to 1. +// When compiling under Windows, set to 1 if you want to compile against +// libusb, or 0 if some other USB driver. +#define USE_LIBUSB @USE_LIBUSB@ + +#endif + diff -Nru barry-0.14/src/r_bookmark.cc barry-0.0.20110506/src/r_bookmark.cc --- barry-0.14/src/r_bookmark.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_bookmark.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,386 @@ +/// +/// \file r_bookmark.cc +/// Record parsing class for the phone browser bookmarks database. +/// + +/* + Copyright (C) 2008-2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_bookmark.h" +#include "record-internal.h" +#include "protostructs.h" +#include "data.h" +#include "time.h" +#include "iconv.h" +#include "debug.h" +#include +#include +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// Bookmark Class + +// Bookmark Field Codes +#define BMKFC_BOOKMARK_TYPE 0x01 +#define BMKFC_STRUCT1 0x11 +#define BMKFC_STRUCT2 0x12 + +#define BMKFC_END 0xffff + +// Bookmark Struct1 section codes +#define BMK1SC_HOMEPAGE_KEY 0x85 // default section on 9550... + // has browser dropdown grayed + // out +#define BMK1SC_BOOKMARK_ID 0x87 // when user adds a bookmark +#define BMK1SC_BOOKMARK_ID2 0x84 // only Nicolas sees this? +#define BMK1SC_NAME 0x04 +#define BMK1SC_ICON 0x05 +#define BMK1SC_FOLDERS 0x81 + +static FieldLink BookmarkFieldLinks[] = { + { BMKFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } +}; + +Bookmark::Bookmark() +{ + Clear(); +} + +Bookmark::~Bookmark() +{ +} + +const unsigned char* Bookmark::ParseStruct1Field(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + // grab section type + const uint8_t type = *begin; + begin += 1; + if( begin > end ) + return begin; + + switch( type ) + { + case BMK1SC_HOMEPAGE_KEY: + case BMK1SC_BOOKMARK_ID: + case BMK1SC_BOOKMARK_ID2: + { + const BookmarkId *id = (const BookmarkId*) begin; + begin += BOOKMARK_ID_SIZE; + if( begin > end ) + return begin; + + // not sure where id->bookmark_id links to, so ignore + // for now... + Index = id->index; + } + return begin; + + case BMK1SC_NAME: + case BMK1SC_ICON: + { + const VarStringField *f = (const VarStringField*) begin; + begin += VARSTRING_FIELD_HEADER_SIZE; + if( begin > end ) + return begin; + + const uint16_t size = be_btohs(f->be_size); + + if( f->present == 1) { // if field is defined + begin += size; + if( begin > end ) + return begin; + + switch( type ) + { + case BMK1SC_NAME: + Name = ParseFieldString(f->data, size); + break; + case BMK1SC_ICON: + Icon = ParseFieldString(f->data, size); + break; + default: + throw std::logic_error("Check cases"); + break; + } + } + else if( f->present == 0 && size > 0xA0 ) { + // FIXME - a size of 0xA5 seems to occasionally + // appear, with 5 bytes of id-looking data + // we just skip it here.... note this + // may be a different field, but it meshes + // itself into the ICON section somehow, + // that is unclear +// +// example with the A5, before modification to add '?' +// Type: 0x11 Data: +// 00000000: 85 9b ed ca 13 00 04 01 00 09 48 6f 6d 65 20 50 ..........Home P +// 00000010: 61 67 65 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 00 age............. +// 00000020: 00 a5 b8 f0 97 e4 3a 00 00 01 ......:... +// +// example without the A5, after record modified: +// Type: 0x11 Data: +// 00000000: 85 9b ed ca 13 00 04 01 00 0a 48 6f 6d 65 20 50 ..........Home P +// 00000010: 61 67 65 3f 81 b9 fc f8 f6 c2 e3 a4 d5 08 01 05 age?............ +// 00000020: 00 00 00 00 00 01 ...... +// + + begin += size & 0x0F; + } + } + return begin; + + case BMK1SC_FOLDERS: + { + //const BookmarkFolders *f = (const BookmarkFolders*) begin; + begin += BOOKMARK_FOLDERS_HEADER_SIZE; + if( begin > end ) + return begin; + + // currently don't know how to link these to + // anything else in the device.... skipping + } + return begin; + +/* + case 0x08: + isdefined = *b; + b += sizeof(uint8_t); + if (isdefined == 1) { // if field is defined + const uint16_t size = be_btohs(*((const uint16_t *) b)); + b += sizeof(uint16_t); + b += size; + } + break; +*/ + + default: + // if we are 3 bytes away from the end, these are the + // display, javascript, and browser identity flags + // (make sure to account for the type we ate above) + if( (end - begin) == 2 ) { + if ((Barry::Bookmark::DisplayModeType) *(begin - 3) > Barry::Bookmark::DisplayUnknown) + DisplayMode = Barry::Bookmark::DisplayUnknown; + else + DisplayMode = (Barry::Bookmark::DisplayModeType) *(begin - 3); + + if ((Barry::Bookmark::JavaScriptModeType) *(begin - 2) > Barry::Bookmark::JavaScriptUnknown) + JavaScriptMode = Barry::Bookmark::JavaScriptUnknown; + else + JavaScriptMode = (Barry::Bookmark::JavaScriptModeType) *(begin - 2); + + if ((Barry::Bookmark::BrowserIdentityType) *(begin - 1) > Barry::Bookmark::IdentityUnknown) + BrowserIdentity = Barry::Bookmark::IdentityUnknown; + else + BrowserIdentity = (Barry::Bookmark::BrowserIdentityType) *(begin - 1); + } + // if we are at the beginning, this could be the 7750 + // with its odd no-code ID... the 7750 seems to have + // a BOOKMARK_ID record without any code byte, + // so check that the data looks like this: + // XX XX XX XX 00 + // with the 4 byte ID and the index of 0, being the + // first default bookmark + else if( (begin + 3) < end && begin[3] == 0 ) { + // recurse into ourselves + return ParseStruct1Field(begin + 4, end, ic); + } + else { + ddout("Bookmark parser: unknown section type: " + << std::hex << (unsigned int) type); + } + break; + } + + return begin; +} + +const unsigned char* Bookmark::ParseStruct2(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + // first field in struct2 seems to always be the URL + + // grab size and advance over string, checking sizes + const StringField *field = (const StringField*) begin; + begin += STRING_FIELD_HEADER_SIZE; + if( begin > end ) + return begin; + + const uint16_t size = be_btohs(field->be_size); + begin += sizeof(uint16_t) + size; + if( begin > end ) // if begin==end, we are ok + return begin; + + Url = ParseFieldString(field->data, size); + + // FIXME - more fields after this, but unknown meaning + + return begin; +} + +const unsigned char* Bookmark::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *) begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !btohs(field->size) ) // if field has no size, something's up + return begin; + + + const unsigned char *b = field->u.raw; + const unsigned char *e = begin; + + // handle special cases + switch( field->type ) + { + case BMKFC_STRUCT1: + while (b <= e) { + b = ParseStruct1Field(b, e, ic); + } + return b; + + case BMKFC_BOOKMARK_TYPE: + // above size check guarantees at least one byte, + // so this is safe + if( field->u.raw[0] != 'D' ) { + throw Error( "Bookmark::ParseField: BookmarkType is not 'D'" ); + } + return begin; + + case BMKFC_STRUCT2: + begin = ParseStruct2(b, e, ic); + return begin; + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + // return new pointer for next field + return begin; +} + +void Bookmark::ParseHeader(const Data &data, size_t &offset) +{ + // no header in Bookmark records +} + +void Bookmark::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void Bookmark::BuildHeader(Data &data, size_t &offset) const +{ + // not yet implemented +} + +void Bookmark::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + // not yet implemented +} + +void Bookmark::Dump(std::ostream &os) const +{ + static const char *DisplayModeName[] = { "Automatic", "Enabled", "Disabled", "Unknown" }; + static const char *JavaScriptModeName[] = { "Automatic", "Enabled", "Disabled", "Unknown" }; + static const char *BrowserIdentityName[] = { "Automatic", "BlackBerry", "FireFox", "Internet Explorer", "Unknown" }; + + os << "Bookmark entry: 0x" << setbase(16) << RecordId + << " (" << (unsigned int)RecType << ")" + << " (index " << (unsigned int)Index << ")\n"; + + // cycle through the type table + for( const FieldLink *b = BookmarkFieldLinks; + b->type != BMKFC_END; + b++ ) + { + if( b->strMember ) { + const std::string &s = this->*(b->strMember); + if( s.size() ) + os << " " << b->name << ": " << s << "\n"; + } + else if( b->timeMember ) { + time_t t = this->*(b->timeMember); + if( t > 0 ) + os << " " << b->name << ": " << ctime(&t); + else + os << " " << b->name << ": unknown\n"; + } + } + + if( Name.size() ) + os << " Name: " << Name << "\n"; + if( Icon.size() ) + os << " Icon: " << Icon << "\n"; + if( Url.size() ) + os << " Url: " << Url << "\n"; + os << " Display mode: " << DisplayModeName[DisplayMode] << "\n"; + os << " JavaScript mode: " << JavaScriptModeName[JavaScriptMode] << "\n"; + os << " Browser Identity mode: " << BrowserIdentityName[BrowserIdentity] << "\n"; + + os << Unknowns; + os << "\n\n"; +} + +bool Bookmark::operator<(const Bookmark &other) const +{ + int cmp = Name.compare(other.Name); + return cmp < 0; +} + +void Bookmark::Clear() +{ + RecType = GetDefaultRecType(); + RecordId = 0; + Index = 0; + + Name.clear(); + Icon.clear(); + Url.clear(); + + BrowserIdentity = IdentityUnknown; + DisplayMode = DisplayUnknown; + JavaScriptMode = JavaScriptUnknown; + + Unknowns.clear(); +} + +std::string Bookmark::GetDescription() const +{ + return Name; +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_bookmark.h barry-0.0.20110506/src/r_bookmark.h --- barry-0.14/src/r_bookmark.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_bookmark.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,124 @@ +/// +/// \file r_bookmark.h +/// Record parsing class for call logs +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_BOOKMARK_H__ +#define __BARRY_RECORD_BOOKMARK_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include + +namespace Barry { + +// forward declarations +class IConverter; + +class BXEXPORT Bookmark +{ +public: + typedef Barry::UnknownsType UnknownsType; + + uint8_t RecType; + uint32_t RecordId; + + uint8_t Index; + + std::string Name; + std::string Icon; + std::string Url; + + enum BrowserIdentityType + { + IdentityAuto = 0, + IdentityBlackBerry, + IdentityFireFox, + IdentityInternetExplorer, + IdentityUnknown + }; + BrowserIdentityType BrowserIdentity; + + enum DisplayModeType + { + DisplayAuto = 0, + DisplayColomn, + DisplayPage, + DisplayUnknown + }; + DisplayModeType DisplayMode; + + enum JavaScriptModeType + { + JavaScriptAuto = 0, + JavaScriptEnabled, + JavaScriptDisabled, + JavaScriptUnknown + }; + JavaScriptModeType JavaScriptMode; + + UnknownsType Unknowns; + +protected: + const unsigned char* ParseStruct1Field(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + const unsigned char* ParseStruct2(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + +public: + Bookmark(); + ~Bookmark(); + + // Parser / Builder API (see parser.h / builder.h) + const unsigned char* ParseField(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + + // operations (common among record classes + void Clear(); + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + // Sorting - use enough data to make the sorting as + // consistent as possible + bool operator<(const Bookmark &other) const; + + // database name + static const char * GetDBName() { return "Browser Bookmarks"; } + static uint8_t GetDefaultRecType() { return 1; } +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Bookmark &msg) { + msg.Dump(os); + return os; +} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_calendar.cc barry-0.0.20110506/src/r_calendar.cc --- barry-0.14/src/r_calendar.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_calendar.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,6 +27,7 @@ #include "time.h" #include "error.h" #include "endian.h" +#include "iconv.h" #include #include #include @@ -43,6 +44,39 @@ /////////////////////////////////////////////////////////////////////////////// +// Calendar class, static members + +// +// Note! These functions currently only pass the same values through. +// In actuality, these are technically two different values: +// one on the raw protocol side, and the other part of the +// guaranteed Barry API. If the Blackberry ever changes the +// meanings for these codes, do the translation here. +// + +Calendar::FreeBusyFlagType Calendar::FreeBusyFlagProto2Rec(uint8_t f) +{ + return (FreeBusyFlagType)f; +} + +uint8_t Calendar::FreeBusyFlagRec2Proto(FreeBusyFlagType f) +{ + return f; +} + +Calendar::ClassFlagType Calendar::ClassFlagProto2Rec(uint8_t f) +{ + return (ClassFlagType)f; +} + +uint8_t Calendar::ClassFlagRec2Proto(ClassFlagType f) +{ + return f; +} + + + +/////////////////////////////////////////////////////////////////////////////// // Calendar class // calendar field codes @@ -53,23 +87,29 @@ #define CALFC_NOTIFICATION_TIME 0x05 #define CALFC_START_TIME 0x06 #define CALFC_END_TIME 0x07 -#define CALFC_RECURRENCE_DATA 0x0c +#define CALFC_ACCEPTED_BY 0x0b #define CALFC_VERSION_DATA 0x10 +#define CALFC_INVITED 0x15 +#define CALFC_ORGANIZER 0x16 #define CALFC_NOTIFICATION_DATA 0x1a #define CALFC_FREEBUSY_FLAG 0x1c #define CALFC_TIMEZONE_CODE 0x1e // only seems to show up if recurring #define CALFC_CLASS_FLAG 0x28 // private flag from outlook +#define CALFC_CALENDAR_ID 0x2b // Calendar using (new devices have several calendar) #define CALFC_ALLDAYEVENT_FLAG 0xff #define CALFC_END 0xffff -FieldLink CalendarFieldLinks[] = { - { CALFC_SUBJECT, "Subject", 0, 0, &Calendar::Subject, 0, 0 }, - { CALFC_NOTES, "Notes", 0, 0, &Calendar::Notes, 0, 0 }, - { CALFC_LOCATION, "Location", 0, 0, &Calendar::Location, 0, 0 }, - { CALFC_NOTIFICATION_TIME,"Notification Time",0,0, 0, 0, &Calendar::NotificationTime }, - { CALFC_START_TIME, "Start Time", 0, 0, 0, 0, &Calendar::StartTime }, - { CALFC_END_TIME, "End Time", 0, 0, 0, 0, &Calendar::EndTime }, - { CALFC_END, "End of List",0, 0, 0, 0, 0 } +static FieldLink CalendarFieldLinks[] = { + { CALFC_SUBJECT, "Subject", 0, 0, &Calendar::Subject, 0, 0, 0, 0, true }, + { CALFC_NOTES, "Notes", 0, 0, &Calendar::Notes, 0, 0, 0, 0, true }, + { CALFC_LOCATION, "Location", 0, 0, &Calendar::Location, 0, 0, 0, 0, true }, + { CALFC_NOTIFICATION_TIME,"Notification Time",0,0, 0, 0, &Calendar::NotificationTime, 0, 0, false }, + { CALFC_START_TIME, "Start Time", 0, 0, 0, 0, &Calendar::StartTime, 0, 0, false }, + { CALFC_END_TIME, "End Time", 0, 0, 0, 0, &Calendar::EndTime, 0, 0, false }, + { CALFC_ORGANIZER, "Organizer", 0, 0, 0, &Calendar::Organizer, 0, 0, 0, true }, + { CALFC_ACCEPTED_BY,"Accepted By",0, 0, 0, &Calendar::AcceptedBy, 0, 0, 0, true }, + { CALFC_INVITED, "Invited", 0, 0, 0, &Calendar::Invited, 0, 0, 0, true }, + { CALFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } }; Calendar::Calendar() @@ -82,7 +122,8 @@ } const unsigned char* Calendar::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -103,6 +144,8 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } else if( b->timeMember && btohs(field->size) == 4 ) { @@ -111,6 +154,40 @@ t = min2time(field->u.min1900); return begin; } + else if( b->addrMember ) { + // + // parse email address + // get dual addr+name string first + // Note: this is a different format than + // used in r_message*.cc + // + std::string dual((const char*)field->u.raw, btohs(field->size)); + + EmailAddress a; + + // assign first string, using null terminator + // letting std::string add it for us if it + // doesn't exist + a.Email = dual.c_str(); + + // assign second string, using first size + // as starting point + a.Name = dual.c_str() + a.Email.size() + 1; + + // if the address is non-empty, add to list + if( a.size() ) { + // i18n convert if needed + if( b->iconvNeeded && ic ) { + a.Name = ic->FromBB(a.Name); + a.Email = ic->FromBB(a.Email); + } + + EmailAddressList &al = this->*(b->addrMember); + al.push_back(a); + } + + return begin; + } } } @@ -137,21 +214,11 @@ AllDayEvent = field->u.raw[0] == 1; return begin; - case CALFC_RECURRENCE_DATA: - if( btohs(field->size) >= CALENDAR_RECURRENCE_DATA_FIELD_SIZE ) { - // good data - ParseRecurrenceData(&field->u.raw[0]); - } - else { - // not enough data! - throw Error("Calendar::ParseField: not enough data in recurrence data field"); - } - return begin; - case CALFC_TIMEZONE_CODE: if( btohs(field->size) == 2 ) { // good data TimeZoneCode = btohs(field->u.code); + TimeZoneValid = true; } else { throw Error("Calendar::ParseField: not enough data in time zone code field"); @@ -159,20 +226,33 @@ return begin; case CALFC_FREEBUSY_FLAG: - FreeBusyFlag = (FreeBusyFlagType)field->u.raw[0]; - if( FreeBusyFlag > OutOfOffice ) { + if( field->u.raw[0] > CR_FREEBUSY_RANGE_HIGH ) { throw Error("Calendar::ParseField: FreeBusyFlag out of range" ); } + FreeBusyFlag = FreeBusyFlagProto2Rec(field->u.raw[0]); + return begin; + + case CALFC_CALENDAR_ID: + if( btohs(field->size) == 8 ) { + CalendarID = btohll(field->u.uint64); + } + else { + throw Error("Calendar::ParseField: size data unknown in calendar field"); + } return begin; case CALFC_CLASS_FLAG: - ClassFlag = (ClassFlagType)field->u.raw[0]; - if( ClassFlag > Private ) { + if( field->u.raw[0] > CR_CLASS_RANGE_HIGH ) { throw Error("Calendar::ParseField: ClassFlag out of range" ); } + ClassFlag = ClassFlagProto2Rec(field->u.raw[0]); return begin; } + // base class handles recurring data + if( RecurBase::ParseField(field->type, field->u.raw, btohs(field->size), ic) ) + return begin; + // if still not handled, add to the Unknowns list UnknownField uf; uf.type = field->type; @@ -183,145 +263,15 @@ return begin; } -// this function assumes the size has already been checked -void Calendar::ParseRecurrenceData(const void *data) -{ - const CalendarRecurrenceDataField *rec = - (const CalendarRecurrenceDataField*) data; - - Interval = btohs(rec->interval); - if( Interval < 1 ) - Interval = 1; // must always be >= 1 - - if( rec->endTime == 0xffffffff ) { - Perpetual = true; - } - else { - RecurringEndTime = min2time(rec->endTime); - Perpetual = false; - } - - switch( rec->type ) - { - case CRDF_TYPE_DAY: - RecurringType = Day; - // no extra data - break; - - case CRDF_TYPE_MONTH_BY_DATE: - RecurringType = MonthByDate; - DayOfMonth = rec->u.month_by_date.monthDay; - break; - - case CRDF_TYPE_MONTH_BY_DAY: - RecurringType = MonthByDay; - DayOfWeek = rec->u.month_by_day.weekDay; - WeekOfMonth = rec->u.month_by_day.week; - break; - - case CRDF_TYPE_YEAR_BY_DATE: - RecurringType = YearByDate; - DayOfMonth = rec->u.year_by_date.monthDay; - MonthOfYear = rec->u.year_by_date.month; - break; - - case CRDF_TYPE_YEAR_BY_DAY: - RecurringType = YearByDay; - DayOfWeek = rec->u.year_by_day.weekDay; - WeekOfMonth = rec->u.year_by_day.week; - MonthOfYear = rec->u.year_by_day.month; - break; - - case CRDF_TYPE_WEEK: - RecurringType = Week; - - // Note: this simple copy is only possible since - // the CAL_WD_* constants are the same as CRDF_WD_* constants. - // If this ever changes, this code will need to change. - WeekDays = rec->u.week.days; - break; - - default: - eout("Unknown recurrence data type: " << rec->type); - throw Error("Unknown recurrence data type"); - } -} - -// this function assumes there is CALENDAR_RECURRENCE_DATA_FIELD_SIZE bytes -// available in data -void Calendar::BuildRecurrenceData(void *data) const -{ - if( !Recurring ) - throw Error("Calendar::BuildRecurrenceData: Attempting to build recurrence data on non-recurring record."); - - CalendarRecurrenceDataField *rec = (CalendarRecurrenceDataField*) data; - - // set all to zero - memset(data, 0, CALENDAR_RECURRENCE_DATA_FIELD_SIZE); - - rec->interval = htobs(Interval); - rec->startTime = time2min(StartTime); - if( Perpetual ) - rec->endTime = 0xffffffff; - else - rec->endTime = time2min(RecurringEndTime); - - switch( RecurringType ) - { - case Day: - rec->type = CRDF_TYPE_DAY; - // no extra data - break; - - case MonthByDate: - rec->type = CRDF_TYPE_MONTH_BY_DATE; - rec->u.month_by_date.monthDay = DayOfMonth; - break; - - case MonthByDay: - rec->type = CRDF_TYPE_MONTH_BY_DAY; - rec->u.month_by_day.weekDay = DayOfWeek; - rec->u.month_by_day.week = WeekOfMonth; - break; - - case YearByDate: - rec->type = CRDF_TYPE_YEAR_BY_DATE; - rec->u.year_by_date.monthDay = DayOfMonth; - rec->u.year_by_date.month = MonthOfYear; - break; - - case YearByDay: - rec->type = CRDF_TYPE_YEAR_BY_DAY; - rec->u.year_by_day.weekDay = DayOfWeek; - rec->u.year_by_day.week = WeekOfMonth; - rec->u.year_by_day.month = MonthOfYear; - break; - - case Week: - rec->type = CRDF_TYPE_WEEK; - - // Note: this simple copy is only possible since - // the CAL_WD_* constants are the same as CRDF_WD_* constants. - // If this ever changes, this code will need to change. - rec->u.week.days = WeekDays; - break; - - default: - eout("Calendar::BuildRecurrenceData: " - "Unknown recurrence data type: " << rec->type); - throw Error("Calendar::BuildRecurrenceData: Unknown recurrence data type"); - } -} - void Calendar::ParseHeader(const Data &data, size_t &offset) { // no header in Calendar records } -void Calendar::ParseFields(const Data &data, size_t &offset) +void Calendar::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } @@ -335,7 +285,7 @@ // /// Build fields part of record. /// -void Calendar::BuildFields(Data &data, size_t &offset) const +void Calendar::BuildFields(Data &data, size_t &offset, const IConverter *ic) const { data.Zap(); @@ -354,29 +304,64 @@ if( b->strMember ) { const std::string &s = this->*(b->strMember); if( s.size() ) - BuildField(data, offset, b->type, s); + BuildField(data, offset, b->type, (b->iconvNeeded && ic) ? ic->ToBB(s) : s); } else if( b->timeMember ) { time_t t = this->*(b->timeMember); if( t > 0 ) BuildField1900(data, offset, b->type, t); } + else if( b->addrMember ) { + const EmailAddressList &al = this->*(b->addrMember); + EmailAddressList::const_iterator lb = al.begin(), le = al.end(); + + // add all entries in list + for( ; lb != le; ++lb ) { + + // skip empty entries + if( !lb->size() ) + continue; + + std::string Name = lb->Name, + Email = lb->Email; + + // do i18n conversion only if needed + if( b->iconvNeeded && ic ) { + Name = ic->ToBB(Name); + Email = ic->ToBB(Email); + } + + // + // Build an addr+name field, each string + // null terminated. + // Note: this is a different format than + // what is used in r_message*.cc + // + std::string field(lb->Email.c_str(), lb->Email.size() + 1); + field.append(lb->Name.c_str(), lb->Name.size() + 1); + BuildField(data, offset, b->type, field.data(), field.size()); + } + } } // handle special cases - if( Recurring ) { CalendarRecurrenceDataField recur; - BuildRecurrenceData(&recur); - BuildField(data, offset, CALFC_RECURRENCE_DATA, + BuildRecurrenceData(StartTime, &recur); + BuildField(data, offset, RecurBase::RecurringFieldType(), &recur, CALENDAR_RECURRENCE_DATA_FIELD_SIZE); } if( TimeZoneValid ) BuildField(data, offset, CALFC_TIMEZONE_CODE, TimeZoneCode); - BuildField(data, offset, CALFC_FREEBUSY_FLAG, (char)FreeBusyFlag); - BuildField(data, offset, CALFC_CLASS_FLAG, (char)ClassFlag); + BuildField(data, offset, CALFC_FREEBUSY_FLAG, FreeBusyFlagRec2Proto(FreeBusyFlag)); + BuildField(data, offset, CALFC_CLASS_FLAG, ClassFlagRec2Proto(ClassFlag)); + + // If CalendarID is defined and most of supported ! + // (by default 0xffff ffff ffff ffff) + if( CalendarID != (uint64_t) -1 ) + BuildField(data, offset, CALFC_CALENDAR_ID, CalendarID); // and finally save unknowns UnknownsType::const_iterator @@ -390,50 +375,61 @@ void Calendar::Clear() { - RecType = Calendar::GetDefaultRecType(); + // clear the base class too + RecurBase::Clear(); + + // clear our fields + RecType = GetDefaultRecType(); + RecordId = 0; AllDayEvent = false; Subject.clear(); Notes.clear(); Location.clear(); NotificationTime = StartTime = EndTime = 0; + Organizer.clear(); + AcceptedBy.clear(); + Invited.clear(); FreeBusyFlag = Free; ClassFlag = Public; - Recurring = false; - RecurringType = Calendar::Week; - Interval = 1; - RecurringEndTime = 0; - Perpetual = false; + CalendarID = btohll((uint64_t) -1); + TimeZoneCode = GetTimeZoneCode(0, 0); // default to GMT TimeZoneValid = false; - DayOfWeek = WeekOfMonth = DayOfMonth = MonthOfYear = 0; - WeekDays = 0; Unknowns.clear(); } -void Calendar::Dump(std::ostream &os) const +std::string Calendar::GetDescription() const +{ + return Subject; +} + +void Calendar::DumpSpecialFields(std::ostream &os) const { - static const char *DayNames[] = { "Sun", "Mon", "Tue", "Wed", - "Thu", "Fri", "Sat" }; - static const char *MonthNames[] = { "Jan", "Feb", "Mar", "Apr", - "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static const char *ClassTypes[] = { "Public", "Confidential", "Private" }; static const char *FreeBusy[] = { "Free", "Tentative", "Busy", "Out of Office" }; + os << " Calendar ID: 0x" << setbase(16) << CalendarID << "\n"; + os << " All Day Event: " << (AllDayEvent ? "yes" : "no") << "\n"; + os << " Class: " << ClassTypes[ClassFlag] << "\n"; + os << " Free/Busy: " << FreeBusy[FreeBusyFlag] << "\n"; + if( TimeZoneValid ) + os << " Time Zone: " << GetTimeZone(TimeZoneCode)->Name << "\n"; +} + +void Calendar::Dump(std::ostream &os) const +{ + // FIXME - need a "check all data" function that make sure that all // recurrence data is within range. Then call that before using // the data, such as in Build and in Dump. os << "Calendar entry: 0x" << setbase(16) << RecordId << " (" << (unsigned int)RecType << ")\n"; - os << " All Day Event: " << (AllDayEvent ? "yes" : "no") << "\n"; - os << " Class: " << ClassTypes[ClassFlag] << "\n"; - os << " Free/Busy: " << FreeBusy[FreeBusyFlag] << "\n"; - if( TimeZoneValid ) - os << " Time Zone: " << GetTimeZone(TimeZoneCode)->Name << "\n"; + DumpSpecialFields(os); // cycle through the type table for( const FieldLink *b = CalendarFieldLinks; @@ -452,78 +448,121 @@ else os << " " << b->name << ": disabled\n"; } + else if( b->addrMember ) { + const EmailAddressList &al = this->*(b->addrMember); + EmailAddressList::const_iterator lb = al.begin(), le = al.end(); + + for( ; lb != le; ++lb ) { + if( !lb->size() ) + continue; + + os << " " << b->name << ": " << *lb << "\n"; + } + } } // print recurrence data if available - os << " Recurring: " << (Recurring ? "yes" : "no") << "\n"; - if( Recurring ) { - switch( RecurringType ) - { - case Day: - os << " Every day.\n"; - break; + RecurBase::Dump(os); - case MonthByDate: - os << " Every month on the " - << DayOfMonth - << (DayOfMonth == 1 ? "st" : "") - << (DayOfMonth == 2 ? "nd" : "") - << (DayOfMonth == 3 ? "rd" : "") - << (DayOfMonth > 3 ? "th" : "") - << "\n"; - break; + // print any unknowns + os << Unknowns; +} - case MonthByDay: - os << " Every month on the " - << DayNames[DayOfWeek] - << " of week " - << WeekOfMonth - << "\n"; - break; +bool Calendar::operator<(const Calendar &other) const +{ + if( StartTime < other.StartTime ) + return true; + else if( StartTime > other.StartTime ) + return false; + + int cmp = Subject.compare(other.Subject); + if( cmp == 0 ) + cmp = Location.compare(other.Location); + return cmp < 0; +} - case YearByDate: - os << " Every year on " - << MonthNames[MonthOfYear-1] - << " " << DayOfMonth << "\n"; - break; - case YearByDay: - os << " Every year in " << MonthNames[MonthOfYear-1] - << " on " - << DayNames[DayOfWeek] - << " of week " << WeekOfMonth << "\n"; - break; +/////////////////////////////////////////////////////////////////////////////// +// Calendar-All class - case Week: - os << " Every week on: "; - if( WeekDays & CAL_WD_SUN ) os << "Sun "; - if( WeekDays & CAL_WD_MON ) os << "Mon "; - if( WeekDays & CAL_WD_TUE ) os << "Tue "; - if( WeekDays & CAL_WD_WED ) os << "Wed "; - if( WeekDays & CAL_WD_THU ) os << "Thu "; - if( WeekDays & CAL_WD_FRI ) os << "Fri "; - if( WeekDays & CAL_WD_SAT ) os << "Sat "; - os << "\n"; - break; +// calendar-all field codes +#define CALALLFC_CALENDAR_ID 0x02 // Calendar using (new devices have several calendar) +#define CALALLFC_MAIL_ACCOUNT 0x03 +#define CALALLFC_UNIQUEID 0x05 +#define CALALLFC_CAL_OBJECT 0x0a +#define CALALLFC_END 0xffff - default: - os << " Unknown recurrence type\n"; +void CalendarAll::Clear() +{ + Calendar::Clear(); + + MailAccount.clear(); +} + +void CalendarAll::ParseHeader(const Data &data, size_t &offset) +{ + const unsigned char *b = (const unsigned char*) (data.GetData() + offset); + const unsigned char *e = (const unsigned char*) (data.GetData() + data.GetSize()); + + while( (b + COMMON_FIELD_HEADER_SIZE) < e ) { + const CommonField *field = (const CommonField *) b; + + // advance and check size + b += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( b > e ) // if begin==end, we are ok + continue; + + if( !btohs(field->size) ) // if field has no size, something's up + continue; + + // handle special cases + if( field->type == CALALLFC_CAL_OBJECT ) + { + b -= btohs(field->size); + // end of header break; } - os << " Interval: " << Interval << "\n"; + switch( field->type ) + { + case CALALLFC_CALENDAR_ID: + if( btohs(field->size) == 8 ) { + CalendarID = btohll(field->u.uint64); + } + else { + throw Error("CalendarAll::ParseField: size data unknown in calendar field"); + } + continue; - if( Perpetual ) - os << " Ends: never\n"; - else - os << " Ends: " - << ctime(&RecurringEndTime); + case CALALLFC_MAIL_ACCOUNT: + MailAccount = ParseFieldString(field); + continue; + + case CALALLFC_UNIQUEID: + if( btohs(field->size) == 4 ) { + RecordId = btohl(field->u.uint32); + } + else { + throw Error("CalendarAll::ParseHeader: size data unknown in calendar field"); + } + continue; + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); } - // print any unknowns - os << Unknowns; + offset += b - (data.GetData() + offset); } +void CalendarAll::DumpSpecialFields(std::ostream &os) const +{ + Calendar::DumpSpecialFields(os); + os << " Mail Account: " << MailAccount << "\n"; +} } // namespace Barry diff -Nru barry-0.14/src/r_calendar.h barry-0.0.20110506/src/r_calendar.h --- barry-0.14/src/r_calendar.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_calendar.h 2011-05-06 12:20:17.000000000 +0000 @@ -1,10 +1,10 @@ /// /// \file r_calendar.h -/// Blackberry database record parser class for calndar records. +/// Blackberry database record parser class for calendar records. /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,6 +24,7 @@ #include "dll.h" #include "record.h" +#include "r_recur_base.h" #include #include #include @@ -32,6 +33,9 @@ namespace Barry { +// forward declarations +class IConverter; + // // NOTE: All classes here must be container-safe! Perhaps add sorting // operators in the future. @@ -42,10 +46,10 @@ /// \addtogroup RecordParserClasses /// @{ -class BXEXPORT Calendar +class BXEXPORT Calendar : public RecurBase { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; uint8_t RecType; uint32_t RecordId; @@ -58,6 +62,9 @@ time_t NotificationTime; // 0 means notification is off time_t StartTime; time_t EndTime; + EmailAddressList Organizer; + EmailAddressList AcceptedBy; + EmailAddressList Invited; // list of invited people (email a /// /// Free Busy Flag @@ -92,41 +99,8 @@ ClassFlagType ClassFlag; - /// - /// Recurring data - /// - /// Note: interval can be used on all of these recurring types to - /// make it happen "every other time" or more, etc. - /// - enum RecurringCodeType { - Day = 1, //< eg. every day - //< set: nothing - MonthByDate = 3, //< eg. every month on the 12th - //< set: DayOfMonth - MonthByDay = 4, //< eg. every month on 3rd Wed - //< set: DayOfWeek and WeekOfMonth - YearByDate = 5, //< eg. every year on March 5 - //< set: DayOfMonth and MonthOfYear - YearByDay = 6, //< eg. every year on 3rd Wed of Jan - //< set: DayOfWeek, WeekOfMonth, and - //< MonthOfYear - Week = 12 //< eg. every week on Mon and Fri - //< set: WeekDays - }; - - - - bool Recurring; - RecurringCodeType RecurringType; - unsigned short Interval; // must be >= 1 - time_t RecurringEndTime; // only pertains if Recurring is true - // sets the date and time when - // recurrence of this appointment - // should no longer occur - // If a perpetual appointment, this - // is 0xFFFFFFFF in the low level data - // Instead, set the following flag. - bool Perpetual; // if true, this will always recur + uint64_t CalendarID; // Calendar ID (usefull if devices have several calendars) + unsigned short TimeZoneCode; // the time zone originally used // for the recurrence data... // seems to have little use, but @@ -135,30 +109,21 @@ bool TimeZoneValid; // true if the record contained a // time zone code - unsigned short // recurring details, depending on type - DayOfWeek, // 0-6 - WeekOfMonth, // 1-5 - DayOfMonth, // 1-31 - MonthOfYear; // 1-12 - unsigned char WeekDays; // bitmask, bit 0 = sunday - -// FIXME - put these somewhere usable by both C and C++ - #define CAL_WD_SUN 0x01 - #define CAL_WD_MON 0x02 - #define CAL_WD_TUE 0x04 - #define CAL_WD_WED 0x08 - #define CAL_WD_THU 0x10 - #define CAL_WD_FRI 0x20 - #define CAL_WD_SAT 0x40 - // unknown UnknownsType Unknowns; +protected: + static FreeBusyFlagType FreeBusyFlagProto2Rec(uint8_t f); + static uint8_t FreeBusyFlagRec2Proto(FreeBusyFlagType f); + + static ClassFlagType ClassFlagProto2Rec(uint8_t f); + static uint8_t ClassFlagRec2Proto(ClassFlagType f); + + virtual void DumpSpecialFields(std::ostream &os) const; + public: const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); - void ParseRecurrenceData(const void *data); - void BuildRecurrenceData(void *data) const; + const unsigned char *end, const IConverter *ic = 0); public: Calendar(); @@ -169,16 +134,17 @@ uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; + std::string GetDescription() const; // sorting - bool operator<(const Calendar &other) const { return StartTime < other.StartTime; } + bool operator<(const Calendar &other) const; // database name static const char * GetDBName() { return "Calendar"; } @@ -190,6 +156,32 @@ return os; } + +class BXEXPORT CalendarAll : public Calendar +{ +protected: + virtual void DumpSpecialFields(std::ostream &os) const; + +public: + std::string MailAccount; + +public: + // Parser / Builder API (see parser.h / builder.h) + void ParseHeader(const Data &data, size_t &offset); + + void Clear(); + +public: + // database name + static const char * GetDBName() { return "Calendar - All"; } +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const CalendarAll &msg) { + msg.Dump(os); + return os; +} + + /// @} } // namespace Barry diff -Nru barry-0.14/src/r_calllog.cc barry-0.0.20110506/src/r_calllog.cc --- barry-0.14/src/r_calllog.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_calllog.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,339 @@ +/// +/// \file r_calllog.cc +/// Record parsing class for the phone call logs database. +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_calllog.h" +#include "record-internal.h" +#include "protostructs.h" +#include "data.h" +#include "time.h" +#include "iconv.h" +#include +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +#define MILLISECONDS_IN_A_SECOND 1000 + +time_t CallLog::GetTime() const +{ + return (time_t)(Timestamp / MILLISECONDS_IN_A_SECOND); +} + +CallLog::DirectionFlagType CallLog::DirectionProto2Rec(uint8_t s) +{ + return (DirectionFlagType)s; +} + +uint8_t CallLog::DirectionRec2Proto(DirectionFlagType s) +{ + return s; +} + +CallLog::PhoneTypeFlagType CallLog::PhoneTypeProto2Rec(uint8_t s) +{ + return (PhoneTypeFlagType)s; +} + +uint8_t CallLog::PhoneTypeRec2Proto(PhoneTypeFlagType s) +{ + return s; +} + + +/////////////////////////////////////////////////////////////////////////////// +// CallLog Class + +// CallLog Field Codes +#define CLLFC_CALLLOG_TYPE 0x01 +#define CLLFC_DIRECTION 0x02 +#define CLLFC_DURATION 0x03 +#define CLLFC_TIMESTAMP 0x04 +#define CLLFC_STATUS 0x06 +#define CLLFC_UNIQUEID 0x07 +#define CLLFC_PHONE_TYPE 0x0b +#define CLLFC_PHONE_NUMBER 0x0c +#define CLLFC_PHONE_INFO 0x0d +#define CLLFC_CONTACT_NAME 0x1f +#define CLLFC_END 0xffff + +static FieldLink CallLogFieldLinks[] = { + { CLLFC_PHONE_NUMBER, "Phone number", 0, 0, &CallLog::PhoneNumber, 0, 0, 0, 0, true }, + { CLLFC_CONTACT_NAME, "Contact name", 0, 0, &CallLog::ContactName, 0, 0, 0, 0, true }, + { CLLFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } +}; + +CallLog::CallLog() +{ + Clear(); +} + +CallLog::~CallLog() +{ +} + +const unsigned char* CallLog::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *) begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !btohs(field->size) ) // if field has no size, something's up + return begin; + + if( field->type == CLLFC_CALLLOG_TYPE ) { + if( field->u.raw[0] != 'p' ) { + throw Error( "CallLog::ParseField: CallLogType is not 'p'" ); + } + return begin; + } + + // this is always the same as the RecordID from the lower level + // protocol, so we throw this away for now + if( field->type == CLLFC_UNIQUEID) + return begin; + + // cycle through the type table + for( FieldLink *b = CallLogFieldLinks; + b->type != CLLFC_END; + b++ ) + { + if( b->type == field->type ) { + if( b->strMember ) { + std::string &s = this->*(b->strMember); + s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); + return begin; // done! + } + else if( b->timeMember && btohs(field->size) == 4 ) { + time_t &t = this->*(b->timeMember); + t = min2time(field->u.min1900); + return begin; + } + } + } + + // handle special cases + switch( field->type ) + { + case CLLFC_STATUS: + // single byte... size check above checks for non-zero already + switch (field->u.raw[0]) { + case 0x00: + StatusFlag = Barry::CallLog::OK; + break; + case 0x01: + StatusFlag = Barry::CallLog::Busy; + break; + case 0x09: + StatusFlag = Barry::CallLog::NetError; + break; + default: + StatusFlag = Barry::CallLog::Unknown; + } + return begin; + + case CLLFC_DIRECTION: + if( field->u.raw[0] > CLL_DIRECTION_RANGE_HIGH ) { + throw Error( "CallLog::ParseField: direction field out of bounds" ); + } + else { + DirectionFlag = DirectionProto2Rec(field->u.raw[0]); + } + return begin; + + case CLLFC_PHONE_TYPE: + if( field->u.raw[0] > CLL_PHONETYPE_RANGE_HIGH ) { + PhoneTypeFlag = Barry::CallLog::TypeUnknown; + } + else { + PhoneTypeFlag = PhoneTypeProto2Rec(field->u.raw[0]); + } + return begin; + + case CLLFC_PHONE_INFO: + switch (field->u.raw[0]) { + case 0x03: + PhoneInfoFlag = Barry::CallLog::InfoKnown; + break; + case 0x80: + PhoneInfoFlag = Barry::CallLog::InfoUnknown; + break; + case 0x40: + PhoneInfoFlag = Barry::CallLog::InfoPrivate; + break; + default: + PhoneInfoFlag = Barry::CallLog::InfoUndefined; + } + return begin; + + case CLLFC_DURATION: + if( btohs(field->size) >= sizeof(field->u.uint32) ) { + Duration = btohl(field->u.uint32); + return begin; + } + break; + + case CLLFC_TIMESTAMP: + if( btohs(field->size) >= sizeof(field->u.timestamp) ) { + Timestamp = btohll(field->u.timestamp); + return begin; + } + break; + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + // return new pointer for next field + return begin; +} + +void CallLog::ParseHeader(const Data &data, size_t &offset) +{ + // no header in CallLog records +} + +void CallLog::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void CallLog::BuildHeader(Data &data, size_t &offset) const +{ + // not yet implemented +} + +void CallLog::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + // not yet implemented +} + +void CallLog::Dump(std::ostream &os) const +{ + uint32_t timestamp = Duration; + int32_t days, hours, minutes, secondes; + + static const char *DirectionName[] = { "Received", "Sent", "Call Missing (Messagerie)", "Call Missing" }; + static const char *StatusName[] = { "OK", "Busy", "Error", "Not supported by Barry" }; + static const char *PhoneInfoName[] = { "Undefined", "Known phone number", "Unknown phone number", "Private phone number" }; + static const char *PhoneTypeName[] = { "Unknown", "Office", "Home", "Mobile", "Not supported by Barry" }; + + os << "CallLog entry: 0x" << setbase(16) << RecordId + << " (" << (unsigned int)RecType << ")\n"; + + time_t t = GetTime(); + os << " Timestamp: " << ctime(&t); + os << " Direction: " << DirectionName[DirectionFlag] << "\n"; + os << " Status: " << StatusName[StatusFlag] << "\n"; + os << " Phone info: " << PhoneInfoName[PhoneInfoFlag] << "\n"; + os << " Phone type: " << PhoneTypeName[PhoneTypeFlag] << "\n"; + + os << " Duration: "; + + // Days : + days = (int) (timestamp / (60 * 60 * 24)); + timestamp = timestamp - (days * (60 * 60 * 24)); + // Hours : + hours = (int) (timestamp / (60 * 60)); + timestamp = timestamp - (hours * (60 * 60)); + // Minutes : + minutes = (int) (timestamp / 60); + timestamp = timestamp - (minutes * 60); + // Secondes : + secondes = timestamp; + + if (days > 1) + os << setbase(10) << days << " days "; + else if (days > 0) + os << setbase(10) << days << " day "; + + os << setfill ('0') << setw(2) << setbase(10) << hours; + os << ":"; + os << setfill ('0') << setw(2) << setbase(10) << minutes; + os << ":"; + os << setfill ('0') << setw(2) << setbase(10) << secondes; + os << "\n"; + + // cycle through the type table + for( const FieldLink *b = CallLogFieldLinks; + b->type != CLLFC_END; + b++ ) + { + if( b->strMember ) { + const std::string &s = this->*(b->strMember); + if( s.size() ) + os << " " << b->name << ": " << s << "\n"; + } + else if( b->timeMember ) { + time_t t = this->*(b->timeMember); + if( t > 0 ) + os << " " << b->name << ": " << ctime(&t); + else + os << " " << b->name << ": unknown\n"; + } + } + + + os << Unknowns; + os << "\n\n"; +} + +void CallLog::Clear() +{ + RecType = GetDefaultRecType(); + RecordId = 0; + + Duration = 0; + Timestamp = 0; + + ContactName.clear(); + PhoneNumber.clear(); + + DirectionFlag = Barry::CallLog::Receiver; + StatusFlag = Barry::CallLog::Unknown; + PhoneTypeFlag = Barry::CallLog::TypeUnknown; + PhoneInfoFlag = Barry::CallLog::InfoUndefined; + + Unknowns.clear(); +} + +std::string CallLog::GetDescription() const +{ + return ContactName; +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_calllog.h barry-0.0.20110506/src/r_calllog.h --- barry-0.14/src/r_calllog.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_calllog.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,141 @@ +/// +/// \file r_calllog.h +/// Record parsing class for call logs +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_CALLLOG_H__ +#define __BARRY_RECORD_CALLLOG_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include + +namespace Barry { + +// forward declarations +class IConverter; + +class BXEXPORT CallLog +{ +public: + typedef Barry::UnknownsType UnknownsType; + + uint8_t RecType; + uint32_t RecordId; + + uint32_t Duration; //< duration of call in seconds + uint64_t Timestamp; //< timestamp of call in milliseconds + //< use GetTime() to convert to + //< a time_t + std::string ContactName; + std::string PhoneNumber; + + enum DirectionFlagType + { + Receiver = 0, //< We have received a call + Emitter, //< We have composed a call + Failed, //< We have missing a call and the + //< emitter is arrived on our + //< answering machine + Missing //< We have missing a call. The + //< emitter has stopped the + //< communication. + }; + DirectionFlagType DirectionFlag; + + enum StatusFlagType + { + OK = 0, // + Busy, //< We have sent the emitter on our + //< answering machine + NetError, //< Network communication error + Unknown //< Not supported by Barry CallLog parser + }; + StatusFlagType StatusFlag; + + enum PhoneTypeFlagType + { + TypeUndefined = 0, + TypeOffice, + TypeHome, + TypeMobile, + TypeUnknown // To be completed (Office2, Home2, Pager ???) + }; + PhoneTypeFlagType PhoneTypeFlag; + + enum PhoneInfoFlagType + { + InfoUndefined = 0, + InfoKnown, //< PhoneNumber should be set + InfoUnknown, //< PhoneNumber isn't set + InfoPrivate //< PhoneNumber is private + }; + PhoneInfoFlagType PhoneInfoFlag; + + UnknownsType Unknowns; + +protected: + time_t GetTime() const; + + static DirectionFlagType DirectionProto2Rec(uint8_t s); + static uint8_t DirectionRec2Proto(DirectionFlagType s); + + static PhoneTypeFlagType PhoneTypeProto2Rec(uint8_t s); + static uint8_t PhoneTypeRec2Proto(PhoneTypeFlagType s); + +public: + CallLog(); + ~CallLog(); + + // Parser / Builder API (see parser.h / builder.h) + const unsigned char* ParseField(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + + // operations (common among record classes) + void Clear(); + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + // Sorting + bool operator<(const CallLog &other) const { return Timestamp < other.Timestamp; } + + // database name + static const char * GetDBName() { return "Phone Call Logs"; } + static uint8_t GetDefaultRecType() { return 0; } +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const CallLog &msg) { + msg.Dump(os); + return os; +} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_command.cc barry-0.0.20110506/src/r_command.cc --- barry-0.14/src/r_command.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_command.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,107 @@ +/// +/// \file r_command.cc +/// Internal implementation of CommandTable parser class +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "record.h" +#include "record-internal.h" +#include "data.h" +#include +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// CommandTable class + +CommandTable::CommandTable() +{ +} + +CommandTable::~CommandTable() +{ +} + +const unsigned char* CommandTable::ParseField(const unsigned char *begin, + const unsigned char *end) +{ + // check if there is enough data for a header + const unsigned char *headend = begin + sizeof(CommandTableField); + if( headend > end ) + return headend; + + const CommandTableField *field = (const CommandTableField *) begin; + + // advance and check size + begin += COMMAND_FIELD_HEADER_SIZE + field->size; // size is byte + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !field->size ) // if field has no size, something's up + return begin; + + Command command; + command.Code = field->code; + command.Name.assign((const char *)field->name, field->size); + Commands.push_back(command); + return begin; +} + +void CommandTable::Parse(const Data &data, size_t offset) +{ + if( offset >= data.GetSize() ) + return; + + const unsigned char *begin = data.GetData() + offset; + const unsigned char *end = data.GetData() + data.GetSize(); + + while( begin < end ) + begin = ParseField(begin, end); +} + +void CommandTable::Clear() +{ + Commands.clear(); +} + +unsigned int CommandTable::GetCommand(const std::string &name) const +{ + CommandArrayType::const_iterator b = Commands.begin(); + for( ; b != Commands.end(); b++ ) + if( b->Name == name ) + return b->Code; + return 0; +} + +void CommandTable::Dump(std::ostream &os) const +{ + CommandArrayType::const_iterator b = Commands.begin(); + os << "Command table:\n"; + for( ; b != Commands.end(); b++ ) { + os << " Command: 0x" << setbase(16) << b->Code + << " '" << b->Name << "'\n"; + } +} + + +} // namespace Barry + diff -Nru barry-0.14/src/r_contact.cc barry-0.0.20110506/src/r_contact.cc --- barry-0.14/src/r_contact.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_contact.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -27,8 +27,11 @@ #include "time.h" #include "error.h" #include "endian.h" -#include +#include "iconv.h" +#include "trim.h" +#include #include +#include #include #include @@ -58,6 +61,8 @@ #define CFC_WORK_PHONE_2 16 // 0x10 #define CFC_HOME_PHONE_2 17 // 0x11 #define CFC_OTHER_PHONE 18 // 0x12 +#define CFC_MOBILE_PHONE_2 19 // 0x13 +#define CFC_HOME_FAX 20 // 0x14 #define CFC_NAME 32 // 0x20 used twice, in first/last name order #define CFC_COMPANY 33 #define CFC_DEFAULT_COMM_METHOD 34 @@ -92,48 +97,54 @@ #define CFC_IMAGE 77 // 0x4D #define CFC_BIRTHDAY 82 // 0x52 #define CFC_ANNIVERSARY 83 // 0x53 +#define CFC_MAYBE_CATEGORYID 84 // 0x54 +#define CFC_UNIQUEID 85 // 0x55 +#define CFC_NICKNAME 86 // 0x56 #define CFC_INVALID_FIELD 255 // Contact code to field table -FieldLink ContactFieldLinks[] = { - { CFC_PHONE, "Phone", 0,0, &Contact::Phone, 0, 0 }, - { CFC_FAX, "Fax", "facsimileTelephoneNumber",0, &Contact::Fax, 0, 0 }, - { CFC_WORK_PHONE, "WorkPhone", "telephoneNumber",0, &Contact::WorkPhone, 0, 0 }, - { CFC_HOME_PHONE, "HomePhone", "homePhone",0, &Contact::HomePhone, 0, 0 }, - { CFC_MOBILE_PHONE, "MobilePhone","mobile",0, &Contact::MobilePhone, 0, 0 }, - { CFC_PAGER, "Pager", "pager",0, &Contact::Pager, 0, 0 }, - { CFC_PIN, "PIN", 0,0, &Contact::PIN, 0, 0 }, - { CFC_RADIO, "Radio", 0,0, &Contact::Radio, 0, 0 }, - { CFC_WORK_PHONE_2, "WorkPhone2", 0,0, &Contact::WorkPhone2, 0, 0 }, - { CFC_HOME_PHONE_2, "HomePhone2", 0,0, &Contact::HomePhone2, 0, 0 }, - { CFC_OTHER_PHONE, "OtherPhone", 0,0, &Contact::OtherPhone, 0, 0 }, - { CFC_COMPANY, "Company", "o",0, &Contact::Company, 0, 0 }, - { CFC_DEFAULT_COMM_METHOD,"DefaultCommMethod",0,0, &Contact::DefaultCommunicationsMethod, 0, 0 }, - { CFC_ADDRESS1, "WorkAddress1", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address1 }, - { CFC_ADDRESS2, "WorkAddress2", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address2 }, - { CFC_ADDRESS3, "WorkAddress3", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address3 }, - { CFC_CITY, "WorkCity", "l",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::City }, - { CFC_PROVINCE, "WorkProvince", "st",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Province }, - { CFC_POSTAL_CODE, "WorkPostalCode", "postalCode",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::PostalCode }, - { CFC_COUNTRY, "WorkCountry", "c", "country", 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Country }, - { CFC_TITLE, "JobTitle", "title",0, &Contact::JobTitle, 0, 0 }, - { CFC_PUBLIC_KEY, "PublicKey", 0,0, &Contact::PublicKey, 0, 0 }, - { CFC_URL, "URL", 0,0, &Contact::URL, 0, 0 }, - { CFC_PREFIX, "Prefix", 0,0, &Contact::Prefix, 0, 0 }, - { CFC_HOME_ADDRESS1,"HomeAddress1", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address1, }, - { CFC_HOME_ADDRESS2,"HomeAddress2", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address2, }, - { CFC_HOME_ADDRESS3,"HomeAddress3", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address3, }, - { CFC_NOTES, "Notes", 0,0, &Contact::Notes, 0, 0 }, - { CFC_USER_DEFINED_1, "UserDefined1", 0,0, &Contact::UserDefined1, 0, 0 }, - { CFC_USER_DEFINED_2, "UserDefined2", 0,0, &Contact::UserDefined2, 0, 0 }, - { CFC_USER_DEFINED_3, "UserDefined3", 0,0, &Contact::UserDefined3, 0, 0 }, - { CFC_USER_DEFINED_4, "UserDefined4", 0,0, &Contact::UserDefined4, 0, 0 }, - { CFC_HOME_CITY, "HomeCity", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::City, }, - { CFC_HOME_PROVINCE,"HomeProvince", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Province, }, - { CFC_HOME_POSTAL_CODE, "HomePostalCode", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::PostalCode, }, - { CFC_HOME_COUNTRY, "HomeCountry",0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Country, }, - { CFC_IMAGE, "Image", 0,0, &Contact::Image, 0, 0 }, - { CFC_INVALID_FIELD,"EndOfList", 0, 0, 0 } +static FieldLink ContactFieldLinks[] = { + { CFC_NICKNAME, "Nickname", 0,0, &Contact::Nickname, 0, 0, 0, 0, true }, + { CFC_PHONE, "Phone", 0,0, &Contact::Phone, 0, 0, 0, 0, true }, + { CFC_FAX, "Fax", "facsimileTelephoneNumber",0, &Contact::Fax, 0, 0, 0, 0, true }, + { CFC_HOME_FAX, "HomeFax", 0,0, &Contact::HomeFax, 0, 0, 0, 0, true }, + { CFC_WORK_PHONE, "WorkPhone", "telephoneNumber",0, &Contact::WorkPhone, 0, 0, 0, 0, true }, + { CFC_HOME_PHONE, "HomePhone", "homePhone",0, &Contact::HomePhone, 0, 0, 0, 0, true }, + { CFC_MOBILE_PHONE, "MobilePhone","mobile",0, &Contact::MobilePhone, 0, 0, 0, 0, true }, + { CFC_MOBILE_PHONE_2,"MobilePhone2",0,0, &Contact::MobilePhone2, 0, 0, 0, 0, true }, + { CFC_PAGER, "Pager", "pager",0, &Contact::Pager, 0, 0, 0, 0, true }, + { CFC_PIN, "PIN", 0,0, &Contact::PIN, 0, 0, 0, 0, true }, + { CFC_RADIO, "Radio", 0,0, &Contact::Radio, 0, 0, 0, 0, true }, + { CFC_WORK_PHONE_2, "WorkPhone2", 0,0, &Contact::WorkPhone2, 0, 0, 0, 0, true }, + { CFC_HOME_PHONE_2, "HomePhone2", 0,0, &Contact::HomePhone2, 0, 0, 0, 0, true }, + { CFC_OTHER_PHONE, "OtherPhone", 0,0, &Contact::OtherPhone, 0, 0, 0, 0, true }, + { CFC_COMPANY, "Company", "o",0, &Contact::Company, 0, 0, 0, 0, true }, + { CFC_DEFAULT_COMM_METHOD,"DefaultCommMethod",0,0, &Contact::DefaultCommunicationsMethod, 0, 0, 0, 0, true }, + { CFC_ADDRESS1, "WorkAddress1", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address1, true }, + { CFC_ADDRESS2, "WorkAddress2", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address2, true }, + { CFC_ADDRESS3, "WorkAddress3", 0,0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Address3, true }, + { CFC_CITY, "WorkCity", "l",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::City, true }, + { CFC_PROVINCE, "WorkProvince", "st",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Province, true }, + { CFC_POSTAL_CODE, "WorkPostalCode", "postalCode",0, 0, 0, 0, &Contact::WorkAddress, &PostalAddress::PostalCode, true }, + { CFC_COUNTRY, "WorkCountry", "c", "country", 0, 0, 0, &Contact::WorkAddress, &PostalAddress::Country, true }, + { CFC_TITLE, "JobTitle", "title",0, &Contact::JobTitle, 0, 0, 0, 0, true }, + { CFC_PUBLIC_KEY, "PublicKey", 0,0, &Contact::PublicKey, 0, 0, 0, 0, false }, + { CFC_URL, "URL", 0,0, &Contact::URL, 0, 0, 0, 0, true }, + { CFC_PREFIX, "Prefix", 0,0, &Contact::Prefix, 0, 0, 0, 0, true }, + { CFC_HOME_ADDRESS1,"HomeAddress1", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address1, true }, + { CFC_HOME_ADDRESS2,"HomeAddress2", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address2, true }, + { CFC_HOME_ADDRESS3,"HomeAddress3", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Address3, true }, + { CFC_NOTES, "Notes", 0,0, &Contact::Notes, 0, 0, 0, 0, true }, + { CFC_USER_DEFINED_1, "UserDefined1", 0,0, &Contact::UserDefined1, 0, 0, 0, 0, true }, + { CFC_USER_DEFINED_2, "UserDefined2", 0,0, &Contact::UserDefined2, 0, 0, 0, 0, true }, + { CFC_USER_DEFINED_3, "UserDefined3", 0,0, &Contact::UserDefined3, 0, 0, 0, 0, true }, + { CFC_USER_DEFINED_4, "UserDefined4", 0,0, &Contact::UserDefined4, 0, 0, 0, 0, true }, + { CFC_HOME_CITY, "HomeCity", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::City, true }, + { CFC_HOME_PROVINCE,"HomeProvince", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Province, true }, + { CFC_HOME_POSTAL_CODE, "HomePostalCode", 0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::PostalCode, true }, + { CFC_HOME_COUNTRY, "HomeCountry",0,0, 0, 0, 0, &Contact::HomeAddress, &PostalAddress::Country, true }, + { CFC_IMAGE, "Image", 0,0, &Contact::Image, 0, 0, 0, 0, false }, + { CFC_INVALID_FIELD,"EndOfList", 0, 0, 0, 0, 0, 0, 0, false } }; Contact::Contact() @@ -148,7 +159,8 @@ } const unsigned char* Contact::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -169,11 +181,15 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } else if( b->postMember && b->postField ) { std::string &s = (this->*(b->postMember)).*(b->postField); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; } else { @@ -186,7 +202,10 @@ switch( field->type ) { case CFC_EMAIL: { - EmailAddresses.push_back( ParseFieldString(field) ); + std::string s = ParseFieldString(field); + if( ic ) + s = ic->FromBB(s); + EmailAddresses.push_back( s ); } return begin; @@ -204,6 +223,8 @@ } *name = ParseFieldString(field); + if( ic ) + *name = ic->FromBB(*name); } return begin; @@ -221,7 +242,9 @@ case CFC_CATEGORY: { std::string catstring = ParseFieldString(field); - CategoryStr2List(catstring, Categories); + if( ic ) + catstring = ic->FromBB(catstring); + Categories.CategoryStr2List(catstring); } return begin; @@ -236,6 +259,13 @@ Anniversary.FromBBString(astring); } return begin; + + case CFC_UNIQUEID: + // this is a duplicate of the UniqueID that comes from + // the envelope part of the protocol... just throw this + // away, since when we upload it, we need to use a + // consisten UniqueID / RecordID from the API + return begin; } // if still not handled, add to the Unknowns list @@ -253,11 +283,10 @@ // no header to parse in Contact records } -// this is called by the RecordParser<> class, which checks size for us -void Contact::ParseFields(const Data &data, size_t &offset) +void Contact::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } @@ -271,7 +300,7 @@ // /// Build fields part of record /// -void Contact::BuildFields(Data &data, size_t &offset) const +void Contact::BuildFields(Data &data, size_t &offset, const IConverter *ic) const { data.Zap(); @@ -286,23 +315,37 @@ BuildField(data, offset, CFC_GROUP_FLAG, 'G'); // special fields not in type table - if( FirstName.size() ) - BuildField(data, offset, CFC_NAME, FirstName); + if( FirstName.size() ) { + std::string s = ic ? ic->ToBB(FirstName) : FirstName; + BuildField(data, offset, CFC_NAME, s); + } if( LastName.size() ) { if( !FirstName.size() ) { // order matters with first/last name, and if // last name exists, and first name doesn't, // insert blank first name ahead of it - BuildField(data, offset, CFC_NAME, FirstName); + BuildField(data, offset, CFC_NAME, ""); } - BuildField(data, offset, CFC_NAME, LastName); + BuildField(data, offset, CFC_NAME, ic ? ic->ToBB(LastName) : LastName); } +// FIXME +// // add unknown data +// char buffer[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +// BuildField(data, offset, 0x54, buffer, 8); + + // With the BlackBerry Storm, I have to add this entry. + // Otherwise the uniqueId of this contact is reseted ! + // The device seems accept the multiple contact with the same uniqueId, + // but the synchronization process uses this uniqueId to identify the contact. + // add uniqueId + BuildField(data, offset, CFC_UNIQUEID, RecordId); + // add all email addresses EmailList::const_iterator eai = EmailAddresses.begin(); for( ; eai != EmailAddresses.end(); ++eai ) { if( eai->size() ) { - BuildField(data, offset, CFC_EMAIL, *eai); + BuildField(data, offset, CFC_EMAIL, ic ? ic->ToBB(*eai) : *eai); } } @@ -315,13 +358,15 @@ if( b->strMember ) { const std::string &field = this->*(b->strMember); if( field.size() ) { - BuildField(data, offset, b->type, field); + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); } } else if( b->postMember && b->postField ) { const std::string &field = (this->*(b->postMember)).*(b->postField); if( field.size() ) { - BuildField(data, offset, b->type, field); + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); } } } @@ -339,8 +384,8 @@ // save categories if( Categories.size() ) { string store; - CategoryList2Str(Categories, store); - BuildField(data, offset, CFC_CATEGORY, store); + Categories.CategoryList2Str(store); + BuildField(data, offset, CFC_CATEGORY, ic ? ic->ToBB(store) : store); } // save Birthday and Anniversary @@ -361,14 +406,18 @@ void Contact::Clear() { - RecType = Contact::GetDefaultRecType(); + RecType = GetDefaultRecType(); + RecordId = 0; EmailAddresses.clear(); Phone.clear(); + Fax.clear(); + HomeFax.clear(); WorkPhone.clear(); HomePhone.clear(); MobilePhone.clear(); + MobilePhone2.clear(); Pager.clear(); PIN.clear(); Radio.clear(); @@ -389,6 +438,7 @@ UserDefined3.clear(); UserDefined4.clear(); Image.clear(); + Nickname.clear(); Birthday.Clear(); Anniversary.Clear(); @@ -404,6 +454,11 @@ m_FirstNameSeen = false; } +std::string Contact::GetDescription() const +{ + return GetFullName(); +} + // // GetFullName // @@ -459,6 +514,11 @@ b->type != CFC_INVALID_FIELD; b++ ) { + // special case: don't dump the raw image data, but + // leave that for a special hex dump + if( b->type == CFC_IMAGE ) + continue; + const std::string *pField = 0; if( b->strMember ) { pField = &(this->*(b->strMember)); @@ -470,13 +530,13 @@ // print only fields with data if( pField && pField->size() ) { os << " " << setw(20) << b->name; - os << ": " << *pField << "\n"; + os << ": " << Cr2LfWrapper(*pField) << "\n"; } } if( Categories.size() ) { string display; - CategoryList2Str(Categories, display); + Categories.CategoryList2Str(display); os << " Categories : " << display << "\n"; } @@ -497,6 +557,13 @@ os << " ID: 0x" << setbase(16) << gb->Link << "\n"; } + // print Image in hex dump format, if available + if( Image.size() ) { + Data image(Image.data(), Image.size()); + os << " Photo image:\n"; + os << image << "\n"; + } + // and finally print unknowns os << Unknowns; @@ -505,6 +572,23 @@ os.fill(fill); } +bool Contact::operator<(const Contact &other) const +{ + // old sorting mechanism, to put group links at the bottom + //return GroupLinks.size() == 0 && other.GroupLinks.size() > 0; + // testing - put group links at the top + //return GroupLinks.size() > 0 && other.GroupLinks.size() == 0; + + // usually one of these fields is filled in, so compare + // them all in a ( LastName + FirstName + Company ) key style + int cmp = LastName.compare(other.LastName); + if( cmp == 0 ) + cmp = FirstName.compare(other.FirstName); + if( cmp == 0 ) + cmp = Company.compare(other.Company); + return cmp < 0; +} + void Contact::SplitName(const std::string &full, std::string &first, std::string &last) { first.clear(); @@ -522,53 +606,51 @@ } } -void Contact::CategoryStr2List(const std::string &str, - Barry::CategoryList &list) +std::string Contact::Email2CommaString(const EmailList &list) +{ + ostringstream oss; + for( EmailList::const_iterator i = list.begin(); i!=list.end(); ++i ) { + if( i != list.begin() ) + oss << ", "; + oss << *i; + } + return oss.str(); +} + +/// Replaces the EmailAddresses list with the parsed results of +/// list. If list is empty, then EmailAddresses will also be empty. +/// Note that incoming addresses need to be in simple format, not +/// complex formats like "Name " but just +/// "user@example.com". This is a device limitation. +/// +/// Any complex email addresses found in the list will be dropped, +/// with a message sent to the debug output stream. +void Contact::CommaString2Email(const std::string &list, EmailList &result) { // start fresh - list.clear(); - - if( !str.size() ) - return; - - // parse the comma-delimited string to a list, stripping away - // any white space around each category name - string::size_type start = 0, end = 0, delim = str.find(',', start); - while( start != string::npos ) { - if( delim == string::npos ) - end = str.size() - 1; - else - end = delim - 1; - - // strip surrounding whitespace - while( str[start] == ' ' ) - start++; - while( end && str[end] == ' ' ) - end--; + result.clear(); - if( start <= end ) { - string token = str.substr(start, end-start+1); - list.push_back(token); + // parse the comma separated list + istringstream iss(list); + string address; + + while( iss >> ws && getline(iss, address, ',') ) { + // trim any trailing whitespace in the address + Inplace::rtrim(address); + + // is this a complex address? like: + // Chris Frey + // The device only accepts the plain + // "cdfrey@foursquare.net" part here + if( address.rfind('>') != string::npos ) { + dout("Error: Cannot convert complex name+address to a simple contact email address, skipping: " << address); + continue; + } + + // add to list if anything left + if( address.size() ) { + result.push_back(address); } - - // next - start = delim; - if( start != string::npos ) - start++; - delim = str.find(',', start); - } -} - -void Contact::CategoryList2Str(const Barry::CategoryList &list, - std::string &str) -{ - str.clear(); - - Barry::CategoryList::const_iterator i = list.begin(); - for( ; i != list.end(); ++i ) { - if( str.size() ) - str += ", "; - str += *i; } } diff -Nru barry-0.14/src/r_contact.h barry-0.0.20110506/src/r_contact.h --- barry-0.14/src/r_contact.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_contact.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -32,6 +32,9 @@ namespace Barry { +// forward declarations +class IConverter; + // // NOTE: All classes here must be container-safe! Perhaps add sorting // operators in the future. @@ -48,31 +51,49 @@ {} }; -typedef std::vector CategoryList; - /// \addtogroup RecordParserClasses /// @{ +// +// Contact record class +// +/// Represents a single record in the Address Book Blackberry database. +/// class BXEXPORT Contact { public: typedef Barry::CategoryList CategoryList; typedef ContactGroupLink GroupLink; typedef std::vector GroupLinksType; - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; typedef std::string EmailType; typedef std::vector EmailList; + // + // Record fields + // + // contact specific data uint8_t RecType; uint32_t RecordId; EmailList EmailAddresses; + + /// This field, Phone, is deprecated. It is possible + /// to write to this field to the Blackberry, + /// but modern devices won't let you add it + /// through their GUIs. This field only seems + /// to exist on the 7750. While other devices + /// accept the field and display it, it is + /// not accessible by default. + std::string Phone; + std::string - Phone, Fax, + HomeFax, WorkPhone, HomePhone, MobilePhone, + MobilePhone2, Pager, PIN, Radio, @@ -92,7 +113,8 @@ UserDefined2, UserDefined3, UserDefined4, - Image; + Image, + Nickname; Date Birthday; Date Anniversary; @@ -112,10 +134,9 @@ private: bool m_FirstNameSeen; -//protected: public: const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); public: Contact(); @@ -130,20 +151,18 @@ uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); // erase everything - void Dump(std::ostream &os) const; + std::string GetDescription() const; - // sorting - put group links at the end - bool operator<(const Contact &other) const { - return GroupLinks.size() == 0 && other.GroupLinks.size() > 0; -// // testing - put group links at the top -// return GroupLinks.size() > 0 && other.GroupLinks.size() == 0; - } + // Sorting - use enough data to make the sorting as + // consistent as possible + bool operator<(const Contact &other) const; // database name static const char * GetDBName() { return "Address Book"; } @@ -151,8 +170,8 @@ // helpers static void SplitName(const std::string &full, std::string &first, std::string &last); - static void CategoryStr2List(const std::string &str, Barry::CategoryList &list); - static void CategoryList2Str(const Barry::CategoryList &list, std::string &str); + static std::string Email2CommaString(const EmailList &list); + static void CommaString2Email(const std::string &list, EmailList &result); }; BXEXPORT inline std::ostream& operator<< (std::ostream &os, const Contact &contact) { diff -Nru barry-0.14/src/r_cstore.cc barry-0.0.20110506/src/r_cstore.cc --- barry-0.14/src/r_cstore.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_cstore.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,245 @@ +/// +/// \file r_cstore.cc +/// Blackberry database record parser class for +/// Content Store records. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_cstore.h" +#include "record-internal.h" +#include "data.h" + +#include +#include +#include + +#define __DEBUG_MODE__ +#include "debug.h" + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + + +/////////////////////////////////////////////////////////////////////////////// +// ContentStore class + +// ContentStore field codes +#define CSFC_FILENAME 0x01 // may not always be a complete file,but + // a folder name as well +#define CSFC_FOLDER_FLAG 0x05 +#define CSFC_FILE_DESCRIPTOR 0x06 +#define CSFC_FILE_CONTENT 0x07 + + +#define MAX_CONTENT_BLOCK_SIZE 0xfffe + +ContentStore::ContentStore() +{ + Clear(); +} + +ContentStore::~ContentStore() +{ +} + +const unsigned char* ContentStore::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *) begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !btohs(field->size) ) // if field has no size, something's up + return begin; + + switch( field->type ) + { + case CSFC_FILENAME: + Filename = ParseFieldString(field); + return begin; + + case CSFC_FOLDER_FLAG: + FolderFlag = false; + { + // the CSFC_FOLDER_FLAG field seems to always + // contain the string "folder".. so check for it + string s = ParseFieldString(field); + if( s == "folder" ) { + FolderFlag = true; + } + } + return begin; + + case CSFC_FILE_CONTENT: + if( FileSize ) { + // size already received, append data to FileContent + FileContent.append((const char*)field->u.raw, + btohs(field->size)); + } + else { + FileSize = btohll(field->u.uint64); + } + return begin; + + case CSFC_FILE_DESCRIPTOR: + // need to parse this further, but until then, just + // store it as a chunk of data + FileDescriptor.assign((const char*)field->u.raw, + btohs(field->size)); + return begin; + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + // return new pointer for next field + return begin; +} + +void ContentStore::ParseHeader(const Data &data, size_t &offset) +{ + // no header to parse +} + +void ContentStore::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void ContentStore::BuildHeader(Data &data, size_t &offset) const +{ +} + +void ContentStore::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + data.Zap(); + + if( !Filename.size() ) + throw BadData("Content Store must have a name."); + + if( !FolderFlag && !FileContent.size() ) + throw BadData("Content Store item without any data."); + + // Filename + BuildField(data, offset, CSFC_FILENAME, Filename); + + // Folder? + if( FolderFlag ) { + BuildField(data, offset, CSFC_FOLDER_FLAG, string("folder")); + } + else { + // write file descriptor first + BuildField(data, offset, CSFC_FILE_DESCRIPTOR, + FileDescriptor.data(), FileDescriptor.size()); + + // a normal file... the file content is given: + // 64 bit size + // content in blocks of 0xfffe bytes until done + // all with the same ID + + // force the size to actual, and write it first + uint64_t RealSize = FileContent.size(); + BuildField(data, offset, CSFC_FILE_CONTENT, RealSize); + + // write data in blocks of 0xfffe bytes + for( size_t foff = 0; foff < FileContent.size(); ) { + size_t blocksize = FileContent.size() - foff; + if( blocksize > MAX_CONTENT_BLOCK_SIZE ) + blocksize = MAX_CONTENT_BLOCK_SIZE; + BuildField(data, offset, CSFC_FILE_CONTENT, + FileContent.data() + foff, blocksize); + + // advance + foff += blocksize; + } + } + + // and finally save unknowns + UnknownsType::const_iterator + ub = Unknowns.begin(), ue = Unknowns.end(); + for( ; ub != ue; ub++ ) { + BuildField(data, offset, *ub); + } + + data.ReleaseBuffer(offset); +} + +void ContentStore::Clear() +{ + RecType = GetDefaultRecType(); + RecordId = 0; + + Filename.clear(); + FolderFlag = false; + FileContent.clear(); + FileDescriptor.clear(); + + Unknowns.clear(); + + // internal variables + FileSize = 0; +} + +std::string ContentStore::GetDescription() const +{ + return Filename; +} + +void ContentStore::Dump(std::ostream &os) const +{ + ios::fmtflags oldflags = os.setf(ios::left); + char fill = os.fill(' '); + + os << "ContentStore: 0x" << hex << RecordId + << " (" << (unsigned int)RecType << ")\n"; + + os << " Filename: " << Filename << endl; + os << " Folder: " << (FolderFlag ? "yes" : "no") << endl; + os << " BB Size: " << dec << FileSize << endl; + os << " Actual Size: " << FileContent.size() << endl; + os << " Descriptor:\n" + << Data(FileDescriptor.data(), FileDescriptor.size()) << endl; + os << " Content:\n" + << Data(FileContent.data(), FileContent.size()) << endl; + + // and finally print unknowns + os << Unknowns; + + // cleanup the stream + os.flags(oldflags); + os.fill(fill); +} + +bool ContentStore::operator<(const ContentStore &other) const +{ + return RecordId < other.RecordId; +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_cstore.h barry-0.0.20110506/src/r_cstore.h --- barry-0.14/src/r_cstore.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_cstore.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,116 @@ +/// +/// \file r_cstore.h +/// Blackberry database record parser class for +/// Content Store records. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_CSTORE_H__ +#define __BARRY_RECORD_CSTORE_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include +#include +#include + +namespace Barry { + +// forward declarations +class IConverter; + +// +// NOTE: All classes here must be container-safe! Perhaps add sorting +// operators in the future. +// + +/// \addtogroup RecordParserClasses +/// @{ + +// +// Content Store record class +// +/// Represents a single record in the Content Store Blackberry database. +/// +class BXEXPORT ContentStore +{ +public: + typedef Barry::UnknownsType UnknownsType; + + // + // Record fields + // + + // contact specific data + uint8_t RecType; + uint32_t RecordId; + + std::string Filename; + bool FolderFlag; + std::string FileContent; + std::string FileDescriptor; + + UnknownsType Unknowns; + +private: + uint64_t FileSize; + +public: + const unsigned char* ParseField(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + +public: + ContentStore(); + ~ContentStore(); + + // operations (common among record classes) + void Clear(); // erase everything + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + // Sorting - use enough data to make the sorting as + // consistent as possible + bool operator<(const ContentStore &other) const; + + // Parser / Builder API (see parser.h / builder.h) + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + static const char * GetDBName() { return "Content Store"; } + static uint8_t GetDefaultRecType() { return 0; } +}; + +BXEXPORT inline std::ostream& operator<< (std::ostream &os, + const ContentStore &cstore) +{ + cstore.Dump(os); + return os; +} + +/// @} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_dbdb.cc barry-0.0.20110506/src/r_dbdb.cc --- barry-0.14/src/r_dbdb.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_dbdb.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,183 @@ +/// +/// \file r_dbdb.cc +/// DatabaseDatabase record parser class +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "record.h" +#include "record-internal.h" +#include "data.h" +#include "protocol.h" +#include "debug.h" +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// DatabaseDatabase class + +DatabaseDatabase::DatabaseDatabase() +{ +} + +DatabaseDatabase::~DatabaseDatabase() +{ +} + +template +void DatabaseDatabase::ParseRec(const RecordType &rec, const unsigned char *end) +{ +} + +template +const unsigned char* DatabaseDatabase::ParseField(const unsigned char *begin, + const unsigned char *end) +{ + // check if there is enough data for a header + const unsigned char *headend = begin + sizeof(FieldType); + if( headend > end ) + return headend; + + // get our header + const FieldType *field = (const FieldType *) begin; + + // advance and check size + begin += sizeof(FieldType) - sizeof(field->name) + ConvertHtoB(field->nameSize); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !ConvertHtoB(field->nameSize) ) // if field has no size, something's up + return begin; + + Database db; + db.Number = ConvertHtoB(field->dbNumber); + db.RecordCount = ConvertHtoB(field->dbRecordCount); + db.Name.assign((const char *)field->name, ConvertHtoB(field->nameSize) - 1); + Databases.push_back(db); + return begin; +} + +void DatabaseDatabase::Parse(const Data &data) +{ + // check size to make sure we have up to the DBAccess operation byte + if( data.GetSize() < (SB_PACKET_DBACCESS_HEADER_SIZE + 1) ) + return; + + MAKE_PACKET(pack, data); + const unsigned char *begin = 0; + const unsigned char *end = data.GetData() + data.GetSize(); + + switch( pack->u.db.u.response.operation ) + { + case SB_DBOP_GET_DBDB: + // using the new protocol + if( data.GetSize() > SB_PACKET_DBDB_HEADER_SIZE ) { + begin = (const unsigned char *) + &pack->u.db.u.response.u.dbdb.field[0]; + + // this while check is ok, since ParseField checks + // for header size + while( begin < end ) + begin = ParseField(begin, end); + } + else + dout("DatabaseDatabase: not enough data for parsing"); + break; + + case SB_DBOP_OLD_GET_DBDB: + // using the old protocol + if( data.GetSize() > SB_PACKET_OLD_DBDB_HEADER_SIZE ) { + begin = (const unsigned char *) + &pack->u.db.u.response.u.old_dbdb.field[0]; + + // this while check is ok, since ParseField checks + // for header size + while( begin < end ) + begin = ParseField(begin, end); + } + else + dout("DatabaseDatabase: not enough data for parsing"); + break; + + default: + // unknown protocol + dout("Unknown protocol"); + break; + } + + +} + +void DatabaseDatabase::Clear() +{ + Databases.clear(); +} + +namespace { + bool NameSort(const DatabaseDatabase::Database &one, + const DatabaseDatabase::Database &two) + { + return one.Name < two.Name; + } +} + +void DatabaseDatabase::SortByName() +{ + std::sort(Databases.begin(), Databases.end(), NameSort); +} + +bool DatabaseDatabase::GetDBNumber(const std::string &name, + unsigned int &number) const +{ + DatabaseArrayType::const_iterator b = Databases.begin(); + for( ; b != Databases.end(); b++ ) + if( b->Name == name ) { + number = b->Number; + return true; + } + return false; +} + +bool DatabaseDatabase::GetDBName(unsigned int number, + std::string &name) const +{ + DatabaseArrayType::const_iterator b = Databases.begin(); + for( ; b != Databases.end(); b++ ) + if( b->Number == number ) { + name = b->Name; + return true; + } + return false; +} + +void DatabaseDatabase::Dump(std::ostream &os) const +{ + DatabaseArrayType::const_iterator b = Databases.begin(); + os << "Database database:\n"; + for( ; b != Databases.end(); b++ ) { + os << " Database: 0x" << setbase(16) << b->Number + << " '" << b->Name << "' (records: " + << setbase(10) << b->RecordCount << ")\n"; + } +} + +} // namespace Barry + diff -Nru barry-0.14/src/README barry-0.0.20110506/src/README --- barry-0.14/src/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/README 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,10 @@ +This directory has source code to 3 libraries. + +Take a look at the Makefile.am file to see which files belong to which +library. + +The file prefixes j_* and dp_* have some connection to this split. + +The prefixes r_* and m_* do not: they mark files related to database +record parsing and protocol modes respectively. + diff -Nru barry-0.14/src/record.cc barry-0.0.20110506/src/record.cc --- barry-0.14/src/record.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/record.cc 2011-05-06 12:20:17.000000000 +0000 @@ -1,15 +1,12 @@ /// /// \file record.cc -/// Blackberry database record classes. Help translate data -/// from data packets to useful structurs, and back. -/// This header provides the common types and classes -/// used by the general record parser classes in the -/// r_*.h files. Only application-safe API stuff goes in -/// here. Internal library types go in record-internal.h +/// Misc. Blackberry database record helper classes and functions. +/// Helps translate data from data packets to useful structures, +/// and back. /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,16 +23,17 @@ #include "record.h" #include "record-internal.h" -#include "protocol.h" #include "protostructs.h" #include "data.h" #include "time.h" #include "error.h" #include "endian.h" +#include "trim.h" #include #include #include #include +#include // for sscanf() #include #define __DEBUG_MODE__ @@ -46,6 +44,20 @@ namespace Barry { +BXEXPORT std::ostream& operator<< (std::ostream &os, const Cr2LfWrapper &str) +{ + for( std::string::const_iterator i = str.m_str.begin(); + i != str.m_str.end() && *i; + i++) + { + if( *i == '\r' ) + os << '\n'; + else + os << *i; + } + return os; +} + ////////////////////////////////////////////////////////////////////////////// // Field builder helper functions @@ -65,6 +77,11 @@ void BuildField(Data &data, size_t &size, uint8_t type, char c) { + BuildField(data, size, type, (uint8_t)c); +} + +void BuildField(Data &data, size_t &size, uint8_t type, uint8_t c) +{ size_t strsize = 1; size_t fieldsize = COMMON_FIELD_HEADER_SIZE + strsize; unsigned char *pd = data.GetBuffer(size + fieldsize) + size; @@ -93,6 +110,38 @@ size += fieldsize; } +void BuildField(Data &data, size_t &size, uint8_t type, uint32_t value) +{ + size_t strsize = 4; + size_t fieldsize = COMMON_FIELD_HEADER_SIZE + strsize; + unsigned char *pd = data.GetBuffer(size + fieldsize) + size; + CommonField *field = (CommonField *) pd; + + field->size = htobl(strsize); + field->type = type; + + uint32_t store = htobl(value); + memcpy(field->u.raw, &store, strsize); + + size += fieldsize; +} + +void BuildField(Data &data, size_t &size, uint8_t type, uint64_t value) +{ + size_t strsize = 8; + size_t fieldsize = COMMON_FIELD_HEADER_SIZE + strsize; + unsigned char *pd = data.GetBuffer(size + fieldsize) + size; + CommonField *field = (CommonField *) pd; + + field->size = htobl(strsize); + field->type = type; + + uint64_t store = htobll(value); + memcpy(field->u.raw, &store, strsize); + + size += fieldsize; +} + void BuildField(Data &data, size_t &size, uint8_t type, const std::string &str) { // include null terminator @@ -156,360 +205,98 @@ /////////////////////////////////////////////////////////////////////////////// -// CommandTable class - -CommandTable::CommandTable() -{ -} - -CommandTable::~CommandTable() -{ -} - -const unsigned char* CommandTable::ParseField(const unsigned char *begin, - const unsigned char *end) -{ - // check if there is enough data for a header - const unsigned char *headend = begin + sizeof(CommandTableField); - if( headend > end ) - return headend; - - const CommandTableField *field = (const CommandTableField *) begin; - - // advance and check size - begin += COMMAND_FIELD_HEADER_SIZE + field->size; // size is byte - if( begin > end ) // if begin==end, we are ok - return begin; - - if( !field->size ) // if field has no size, something's up - return begin; - - Command command; - command.Code = field->code; - command.Name.assign((const char *)field->name, field->size); - Commands.push_back(command); - return begin; -} +// UnknownField -void CommandTable::Parse(const Data &data, size_t offset) -{ - if( offset >= data.GetSize() ) - return; - - const unsigned char *begin = data.GetData() + offset; - const unsigned char *end = data.GetData() + data.GetSize(); - - while( begin < end ) - begin = ParseField(begin, end); -} - -void CommandTable::Clear() -{ - Commands.clear(); -} - -unsigned int CommandTable::GetCommand(const std::string &name) const -{ - CommandArrayType::const_iterator b = Commands.begin(); - for( ; b != Commands.end(); b++ ) - if( b->Name == name ) - return b->Code; - return 0; -} - -void CommandTable::Dump(std::ostream &os) const +std::ostream& operator<< (std::ostream &os, const std::vector &unknowns) { - CommandArrayType::const_iterator b = Commands.begin(); - os << "Command table:\n"; - for( ; b != Commands.end(); b++ ) { - os << " Command: 0x" << setbase(16) << b->Code - << " '" << b->Name << "'\n"; + std::vector::const_iterator + ub = unknowns.begin(), ue = unknowns.end(); + if( ub != ue ) + os << " Unknowns:\n"; + for( ; ub != ue; ub++ ) { + os << " Type: 0x" << setbase(16) + << (unsigned int) ub->type + << " Data:\n" << Data(ub->data.data(), ub->data.size()); } + return os; } - /////////////////////////////////////////////////////////////////////////////// -// RecordStateTable class - -RecordStateTable::RecordStateTable() - : m_LastNewRecordId(1) -{ -} - -RecordStateTable::~RecordStateTable() -{ -} - -const unsigned char* RecordStateTable::ParseField(const unsigned char *begin, - const unsigned char *end) -{ - const RecordStateTableField *field = (const RecordStateTableField *) begin; - - // advance and check size - begin += sizeof(RecordStateTableField); - if( begin > end ) // if begin==end, we are ok - return begin; - - State state; - state.Index = btohs(field->index); - state.RecordId = btohl(field->uniqueId); - state.Dirty = (field->flags & BARRY_RSTF_DIRTY) != 0; - state.RecType = field->rectype; - state.Unknown2.assign((const char*)field->unknown2, sizeof(field->unknown2)); - StateMap[state.Index] = state; - - return begin; -} - -void RecordStateTable::Parse(const Data &data) -{ - size_t offset = 12; // skipping the unknown 2 bytes at start - - if( offset >= data.GetSize() ) - return; - - const unsigned char *begin = data.GetData() + offset; - const unsigned char *end = data.GetData() + data.GetSize(); - - while( begin < end ) - begin = ParseField(begin, end); -} - -void RecordStateTable::Clear() -{ - StateMap.clear(); - m_LastNewRecordId = 1; -} +// EmailAddress class -// Searches the StateMap table for RecordId, and returns the "index" -// in the map if found. Returns true if found, false if not. -// pFoundIndex can be null if only the existence of the index is desired -bool RecordStateTable::GetIndex(uint32_t RecordId, IndexType *pFoundIndex) const +EmailAddress::EmailAddress(const std::string &complex_address) { - StateMapType::const_iterator i = StateMap.begin(); - for( ; i != StateMap.end(); ++i ) { - if( i->second.RecordId == RecordId ) { - if( pFoundIndex ) - *pFoundIndex = i->first; - return true; - } + size_t end = complex_address.rfind('>'); + size_t start = complex_address.rfind('<'); + if( start == string::npos || end == string::npos || start > end ) { + // simple address, add it + Email = complex_address; + Inplace::trim(Email); } - return false; -} + else { + Name = complex_address.substr(0, start); + Inplace::trim(Name); -// Generate a new RecordId that is not in the state table. -// Starts at 1 and keeps incrementing until a free one is found. -uint32_t RecordStateTable::MakeNewRecordId() const -{ - // start with next Id - m_LastNewRecordId++; - - // make sure it doesn't already exist - StateMapType::const_iterator i = StateMap.begin(); - while( i != StateMap.end() ) { - if( m_LastNewRecordId == i->second.RecordId ) { - m_LastNewRecordId++; // try again - i = StateMap.begin(); // start over - } - else { - ++i; // next State - } + Email = complex_address.substr(start+1, end - start - 1); + Inplace::trim(Email); } - return m_LastNewRecordId; } -void RecordStateTable::Dump(std::ostream &os) const +std::ostream& operator<<(std::ostream &os, const EmailAddress &msga) { - ios::fmtflags oldflags = os.setf(ios::right); - char fill = os.fill(' '); - bool bPrintAscii = Data::PrintAscii(); - Data::PrintAscii(false); - - os << " Index RecordId Dirty RecType" << endl; - os << "------- ---------- ----- -------" << endl; - - StateMapType::const_iterator b, e = StateMap.end(); - for( b = StateMap.begin(); b != e ; ++b ) { - const State &state = b->second; - - os.fill(' '); - os << setbase(10) << setw(7) << state.Index; - os << " 0x" << setbase(16) << setfill('0') << setw(8) << state.RecordId; - os << " " << setfill(' ') << setw(5) << (state.Dirty ? "yes" : "no"); - os << " 0x" << setbase(16) << setfill('0') << setw(2) << state.RecType; - os << " " << Data(state.Unknown2.data(), state.Unknown2.size()); - } - - // cleanup the stream - os.flags(oldflags); - os.fill(fill); - Data::PrintAscii(bPrintAscii); + if( msga.Name.size() ) + os << msga.Name << " <"; + os << msga.Email; + if( msga.Name.size() ) + os << ">"; + return os; } - /////////////////////////////////////////////////////////////////////////////// -// DatabaseDatabase class - -DatabaseDatabase::DatabaseDatabase() -{ -} - -DatabaseDatabase::~DatabaseDatabase() -{ -} - -template -void DatabaseDatabase::ParseRec(const RecordType &rec, const unsigned char *end) -{ -} +// EmailAddressList class -template -const unsigned char* DatabaseDatabase::ParseField(const unsigned char *begin, - const unsigned char *end) +std::string EmailAddressList::ToCommaSeparated() const { - // check if there is enough data for a header - const unsigned char *headend = begin + sizeof(FieldType); - if( headend > end ) - return headend; - - // get our header - const FieldType *field = (const FieldType *) begin; - - // advance and check size - begin += sizeof(FieldType) - sizeof(field->name) + ConvertHtoB(field->nameSize); - if( begin > end ) // if begin==end, we are ok - return begin; - - if( !ConvertHtoB(field->nameSize) ) // if field has no size, something's up - return begin; - - Database db; - db.Number = ConvertHtoB(field->dbNumber); - db.RecordCount = ConvertHtoB(field->dbRecordCount); - db.Name.assign((const char *)field->name, ConvertHtoB(field->nameSize) - 1); - Databases.push_back(db); - return begin; -} - -void DatabaseDatabase::Parse(const Data &data) -{ - // check size to make sure we have up to the DBAccess operation byte - if( data.GetSize() < (SB_PACKET_DBACCESS_HEADER_SIZE + 1) ) - return; - - MAKE_PACKET(pack, data); - const unsigned char *begin = 0; - const unsigned char *end = data.GetData() + data.GetSize(); - - switch( pack->u.db.u.response.operation ) - { - case SB_DBOP_GET_DBDB: - // using the new protocol - if( data.GetSize() > SB_PACKET_DBDB_HEADER_SIZE ) { - begin = (const unsigned char *) - &pack->u.db.u.response.u.dbdb.field[0]; - - // this while check is ok, since ParseField checks - // for header size - while( begin < end ) - begin = ParseField(begin, end); - } - else - dout("DatabaseDatabase: not enough data for parsing"); - break; - - case SB_DBOP_OLD_GET_DBDB: - // using the old protocol - if( data.GetSize() > SB_PACKET_OLD_DBDB_HEADER_SIZE ) { - begin = (const unsigned char *) - &pack->u.db.u.response.u.old_dbdb.field[0]; - - // this while check is ok, since ParseField checks - // for header size - while( begin < end ) - begin = ParseField(begin, end); - } - else - dout("DatabaseDatabase: not enough data for parsing"); - break; - - default: - // unknown protocol - dout("Unknown protocol"); - break; - } - - -} - -void DatabaseDatabase::Clear() -{ - Databases.clear(); -} - -bool DatabaseDatabase::GetDBNumber(const std::string &name, - unsigned int &number) const -{ - DatabaseArrayType::const_iterator b = Databases.begin(); - for( ; b != Databases.end(); b++ ) - if( b->Name == name ) { - number = b->Number; - return true; - } - return false; + std::ostringstream oss; + oss << *this; + return oss.str(); } -bool DatabaseDatabase::GetDBName(unsigned int number, - std::string &name) const -{ - DatabaseArrayType::const_iterator b = Databases.begin(); - for( ; b != Databases.end(); b++ ) - if( b->Number == number ) { - name = b->Name; - return true; +/// Adds every email address found in the comma separated list. +/// Does not clear() first. +void EmailAddressList::AddCommaSeparated(const std::string &list) +{ + istringstream iss(list); + string address; + iss >> ws; + + while( getline(iss, address, ',') ) { + // trim any trailing whitespace in the address + size_t len = address.size(); + while( len && ::isspace(address[len-1]) ) + address.resize(len-1); + + // add to list if anything left + if( address.size() ) { + EmailAddress ea(address); + push_back(ea); } - return false; -} - -void DatabaseDatabase::Dump(std::ostream &os) const -{ - DatabaseArrayType::const_iterator b = Databases.begin(); - os << "Database database:\n"; - for( ; b != Databases.end(); b++ ) { - os << " Database: 0x" << setbase(16) << b->Number - << " '" << b->Name << "' (records: " - << setbase(10) << b->RecordCount << ")\n"; } } - -std::ostream& operator<< (std::ostream &os, const std::vector &unknowns) +std::ostream& operator<<(std::ostream &os, const EmailAddressList &elist) { - std::vector::const_iterator - ub = unknowns.begin(), ue = unknowns.end(); - if( ub != ue ) - os << " Unknowns:\n"; - for( ; ub != ue; ub++ ) { - os << " Type: 0x" << setbase(16) - << (unsigned int) ub->type - << " Data:\n" << Data(ub->data.data(), ub->data.size()); + for( EmailAddressList::const_iterator i = elist.begin(); i != elist.end(); ++i ) { + if( i != elist.begin() ) + os << ", "; + os << *i; } return os; } - -/////////////////////////////////////////////////////////////////////////////// -// EmailAddress class - -std::ostream& operator<<(std::ostream &os, const EmailAddress &msga) { - os << msga.Name.c_str() << " <" << msga.Email.c_str() << ">"; - return os; -} - - /////////////////////////////////////////////////////////////////////////////// // PostalAddress class @@ -543,7 +330,7 @@ address += "\n"; if( PostalCode.size() ) address += PostalCode; - + return address; } @@ -589,9 +376,10 @@ std::string Date::ToYYYYMMDD() const { std::ostringstream oss; - oss << setw(4) << Year - << setw(2) << Month + 1 - << setw(2) << Day; + // setfill and setw not sticky. + oss << setw(4) << setfill('0') << dec << Year + << setw(2) << setfill('0') << dec << (Month + 1) + << setw(2) << setfill('0') << dec << Day; return oss.str(); } @@ -604,14 +392,18 @@ std::string Date::ToBBString() const { std::ostringstream oss; - oss << setw(2) << Day - << Month + 1 - << Year; + // setw() ain't 'sticky'! + oss << setw(2) << setfill('0') << dec << Day << '/' + << setw(2) << setfill('0') << dec << (Month + 1) << '/' + << setw(2) << setfill('0') << dec << Year; return oss.str(); } bool Date::FromTm(const struct tm *timep) { + if( !timep ) + throw std::logic_error("NULL time pointer passed to Date::FromTm"); + Year = timep->tm_year + 1900; Month = timep->tm_mon; Day = timep->tm_mday; @@ -644,13 +436,69 @@ std::ostream& operator<<(std::ostream &os, const Date &date) { - os << setw(4) << date.Year << '/' - << setw(2) << date.Month << '/' - << setw(2) << date.Day; + os << setw(4) << setfill('0') << dec << date.Year << '/' + << setw(2) << setfill('0') << dec << (date.Month + 1) << '/' + << setw(2) << setfill('0') << dec << date.Day; return os; } +/////////////////////////////////////////////////////////////////////////////// +// CategoryList class + +/// Parses the given comma delimited category string into +/// this CategoryList object, appending each token to the vector. +/// Will clear vector beforehand. +void CategoryList::CategoryStr2List(const std::string &str) +{ + // start fresh + clear(); + + if( !str.size() ) + return; + + // parse the comma-delimited string to a list, stripping away + // any white space around each category name + string::size_type start = 0, end = 0, delim = str.find(',', start); + while( start != string::npos ) { + if( delim == string::npos ) + end = str.size() - 1; + else + end = delim - 1; + + // strip surrounding whitespace + while( str[start] == ' ' ) + start++; + while( end && str[end] == ' ' ) + end--; + + if( start <= end ) { + string token = str.substr(start, end-start+1); + push_back(token); + } + + // next + start = delim; + if( start != string::npos ) + start++; + delim = str.find(',', start); + } +} + +/// Turns the current vectory into a comma delimited category +/// string suitable for use in Calendar, Task, and Memo protocol values. +void CategoryList::CategoryList2Str(std::string &str) const +{ + str.clear(); + + Barry::CategoryList::const_iterator i = begin(); + for( ; i != end(); ++i ) { + if( str.size() ) + str += ", "; + str += *i; + } +} + } // namespace Barry diff -Nru barry-0.14/src/record.h barry-0.0.20110506/src/record.h --- barry-0.14/src/record.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/record.h 2011-05-06 12:20:17.000000000 +0000 @@ -9,7 +9,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -45,6 +45,19 @@ // +// stream-based wrapper to avoid printing strings that contain +// the \r carriage return characters +class BXEXPORT Cr2LfWrapper +{ + friend std::ostream& operator<< (std::ostream &os, const Cr2LfWrapper &str); + const std::string &m_str; +public: + explicit Cr2LfWrapper(const std::string &str) + : m_str(str) + { + } +}; +BXEXPORT std::ostream& operator<< (std::ostream &os, const Cr2LfWrapper &str); struct BXEXPORT CommandTableCommand { @@ -159,6 +172,8 @@ void Parse(const Data &data); void Clear(); + void SortByName(); + // returns true on success, and fills target bool GetDBNumber(const std::string &name, unsigned int &number) const; bool GetDBName(unsigned int number, std::string &name) const; @@ -186,21 +201,44 @@ uint8_t type; UnknownData data; }; -BXEXPORT std::ostream& operator<< (std::ostream &os, const std::vector &unknowns); +typedef std::vector UnknownsType; +BXEXPORT std::ostream& operator<< (std::ostream &os, const UnknownsType &unknowns); struct BXEXPORT EmailAddress { std::string Name; std::string Email; + EmailAddress() + { + } + + /// Converts "Name " into Name + Address + /// Will also handle just a plain address too. + explicit EmailAddress(const std::string &complex_address); + void clear() { Name.clear(); Email.clear(); } + + size_t size() const + { + return Name.size() + Email.size(); + } }; BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddress &msga); +class BXEXPORT EmailAddressList : public std::vector +{ +public: + std::string ToCommaSeparated() const; + void AddCommaSeparated(const std::string &list); +}; + +BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddressList &elist); + struct BXEXPORT PostalAddress { std::string @@ -244,6 +282,22 @@ }; BXEXPORT std::ostream& operator<<(std::ostream &os, const Date &date); +class BXEXPORT CategoryList : public std::vector +{ +public: + /// Parses the given comma delimited category string into + /// this CategoryList object, appending each token to the vector. + /// Will clear vector beforehand. + void CategoryStr2List(const std::string &str); + + /// Turns the current vectory into a comma delimited category + /// string suitable for use in Calendar, Task, and Memo + /// protocol values. + void CategoryList2Str(std::string &str) const; + + using std::vector::operator=; +}; + /// \addtogroup RecordParserClasses /// Parser and data storage classes. These classes take a @@ -256,17 +310,24 @@ } // namespace Barry +#ifndef __BARRY_LIBRARY_BUILD__ // Include all parser classes, to make it easy for the application to use. #include "r_calendar.h" +#include "r_calllog.h" +#include "r_bookmark.h" #include "r_contact.h" +#include "r_cstore.h" #include "r_memo.h" #include "r_message.h" #include "r_servicebook.h" #include "r_task.h" #include "r_pin_message.h" #include "r_saved_message.h" +#include "r_sms.h" #include "r_folder.h" #include "r_timezone.h" +#include "r_hhagent.h" +#endif #endif diff -Nru barry-0.14/src/record-internal.h barry-0.0.20110506/src/record-internal.h --- barry-0.14/src/record-internal.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/record-internal.h 2011-05-06 12:20:17.000000000 +0000 @@ -8,7 +8,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -33,18 +33,24 @@ #include "record.h" // forward declarations -namespace Barry { class Data; } +namespace Barry { + class Data; + class IConverter; +} namespace Barry { template -const unsigned char* ParseCommonFields(RecordT &rec, const void *begin, const void *end) +const unsigned char* ParseCommonFields(RecordT &rec, + const void *begin, + const void *end, + const IConverter *ic = 0) { const unsigned char *b = (const unsigned char*) begin; const unsigned char *e = (const unsigned char*) end; while( (b + COMMON_FIELD_HEADER_SIZE) < e ) - b = rec.ParseField(b, e); + b = rec.ParseField(b, e, ic); return b; } @@ -70,15 +76,19 @@ const char *ldif; const char *objectClass; std::string RecordT::* strMember; // FIXME - find a more general - EmailAddress RecordT::* addrMember; // way to do this... + EmailAddressList RecordT::* addrMember; // way to do this... time_t RecordT::* timeMember; PostalAddress RecordT::* postMember; std::string PostalAddress::* postField; + bool iconvNeeded; }; void BuildField1900(Data &data, size_t &size, uint8_t type, time_t t); void BuildField(Data &data, size_t &size, uint8_t type, char c); +void BuildField(Data &data, size_t &size, uint8_t type, uint8_t c); void BuildField(Data &data, size_t &size, uint8_t type, uint16_t value); +void BuildField(Data &data, size_t &size, uint8_t type, uint32_t value); +void BuildField(Data &data, size_t &size, uint8_t type, uint64_t value); void BuildField(Data &data, size_t &size, uint8_t type, const std::string &str); void BuildField(Data &data, size_t &size, uint8_t type, const void *buf, size_t bufsize); void BuildField(Data &data, size_t &size, const Barry::UnknownField &field); @@ -86,6 +96,13 @@ std::string ParseFieldString(const Barry::Protocol::CommonField *field); std::string ParseFieldString(const void *data, uint16_t maxlen); + +// Functions to help build JDWP command packets +void AddJDWByte(Barry::Data &data, size_t &size, const uint8_t value); +void AddJDWInt(Barry::Data &data, size_t &size, const uint32_t value); +void AddJDWChar(Barry::Data &data, size_t &size, const void *buf, size_t bufsize); +void AddJDWString(Barry::Data &data, size_t &size, const std::string &str); + } // namespace Barry #endif diff -Nru barry-0.14/src/restore.cc barry-0.0.20110506/src/restore.cc --- barry-0.14/src/restore.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/restore.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,374 @@ +/// +/// \file restore.cc +/// Builder class for restoring from Barry Backup files +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "restore.h" +#include "tarfile.h" +#include "error.h" +#include +#include +#include +#include +#include + +using namespace std; + +namespace Barry { + +namespace { + + int CountFiles(reuse::TarFile &tar, + const Barry::Restore::DBListType &restoreList, + bool default_all_db) + { + int count = 0; + std::string name, last_name; + bool good = false; + + while( tar.ReadNextFilenameOnly(name) ) { + std::string::size_type pos = name.rfind('/'); + if( pos == std::string::npos ) + continue; // bad name + std::string dbname = name.substr(0, pos); + + if( dbname != last_name ) { + last_name = dbname; + good = (default_all_db && restoreList.size() == 0) || + restoreList.IsSelected(dbname); + } + if( good ) + count++; + } + return count; + } + +} + +////////////////////////////////////////////////////////////////////////////// +// Static Restore members + +/// Splits a tarpath of the form "DBName/DBID" into separate string values. +/// Returns true if successful, false if tarpath is a bad name. +bool Restore::SplitTarPath(const std::string &tarpath, + std::string &dbname, + std::string &dbid_text, + uint8_t &dbrectype, + uint32_t &dbid) +{ + std::string::size_type pos = tarpath.rfind('/'); + if( pos == std::string::npos ) + return false; // bad name + + dbname = tarpath.substr(0, pos); + dbid_text = tarpath.substr(pos + 1); + if( dbname.size() == 0 || dbid_text.size() == 0 ) + return false; // bad name + + std::istringstream iss(dbid_text); + unsigned int temp; + iss >> std::hex >> dbid >> temp; + dbrectype = (uint8_t) temp; + + return true; +} + + +////////////////////////////////////////////////////////////////////////////// +// Restore - constructors + +Restore::Restore(const std::string &tarpath, bool default_all_db) + : m_tarpath(tarpath) + , m_default_all_db(default_all_db) + , m_tar_record_state(RS_EMPTY) + , m_rec_type(0) + , m_unique_id(0) +{ + try { + m_tar.reset( new reuse::TarFile(tarpath.c_str(), false, + &reuse::gztar_ops_nonthread, true) ); + } + catch( reuse::TarFile::TarError &te ) { + throw Barry::RestoreError(te.what()); + } +} + +Restore::~Restore() +{ +} + + +////////////////////////////////////////////////////////////////////////////// +// Restore - Protected helpers + +bool Restore::IsSelected(const std::string &dbName) const +{ + // if nothing is in the list, use default + if( m_dbList.size() == 0 ) + return m_default_all_db; + else + return m_dbList.IsSelected(dbName); +} + + +////////////////////////////////////////////////////////////////////////////// +// Restore - Public API + +void Restore::AddDB(const std::string &dbName) +{ + if( find(m_dbList.begin(), m_dbList.end(), dbName) == m_dbList.end() ) { + // only add it if it is not already in the list + m_dbList.push_back(dbName); + } +} + +void Restore::Add(const DBListType &dbList) +{ + for( DBListType::const_iterator i = dbList.begin(); + i != dbList.end(); + ++i ) + { + AddDB(*i); + } +} + +void Restore::SkipCurrentDB() +{ + // skip all records until next DB + try { + while( Retrieve(m_record_data) == RS_NEXT ) { + std::cerr << "Skipping: " + << m_current_dbname << "/" + << m_tar_id_text << std::endl; + m_tar_record_state = RS_EMPTY; + } + } + catch( reuse::TarFile::TarError & ) { + m_tar_record_state = RS_EOF; + } +} + +unsigned int Restore::GetRecordTotal() const +{ + return GetRecordTotal(m_tarpath, m_dbList, m_default_all_db); +} + +unsigned int Restore::GetRecordTotal(const std::string &tarpath, + const DBListType &dbList, + bool default_all_db) +{ + unsigned int count = 0; + + std::auto_ptr tar; + + try { + // do a scan through the tar file + tar.reset( new reuse::TarFile(tarpath.c_str(), false, + &reuse::gztar_ops_nonthread, true) ); + count = CountFiles(*tar, dbList, default_all_db); + } + catch( reuse::TarFile::TarError &te ) { + throw Barry::RestoreError(te.what()); + } + return count; +} + +bool Restore::GetNextMeta(DBData &data) +{ + // always use m_record_data here, so that we don't lose access + // to the actual record data for future calls to BuildRecord() + // and FetchRecord() + if( m_tar_record_state == RS_EMPTY ) { + Retrieve(m_record_data); + } + + // fill in the meta data that will be returned in the next call + // to BuildRecord() or FetchRecord()... this is only valid if + // the state is RS_NEXT + switch( m_tar_record_state ) + { + case RS_NEXT: + data.SetVersion(Barry::DBData::REC_VERSION_1); + data.SetDBName(m_current_dbname); + data.SetIds(m_rec_type, m_unique_id); + data.SetOffset(0); + return true; + + default: + return false; + } +} + + +////////////////////////////////////////////////////////////////////////////// +// Barry::Builder overrides + +Restore::RetrievalState Restore::Retrieve(Data &record_data) +{ + // don't do anything unless we're empty + if( m_tar_record_state != RS_EMPTY ) + return m_tar_record_state; + + // search for a valid record + for(;;) { + // load record data from tar file + std::string filename; + if( !m_tar->ReadNextFile(filename, record_data) ) { + // assume end of file + return m_tar_record_state = RS_EOF; + } + m_tar_record_state = RS_UNKNOWN; + + // split record filename into dbname and ID + std::string dbname; + if( !SplitTarPath(filename, dbname, m_tar_id_text, m_rec_type, m_unique_id) ) { + // invalid filename, skip it + std::cerr << "Skipping invalid tar record: " << filename << std::endl; + continue; + } + + // are we working on the same dbname as last time? + // if so, go ahead! + if( m_current_dbname == dbname ) { + return m_tar_record_state = RS_NEXT; + } + + // DIFFERENT DBNAME from here on down! + m_tar_record_state = RS_DBEND; + + // does the filter allow this record? + // if not, skip it and continue looking + if( !IsSelected(dbname) ) { + continue; + } + + // all checks pass, load the new dbname, and return DBEND + // if we are on a dbname boundary + if( m_current_dbname.size() == 0 ) { + // this is the first time through Retrieve, so ok + m_tar_record_state = RS_NEXT; + } + + m_current_dbname = dbname; + return m_tar_record_state; + } +} + +bool Restore::BuildRecord(Barry::DBData &data, + size_t &offset, + const Barry::IConverter *ic) +{ + // in this case, we are loading into m_record_data anyway, + // so no special handling is needed, like FetchRecord() needs. + switch( Retrieve(m_record_data) ) + { + case RS_NEXT: + { + data.SetVersion(Barry::DBData::REC_VERSION_1); + data.SetDBName(m_current_dbname); + data.SetIds(m_rec_type, m_unique_id); + data.SetOffset(offset); + + int packet_size = offset + m_record_data.GetSize(); + unsigned char *buf = data.UseData().GetBuffer(packet_size); + memcpy(buf + offset, m_record_data.GetData(), m_record_data.GetSize()); + offset += m_record_data.GetSize(); + data.UseData().ReleaseBuffer(packet_size); + + // clear loaded flag, as it has now been used + m_tar_record_state = RS_EMPTY; + return true; + } + + case RS_EMPTY: + case RS_UNKNOWN: + default: + throw std::logic_error("Invalid state in Restore::BuildRecord()"); + + case RS_DBEND: + // process the end of database by returning false + // the next round will be valid, so set to RS_NEXT + m_tar_record_state = RS_NEXT; + return false; + + case RS_EOF: + // always return false at end of file + return false; + } +} + +bool Restore::FetchRecord(Barry::DBData &data, const Barry::IConverter *ic) +{ + // if the record has not yet been loaded, we can optimize + // the buffer, and pass in our own... otherwise, just copy + // the current buffer from m_record_data + // + // it is assumed here that Builder users will not alternate + // between calls to BuildRecord() and FetchRecord() + // + if( m_tar_record_state == RS_EMPTY ) { + // BUT, if RS_DBEND is the next value, then we need + // to save the data for the next round... this + // optimization is almost more bother than it's worth :-) + if( Retrieve(data.UseData()) == RS_DBEND ) { + m_record_data = data.GetData(); + m_tar_record_state = RS_NEXT; + return false; + } + } + else { + data.UseData() = m_record_data; + } + + switch( m_tar_record_state ) + { + case RS_NEXT: + data.SetVersion(Barry::DBData::REC_VERSION_1); + data.SetDBName(m_current_dbname); + data.SetIds(m_rec_type, m_unique_id); + data.SetOffset(0); + + // clear loaded flag, as it has now been used + m_tar_record_state = RS_EMPTY; + return true; + + case RS_EMPTY: + case RS_UNKNOWN: + default: + throw std::logic_error("Invalid state in Restore::FetchRecord()"); + + case RS_DBEND: + // process the end of database by returning false + // the next round will be valid, so set to RS_NEXT + m_tar_record_state = RS_NEXT; + return false; + + case RS_EOF: + // always return false at end of file + return false; + } +} + +bool Restore::EndOfFile() const +{ + return m_tar_record_state == RS_EOF; +} + +} // namespace Barry + diff -Nru barry-0.14/src/restore.h barry-0.0.20110506/src/restore.h --- barry-0.14/src/restore.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/restore.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,152 @@ +/// +/// \file restore.h +/// Builder class for restoring from Barry Backup files +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRYBACKUP_RESTORE_H__ +#define __BARRYBACKUP_RESTORE_H__ + +#include "dll.h" +#include "builder.h" +#include "configfile.h" +#include +#include +#include + +// forward declarations +namespace reuse { + class TarFile; +} + +namespace Barry { + +// +// Restore +// +/// Barry Backup Restore builder class. This class is suitable +/// to be used as a builder object anywhere a builder object is +/// accepted. It reads from a Barry Backup tar.gz backup file, +/// and builds records in a staged manner. +/// +/// If a backup file contains more than one database (for example +/// both Address Book and Calendar), then it will build one database +/// first, return false on Retrieve(), and then build the next. +/// If Retrieve() returns false, but EndOfFile() also returns false, +/// then more databases are available. +/// +/// The idea is that you can call Desktop::SaveDatabase() multiple +/// times with this same Restore object, for all the databases in +/// the backup file. +/// +/// It is safe to call Retrieve() multiple times, so when first +/// starting a restore: +/// - call the constructor +/// - call AddDB() with any filters +/// - then call Retrieve(), which will grab the first record, +/// and make GetDBName() valid. +/// +class BXEXPORT Restore : public Barry::Builder +{ +public: + typedef Barry::ConfigFile::DBListType DBListType; + +private: + enum RetrievalState + { + RS_EMPTY, // no record loaded + RS_UNKNOWN, // record data loaded, but not yet checked + // whether this is part of current database + RS_NEXT, // record loaded, part of current database + RS_DBEND, // next record loaded, but end-of-database + // not yet processed by Builder API + RS_EOF // no recrd loaded, end of tar file + }; + + DBListType m_dbList; + + std::string m_tarpath; + std::auto_ptr m_tar; + + bool m_default_all_db; + RetrievalState m_tar_record_state; + uint8_t m_rec_type; + uint32_t m_unique_id; + std::string m_current_dbname; + Barry::Data m_record_data; + std::string m_tar_id_text; + +protected: + static bool SplitTarPath(const std::string &tarpath, + std::string &dbname, std::string &dbid_text, + uint8_t &dbrectype, uint32_t &dbid); + + bool IsSelected(const std::string &dbName) const; + RetrievalState Retrieve(Data &record_data); + + +public: + /// If default_all_db is true, and none of the Add*() functions + /// are called (meaning that Restore has an empty database list), + /// then all records are restored. If false in this situation, + /// nothing is restored. + /// + /// If any of the Add*() functions are called, then the database + /// list takes precedence, and default_all_db has no effect. + /// + explicit Restore(const std::string &tarpath, + bool default_all_db = true); + ~Restore(); + + /// Add database name to the read filter. + void AddDB(const std::string &dbName); + + /// Add all database names in dblist to the read filter + /// This function is additive. + void Add(const DBListType &dbList); + + // Skip the current DB, in case of error, or preference + void SkipCurrentDB(); + + /// Loads the given file, and counts all records according + /// to the current read filter. Does not use the main + /// Restore file, but opens the file separately. + /// It is safe to call this function as often as needed. + unsigned int GetRecordTotal() const; + + /// Static version of above call + static unsigned int GetRecordTotal(const std::string &tarpath, + const DBListType &dbList, bool default_all_db); + + /// If this function returns true, it fills data with the + /// meta data that the next call to BuildRecord() will retrieve. + /// This is useful for applications that need to setup a manual + /// call to Desktop::SaveDatabase(). + bool GetNextMeta(DBData &data); + + // Barry::Builder overrides + bool BuildRecord(Barry::DBData &data, size_t &offset, + const Barry::IConverter *ic); + bool FetchRecord(Barry::DBData &data, const Barry::IConverter *ic); + bool EndOfFile() const; +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_folder.cc barry-0.0.20110506/src/r_folder.cc --- barry-0.14/src/r_folder.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_folder.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -26,7 +26,9 @@ #include "data.h" #include "time.h" #include "debug.h" -#include +#include "iconv.h" +#include +#include #include using namespace std; @@ -34,6 +36,30 @@ namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// Folder Class, static members + +// +// Note! These functions currently only pass the same values through. +// In actuality, these are technically two different values: +// one on the raw protocol side, and the other part of the +// guaranteed Barry API. If the Blackberry ever changes the +// meanings for these codes, do the translation here. +// + +Folder::FolderType Folder::TypeProto2Rec(uint8_t t) +{ + return (FolderType)t; +} + +uint8_t Folder::TypeRec2Proto(FolderType t) +{ + return t; +} + + + /////////////////////////////////////////////////////////////////////////////// // Folder Class @@ -45,30 +71,16 @@ #define FFC_ADDRESS1 0x0d #define FFC_ADDRESS2 0x0e #define FFC_TYPE 0x0f -#define FFC_END 0xffff - -// Folder Types -#define SUBTREE 0x00 -#define DELETED 0x01 -#define INBOX 0x02 -#define OUTBOX 0x03 -#define SENT 0x04 -#define OTHER 0x05 -#define DRAFT 0x0a - -// Folder Status -#define ORPHAN 0x50 -#define UNFILED 0x51 -#define FILED 0x52 +#define FFC_END 0xffff #define INVALID -1 #define SEPARATOR 0x2f #define ROOT_SEPARATOR 0x3a -FieldLink FolderFieldLinks[] = { - { FFC_NAME, "FolderName", 0, 0, &Folder::FolderName, 0, 0 }, - { FFC_END, "End of List", 0, 0, 0, 0, 0 }, +static FieldLink FolderFieldLinks[] = { + { FFC_NAME, "FolderName", 0, 0, &Folder::Name, 0, 0, 0, 0, true }, + { FFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false }, }; Folder::Folder() @@ -82,7 +94,8 @@ } const unsigned char* Folder::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -93,7 +106,7 @@ if( !btohs(field->size) ) // if field has no size, something's up return begin; - + // cycle through the type table for( FieldLink *b = FolderFieldLinks; b->type != FFC_END; @@ -103,6 +116,8 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } else if( b->timeMember && btohs(field->size) == 4 ) { @@ -116,13 +131,13 @@ switch( field->type ) { case FFC_TYPE: - FolderType = (FolderTypeEnum)field->u.raw[0]; + Type = TypeProto2Rec(field->u.raw[0]); return begin; case FFC_NUMBER: - FolderNumber = field->u.raw[0]; // two's complement + Number = field->u.raw[0]; // two's complement return begin; case FFC_LEVEL: - FolderLevel = field->u.raw[0]; + Level = field->u.raw[0]; return begin; } @@ -141,36 +156,60 @@ // no header in Folder records } -void Folder::ParseFields(const Data &data, size_t &offset) +void Folder::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } +void Folder::BuildHeader(Data &data, size_t &offset) const +{ + // not yet implemented +} + +void Folder::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + // not yet implemented +} + void Folder::Clear() { - FolderName.clear(); + RecType = GetDefaultRecType(); + RecordId = 0; + + Name.clear(); + Number = 0; + Level = 0; + + Type = FolderSubtree; + Unknowns.clear(); - FolderType = FolderSubtree; +} + +std::string Folder::GetDescription() const +{ + ostringstream oss; + oss << Name << " (" << Level << ")"; + return oss.str(); } void Folder::Dump(std::ostream &os) const { static const char *FolderTypeString[] = { "Subtree", "Deleted", "Inbox", "Outbox", "Sent", "Other"}; // static const char *FolderStatusString[] = { "Orphan", "Unfiled", "Filed" }; - + os << "Folder Records\n\n"; - os << "Folder Name: " << FolderName << "\n"; + os << "Folder Name: " << Name << "\n"; os << "Folder Type: "; - if( FolderType < FolderDraft ) - os << FolderTypeString[FolderType] << "\n"; - else if( FolderType == FolderDraft ) + if( Type < FolderDraft ) + os << FolderTypeString[Type] << "\n"; + else if( Type == FolderDraft ) os << "Draft\n"; else - os << "Unknown (" << std::hex << FolderType << ")\n"; - os << "Folder Number: " << std::dec << FolderNumber << "\n"; - os << "Folder Level: " << std::dec << FolderLevel << "\n"; + os << "Unknown (" << std::hex << Type << ")\n"; + os << "Folder Number: " << std::dec << Number << "\n"; + os << "Folder Level: " << std::dec << Level << "\n"; os << "\n"; os << Unknowns; os << "\n\n"; diff -Nru barry-0.14/src/r_folder.h barry-0.0.20110506/src/r_folder.h --- barry-0.14/src/r_folder.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_folder.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -31,18 +31,22 @@ namespace Barry { +// forward declarations +class IConverter; + class BXEXPORT Folder { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; + uint8_t RecType; uint32_t RecordId; - - std::string FolderName; - uint16_t FolderNumber; // Not unique, used for ordering of subfolders - NOT level - uint16_t FolderLevel; // From parent - - enum FolderTypeEnum { + + std::string Name; + uint16_t Number; // Not unique, used for ordering of subfolders - NOT level + uint16_t Level; // From parent + + enum FolderType { FolderSubtree = 0, FolderDeleted, FolderInbox, @@ -51,8 +55,8 @@ FolderOther, FolderDraft = 0x0a }; - FolderTypeEnum FolderType; - + FolderType Type; + enum FolderStatusType { FolderOrphan = 0x50, FolderUnfiled, @@ -61,23 +65,30 @@ UnknownsType Unknowns; -public: +protected: + static FolderType TypeProto2Rec(uint8_t t); + static uint8_t TypeRec2Proto(FolderType t); + +public: Folder(); ~Folder(); const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); uint8_t GetRecType() const { return RecType; } uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; - bool operator<(const Folder &other) const { return FolderName < other.FolderName; } + std::string GetDescription() const; + + bool operator<(const Folder &other) const { return Name < other.Name; } // database name static const char * GetDBName() { return "Folders"; } diff -Nru barry-0.14/src/r_hhagent.cc barry-0.0.20110506/src/r_hhagent.cc --- barry-0.14/src/r_hhagent.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_hhagent.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,413 @@ +/// +/// \file r_hhagent.cc +/// Blackberry database record parser class for Handheld Agent records +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_hhagent.h" +#include "record-internal.h" +#include "protostructs.h" +#include "iconv.h" +#include "time.h" +#include +#include +#include +#include + +#define __DEBUG_MODE__ +#include "debug.h" + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + + +/////////////////////////////////////////////////////////////////////////////// +// HandheldAgent class + +// Common field codes +#define HHAFC_END 0xffff + +// Field codes for record 3000000 +#define HHAFC3_MODEL 0x03 +#define HHAFC3_BANDS 0x07 +#define HHAFC3_VERSION 0x08 +#define HHAFC3_NETWORK 0x0f +#define HHAFC3_PIN 0x10 +#define HHAFC3_MEID 0x11 + +// Field codes for record 7000000 +#define HHAFC7_FIRMWARE 0x13 +#define HHAFC7_MANUFACTURER 0x14 +#define HHAFC7_MODEL 0x15 +#define HHAFC7_PLATFORM 0x17 + +// These fields are only valid for RecordId 0x3000000 +static FieldLink HandheldAgentFieldLinks_3000000[] = { + { HHAFC3_MODEL, "Model", 0, 0, &HandheldAgent::Model, 0, 0, 0, 0, true }, + { HHAFC3_NETWORK, "Network", 0, 0, &HandheldAgent::Network, 0, 0, 0, 0, true }, + { HHAFC3_BANDS, "Bands", 0, 0, &HandheldAgent::Bands, 0, 0, 0, 0, true }, + { HHAFC3_MEID, "MEID/ESN", 0, 0, &HandheldAgent::MEID, 0, 0, 0, 0, true }, + { HHAFC3_PIN, "PIN", 0, 0, &HandheldAgent::Pin, 0, 0, 0, 0, true }, + { HHAFC3_VERSION, "Version",0, 0, &HandheldAgent::Version, 0, 0, 0, 0, true }, + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// These fields are only for RecordId 0x4000000 +static FieldLink HandheldAgentFieldLinks_4000000[] = { + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// These fields are only for RecordId 0x5000000 +static FieldLink HandheldAgentFieldLinks_5000000[] = { + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// These fields are only for RecordId 0x7000000 +static FieldLink HandheldAgentFieldLinks_7000000[] = { + { HHAFC7_MODEL, "Model", 0, 0, &HandheldAgent::Model, 0, 0, 0, 0, true }, + { HHAFC7_MANUFACTURER,"Manufacturer",0,0,&HandheldAgent::Manufacturer,0, 0, 0, 0, true }, + { HHAFC7_FIRMWARE, "Firmware", 0, 0, &HandheldAgent::Version, 0, 0, 0, 0, true }, + { HHAFC7_PLATFORM, "Platform", 0, 0, &HandheldAgent::PlatformVersion, 0, 0, 0, 0, true }, + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// Use this table for default application style records +static FieldLink HandheldAgentFieldLinks_Default[] = { + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// Use this for display / Dump() etc... includes all fields +static FieldLink HandheldAgentFieldLinks_All[] = { + { 0, "Model", 0, 0, &HandheldAgent::Model, 0, 0, 0, 0, true }, + { 0, "Network", 0, 0, &HandheldAgent::Network, 0, 0, 0, 0, true }, + { 0, "Manufacturer",0,0, &HandheldAgent::Manufacturer,0, 0, 0, 0, true }, + { 0, "Bands", 0, 0, &HandheldAgent::Bands, 0, 0, 0, 0, true }, + { 0, "MEID/ESN", 0, 0, &HandheldAgent::MEID, 0, 0, 0, 0, true }, + { 0, "PIN", 0, 0, &HandheldAgent::Pin, 0, 0, 0, 0, true }, + { 0, "Version", 0, 0, &HandheldAgent::Version, 0, 0, 0, 0, true }, + { 0, "Platform", 0, 0, &HandheldAgent::PlatformVersion, 0, 0, 0, 0, true }, + { HHAFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +HandheldAgent::HandheldAgent() +{ + Clear(); +} + +HandheldAgent::~HandheldAgent() +{ +} + +const unsigned char* HandheldAgent::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *) begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !btohs(field->size) ) // if field has no size, something's up + return begin; + + // cycle through the type table + FieldLink *b = HandheldAgentFieldLinks_Default; + if( RecordId == 0 ) { + // internal consistency check... all parsing code should + // call SetIds() first, and HandheldAgent relies on this, + // so double check, and throw if not + throw std::logic_error("HandheldAgent requires SetIds() to be called before ParseField()"); + } + else if( RecordId == GetMEIDRecordId() ) { + b = HandheldAgentFieldLinks_3000000; + } + else if( RecordId == GetUnknown1RecordId() ) { + b = HandheldAgentFieldLinks_4000000; + } + else if( RecordId == GetUnknown2RecordId() ) { + b = HandheldAgentFieldLinks_5000000; + } + else if( RecordId == GetUnknown3RecordId() ) { + b = HandheldAgentFieldLinks_7000000; + } + + for( ; b->type != HHAFC_END; b++ ) { + if( b->type == field->type ) { + if( b->strMember ) { + std::string &s = this->*(b->strMember); + s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); + return begin; // done! + } + else if( b->timeMember && btohs(field->size) == 4 ) { + time_t &t = this->*(b->timeMember); + dout("min1900: " << field->u.min1900); + t = min2time(field->u.min1900); + return begin; + } + else if( b->addrMember ) { + // + // parse email address + // get dual addr+name string first + // Note: this is a different format than + // used in r_message*.cc + // + std::string dual((const char*)field->u.raw, btohs(field->size)); + + EmailAddress a; + + // assign first string, using null terminator + // letting std::string add it for us if it + // doesn't exist + a.Email = dual.c_str(); + + // assign second string, using first size + // as starting point + a.Name = dual.c_str() + a.Email.size() + 1; + + // if the address is non-empty, add to list + if( a.size() ) { + // i18n convert if needed + if( b->iconvNeeded && ic ) { + a.Name = ic->FromBB(a.Name); + a.Email = ic->FromBB(a.Email); + } + + EmailAddressList &al = this->*(b->addrMember); + al.push_back(a); + } + + return begin; + } + } + } + + // handle special cases +// switch( field->type ) +// { +// } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + // return new pointer for next field + return begin; +} + +void HandheldAgent::ParseHeader(const Data &data, size_t &offset) +{ + // no header in HandheldAgent records +} + +void HandheldAgent::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void HandheldAgent::BuildHeader(Data &data, size_t &offset) const +{ + // no header in HandheldAgent records +} + +// +// Build +// +/// Build fields part of record. +/// +void HandheldAgent::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ +} + +void HandheldAgent::Clear() +{ + // clear our fields + RecType = GetDefaultRecType(); + RecordId = 0; + + MEID.clear(); + Model.clear(); + Bands.clear(); + Pin.clear(); + Version.clear(); + PlatformVersion.clear(); + Manufacturer.clear(); + Network.clear(); + + Unknowns.clear(); +} + +std::string HandheldAgent::GetDescription() const +{ + ostringstream oss; + oss << "Handheld Agent: 0x" << hex << RecordId; + return oss.str(); +} + +void HandheldAgent::Dump(std::ostream &os) const +{ + os << "HandheldAgent entry: 0x" << hex << RecordId + << " (" << (unsigned int)RecType << ")\n"; + + // cycle through the type table + for( const FieldLink *b = HandheldAgentFieldLinks_All; + b->type != HHAFC_END; + b++ ) + { + if( b->strMember ) { + const std::string &s = this->*(b->strMember); + if( s.size() ) + os << " " << b->name << ": " << s << "\n"; + } + else if( b->timeMember ) { + time_t t = this->*(b->timeMember); + if( t > 0 ) + os << " " << b->name << ": " << ctime(&t); + else + os << " " << b->name << ": disabled\n"; + } + else if( b->addrMember ) { + const EmailAddressList &al = this->*(b->addrMember); + EmailAddressList::const_iterator lb = al.begin(), le = al.end(); + + for( ; lb != le; ++lb ) { + if( !lb->size() ) + continue; + + os << " " << b->name << ": " << *lb << "\n"; + } + } + } + + // print any unknowns + os << Unknowns; +} + +bool HandheldAgent::operator<(const HandheldAgent &other) const +{ + return RecordId < other.RecordId; +} + +bool HandheldAgent::IsSpecial(uint32_t record_id) +{ + return + record_id == GetMEIDRecordId() || + record_id == GetUnknown1RecordId() || + record_id == GetUnknown2RecordId() || + record_id == GetUnknown3RecordId(); +} + +// +// The ESN number is in two parts. When in decimal, the first 3 +// characters are one number, then the rest. In hex, the first 2 +// digits are the same number, then the rest. Both are padded +// with zeros. +// +// For example, hex: 4c070068 dec: 07600458856 +// hex: [4c]070068 dec: [076]00458856 +// +// Returns an empty string on error. +// + +bool HandheldAgent::IsESNHex(const std::string &esn) +{ + const char *hex = "0123456789ABCDEFabcdef"; + size_t npos = string::npos; + + if( esn.size() == 8 && esn.find_first_not_of(hex) == npos ) { + return true; + } + + return false; +} + +bool HandheldAgent::IsESNDec(const std::string &esn) +{ + const char *dec = "0123456789"; + size_t npos = string::npos; + + if( esn.size() == 11 && esn.find_first_not_of(dec) == npos ) { + return true; + } + + return false; +} + +std::string HandheldAgent::ESNDec2Hex(const std::string &esn) +{ + string empty; + + if( esn.size() != 11 ) + return empty; + + unsigned int part1, part2; + istringstream iss(esn.substr(0, 3)); + iss >> dec >> part1; + if( !iss ) + return empty; + iss.str(esn.substr(3)); + iss.clear(); + iss >> dec >> part2; + if( !iss ) + return empty; + + ostringstream oss; + oss << setfill('0') << setw(2) << hex << part1; + oss << setfill('0') << setw(6) << hex << part2; + if( !oss ) + return empty; + return oss.str(); +} + +std::string HandheldAgent::ESNHex2Dec(const std::string &esn) +{ + string empty; + + if( esn.size() != 8 ) + return empty; + + unsigned int part1, part2; + istringstream iss(esn.substr(0, 2)); + iss >> hex >> part1; + if( !iss ) + return empty; + iss.str(esn.substr(2)); + iss.clear(); + iss >> hex >> part2; + if( !iss ) + return empty; + + ostringstream oss; + oss << setfill('0') << setw(3) << dec << part1; + oss << setfill('0') << setw(8) << dec << part2; + if( !oss ) + return empty; + return oss.str(); +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_hhagent.h barry-0.0.20110506/src/r_hhagent.h --- barry-0.14/src/r_hhagent.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_hhagent.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,126 @@ +/// +/// \file r_hhagent.h +/// Blackberry database record parser class for Handheld Agent records +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_HHAGENT_H__ +#define __BARRY_RECORD_HHAGENT_H__ + +#include "dll.h" +#include "record.h" + +namespace Barry { + +// forward declarations +class IConverter; + +// +// NOTE: All classes here must be container-safe! Perhaps add sorting +// operators in the future. +// + +/// \addtogroup RecordParserClasses +/// @{ + +// +// Handheld Agent record class +// +/// Represents a single record in the Handheld Agent database. +/// +class BXEXPORT HandheldAgent +{ +public: + typedef Barry::UnknownsType UnknownsType; + + // + // Record fields + // + + // contact specific data + uint8_t RecType; + uint32_t RecordId; + + std::string MEID; + std::string Model; + std::string Bands; + std::string Pin; // may not be valid for every record + std::string Version; + std::string PlatformVersion; + std::string Manufacturer; + std::string Network; + + UnknownsType Unknowns; + +public: + const unsigned char* ParseField(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + +public: + HandheldAgent(); + ~HandheldAgent(); + + uint32_t GetID() const { return RecordId; } + std::string GetFullName() const; + const std::string& GetEmail(unsigned int index = 0) const; + + // Parser / Builder API (see parser.h / builder.h) + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + + // operations (common among record classes) + void Clear(); // erase everything + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + // Sorting - use enough data to make the sorting as + // consistent as possible + bool operator<(const HandheldAgent &other) const; + + // database name + static const char * GetDBName() { return "Handheld Agent"; } + static uint8_t GetDefaultRecType() { return 0; } + static uint32_t GetMEIDRecordId() { return 0x3000000; } + static uint32_t GetUnknown1RecordId() { return 0x4000000; } + static uint32_t GetUnknown2RecordId() { return 0x5000000; } + static uint32_t GetUnknown3RecordId() { return 0x7000000; } + static bool IsSpecial(uint32_t record_id); + + // utility functions + static bool IsESNHex(const std::string &esn); + static bool IsESNDec(const std::string &esn); + static std::string ESNDec2Hex(const std::string &esn); + static std::string ESNHex2Dec(const std::string &esn); +}; + +BXEXPORT inline std::ostream& operator<< (std::ostream &os, const HandheldAgent &hha) { + hha.Dump(os); + return os; +} + +/// @} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_memo.cc barry-0.0.20110506/src/r_memo.cc --- barry-0.14/src/r_memo.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_memo.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ #include "protostructs.h" #include "data.h" #include "time.h" +#include "iconv.h" #include #include @@ -43,11 +44,10 @@ #define MEMFC_CATEGORY 0x04 #define MEMFC_END 0xffff -FieldLink MemoFieldLinks[] = { - { MEMFC_TITLE, "Title", 0, 0, &Memo::Title, 0, 0 }, - { MEMFC_BODY, "Body", 0, 0, &Memo::Body, 0, 0 }, - { MEMFC_CATEGORY, "Category", 0, 0, &Memo::Category, 0, 0 }, - { MEMFC_END, "End of List", 0, 0, 0, 0, 0 } +static FieldLink MemoFieldLinks[] = { + { MEMFC_TITLE, "Title", 0, 0, &Memo::Title, 0, 0, 0, 0, true }, + { MEMFC_BODY, "Body", 0, 0, &Memo::Body, 0, 0, 0, 0, true }, + { MEMFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } }; Memo::Memo() @@ -60,7 +60,8 @@ } const unsigned char* Memo::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -73,10 +74,10 @@ return begin; if( field->type == MEMFC_MEMO_TYPE ) { - if( ( MemoType = field->u.raw[0] ) != 'm' ) { + if( field->u.raw[0] != 'm' ) { throw Error( "Memo::ParseField: MemoType is not 'm'" ); } - return begin; + return begin; } @@ -89,6 +90,8 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } else if( b->timeMember && btohs(field->size) == 4 ) { @@ -98,6 +101,18 @@ } } } + // handle special cases + switch( field->type ) + { + case MEMFC_CATEGORY: + { + std::string catstring = ParseFieldString(field); + if( ic ) + catstring = ic->FromBB(catstring); + Categories.CategoryStr2List(catstring); + } + return begin; + } // if still not handled, add to the Unknowns list UnknownField uf; @@ -114,36 +129,124 @@ // no header in Memo records } -void Memo::ParseFields(const Data &data, size_t &offset) +void Memo::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } +void Memo::BuildHeader(Data &data, size_t &offset) const +{ + // no header in Memo records +} + + +// +// Build +// +/// Build fields part of record. +/// +void Memo::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + data.Zap(); + + // tack on the 'm' memo type field first + BuildField(data, offset, MEMFC_MEMO_TYPE, 'm'); + + // Categories + if( Categories.size() ) { + string store; + Categories.CategoryList2Str(store); + BuildField(data, offset, MEMFC_CATEGORY, ic ? ic->ToBB(store) : store); + } + + // cycle through the type table + for( FieldLink *b = MemoFieldLinks; + b->type != MEMFC_END; + b++ ) + { + // print only fields with data + if( b->strMember ) { + const std::string &field = this->*(b->strMember); + if( field.size() ) { + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); + } + } + else if( b->postMember && b->postField ) { + const std::string &field = (this->*(b->postMember)).*(b->postField); + if( field.size() ) { + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); + } + } + } + + // and finally save unknowns + UnknownsType::const_iterator + ub = Unknowns.begin(), ue = Unknowns.end(); + for( ; ub != ue; ub++ ) { + BuildField(data, offset, *ub); + } + + data.ReleaseBuffer(offset); +} + + + void Memo::Dump(std::ostream &os) const { os << "Memo entry: 0x" << setbase(16) << RecordId << " (" << (unsigned int)RecType << ")\n"; os << " Title: " << Title << "\n"; - os << " Body: " << Body << "\n"; - os << " Category: " << Category << "\n"; + os << " Body: "; + + // The Body may have '\r' characters... translate them + // in the output to make it look more pretty + for( string::const_iterator i = Body.begin(); i != Body.end(); ++i ) { + if( *i == '\r' ) + os << "\n "; + else + os << *i; + } + os << "\n"; + + if( Categories.size() ) { + string display; + Categories.CategoryList2Str(display); + os << " Categories: " << display << "\n"; + } os << Unknowns; os << "\n\n"; } +bool Memo::operator<(const Memo &other) const +{ + int cmp = Title.compare(other.Title); + if( cmp == 0 ) + cmp = Body.compare(other.Body); + return cmp < 0; +} + void Memo::Clear() { + RecType = GetDefaultRecType(); + RecordId = 0; + Title.clear(); Body.clear(); - Category.clear(); - - MemoType = 0; + Categories.clear(); Unknowns.clear(); } +std::string Memo::GetDescription() const +{ + return Title; +} + } // namespace Barry diff -Nru barry-0.14/src/r_memo.h barry-0.0.20110506/src/r_memo.h --- barry-0.14/src/r_memo.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_memo.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -31,24 +31,26 @@ namespace Barry { +// forward declarations +class IConverter; + class BXEXPORT Memo { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; uint8_t RecType; uint32_t RecordId; - uint8_t MemoType; std::string Title; std::string Body; - std::string Category; + CategoryList Categories; UnknownsType Unknowns; public: const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); public: Memo(); @@ -59,14 +61,17 @@ uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; - - bool operator<(const Memo &other) const { return Title < other.Title; } + std::string GetDescription() const; + + bool operator<(const Memo &other) const; + // database name static const char * GetDBName() { return "Memos"; } static uint8_t GetDefaultRecType() { return 0; } // or 0? diff -Nru barry-0.14/src/r_message_base.cc barry-0.0.20110506/src/r_message_base.cc --- barry-0.14/src/r_message_base.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_message_base.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,419 @@ +/// +/// \file r_message_base.cc +/// Base class for email-oriented Blackberry database records +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007, Brian Edginton (edge@edginton.net) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_message_base.h" +#include "record-internal.h" +#include "protostructs.h" +#include "data.h" +#include "time.h" +#include "endian.h" +#include "iconv.h" +#include +#include +#include + +#define __DEBUG_MODE__ +#include "debug.h" + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// Message class + + +// Email / message field codes +#define MBFC_TO 0x01 // can occur multiple times +#define MBFC_CC 0x02 // ditto +#define MBFC_BCC 0x03 // ditto +#define MBFC_SENDER 0x04 +#define MBFC_FROM 0x05 +#define MBFC_REPLY_TO 0x06 +#define MBFC_SUBJECT 0x0b +#define MBFC_BODY 0x0c +#define MBFC_REPLY_UNKNOWN 0x12 // This shows up as 0x00 on replies + // but we don't do much with it now +#define MBFC_ATTACHMENT 0x16 +#define MBFC_RECORDID 0x4b // Internal Message ID, mimics header RecNumber +#define MBFC_END 0xffff + +#define PRIORITY_MASK 0x003f +#define PRIORITY_HIGH 0x0008 +#define PRIORITY_LOW 0x0002 + +#define SENSITIVE_MASK 0xff80 +#define SENSITIVE_CONFIDENTIAL 0x0100 +#define SENSITIVE_PERSONAL 0x0080 +#define SENSITIVE_PRIVATE 0x0040 // actual pattern is 0x00C0 + +#define MESSAGE_READ 0x0800 +#define MESSAGE_REPLY 0x0001 +#define MESSAGE_SAVED 0x0002 +#define MESSAGE_FORWARD 0x0008 +#define MESSAGE_TRUNCATED 0x0020 +#define MESSAGE_SAVED_DELETED 0x0080 + +static FieldLink MessageBaseFieldLinks[] = { + { MBFC_TO, "To", 0, 0, 0, &MessageBase::To, 0, 0, 0, true }, + { MBFC_CC, "Cc", 0, 0, 0, &MessageBase::Cc, 0, 0, 0, true }, + { MBFC_BCC, "Bcc", 0, 0, 0, &MessageBase::Bcc, 0, 0, 0, true }, + { MBFC_SENDER, "Sender", 0, 0, 0, &MessageBase::Sender, 0, 0, 0, true }, + { MBFC_FROM, "From", 0, 0, 0, &MessageBase::From, 0, 0, 0, true }, + { MBFC_REPLY_TO, "ReplyTo", 0, 0, 0, &MessageBase::ReplyTo, 0, 0, 0, true }, + { MBFC_SUBJECT, "Subject", 0, 0, &MessageBase::Subject, 0, 0, 0, 0, true }, + { MBFC_BODY, "Body", 0, 0, &MessageBase::Body, 0, 0, 0, 0, true }, + { MBFC_ATTACHMENT, "Attachment", 0, 0, &MessageBase::Attachment, 0, 0, 0, 0, false }, + { MBFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } +}; + +MessageBase::MessageBase() +{ + Clear(); +} + +MessageBase::~MessageBase() +{ +} + +const unsigned char* MessageBase::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *) begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if( begin > end ) // if begin==end, we are ok + return begin; + + if( !btohs(field->size) ) // if field has no size, something's up + return begin; + + // cycle through the type table + for( FieldLink *b = MessageBaseFieldLinks; + b->type != MBFC_END; + b++ ) + { + if( b->type == field->type ) { + if( b->strMember ) { + // parse regular string + std::string &s = this->*(b->strMember); + s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); + return begin; // done! + } + else if( b->addrMember ) { + // parse email address + // get dual name+addr string first + const char *fa = (const char*)field->u.addr.addr; + std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown)); + + // assign first string, using null terminator + // letting std::string add it for us if it + // doesn't exist + EmailAddress a; + a.Name = dual.c_str(); + + // assign second string, using first size + // as starting point + a.Email = dual.c_str() + a.Name.size() + 1; + + // if the address is non-empty, add to list + if( a.size() ) { + // i18n convert if needed + if( b->iconvNeeded && ic ) { + a.Name = ic->FromBB(a.Name); + a.Email = ic->FromBB(a.Email); + } + + EmailAddressList &al = this->*(b->addrMember); + al.push_back(a); + } + + return begin; + } + } + } + + // handle special cases + char swallow; + switch( field->type ) + { + case MBFC_RECORDID: + MessageRecordId = btohl(field->u.uint32); + return begin; + + case MBFC_REPLY_UNKNOWN: // FIXME - not available in SavedMessage? + swallow = field->u.raw[0]; + return begin; + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + return begin; +} + +uint8_t MessageBase::GetRecType() const +{ + throw std::logic_error("MessageBase::GetRecType() called, and not supported by the USB protocol. Should never get called."); +} + +uint32_t MessageBase::GetUniqueId() const +{ + throw std::logic_error("MessageBase::GetUniqueId() called, and not supported by the USB protocol. Should never get called."); +} + +void MessageBase::ParseHeader(const Data &data, size_t &offset) +{ + const unsigned char *begin = data.GetData(); + const unsigned char *end = data.GetData() + data.GetSize(); + + begin += offset + MESSAGE_RECORD_HEADER_SIZE; + if( begin > end ) + return; + + MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset); + + // Priority + Priority = NormalPriority; + + uint16_t priority = btohs(mr->priority); // deal with endian swap once + if( priority & PRIORITY_MASK ) { + if( priority & PRIORITY_HIGH ) { + Priority = HighPriority; + } + else if( priority & PRIORITY_LOW ) { + Priority = LowPriority; + } + else + Priority = UnknownPriority; + } + + // Sensitivity + Sensitivity = NormalSensitivity; + + if( priority & SENSITIVE_MASK ) { + if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) { + Sensitivity = Confidential; + } + else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) { + Sensitivity = Private; + } + else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) { + Sensitivity = Personal; + } + else + Sensitivity = UnknownSensitivity; + } + + // X-rim-org-message-ref-id + // NOTE: I'm cheating a bit here and using this as a reply-to + // It's actually sent by BB with the actual UID in every message + if( mr->inReplyTo ) + MessageReplyTo = btohl(mr->inReplyTo); + + // Status Flags + uint32_t flags = btohl(mr->flags); + + // NOTE: A lot of these flags are 'backwards' but this seemed + // like the most logical way to interpret them for now + if( !( flags & MESSAGE_READ )) + MessageRead = true; + + // NOTE: This is a reply, the original message's flags are not changed + // the inReplyTo field is updated with the original messages's UID + if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY ) + MessageReply = true; + + // NOTE: This bit is unset on truncation, around 4096 on my 7100g + // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested + // the exact size yet + if( !( flags & MESSAGE_TRUNCATED )) + MessageTruncated = true; + + // NOTE: Saved to 'saved' folder + if( !( flags & MESSAGE_SAVED )) + MessageSaved = true; + + // NOTE: Saved to 'saved' folder and then deleted from inbox + if( !( flags & MESSAGE_SAVED_DELETED )) + MessageSavedDeleted = true; + + MessageDateSent = Message2Time(mr->dateSent, mr->timeSent); + MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived); + + offset += MESSAGE_RECORD_HEADER_SIZE; +} + +void MessageBase::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void MessageBase::BuildHeader(Data &data, size_t &offset) const +{ + throw std::logic_error("MessageBase::BuildHeader not yet implemented"); +} + +void MessageBase::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + throw std::logic_error("MessageBase::BuildFields not yet implemented"); +} + +void MessageBase::Clear() +{ + // these must be overwritten by any derived classes + RecType = 0; + RecordId = 0; + + // clear base class variables + From.clear(); + To.clear(); + Cc.clear(); + Bcc.clear(); + Sender.clear(); + ReplyTo.clear(); + + Subject.clear(); + Body.clear(); + Attachment.clear(); + + MessageRecordId = 0; + MessageReplyTo = 0; + MessageDateSent = 0; + MessageDateReceived = 0; + + MessageTruncated = false; + MessageRead = false; + MessageReply = false; + MessageSaved = false; + MessageSavedDeleted = false; + + Priority = NormalPriority; + Sensitivity = NormalSensitivity; + + Unknowns.clear(); +} + +std::string MessageBase::GetDescription() const +{ + // FIXME - ponder a better description... + return Subject; +} + +std::string MessageBase::SimpleFromAddress() const +{ + if( From.size() ) { + // remove all spaces from the email + std::string ret; + for( size_t i = 0; i < From[0].Email.size(); i++ ) + if( From[0].Email[i] != ' ' ) + ret += From[0].Email[i]; + + return ret; + } + else { + return "unknown"; + } +} + +// dump message in mbox format +void MessageBase::Dump(std::ostream &os) const +{ + static const char *Importance[] = + { "Low", "Normal", "High", "Unknown Priority" }; + static const char *SensitivityString[] = + { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" }; + + os << "From " << SimpleFromAddress() << " " << ctime( &MessageDateReceived ); + +/* +FIXME +// savedmessage prints like this: +os << "From " << SimpleFromAddress() << " " << ctime( &MessageDateSent ); +// pinmessage prints like this: +os << "From " << SimpleFromAddress() << " " << ctime( &MessageDateSent ); +*/ + + os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n"; + + if( MessageReplyTo ) + os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n"; + if( MessageSaved ) + os << "X-Message-Status: Saved\n"; + else if( MessageRead ) + os << "Message Status: Opened\n"; + if( Priority != NormalPriority ) + os << "Importance: " << Importance[Priority] << "\n"; + if( Sensitivity != NormalSensitivity ) + os << "Sensitivity: " << SensitivityString[Sensitivity] << "\n"; + os << "Date: " << ctime(&MessageDateSent); + if( From.size() ) + os << "From: " << From[0] << "\n"; + if( To.size() ) + os << "To: " << To << "\n"; + if( Cc.size() ) + os << "Cc: " << Cc << "\n"; + if( Bcc.size() ) + os << "Bcc: " << Bcc << "\n"; + if( Sender.size() ) + os << "Sender: " << Sender << "\n"; + if( ReplyTo.size()) + os << "Reply To: " << ReplyTo << "\n"; + if( Subject.size() ) + os << "Subject: " << Subject << "\n"; + os << "\n"; + os << Cr2LfWrapper(Body); + os << "\n"; + + if( Attachment.size() ) + os << "Attachments: " << Data(Attachment.data(), Attachment.size()) << "\n"; + + os << Unknowns; + os << "\n\n"; +} + +bool MessageBase::operator<(const MessageBase &other) const +{ + // just in case either of these are set to '0', use the + // one with the max value... this uses the latest date, which + // is likely the most accurate + time_t date = std::max(MessageDateSent, MessageDateReceived); + time_t odate = std::max(other.MessageDateSent, other.MessageDateReceived); + + if( date != odate ) + return date < odate; + + return Subject < other.Subject; +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_message_base.h barry-0.0.20110506/src/r_message_base.h --- barry-0.14/src/r_message_base.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_message_base.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,138 @@ +/// +/// \file r_message_base.h +/// Base class for email-oriented Blackberry database records +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007, Brian Edginton (edge@edginton.net) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_MESSAGE_BASE_H__ +#define __BARRY_RECORD_MESSAGE_BASE_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include +#include +#include + + +namespace Barry { + +// forward declarations +class IConverter; + +// +// NOTE: All classes here must be container-safe! Perhaps add sorting +// operators in the future. +// + +class BXEXPORT MessageBase +{ +public: + typedef Barry::UnknownsType UnknownsType; + + uint8_t RecType; + uint32_t RecordId; + + EmailAddressList From; + EmailAddressList To; + EmailAddressList Cc; + EmailAddressList Bcc; + EmailAddressList Sender; //< not available for PINMessage? + EmailAddressList ReplyTo; //< not available for PINMessage? + std::string Subject; + std::string Body; + std::string Attachment; //< not available for PINMessage? + + uint32_t MessageRecordId; // in PINMessage, this happens to be + // the same as RecordId in my (CDF) + // testing, but interestingly, it is + // stored as a field *inside* the + // record, and not as part of the + // header... in effect, this record ID + // occurs twice in the protocol + uint32_t MessageReplyTo; + time_t MessageDateSent; + time_t MessageDateReceived; + + // Message Flags + bool MessageTruncated; + bool MessageRead; + bool MessageReply; + bool MessageSaved; + bool MessageSavedDeleted; + + enum PriorityType { + LowPriority = 0, + NormalPriority, + HighPriority, + UnknownPriority + }; + PriorityType Priority; + + enum SensitivityType { + NormalSensitivity = 0, + Personal, + Private, + Confidential, + UnknownSensitivity + }; + SensitivityType Sensitivity; + + UnknownsType Unknowns; + +protected: + std::string SimpleFromAddress() const; + +public: + const unsigned char* ParseField(const unsigned char *begin, + const unsigned char *end, const IConverter *ic = 0); + +protected: + MessageBase(); + ~MessageBase(); + +public: + // Parser / Builder API (see parser.h / builder.h) + uint8_t GetRecType() const; + uint32_t GetUniqueId() const; // empty API, not required by protocol + void SetIds(uint8_t Type, uint32_t Id){ RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + + // operations (common among record classes) + void Clear(); + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + // sorting + bool operator<(const MessageBase &other) const; +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const MessageBase &msg) { + msg.Dump(os); + return os; +} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_message.cc barry-0.0.20110506/src/r_message.cc --- barry-0.14/src/r_message.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_message.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ -/// -/// \file r_message.cc -/// Blackberry database record parser class for email records. -/// - -/* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "r_message.h" -#include "record-internal.h" -#include "protocol.h" -#include "protostructs.h" -#include "data.h" -#include "time.h" -#include "error.h" -#include "endian.h" -#include -#include -#include -#include - -#define __DEBUG_MODE__ -#include "debug.h" - -using namespace std; -using namespace Barry::Protocol; - -namespace Barry { - -/////////////////////////////////////////////////////////////////////////////// -// Message class - - -// Email / message field codes -#define MFC_TO 0x01 // can occur multiple times -#define MFC_CC 0x02 // ditto -#define MFC_BCC 0x03 // ditto -#define MFC_SENDER 0x04 -#define MFC_FROM 0x05 -#define MFC_REPLY_TO 0x06 -#define MFC_SUBJECT 0x0b -#define MFC_BODY 0x0c -#define MFC_REPLY_UNKNOWN 0x12 // This shows up as 0x00 on replies but we don't do much with it now -#define MFC_ATTACHMENT 0x16 -#define MFC_RECORDID 0x4b -#define MFC_END 0xffff - -#define PRIORITY_MASK 0x003f -#define PRIORITY_HIGH 0x0008 -#define PRIORITY_LOW 0x0002 - -#define SENSITIVE_MASK 0xff80 -#define SENSITIVE_CONFIDENTIAL 0x0100 -#define SENSITIVE_PERSONAL 0x0080 -#define SENSITIVE_PRIVATE 0x0040 // actual pattern is 0x00C0 - -#define MESSAGE_READ 0x0800 -#define MESSAGE_REPLY 0x0001 -#define MESSAGE_SAVED 0x0002 -#define MESSAGE_FORWARD 0x0008 -#define MESSAGE_TRUNCATED 0x0020 -#define MESSAGE_SAVED_DELETED 0x0080 - -FieldLink MessageFieldLinks[] = { - { MFC_TO, "To", 0, 0, 0, &Message::To, 0 }, - { MFC_CC, "Cc", 0, 0, 0, &Message::Cc, 0 }, - { MFC_BCC, "Bcc", 0, 0, 0, &Message::Bcc, 0 }, - { MFC_SENDER, "Sender", 0, 0, 0, &Message::Sender, 0 }, - { MFC_FROM, "From", 0, 0, 0, &Message::From, 0 }, - { MFC_REPLY_TO, "ReplyTo", 0, 0, 0, &Message::ReplyTo, 0 }, - { MFC_SUBJECT, "Subject", 0, 0, &Message::Subject, 0, 0 }, - { MFC_BODY, "Body", 0, 0, &Message::Body, 0, 0 }, - { MFC_ATTACHMENT, "Attachment", 0, 0, &Message::Attachment, 0, 0 }, - { MFC_END, "End of List", 0, 0, 0, 0, 0 } -}; - -Message::Message() -{ - Clear(); -} - -Message::~Message() -{ -} - -const unsigned char* Message::ParseField(const unsigned char *begin, - const unsigned char *end) -{ - const CommonField *field = (const CommonField *) begin; - - // advance and check size - begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); - if( begin > end ) // if begin==end, we are ok - return begin; - - if( !btohs(field->size) ) // if field has no size, something's up - return begin; - - // cycle through the type table - for( FieldLink *b = MessageFieldLinks; - b->type != MFC_END; - b++ ) - { - if( b->type == field->type ) { - if( b->strMember ) { - // parse regular string - std::string &s = this->*(b->strMember); - s = ParseFieldString(field); - return begin; // done! - } - else if( b->addrMember ) { - // parse email address - // get dual name+addr string first - const char *fa = (const char*)field->u.addr.addr; - std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown)); - - // assign first string, using null terminator...letting std::string add it for us if it doesn't exist - EmailAddress &a = this->*(b->addrMember); - a.Name = dual.c_str(); - - // assign second string, using first size as starting point - a.Email = dual.c_str() + a.Name.size() + 1; - return begin; - } - } - } - // handle special cases - char swallow; - switch( field->type ) - { - case MFC_RECORDID: - MessageRecordId = btohl(field->u.uint32); - return begin; - case MFC_REPLY_UNKNOWN: - swallow = field->u.raw[0]; - return begin; - } - // if still not handled, add to the Unknowns list - UnknownField uf; - uf.type = field->type; - uf.data.assign((const char*)field->u.raw, btohs(field->size)); - Unknowns.push_back(uf); - - return begin; -} - -uint8_t Message::GetRecType() const -{ - throw std::logic_error("Message::GetRecType() called, and not supported by the USB protocol. Should never get called."); -} - -// empty API, not required by protocol -uint32_t Message::GetUniqueId() const -{ - throw std::logic_error("Message::GetUniqueId() called, and not supported by the USB protocol. Should never get called."); -} - -void Message::ParseHeader(const Data &data, size_t &offset) -{ - Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE); - - MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset); - - // Priority - MessagePriority = NormalPriority; - - uint16_t priority = btohs(mr->priority); // deal with endian swap once - if( priority & PRIORITY_MASK ) { - if( priority & PRIORITY_HIGH ) { - MessagePriority = HighPriority; - } - else if( priority & PRIORITY_LOW ) { - MessagePriority = LowPriority; - } - else - MessagePriority = UnknownPriority; - } - // Sensitivity - MessageSensitivity = NormalSensitivity; - if( priority & SENSITIVE_MASK ) { - if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) { - MessageSensitivity = Confidential; - } - else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) { - MessageSensitivity = Private; - } - else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) { - MessageSensitivity = Personal; - } - else - MessageSensitivity = UnknownSensitivity; - } - // X-rim-org-message-ref-id // NOTE: I'm cheating a bit here and using this as a reply-to - if( mr->inReplyTo ) // It's actually sent by BB with the actual UID in every message - MessageReplyTo = btohl(mr->inReplyTo); - - // Status Flags - uint32_t flags = btohl(mr->flags); - if( !( flags & MESSAGE_READ )) - MessageRead = true; // NOTE: A lot of these flags are 'backwards' but this seemed - // like the most logical way to interpret them for now - if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY ) - MessageReply = true; // NOTE: This is a reply, the original message's flags are not changed - // the inReplyTo field is updated with the original messages's UID - if( !( flags & MESSAGE_TRUNCATED )) - MessageTruncated = true; // NOTE: This bit is unset on truncation, around 4096 on my 7100g - // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested - // the exact size yet - if( !( flags & MESSAGE_SAVED )) - MessageSaved = true; // NOTE: Saved to 'saved' folder - if( !( flags & MESSAGE_SAVED_DELETED )) - MessageSavedDeleted = true; // NOTE: Saved to 'saved' folder and then deleted from inbox - - MessageDateSent = Message2Time(mr->dateSent, mr->timeSent); - MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived); - - offset += MESSAGE_RECORD_HEADER_SIZE; -} - -void Message::ParseFields(const Data &data, size_t &offset) -{ - const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); - offset += finish - (data.GetData() + offset); -} - -void Message::BuildHeader(Data &data, size_t &offset) const -{ - throw std::logic_error("Message::BuildHeader not yet implemented"); -} - -void Message::BuildFields(Data &data, size_t &offset) const -{ - throw std::logic_error("Message::BuildFields not yet implemented"); -} - -void Message::Clear() -{ - From.clear(); - To.clear(); - Cc.clear(); - Bcc.clear(); - Sender.clear(); - ReplyTo.clear(); - Subject.clear(); - Body.clear(); - Attachment.clear(); - - MessageRecordId = 0; - MessageReplyTo = 0; - MessageDateSent = 0; - MessageDateReceived = 0; - MessageTruncated = false; - MessageRead = false; - MessageReply = false; - MessageSaved = false; - MessageSavedDeleted = false; - - Unknowns.clear(); -} - -std::string Message::SimpleEmailAddress() const -{ - if( From.Email.size() ) { - // remove all spaces from the email - std::string ret; - for( size_t i = 0; i < From.Email.size(); i++ ) - if( From.Email[i] != ' ' ) - ret += From.Email[i]; - - return ret; - } - else { - return "unknown"; - } -} - -// dump message in mbox format -void Message::Dump(std::ostream &os) const -{ - static const char *MessageImportance[] = - { "Low", "Normal", "High", "Unknown Priority" }; - static const char *MessageSensitivityString[] = - { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" }; - - os << "From " << SimpleEmailAddress() << " " << ctime( &MessageDateReceived ); - os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n"; - if( MessageReplyTo ) - os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n"; - if( MessageSaved ) - os << "X-Message-Status: Saved\n"; - else if( MessageRead ) - os << "Message Status: Opened\n"; - if( MessagePriority != NormalPriority ) - os << "Importance: " << MessageImportance[MessagePriority] << "\n"; - if( MessageSensitivity != NormalSensitivity ) - os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n"; - os << "Date: " << ctime(&MessageDateSent); - os << "From: " << From << "\n"; - if( To.Email.size() ) - os << "To: " << To << "\n"; - if( Cc.Email.size() ) - os << "Cc: " << Cc << "\n"; - if( Bcc.Email.size() ) - os << "Bcc: " << Bcc << "\n"; - if( Sender.Email.size() ) - os << "Sender: " << Sender << "\n"; - if( ReplyTo.Email.size()) - os << "Reply To: " << ReplyTo << "\n"; - if( Subject.size() ) - os << "Subject: " << Subject << "\n"; - os << "\n"; - for( std::string::const_iterator i = Body.begin(); - i != Body.end() && *i; - i++) - { - if( *i == '\r' ) - os << '\n'; - else - os << *i; - } - os << "\n"; - if( Attachment.size() ) - os << "Attachments: " << Attachment << "\n"; - - os << Unknowns; - os << "\n\n"; -} - - -} // namespace Barry - diff -Nru barry-0.14/src/r_message.h barry-0.0.20110506/src/r_message.h --- barry-0.14/src/r_message.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_message.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,12 +23,7 @@ #define __BARRY_RECORD_MESSAGE_H__ #include "dll.h" -#include "record.h" -#include -#include -#include -#include -#include +#include "r_message_base.h" namespace Barry { @@ -40,78 +35,16 @@ /// \addtogroup RecordParserClasses /// @{ -class BXEXPORT Message +class BXEXPORT Message : public MessageBase { public: - uint8_t RecType; - uint32_t RecordId; - - EmailAddress From; - EmailAddress To; - EmailAddress Cc; - EmailAddress Bcc; - EmailAddress Sender; - EmailAddress ReplyTo; - std::string Subject; - std::string Body; - std::string Attachment; - uint32_t MessageRecordId; - uint32_t MessageReplyTo; - time_t MessageDateSent; - time_t MessageDateReceived; - - // Message Flags - bool MessageTruncated; - bool MessageRead; - bool MessageReply; - bool MessageSaved; - bool MessageSavedDeleted; - - enum MessagePriorityType { - LowPriority = 0, - NormalPriority, - HighPriority, - UnknownPriority - }; - MessagePriorityType MessagePriority; - - enum MessageSensitivityType { - NormalSensitivity = 0, - Personal, - Private, - Confidential, - UnknownSensitivity - }; - MessageSensitivityType MessageSensitivity; - - std::vector Unknowns; - -protected: - std::string SimpleEmailAddress() const; - -public: - const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); - -public: - Message(); - ~Message(); - - // Parser / Builder API (see parser.h / builder.h) - uint8_t GetRecType() const; - uint32_t GetUniqueId() const; // empty API, not required by protocol - void SetIds(uint8_t Type, uint32_t Id){ RecType = Type; RecordId = Id; } - void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); - void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; - - void Clear(); - - void Dump(std::ostream &os) const; - - // sorting - bool operator<(const Message &other) const { return Subject < other.Subject; } + void Clear() + { + MessageBase::Clear(); + + RecType = GetDefaultRecType(); + RecordId = 0; + } // database name static const char * GetDBName() { return "Messages"; } diff -Nru barry-0.14/src/router.cc barry-0.0.20110506/src/router.cc --- barry-0.14/src/router.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/router.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,21 +23,44 @@ #include "scoped_lock.h" #include "data.h" #include "protostructs.h" +#include "protocol.h" #include "usbwrap.h" #include "endian.h" #include "debug.h" #include +#include +#include + +using namespace std; namespace Barry { /////////////////////////////////////////////////////////////////////////////// +// SocketDataHandler default methods + +void SocketRoutingQueue::SocketDataHandler::Error(Barry::Error &error) +{ + // Just log the error + eout("SocketDataHandler: Error: " << error.what()); + (void) error; +} + +SocketRoutingQueue::SocketDataHandler::~SocketDataHandler() +{ + // Nothing to destroy +} + +/////////////////////////////////////////////////////////////////////////////// // SocketRoutingQueue constructors -SocketRoutingQueue::SocketRoutingQueue(int prealloc_buffer_count) +SocketRoutingQueue::SocketRoutingQueue(int prealloc_buffer_count, + int default_read_timeout) : m_dev(0) , m_writeEp(0) , m_readEp(0) , m_interest(false) + , m_seen_usb_error(false) + , m_timeout(default_read_timeout) , m_continue_reading(false) { pthread_mutex_init(&m_mutex, NULL); @@ -55,6 +78,16 @@ m_continue_reading = false; pthread_join(m_usb_read_thread, NULL); } + + // dump all unused packets to debug output + SocketQueueMap::const_iterator b = m_socketQueues.begin(); + for( ; b != m_socketQueues.end(); ++b ) { + DumpSocketQueue(b->first, b->second->m_queue); + } + if( m_default.size() ) { + ddout("(Default queue is socket 0)"); + DumpSocketQueue(0, m_default); + } } /////////////////////////////////////////////////////////////////////////////// @@ -73,6 +106,79 @@ } // +// QueuePacket +// +/// Helper function to add a buffer to a socket queue. +/// Returns false if no queue is available for that socket. +//// Also empties the DataHandle on success. +/// +bool SocketRoutingQueue::QueuePacket(SocketId socket, DataHandle &buf) +{ + if( m_interest ) { + // lock so we can access the m_socketQueues map safely + scoped_lock lock(m_mutex); + + // search for registration of socket + SocketQueueMap::iterator qi = m_socketQueues.find(socket); + if( qi != m_socketQueues.end() ) { + qi->second->m_queue.push(buf.release()); + return true; + } + } + + return false; +} + +bool SocketRoutingQueue::QueuePacket(DataQueue &queue, DataHandle &buf) +{ + // don't need to lock here, since queue handles its own locking + queue.push(buf.release()); + return true; +} + +// +// RouteOrQueuePacket +// +/// Same as QueuePacket, except sends the data to the callback if +/// a callback is available. +/// +/// This function duplicates code from QueuePacket(), in order to +/// optimize the mutex locking. +/// +bool SocketRoutingQueue::RouteOrQueuePacket(SocketId socket, DataHandle &buf) +{ + // search for registration of socket + if( m_interest ) { + // lock so we can access the m_socketQueues map safely + scoped_lock lock(m_mutex); + + SocketQueueMap::iterator qi = m_socketQueues.find(socket); + if( qi != m_socketQueues.end() ) { + SocketDataHandlerPtr &sdh = qi->second->m_handler; + + // is there a handler? + if( sdh ) { + // unlock & let the handler process it + lock.unlock(); + sdh->DataReceived(*buf.get()); + + // no exceptions thrown, clear the + // DataHandle, sending packet back to its + // free list + buf.reset(); + return true; + } + else { + qi->second->m_queue.push(buf.release()); + return true; + } + } + } + + return false; +} + +// // SimpleReadThread() // /// Convenience thread to handle USB read activity. @@ -82,15 +188,34 @@ SocketRoutingQueue *q = (SocketRoutingQueue *)userptr; // read from USB and write to stdout until finished - std::string msg; + q->m_seen_usb_error = false; while( q->m_continue_reading ) { - if( !q->DoRead(msg, 1000) ) { // timeout in milliseconds - eout("Error in SimpleReadThread: " << msg); + try { + q->DoRead(1000); // timeout in milliseconds + } + catch (std::runtime_error const &e) { + eout("SimpleReadThread received uncaught exception: " << typeid(e).name() << " what: " << e.what()); + } + catch (...) { + eout("SimpleReadThread recevied uncaught exception of unknown type"); } } return 0; } +void SocketRoutingQueue::DumpSocketQueue(SocketId socket, const DataQueue &dq) +{ + // dump a record of any unused packets in the queue, for debugging + if( dq.size() ) { + ddout("SocketRoutingQueue Leftovers: " + << dec << dq.size() + << " packet(s) for socket 0x" + << hex << (unsigned int) socket + << "\n" + << dq); + } +} + /////////////////////////////////////////////////////////////////////////////// // public API @@ -98,10 +223,12 @@ // These functions connect the router to an external Usb::Device // object. Normally this is handled automatically by the // Controller class, but are public here in case they are needed. -void SocketRoutingQueue::SetUsbDevice(Usb::Device *dev, int writeEp, int readEp) +void SocketRoutingQueue::SetUsbDevice(Usb::Device *dev, int writeEp, int readEp, + SocketDataHandlerPtr callback) { scoped_lock lock(m_mutex); m_dev = dev; + m_usb_error_dev_callback = callback; m_writeEp = writeEp; m_readEp = readEp; } @@ -110,6 +237,7 @@ { scoped_lock lock(m_mutex); m_dev = 0; + m_usb_error_dev_callback.reset(); lock.unlock(); // wait for the DoRead cycle to finish, so the external @@ -121,7 +249,7 @@ bool SocketRoutingQueue::UsbDeviceReady() { scoped_lock lock(m_mutex); - return m_dev != 0; + return m_dev != 0 && !m_seen_usb_error; } // @@ -170,8 +298,18 @@ /// DataHandle SocketRoutingQueue::DefaultRead(int timeout) { + if( m_seen_usb_error && timeout == -1 ) { + // If an error has been seen and not cleared then no + // more data will be read into the queue by + // DoRead(). Forcing the timeout to zero allows any + // data already in the queue to be read, but prevents + // waiting for data which will never arrive. + timeout = 0; + } + // m_default handles its own locking - Data *buf = m_default.wait_pop(timeout); + // Be careful with the queue timeout, since its -1 means "forever" + Data *buf = m_default.wait_pop(timeout == -1 ? m_timeout : timeout); return DataHandle(*this, buf); } @@ -194,8 +332,7 @@ /// Throws std::logic_error if already registered. /// void SocketRoutingQueue::RegisterInterest(SocketId socket, - SocketDataHandler handler, - void *context) + SocketDataHandlerPtr handler) { // modifying our own std::map, need a lock scoped_lock lock(m_mutex); @@ -204,7 +341,7 @@ if( qi != m_socketQueues.end() ) throw std::logic_error("RegisterInterest requesting a previously registered socket."); - m_socketQueues[socket] = QueueEntryPtr( new QueueEntry(handler, context) ); + m_socketQueues[socket] = QueueEntryPtr( new QueueEntry(handler) ); m_interest = true; } @@ -224,6 +361,9 @@ if( qi == m_socketQueues.end() ) return; // nothing registered, done + // dump a record of any unused packets in the queue, for debugging + DumpSocketQueue(qi->first, qi->second->m_queue); + // salvage all our data buffers m_free.append_from( qi->second->m_queue ); @@ -296,7 +436,8 @@ } // get data from DataQueue - Data *buf = dq->wait_pop(timeout); + // Be careful with the queue timeout, since its -1 means "forever" + Data *buf = dq->wait_pop(timeout == -1 ? m_timeout : timeout); // specifically delete our copy of shared pointer, in a locked // environment @@ -329,11 +470,9 @@ /// device to work with. /// /// Timeout is in milliseconds. -/// -/// Returns false in the case of USB errors and puts the error message -/// in msg. -/// -bool SocketRoutingQueue::DoRead(std::string &msg, int timeout) +// This timeout is for the USB subsystem, so no special handling +// for it is needed... just use usbwrap's default timeout. +void SocketRoutingQueue::DoRead(int timeout) { class ReadWaitSignal { @@ -358,12 +497,12 @@ { scoped_lock lock(m_mutex); - if( !m_dev ) { + if( !m_dev || m_seen_usb_error ) { lock.unlock(); // unlock early, since we're sleeping // sleep only a short time, since things could be // in the process of setup or teardown usleep(125000); - return true; + return; } dev = m_dev; @@ -384,63 +523,82 @@ Data &data = *buf.get(); if( !dev->BulkRead(readEp, data, timeout) ) - return true; // no data, done! + return; // no data, done! MAKE_PACKET(pack, data); // make sure the size is right - if( data.GetSize() < sizeof(pack->socket) ) - return true; // bad size, just skip + if( data.GetSize() < SB_PACKET_SOCKET_SIZE ) + return; // bad size, just skip // extract the socket from the packet uint16_t socket = btohs(pack->socket); - // we have data, now lock up again to place it - // in the right queue - scoped_lock lock(m_mutex); - - // search for registration of socket - if( m_interest ) { - SocketQueueMap::iterator qi = m_socketQueues.find(socket); - if( qi != m_socketQueues.end() ) { - SocketDataHandler sdh = qi->second->m_handler; - void *ctx = qi->second->m_context; - - // is there a handler? - if( sdh ) { - // unlock & let the handler process it - lock.unlock(); - (*sdh)(ctx, buf.get()); - return true; - } - else { - qi->second->m_queue.push(buf.release()); - return true; - } + // if this is a sequence packet, handle it specially + if( Protocol::IsSequencePacket(data) ) { + // sequence.socket is a single byte + socket = pack->u.sequence.socket; + + ////////////////////////////////////////////// + // ALWAYS queue sequence packets, so that + // the socket code can handle SyncSend() + if( !QueuePacket(socket, buf) ) { + // if no queue available for this + // socket, send it to the default + // queue + QueuePacket(m_default, buf); } - // fall through + // done with sequence packet + return; } - // safe to unlock now, we are done with the map - lock.unlock(); + // we have data, now route or queue it + if( RouteOrQueuePacket(socket, buf) ) + return; // done // if we get here, send to default queue - m_default.push(buf.release()); - return true; - + QueuePacket(m_default, buf); } catch( Usb::Timeout & ) { // this is expected... just ignore } catch( Usb::Error &ue ) { + // set the flag first, in case any of the handlers + // are able to recover from this error + m_seen_usb_error = true; + // this is unexpected, but we're in a thread here... - // return false and the caller decide how to handle it - msg = ue.what(); - return false; - } + // Need to iterate through all the registered handlers + // calling their error callback. + // Can't be locked when calling the callback, so need + // to make a list of them first. + scoped_lock lock(m_mutex); + std::vector handlers; + SocketQueueMap::iterator qi = m_socketQueues.begin(); + while( qi != m_socketQueues.end() ) { + SocketDataHandlerPtr &sdh = qi->second->m_handler; + // is there a handler? + if( sdh ) { + handlers.push_back(sdh); + } + ++qi; + } - return true; + SocketDataHandlerPtr usb_error_handler = m_usb_error_dev_callback; + + lock.unlock(); + std::vector::iterator hi = handlers.begin(); + while( hi != handlers.end() ) { + (*hi)->Error(ue); + ++hi; + } + + // and finally, call the specific error callback if available + if( usb_error_handler.get() ) { + usb_error_handler->Error(ue); + } + } } void SocketRoutingQueue::SpinoffSimpleReadThread() diff -Nru barry-0.14/src/router.h barry-0.0.20110506/src/router.h --- barry-0.14/src/router.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/router.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -29,8 +29,8 @@ #include #include #include "dataqueue.h" - -namespace Usb { class Device; } +#include "error.h" +#include "usbwrap.h" namespace Barry { @@ -41,16 +41,53 @@ friend class DataHandle; public: - typedef void (*SocketDataHandler)(void *ctx, Data*); //< See RegisterInterest() for information on this callback. + // Interface class for socket data callbacks + // See RegisterInterest() for more information. + class BXEXPORT SocketDataHandler + { + public: + // Called when data is received on the socket + // for which interest has been registered. + // + // The lifetime of the data parameter is only valid + // for the duration of this method call. + virtual void DataReceived(Data& data) = 0; + + // Called when an error has occured on the socket + // for which interest has been registered. + // + // The lifetime of the error parameter is only valid + // for the lifetime of this method call. + virtual void Error(Barry::Error &error); + + virtual ~SocketDataHandler(); + }; + + typedef std::tr1::shared_ptr SocketDataHandlerPtr; + + // Simple wrapper template class for SocketDataHandler which provides a basic data recieved callback + template class SimpleSocketDataHandler : public SocketDataHandler + { + void (*m_callback)(T&, Data*); + T& m_context; + public: + SimpleSocketDataHandler(T& context, void (*callback)(T& context, Data* data)) + : m_callback(callback) + , m_context(context) + {} + virtual void DataReceived(Data& data) + { + m_callback(m_context, &data); + } + }; + struct QueueEntry { - SocketDataHandler m_handler; - void *m_context; + SocketDataHandlerPtr m_handler; DataQueue m_queue; - QueueEntry(SocketDataHandler h, void *c) + QueueEntry(SocketDataHandlerPtr h) : m_handler(h) - , m_context(c) {} }; typedef std::tr1::shared_ptr QueueEntryPtr; @@ -70,11 +107,15 @@ pthread_mutex_t m_readwaitMutex; pthread_cond_t m_readwaitCond; + bool m_seen_usb_error; + SocketDataHandlerPtr m_usb_error_dev_callback; DataQueue m_free; DataQueue m_default; SocketQueueMap m_socketQueues; + int m_timeout; + // thread state pthread_t m_usb_read_thread; volatile bool m_continue_reading;// set to true when the thread is created, @@ -88,21 +129,47 @@ // from its destructor. void ReturnBuffer(Data *buf); + // Helper function to add a buffer to a socket queue + // Returns false if no queue is available for that socket + // Also empties the DataHandle on success. + bool QueuePacket(SocketId socket, DataHandle &buf); + bool QueuePacket(DataQueue &queue, DataHandle &buf); + bool RouteOrQueuePacket(SocketId socket, DataHandle &buf); + // Thread function for the simple read behaviour... thread is // created in the SpinoffSimpleReadThread() member below. static void *SimpleReadThread(void *userptr); + void DumpSocketQueue(SocketId socket, const DataQueue &dq); + public: - SocketRoutingQueue(int prealloc_buffer_count = 4); + SocketRoutingQueue(int prealloc_buffer_count = 4, + int default_read_timeout = USBWRAP_DEFAULT_TIMEOUT); ~SocketRoutingQueue(); + // + // data access + // + int GetWriteEp() const { return m_writeEp; } + int GetReadEp() const { return m_readEp; } + + // These functions connect the router to an external Usb::Device // object. Normally this is handled automatically by the // Controller class, but are public here in case they are needed. - void SetUsbDevice(Usb::Device *dev, int writeEp, int readEp); + // + // If DoRead encounters an error, it sets a flag and stops + // reading. To recover, you should handle the Error() call in + // the callback, fix the USB device, and then call + // ClearUsbError() to clear the flag. + // + void SetUsbDevice(Usb::Device *dev, int writeEp, int readEp, + SocketDataHandlerPtr callback = SocketDataHandlerPtr()); void ClearUsbDevice(); bool UsbDeviceReady(); Usb::Device* GetUsbDevice() { return m_dev; } + void ClearUsbError(); + // This class starts out with no buffers, and will grow one buffer // at a time if needed. Call this to allocate count buffers @@ -114,6 +181,9 @@ // Returns false (or null pointer) on timeout and no data. // With the return version of the function, there is no // copying performed. + // + // Timeout is in milliseconds. Default timeout set by constructor + // is used if set to -1. bool DefaultRead(Data &receive, int timeout = -1); DataHandle DefaultRead(int timeout = -1); @@ -123,11 +193,11 @@ // and must be read by DefaultRead() // If not null, handler is called when new data is read. It will // be called in the same thread instance that DoRead() is called from. - // Handler is passed the DataQueue Data pointer, and so no + // Handler is passed the DataQueue Data object, and so no // copying is done. Once the handler returns, the data is // considered processed and not added to the interested queue, // but instead returned to m_free. - void RegisterInterest(SocketId socket, SocketDataHandler handler = 0, void *context = 0); + void RegisterInterest(SocketId socket, SocketDataHandlerPtr handler); // Unregisters interest in data from the given socket, and discards // any existing data in its interest queue. Any new incoming data @@ -140,6 +210,9 @@ // Returns false (or null pointer) on timeout and no data. // With the return version of the function, there is no // copying performed. + // + // Timeout is in milliseconds. Default timeout set by constructor + // is used if set to -1. bool SocketRead(SocketId socket, Data &receive, int timeout = -1); DataHandle SocketRead(SocketId socket, int timeout = -1); @@ -153,11 +226,8 @@ // called... it just doesn't do anything if there is no usb // device to work with. // - // Timeout is in milliseconds. - // - // Returns false in the case of USB errors, and puts the error - // message in msg. - bool DoRead(std::string &msg, int timeout = -1); + // Timeout is in milliseconds. Default is default USB timeout. + void DoRead(int timeout = -1); // Utility function to make it easier for the user to create the // USB pure-read thread. If the user wants anything more complicated @@ -216,13 +286,20 @@ return m_data; } - Data* release() // no longer owns the pointer + Data* release() // no longer owns the pointer, and does not free it { Data *ret = m_data; m_data = 0; return ret; } + // frees current pointer, and takes ownership of new one + void reset(Data *next = 0) + { + clear(); + m_data = next; + } + Data* operator->() { return m_data; @@ -236,7 +313,7 @@ DataHandle& operator=(const DataHandle &other) { if( &m_queue != &other.m_queue ) - throw std::logic_error("Trying to copy DataHandles of different queus!"); + throw std::logic_error("Trying to copy DataHandles of different queues!"); // remove our current data clear(); diff -Nru barry-0.14/src/r_pin_message.cc barry-0.0.20110506/src/r_pin_message.cc --- barry-0.14/src/r_pin_message.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_pin_message.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,325 +0,0 @@ -/// -/// \file r_pin_message.cc -/// Blackberry database record parser class for pin message records. -/// - -/* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) - Copyright (C) 2007, Brian Edginton (edge@edginton.net) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "r_pin_message.h" -#include "record-internal.h" -#include "protocol.h" -#include "protostructs.h" -#include "data.h" -#include "time.h" -#include "error.h" -#include "endian.h" -#include -#include -#include -#include - -#define __DEBUG_MODE__ -#include "debug.h" - -using namespace std; -using namespace Barry::Protocol; - -namespace Barry { - - -/////////////////////////////////////////////////////////////////////////////// -// PINMessage class - - -// PIN message field codes -#define PNMFC_TO 0x01 // can occur multiple times -#define PNMFC_CC 0x02 // ditto -#define PNMFC_BCC 0x03 // ditto -#define PNMFC_FROM 0x05 -#define PNMFC_SUBJECT 0x0b -#define PNMFC_BODY 0x0c -#define PNMFC_REPLY_UNKNOWN 0x12 // this appears on replies, always 0x00 -#define PNMFC_RECORDID 0x4b // Internal Message ID, mimics header RecNumber -#define PNMFC_END 0xffff - -#define PRIORITY_MASK 0x003f -#define PRIORITY_HIGH 0x0008 -#define PRIORITY_LOW 0x0002 - -#define SENSITIVE_MASK 0xff80 -#define SENSITIVE_CONFIDENTIAL 0x0100 -#define SENSITIVE_PERSONAL 0x0080 -#define SENSITIVE_PRIVATE 0x0040 // actual pattern is 0x00C0 - -#define MESSAGE_READ 0x0800 -#define MESSAGE_REPLY 0x0001 -#define MESSAGE_SAVED 0x0002 -#define MESSAGE_FORWARD 0x0008 -#define MESSAGE_TRUNCATED 0x0020 -#define MESSAGE_SAVED_DELETED 0x0080 - -FieldLink PINMessageFieldLinks[] = { - { PNMFC_TO, "To", 0, 0, 0, &PINMessage::To, 0 }, - { PNMFC_CC, "Cc", 0, 0, 0, &PINMessage::Cc, 0 }, - { PNMFC_BCC, "Bcc", 0, 0, 0, &PINMessage::Bcc, 0 }, - { PNMFC_FROM, "From", 0, 0, 0, &PINMessage::From, 0 }, - { PNMFC_SUBJECT, "Subject", 0, 0, &PINMessage::Subject, 0, 0 }, - { PNMFC_BODY, "Body", 0, 0, &PINMessage::Body, 0, 0 }, - { PNMFC_END, "End of List", 0, 0, 0, 0, 0 } -}; - -PINMessage::PINMessage() -{ -} - -PINMessage::~PINMessage() -{ -} - -const unsigned char* PINMessage::ParseField(const unsigned char *begin, - const unsigned char *end) -{ - const CommonField *field = (const CommonField *) begin; - - // advance and check size - begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); - if( begin > end ) // if begin==end, we are ok - return begin; - - if( !btohs(field->size) ) // if field has no size, something's up - return begin; - - // cycle through the type table - for( FieldLink *b = PINMessageFieldLinks; - b->type != PNMFC_END; - b++ ) - { - if( b->type == field->type ) { - if( b->strMember ) { - // parse regular string - std::string &s = this->*(b->strMember); - s = ParseFieldString(field); - return begin; // done! - } - else if( b->addrMember ) { - // parse email address - // get dual name+addr string first - const char *fa = (const char*)field->u.addr.addr; - std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown)); - - // assign first string, using null terminator...letting std::string add it for us if it doesn't exist - EmailAddress &a = this->*(b->addrMember); - a.Name = dual.c_str(); - - // assign second string, using first size as starting point - a.Email = dual.c_str() + a.Name.size() + 1; - return begin; - } - } - } - - // handle special cases - switch( field->type ) - { - case PNMFC_RECORDID: - MessageRecordId = btohl(field->u.uint32); - return begin; - } - - // if still not handled, add to the Unknowns list - UnknownField uf; - uf.type = field->type; - uf.data.assign((const char*)field->u.raw, btohs(field->size)); - Unknowns.push_back(uf); - - return begin; -} - -void PINMessage::ParseHeader(const Data &data, size_t &offset) -{ - // FIXME - we are using a Message (email) record header size - // for a PIN Message record... this is not necessarily guaranteed - // to be the same... someday we could use some more info on - // the message record header and pin message record header - - // FIXED - the header structure for both the PIN messages and - // email messages are the same, as is the header structure for - // 'Saved Email Messages' although some of the fields may not directly apply. - // - // and someday is now here ;) - edge - - Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE); - - MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset); - - // Priority - MessagePriority = NormalPriority; - - uint16_t priority = btohs(mr->priority); // deal with endian swap once - if( priority & PRIORITY_MASK ) { - if( priority & PRIORITY_HIGH ) { - MessagePriority = HighPriority; - } - else if( priority & PRIORITY_LOW ) { - MessagePriority = LowPriority; - } - else - MessagePriority = UnknownPriority; - } - // Sensitivity - MessageSensitivity = NormalSensitivity; - if( priority & SENSITIVE_MASK ) { - if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) { - MessageSensitivity = Confidential; - } - else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) { - MessageSensitivity = Private; - } - else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) { - MessageSensitivity = Personal; - } - else - MessageSensitivity = UnknownSensitivity; - } - // X-rim-org-message-ref-id // NOTE: I'm cheating a bit here and using this as a reply-to - if( mr->inReplyTo ) // It's actually sent by BB with the actual UID in every message - MessageReplyTo = btohl(mr->inReplyTo); - - // Status Flags - uint32_t flags = btohl(mr->flags); - if( !( flags & MESSAGE_READ )) - MessageRead = true; // NOTE: A lot of these flags are 'backwards' but this seemed - // like the most logical way to interpret them for now - if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY ) - MessageReply = true; // NOTE: This is a reply, the original message's flags are not changed - // the inReplyTo field is updated with the original messages's UID - if( !( flags & MESSAGE_TRUNCATED )) - MessageTruncated = true; // NOTE: This bit is unset on truncation, around 4096 on my 7100g - // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested - // the exact size yet - if( !( flags & MESSAGE_SAVED )) - MessageSaved = true; // NOTE: Saved to 'saved' folder - if( !( flags & MESSAGE_SAVED_DELETED )) - MessageSavedDeleted = true; // NOTE: Saved to 'saved' folder and then deleted from inbox - - MessageDateSent = Message2Time(mr->dateSent, mr->timeSent); - MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived); - - offset += MESSAGE_RECORD_HEADER_SIZE; -} - -void PINMessage::ParseFields(const Data &data, size_t &offset) -{ - const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); - offset += finish - (data.GetData() + offset); -} - -void PINMessage::BuildHeader(Data &data, size_t &offset) const -{ - throw std::logic_error("PINMessage::BuildHeader not yet implemented"); -} - -void PINMessage::BuildFields(Data &data, size_t &offset) const -{ - throw std::logic_error("PINMessage::BuildFields not yet implemented"); -} - -void PINMessage::Clear() -{ - From.clear(); - To.clear(); - Cc.clear(); - Bcc.clear(); - - Subject.clear(); - Body.clear(); - - MessageRecordId = 0; - MessageReplyTo = 0; - MessageDateSent = 0; - MessageDateReceived = 0; - MessageTruncated = false; - MessageRead = false; - MessageReply = false; - MessageSaved = false; - MessageSavedDeleted = false; - - Unknowns.clear(); -} - -// dump message in mbox format -void PINMessage::Dump(std::ostream &os) const -{ - static const char *MessageImportance[] = - { "Low", "Normal", "High", "Unknown Priority" }; - static const char *MessageSensitivityString[] = - { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" }; - - os << "From " << (From.Email.size() ? From.Email.c_str() : "unknown") - << " " << ctime( &MessageDateSent ); - os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n"; - if( MessageReplyTo ) - os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n"; - if( MessageSaved ) - os << "Message Status: Saved\n"; - else if( MessageRead ) - os << "Message Status: Opened\n"; - if( MessagePriority != NormalPriority ) - os << "Importance: " << MessageImportance[MessagePriority] << "\n"; - if( MessageSensitivity != NormalSensitivity ) - os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n"; - os << "Date: " << ctime(&MessageDateSent); - - if( From.Name.size()) { - os << " From: " << From.Name << " <" << From.Email << ">\n"; - } - if( To.Name.size()) { - os << " To: " << To.Name << " <" << To.Email << ">\n"; - } - if( Cc.Name.size()) { - os << " Cc: " << Cc.Name << " <" << Cc.Email << ">\n"; - } - if( Bcc.Name.size()) { - os << " Bcc: " << Bcc.Name << " <" << Bcc.Email << ">\n"; - } - - if( Subject.size() ) - os << " Subject: " << Subject << "\n"; - else - os << " Subject: <>\n"; - os << "\n"; - - for( std::string::const_iterator i = Body.begin(); - i != Body.end() && *i; - i++) - { - if( *i == '\r' ) - os << '\n'; - else - os << *i; - } - os << "\n"; - - os << Unknowns; - os << "\n\n"; -} - - -} // namespace Barry - diff -Nru barry-0.14/src/r_pin_message.h barry-0.0.20110506/src/r_pin_message.h --- barry-0.14/src/r_pin_message.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_pin_message.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton (edge@edginton.net) This program is free software; you can redistribute it and/or modify @@ -24,12 +24,7 @@ #define __BARRY_RECORD_PIN_MESSAGE_H__ #include "dll.h" -#include "record.h" -#include -#include -#include -#include -#include +#include "r_message_base.h" namespace Barry { @@ -41,78 +36,16 @@ /// \addtogroup RecordParserClasses /// @{ -class BXEXPORT PINMessage +class BXEXPORT PINMessage : public MessageBase { public: - uint8_t RecType; - uint32_t RecordId; - - EmailAddress From; - EmailAddress To; - EmailAddress Cc; - EmailAddress Bcc; - std::string Subject; - std::string Body; - uint32_t MessageRecordId; // this happens to be the same as - // RecordId in my (CDF) testing, - // but interestingly, it is stored - // as a field *inside* the record, - // and not as part of the header... - // in effect, this record ID occurs - // twice in the protocol - uint32_t MessageReplyTo; - time_t MessageDateSent; - time_t MessageDateReceived; - - // Message Flags - bool MessageTruncated; - bool MessageRead; - bool MessageReply; - bool MessageSaved; - bool MessageSavedDeleted; - - enum MessagePriorityType { - LowPriority = 0, - NormalPriority, - HighPriority, - UnknownPriority - }; - MessagePriorityType MessagePriority; - - enum MessageSensitivityType { - NormalSensitivity = 0, - Personal, - Private, - Confidential, - UnknownSensitivity - }; - MessageSensitivityType MessageSensitivity; - - std::vector Unknowns; - -public: - const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); - -public: - PINMessage(); - ~PINMessage(); - - // Parser / Builder API (see parser.h / builder.h) - uint8_t GetRecType() const { return RecType; } - uint32_t GetUniqueId() const { return RecordId; } - void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } - void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); - void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; - - void Clear(); - - void Dump(std::ostream &os) const; - - // sorting - bool operator<(const PINMessage &other) const { return Subject < other.Subject; } + void Clear() + { + MessageBase::Clear(); + + RecType = GetDefaultRecType(); + RecordId = 0; + } // database name static const char * GetDBName() { return "PIN Messages"; } diff -Nru barry-0.14/src/r_recordstate.cc barry-0.0.20110506/src/r_recordstate.cc --- barry-0.14/src/r_recordstate.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_recordstate.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,153 @@ +/// +/// \file r_recordstate.cc +/// RecordStateTable database record parser class +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "record.h" +#include "record-internal.h" +#include "data.h" +#include +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// RecordStateTable class + +RecordStateTable::RecordStateTable() + : m_LastNewRecordId(1) +{ +} + +RecordStateTable::~RecordStateTable() +{ +} + +const unsigned char* RecordStateTable::ParseField(const unsigned char *begin, + const unsigned char *end) +{ + const RecordStateTableField *field = (const RecordStateTableField *) begin; + + // advance and check size + begin += sizeof(RecordStateTableField); + if( begin > end ) // if begin==end, we are ok + return begin; + + State state; + state.Index = btohs(field->index); + state.RecordId = btohl(field->uniqueId); + state.Dirty = (field->flags & BARRY_RSTF_DIRTY) != 0; + state.RecType = field->rectype; + state.Unknown2.assign((const char*)field->unknown2, sizeof(field->unknown2)); + StateMap[state.Index] = state; + + return begin; +} + +void RecordStateTable::Parse(const Data &data) +{ + size_t offset = 12; // skipping the unknown 2 bytes at start + + if( offset >= data.GetSize() ) + return; + + const unsigned char *begin = data.GetData() + offset; + const unsigned char *end = data.GetData() + data.GetSize(); + + while( begin < end ) + begin = ParseField(begin, end); +} + +void RecordStateTable::Clear() +{ + StateMap.clear(); + m_LastNewRecordId = 1; +} + +// Searches the StateMap table for RecordId, and returns the "index" +// in the map if found. Returns true if found, false if not. +// pFoundIndex can be null if only the existence of the index is desired +bool RecordStateTable::GetIndex(uint32_t RecordId, IndexType *pFoundIndex) const +{ + StateMapType::const_iterator i = StateMap.begin(); + for( ; i != StateMap.end(); ++i ) { + if( i->second.RecordId == RecordId ) { + if( pFoundIndex ) + *pFoundIndex = i->first; + return true; + } + } + return false; +} + +// Generate a new RecordId that is not in the state table. +// Starts at 1 and keeps incrementing until a free one is found. +uint32_t RecordStateTable::MakeNewRecordId() const +{ + // start with next Id + m_LastNewRecordId++; + + // make sure it doesn't already exist + StateMapType::const_iterator i = StateMap.begin(); + while( i != StateMap.end() ) { + if( m_LastNewRecordId == i->second.RecordId ) { + m_LastNewRecordId++; // try again + i = StateMap.begin(); // start over + } + else { + ++i; // next State + } + } + return m_LastNewRecordId; +} + +void RecordStateTable::Dump(std::ostream &os) const +{ + ios::fmtflags oldflags = os.setf(ios::right); + char fill = os.fill(' '); + bool bPrintAscii = Data::PrintAscii(); + Data::PrintAscii(false); + + os << " Index RecordId Dirty RecType" << endl; + os << "------- ---------- ----- -------" << endl; + + StateMapType::const_iterator b, e = StateMap.end(); + for( b = StateMap.begin(); b != e ; ++b ) { + const State &state = b->second; + + os.fill(' '); + os << setbase(10) << setw(7) << state.Index; + os << " 0x" << setbase(16) << setfill('0') << setw(8) << state.RecordId; + os << " " << setfill(' ') << setw(5) << (state.Dirty ? "yes" : "no"); + os << " 0x" << setbase(16) << setfill('0') << setw(2) << state.RecType; + os << " " << Data(state.Unknown2.data(), state.Unknown2.size()); + } + + // cleanup the stream + os.flags(oldflags); + os.fill(fill); + Data::PrintAscii(bPrintAscii); +} + + +} // namespace Barry + diff -Nru barry-0.14/src/r_recur_base.cc barry-0.0.20110506/src/r_recur_base.cc --- barry-0.14/src/r_recur_base.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_recur_base.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,318 @@ +/// +/// \file r_recur_base.cc +/// Base class for recurring calendar event data. +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_recur_base.h" +#include "protostructs.h" +#include "error.h" +#include "endian.h" +#include "time.h" +#include + +#define __DEBUG_MODE__ +#include "debug.h" + +using namespace std; +using namespace Barry::Protocol; + + +#define FIELDCODE_RECURRENCE_DATA 0x0c + +namespace Barry { + + +/////////////////////////////////////////////////////////////////////////////// +// RecurBase class, static members + +unsigned char RecurBase::WeekDayProto2Rec(uint8_t raw_field) +{ + // Note: this simple copy is only possible since + // the CAL_WD_* constants are the same as CRDF_WD_* constants. + // If this ever changes, this code will need to change. + return raw_field; +} + +uint8_t RecurBase::WeekDayRec2Proto(unsigned char weekdays) +{ + // Note: this simple copy is only possible since + // the CAL_WD_* constants are the same as CRDF_WD_* constants. + // If this ever changes, this code will need to change. + return weekdays; +} + + +/////////////////////////////////////////////////////////////////////////////// +// RecurBase class + +RecurBase::RecurBase() +{ + Clear(); +} + +RecurBase::~RecurBase() +{ +} + +bool RecurBase::ParseField(uint8_t type, + const unsigned char *data, + size_t size, + const IConverter *ic) +{ + // handle special cases + switch( type ) + { + case FIELDCODE_RECURRENCE_DATA: + if( size >= CALENDAR_RECURRENCE_DATA_FIELD_SIZE ) { + // good data + ParseRecurrenceData(data); + } + else { + // not enough data! + throw Error("RecurBase::ParseField: not enough data in recurrence data field"); + } + return true; + } + + // unknown field + return false; +} + +// this function assumes the size has already been checked +void RecurBase::ParseRecurrenceData(const void *data) +{ + const CalendarRecurrenceDataField *rec = + (const CalendarRecurrenceDataField*) data; + + Interval = btohs(rec->interval); + if( Interval < 1 ) + Interval = 1; // must always be >= 1 + + if( rec->endTime == 0xffffffff ) { + Perpetual = true; + } + else { + RecurringEndTime = min2time(rec->endTime); + Perpetual = false; + } + + switch( rec->type ) + { + case CRDF_TYPE_DAY: + RecurringType = Day; + // no extra data + break; + + case CRDF_TYPE_MONTH_BY_DATE: + RecurringType = MonthByDate; + DayOfMonth = rec->u.month_by_date.monthDay; + break; + + case CRDF_TYPE_MONTH_BY_DAY: + RecurringType = MonthByDay; + DayOfWeek = rec->u.month_by_day.weekDay; + WeekOfMonth = rec->u.month_by_day.week; + break; + + case CRDF_TYPE_YEAR_BY_DATE: + RecurringType = YearByDate; + DayOfMonth = rec->u.year_by_date.monthDay; + MonthOfYear = rec->u.year_by_date.month; + break; + + case CRDF_TYPE_YEAR_BY_DAY: + RecurringType = YearByDay; + DayOfWeek = rec->u.year_by_day.weekDay; + WeekOfMonth = rec->u.year_by_day.week; + MonthOfYear = rec->u.year_by_day.month; + break; + + case CRDF_TYPE_WEEK: + RecurringType = Week; + WeekDays = WeekDayProto2Rec(rec->u.week.days); + break; + + default: + eout("Unknown recurrence data type: 0x" + << setbase(16) << (unsigned int) rec->type); + throw Error("Unknown recurrence data type"); + } + + Recurring = true; +} + +// this function assumes there is CALENDAR_RECURRENCE_DATA_FIELD_SIZE bytes +// available in data +void RecurBase::BuildRecurrenceData(time_t StartTime, void *data) const +{ + if( !Recurring ) + throw Error("RecurBase::BuildRecurrenceData: Attempting to build recurrence data on non-recurring record."); + + CalendarRecurrenceDataField *rec = (CalendarRecurrenceDataField*) data; + + // set all to zero + memset(data, 0, CALENDAR_RECURRENCE_DATA_FIELD_SIZE); + + rec->interval = htobs(Interval); + rec->startTime = time2min(StartTime); + if( Perpetual ) + rec->endTime = 0xffffffff; + else + rec->endTime = time2min(RecurringEndTime); + + switch( RecurringType ) + { + case Day: + rec->type = CRDF_TYPE_DAY; + // no extra data + break; + + case MonthByDate: + rec->type = CRDF_TYPE_MONTH_BY_DATE; + rec->u.month_by_date.monthDay = DayOfMonth; + break; + + case MonthByDay: + rec->type = CRDF_TYPE_MONTH_BY_DAY; + rec->u.month_by_day.weekDay = DayOfWeek; + rec->u.month_by_day.week = WeekOfMonth; + break; + + case YearByDate: + rec->type = CRDF_TYPE_YEAR_BY_DATE; + rec->u.year_by_date.monthDay = DayOfMonth; + rec->u.year_by_date.month = MonthOfYear; + break; + + case YearByDay: + rec->type = CRDF_TYPE_YEAR_BY_DAY; + rec->u.year_by_day.weekDay = DayOfWeek; + rec->u.year_by_day.week = WeekOfMonth; + rec->u.year_by_day.month = MonthOfYear; + break; + + case Week: + rec->type = CRDF_TYPE_WEEK; + rec->u.week.days = WeekDayRec2Proto(WeekDays); + break; + + default: + eout("RecurBase::BuildRecurrenceData: " + "Unknown recurrence data type: 0x" + << setbase(16) << (unsigned int) rec->type); + throw Error("RecurBase::BuildRecurrenceData: Unknown recurrence data type"); + } +} + +uint8_t RecurBase::RecurringFieldType() const +{ + return FIELDCODE_RECURRENCE_DATA; +} + +void RecurBase::Clear() +{ + Recurring = false; + RecurringType = RecurBase::Week; + Interval = 1; + RecurringEndTime = 0; + Perpetual = false; + DayOfWeek = WeekOfMonth = DayOfMonth = MonthOfYear = 0; + WeekDays = 0; +} + +void RecurBase::Dump(std::ostream &os) const +{ + static const char *DayNames[] = { "Sun", "Mon", "Tue", "Wed", + "Thu", "Fri", "Sat" }; + static const char *MonthNames[] = { "Jan", "Feb", "Mar", "Apr", + "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + +// FIXME - need a "check all data" function that make sure that all +// recurrence data is within range. Then call that before using +// the data, such as in Build and in Dump. + + // print recurrence data if available + os << " Recurring: " << (Recurring ? "yes" : "no") << "\n"; + if( Recurring ) { + switch( RecurringType ) + { + case Day: + os << " Every day.\n"; + break; + + case MonthByDate: + os << " Every month on the " + << DayOfMonth + << (DayOfMonth == 1 ? "st" : "") + << (DayOfMonth == 2 ? "nd" : "") + << (DayOfMonth == 3 ? "rd" : "") + << (DayOfMonth > 3 ? "th" : "") + << "\n"; + break; + + case MonthByDay: + os << " Every month on the " + << DayNames[DayOfWeek] + << " of week " + << WeekOfMonth + << "\n"; + break; + + case YearByDate: + os << " Every year on " + << MonthNames[MonthOfYear-1] + << " " << DayOfMonth << "\n"; + break; + + case YearByDay: + os << " Every year in " << MonthNames[MonthOfYear-1] + << " on " + << DayNames[DayOfWeek] + << " of week " << WeekOfMonth << "\n"; + break; + + case Week: + os << " Every week on: "; + if( WeekDays & CAL_WD_SUN ) os << "Sun "; + if( WeekDays & CAL_WD_MON ) os << "Mon "; + if( WeekDays & CAL_WD_TUE ) os << "Tue "; + if( WeekDays & CAL_WD_WED ) os << "Wed "; + if( WeekDays & CAL_WD_THU ) os << "Thu "; + if( WeekDays & CAL_WD_FRI ) os << "Fri "; + if( WeekDays & CAL_WD_SAT ) os << "Sat "; + os << "\n"; + break; + + default: + os << " Unknown recurrence type\n"; + break; + } + + os << " Interval: " << Interval << "\n"; + + if( Perpetual ) + os << " Ends: never\n"; + else + os << " Ends: " << ctime(&RecurringEndTime); + } +} + + +} // namespace Barry + diff -Nru barry-0.14/src/r_recur_base.h barry-0.0.20110506/src/r_recur_base.h --- barry-0.14/src/r_recur_base.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_recur_base.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,128 @@ +/// +/// \file r_recur_base.h +/// Base class for recurring calendar event data. +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_RECUR_BASE_H__ +#define __BARRY_RECORD_RECUR_BASE_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include +#include +#include + +namespace Barry { + +// forward declarations +class IConverter; + +// +// NOTE: All classes here must be container-safe! Perhaps add sorting +// operators in the future. +// + +class BXEXPORT RecurBase +{ +public: + /// + /// Recurring data + /// + /// Note: interval can be used on all of these recurring types to + /// make it happen "every other time" or more, etc. + /// + enum RecurringCodeType { + Day = 1, //< eg. every day + //< set: nothing + MonthByDate = 3, //< eg. every month on the 12th + //< set: DayOfMonth + MonthByDay = 4, //< eg. every month on 3rd Wed + //< set: DayOfWeek and WeekOfMonth + YearByDate = 5, //< eg. every year on March 5 + //< set: DayOfMonth and MonthOfYear + YearByDay = 6, //< eg. every year on 3rd Wed of Jan + //< set: DayOfWeek, WeekOfMonth, and + //< MonthOfYear + Week = 12 //< eg. every week on Mon and Fri + //< set: WeekDays + }; + + + bool Recurring; + RecurringCodeType RecurringType; + unsigned short Interval; // must be >= 1 + time_t RecurringEndTime; // only pertains if Recurring is true + // sets the date and time when + // recurrence of this appointment + // should no longer occur + // If a perpetual appointment, this + // is 0xFFFFFFFF in the low level data + // Instead, set the following flag. + bool Perpetual; // if true, this will always recur + + unsigned short // recurring details, depending on type + DayOfWeek, // 0-6 + WeekOfMonth, // 1-5 + DayOfMonth, // 1-31 + MonthOfYear; // 1-12 + unsigned char WeekDays; // bitmask, bit 0 = sunday + +// FIXME - put these somewhere usable by both C and C++ + #define CAL_WD_SUN 0x01 + #define CAL_WD_MON 0x02 + #define CAL_WD_TUE 0x04 + #define CAL_WD_WED 0x08 + #define CAL_WD_THU 0x10 + #define CAL_WD_FRI 0x20 + #define CAL_WD_SAT 0x40 + +protected: + void ParseRecurrenceData(const void *data); + static unsigned char WeekDayProto2Rec(uint8_t raw_field); + static uint8_t WeekDayRec2Proto(unsigned char weekdays); + +protected: + RecurBase(); + virtual ~RecurBase(); + +public: + // return true if parse, false if not (for example, if type not + // recognized) + bool ParseField(uint8_t type, const unsigned char *data, size_t size, + const IConverter *ic = 0); + void BuildRecurrenceData(time_t StartTime, void *data) const; + + uint8_t RecurringFieldType() const; + + void Clear(); + + void Dump(std::ostream &os) const; +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const RecurBase &msg) { + msg.Dump(os); + return os; +} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_saved_message.cc barry-0.0.20110506/src/r_saved_message.cc --- barry-0.14/src/r_saved_message.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_saved_message.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,317 +0,0 @@ -/// -/// \file r_saved_message.cc -/// Blackberry database record parser class for saved email -/// message records. -/// - -/* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) - Copyright (C) 2005-2007, Brian Edginton (edge@edginton.net) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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 in the COPYING file at the - root directory of this project for more details. -*/ - -#include "r_saved_message.h" -#include "record-internal.h" -#include "protocol.h" -#include "protostructs.h" -#include "data.h" -#include "time.h" -#include "error.h" -#include "endian.h" -#include -#include -#include -#include - -#define __DEBUG_MODE__ -#include "debug.h" - -using namespace std; -using namespace Barry::Protocol; - -namespace Barry { - -/////////////////////////////////////////////////////////////////////////////// -// Message class - - -// Email / message field codes -#define SEMFC_TO 0x01 // can occur multiple times -#define SEMFC_CC 0x02 // ditto -#define SEMFC_BCC 0x03 // ditto -#define SEMFC_SENDER 0x04 -#define SEMFC_FROM 0x05 -#define SEMFC_REPLY_TO 0x06 -#define SEMFC_SUBJECT 0x0b -#define SEMFC_BODY 0x0c -#define SEMFC_ATTACHMENT 0x16 -#define SEMFC_RECORDID 0x4b -#define SEMFC_END 0xffff - -#define PRIORITY_MASK 0x003f -#define PRIORITY_HIGH 0x0008 -#define PRIORITY_LOW 0x0002 - -#define SENSITIVE_MASK 0xff80 -#define SENSITIVE_CONFIDENTIAL 0x0100 -#define SENSITIVE_PERSONAL 0x0080 -#define SENSITIVE_PRIVATE 0x0040 // actual pattern is 0x00C0 - -#define MESSAGE_READ 0x0800 -#define MESSAGE_REPLY 0x0001 -#define MESSAGE_SAVED 0x0002 -#define MESSAGE_FORWARD 0x0008 -#define MESSAGE_TRUNCATED 0x0020 -#define MESSAGE_SAVED_DELETED 0x0080 - -FieldLink SavedMessageFieldLinks[] = { - { SEMFC_TO, "To", 0, 0, 0, &SavedMessage::To, 0 }, - { SEMFC_CC, "Cc", 0, 0, 0, &SavedMessage::Cc, 0 }, - { SEMFC_BCC, "Bcc", 0, 0, 0, &SavedMessage::Bcc, 0 }, - { SEMFC_SENDER, "Sender", 0, 0, 0, &SavedMessage::Sender, 0 }, - { SEMFC_FROM, "From", 0, 0, 0, &SavedMessage::From, 0 }, - { SEMFC_REPLY_TO, "ReplyTo", 0, 0, 0, &SavedMessage::ReplyTo, 0 }, - { SEMFC_SUBJECT, "Subject", 0, 0, &SavedMessage::Subject, 0, 0 }, - { SEMFC_BODY, "Body", 0, 0, &SavedMessage::Body, 0, 0 }, - { SEMFC_ATTACHMENT, "Attachment", 0, 0, &SavedMessage::Attachment, 0, 0 }, - { SEMFC_END, "End of List", 0, 0, 0, 0, 0 } -}; - -SavedMessage::SavedMessage() -{ - Clear(); -} - -SavedMessage::~SavedMessage() -{ -} - -const unsigned char* SavedMessage::ParseField(const unsigned char *begin, - const unsigned char *end) -{ - const CommonField *field = (const CommonField *) begin; - - // advance and check size - begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); - if( begin > end ) // if begin==end, we are ok - return begin; - - if( !btohs(field->size) ) // if field has no size, something's up - return begin; - - // cycle through the type table - for( FieldLink *b = SavedMessageFieldLinks; - b->type != SEMFC_END; - b++ ) - { - if( b->type == field->type ) { - if( b->strMember ) { - // parse regular string - std::string &s = this->*(b->strMember); - s = ParseFieldString(field); - return begin; // done! - } - else if( b->addrMember ) { - // parse email address - // get dual name+addr string first - const char *fa = (const char*)field->u.addr.addr; - std::string dual(fa, btohs(field->size) - sizeof(field->u.addr.unknown)); - - // assign first string, using null terminator...letting std::string add it for us if it doesn't exist - EmailAddress &a = this->*(b->addrMember); - a.Name = dual.c_str(); - - // assign second string, using first size as starting point - a.Email = dual.c_str() + a.Name.size() + 1; - return begin; - } - } - } - - // handle special cases - switch( field->type ) - { - case SEMFC_RECORDID: - MessageRecordId = btohl(field->u.uint32); - return begin; - } - - // if still not handled, add to the Unknowns list - UnknownField uf; - uf.type = field->type; - uf.data.assign((const char*)field->u.raw, btohs(field->size)); - Unknowns.push_back(uf); - - return begin; -} - -void SavedMessage::ParseHeader(const Data &data, size_t &offset) -{ - Protocol::CheckSize(data, offset + MESSAGE_RECORD_HEADER_SIZE); - - MAKE_RECORD(const Barry::Protocol::MessageRecord, mr, data, offset); - - // Priority - MessagePriority = NormalPriority; - - uint16_t priority = btohs(mr->priority); // deal with endian swap once - if( priority & PRIORITY_MASK ) { - if( priority & PRIORITY_HIGH ) { - MessagePriority = HighPriority; - } - else if( priority & PRIORITY_LOW ) { - MessagePriority = LowPriority; - } - else - MessagePriority = UnknownPriority; - } - // Sensitivity - MessageSensitivity = NormalSensitivity; - if( priority & SENSITIVE_MASK ) { - if(( priority & SENSITIVE_CONFIDENTIAL ) == SENSITIVE_CONFIDENTIAL ) { - MessageSensitivity = Confidential; - } - else if(( priority & SENSITIVE_PRIVATE ) == SENSITIVE_PRIVATE ) { - MessageSensitivity = Private; - } - else if(( priority & SENSITIVE_PERSONAL ) == SENSITIVE_PERSONAL ) { - MessageSensitivity = Personal; - } - else - MessageSensitivity = UnknownSensitivity; - } - // X-rim-org-message-ref-id // NOTE: I'm cheating a bit here and using this as a reply-to - if( mr->inReplyTo ) // It's actually sent by BB with the actual UID in every message - MessageReplyTo = btohl(mr->inReplyTo); - - // Status Flags - uint32_t flags = btohl(mr->flags); - if( !( flags & MESSAGE_READ )) - MessageRead = true; // NOTE: A lot of these flags are 'backwards' but this seemed - // like the most logical way to interpret them for now - if(( flags & MESSAGE_REPLY ) == MESSAGE_REPLY ) - MessageReply = true; // NOTE: This is a reply, the original message's flags are not changed - // the inReplyTo field is updated with the original messages's UID - if( !( flags & MESSAGE_TRUNCATED )) - MessageTruncated = true; // NOTE: This bit is unset on truncation, around 4096 on my 7100g - // NOTE: bit 0x400 is set on REALLY huge messages, haven't tested - // the exact size yet - if( !( flags & MESSAGE_SAVED )) - MessageSaved = true; // NOTE: Saved to 'saved' folder - if( !( flags & MESSAGE_SAVED_DELETED )) - MessageSavedDeleted = true; // NOTE: Saved to 'saved' folder and then deleted from inbox - - MessageDateSent = Message2Time(mr->dateSent, mr->timeSent); - MessageDateReceived = Message2Time(mr->dateReceived, mr->timeReceived); - - offset += MESSAGE_RECORD_HEADER_SIZE; -} - -void SavedMessage::ParseFields(const Data &data, size_t &offset) -{ - const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); - offset += finish - (data.GetData() + offset); -} - -void SavedMessage::BuildHeader(Data &data, size_t &offset) const -{ - throw std::logic_error("SavedMessage::BuildHeader not yet implemented"); -} - -void SavedMessage::BuildFields(Data &data, size_t &offset) const -{ - throw std::logic_error("SavedMessage::BuildFields not yet implemented"); -} - -void SavedMessage::Clear() -{ - From.clear(); - To.clear(); - Cc.clear(); - Bcc.clear(); - Sender.clear(); - ReplyTo.clear(); - Subject.clear(); - Body.clear(); - Attachment.clear(); - - MessageRecordId = 0; - MessageReplyTo = 0; - MessageDateSent = 0; - MessageDateReceived = 0; - MessageTruncated = false; - MessageRead = false; - MessageReply = false; - MessageSaved = false; - MessageSavedDeleted = false; - Unknowns.clear(); -} - -// dump message in mbox format -void SavedMessage::Dump(std::ostream &os) const -{ - static const char *MessageImportance[] = - { "Low", "Normal", "High", "Unknown Priority" }; - static const char *MessageSensitivityString[] = - { "Normal", "Personal", "Private", "Confidential", "Unknown Sensivity" }; - - os << "From " << (From.Email.size() ? From.Email.c_str() : "unknown") - << " " << ctime( &MessageDateSent ); - os << "X-Record-ID: (" << setw(8) << std::hex << MessageRecordId << ")\n"; - if( MessageReplyTo ) - os << "X-rim-org-msg-ref-id: " << std::dec << MessageReplyTo << "\n"; - if( MessageSaved ) - os << "Message Status: Saved\n"; - else if( MessageRead ) - os << "Message Status: Opened\n"; - if( MessagePriority != NormalPriority ) - os << "Importance: " << MessageImportance[MessagePriority] << "\n"; - if( MessageSensitivity != NormalSensitivity ) - os << "Sensitivity: " << MessageSensitivityString[MessageSensitivity] << "\n"; - os << "Date: " << ctime(&MessageDateSent); - os << "From: " << From << "\n"; - if( To.Email.size() ) - os << "To: " << To << "\n"; - if( Cc.Email.size() ) - os << "Cc: " << Cc << "\n"; - if( Bcc.Email.size() ) - os << "Bcc: " << Bcc << "\n"; - if( Sender.Email.size() ) - os << "Sender: " << Sender << "\n"; - if( ReplyTo.Email.size()) - os << "Reply To: " << ReplyTo << "\n"; - if( Subject.size() ) - os << "Subject: " << Subject << "\n"; - os << "\n"; - for( std::string::const_iterator i = Body.begin(); - i != Body.end() && *i; - i++) - { - if( *i == '\r' ) - os << '\n'; - else - os << *i; - } - os << "\n"; - if( Attachment.size() ) - os << "Attachments: " << Attachment << "\n"; - - os << Unknowns; - os << "\n\n"; -} - - -} // namespace Barry - diff -Nru barry-0.14/src/r_saved_message.h barry-0.0.20110506/src/r_saved_message.h --- barry-0.14/src/r_saved_message.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_saved_message.h 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton (edge@edginton.net) This program is free software; you can redistribute it and/or modify @@ -25,12 +25,7 @@ #define __BARRY_RECORD_SAVED_MESSAGE_H__ #include "dll.h" -#include "record.h" -#include -#include -#include -#include -#include +#include "r_message_base.h" namespace Barry { @@ -42,73 +37,16 @@ /// \addtogroup RecordParserClasses /// @{ -class BXEXPORT SavedMessage +class BXEXPORT SavedMessage : public MessageBase { public: - uint8_t RecType; - uint32_t RecordId; - - EmailAddress From; - EmailAddress To; - EmailAddress Cc; - EmailAddress Bcc; - EmailAddress Sender; - EmailAddress ReplyTo; - std::string Subject; - std::string Body; - std::string Attachment; - uint32_t MessageRecordId; - uint32_t MessageReplyTo; - time_t MessageDateSent; - time_t MessageDateReceived; - - // Message Flags - bool MessageTruncated; - bool MessageRead; - bool MessageReply; - bool MessageSaved; - bool MessageSavedDeleted; - - enum MessagePriorityType { - LowPriority = 0, - NormalPriority, - HighPriority, - UnknownPriority - }; - MessagePriorityType MessagePriority; - - enum MessageSensitivityType { - NormalSensitivity = 0, - Personal, - Private, - Confidential, - UnknownSensitivity - }; - MessageSensitivityType MessageSensitivity; - - std::vector Unknowns; - -public: - const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); - -public: - SavedMessage(); - ~SavedMessage(); - - // Parser / Builder API (see parser.h / builder.h) - uint8_t GetRecType() const { return RecType; } - uint32_t GetUniqueId() const { return RecordId; } - void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } - void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); - void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; - void Clear(); - void Dump(std::ostream &os) const; - - // sorting - bool operator<(const SavedMessage &other) const { return Subject < other.Subject; } + void Clear() + { + MessageBase::Clear(); + + RecType = GetDefaultRecType(); + RecordId = 0; + } // database name static const char * GetDBName() { return "Saved Email Messages"; } diff -Nru barry-0.14/src/r_servicebook.cc barry-0.0.20110506/src/r_servicebook.cc --- barry-0.14/src/r_servicebook.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_servicebook.cc 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,6 +28,7 @@ #include "time.h" #include "error.h" #include "endian.h" +#include "iconv.h" #include #include #include @@ -41,14 +42,13 @@ namespace Barry { - /////////////////////////////////////////////////////////////////////////////// // ServiceBookConfig class // service book packed field codes #define SBFCC_END 0xffff -FieldLink ServiceBookConfigFieldLinks[] = { +static FieldLink ServiceBookConfigFieldLinks[] = { // { SBFC_DSID, "DSID", 0, 0, &ServiceBook::DSID, 0, 0 }, { SBFCC_END, "End of List",0, 0, 0, 0, 0 } }; @@ -64,13 +64,15 @@ } const unsigned char* ServiceBookConfig::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const void *raw; uint16_t size, type; switch( Format ) { + case 0x01: case 0x02: { const PackedField_02 *field = (const PackedField_02 *) begin; @@ -92,7 +94,9 @@ break; default: - eout("Unknown packed field format" << Format); + eout("------> Unknown packed field format: 0x" << std::hex << + (unsigned int) Format); + throw BadPackedFormat(Format); return begin + 1; } @@ -144,10 +148,10 @@ } } -void ServiceBookConfig::ParseFields(const Data &data, size_t &offset) +void ServiceBookConfig::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } @@ -167,13 +171,14 @@ // /// Build fields part of record /// -void ServiceBookConfig::BuildFields(Data &data, size_t &offset) const +void ServiceBookConfig::BuildFields(Data &data, size_t &offset, const IConverter *ic) const { throw std::logic_error("ServiceBookConfig::Build not yet implemented"); } void ServiceBookConfig::Clear() { + Format = 0; Unknowns.clear(); } @@ -222,17 +227,97 @@ #define SBFC_USER_ID 0xa3 #define SBFC_END 0xffff -FieldLink ServiceBookFieldLinks[] = { - { SBFC_HIDDEN_NAME, "Hidden Name",0, 0, &ServiceBook::HiddenName, 0, 0 }, - { SBFC_DSID, "DSID", 0, 0, &ServiceBook::DSID, 0, 0 }, - { SBFC_END, "End of List",0, 0, 0, 0, 0 } +// private data class, containing internal structures +class ServiceBookData +{ +public: + FieldLink *m_typeSet; + ServiceBookData(FieldLink *typeSet) : m_typeSet(typeSet) {} +}; + +// The Old/New tables contain the same fields, but use different +// type codes. Keeping them separate yet linked makes it possible +// to convert between old and new type codes, while hopefully keeping +// things generic. +static FieldLink ServiceBookOldFieldLinks[] = { + { SBFC_OLD_NAME, "Old Name", 0, 0, &ServiceBook::Name, 0, 0, 0, 0, true }, + { SBFC_OLD_DESC, "Old Desc", 0, 0, &ServiceBook::Description, 0, 0, 0, 0, true }, + { SBFC_OLD_UNIQUE_ID, "Old UniqueId", 0, 0, &ServiceBook::UniqueId, 0, 0, 0, 0, false }, + { SBFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } +}; + +static FieldLink ServiceBookNewFieldLinks[] = { + { SBFC_NAME, "Name", 0, 0, &ServiceBook::Name, 0, 0, 0, 0, true }, + { SBFC_DESCRIPTION, "Description", 0, 0, &ServiceBook::Description, 0, 0, 0, 0, true }, + { SBFC_UNIQUE_ID, "UniqueId", 0, 0, &ServiceBook::UniqueId, 0, 0, 0, 0, false }, + { SBFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false } +}; + +// This table holds all +static FieldLink ServiceBookFieldLinks[] = { + { SBFC_HIDDEN_NAME, "Hidden Name",0, 0, &ServiceBook::HiddenName, 0, 0, 0, 0, true }, + { SBFC_DSID, "DSID", 0, 0, &ServiceBook::DSID, 0, 0, 0, 0, false }, + { SBFC_CONTENT_ID, "ContentId", 0, 0, &ServiceBook::ContentId, 0, 0, 0, 0, false }, + { SBFC_BES_DOMAIN, "BES Domain", 0, 0, &ServiceBook::BesDomain, 0, 0, 0, 0, false }, + { SBFC_END, "End of List",0, 0, 0, 0, 0, 0, 0, false } +}; + +// Array of conflicting tables only +static FieldLink *ServiceBookLinkTable[] = { + ServiceBookOldFieldLinks, + ServiceBookNewFieldLinks, + 0 }; +#define FIELDLINK_END 0xffff + +template +FieldLink* ParseFieldByTable(RecordT *rec, + const CommonField *field, + const IConverter *ic, + FieldLink *links) +{ + // cycle through the type table + for( FieldLink *b = links; b->type != FIELDLINK_END; b++ ) { + if( b->type == field->type ) { + if( b->strMember ) { + std::string &s = rec->*(b->strMember); + if( s.size() ) { + dout(RecordT::GetDBName() << ": field '" << b->name << "' already has data (" << s << "). Overwriting."); + } + s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); + return links; + } + else if( b->timeMember && btohs(field->size) == 4 ) { + time_t &t = rec->*(b->timeMember); + t = min2time(field->u.min1900); + return links; + } + } + } + return 0; +} + +template +FieldLink* ParseFieldByTable(RecordT *rec, + const CommonField *field, + const IConverter *ic, + FieldLink **b) +{ + for( ; *b; b++ ) { + FieldLink *link = + ParseFieldByTable(rec, field, ic, *b); + if( link ) + return link; + } + return 0; +} + ServiceBook::ServiceBook() - : NameType(SBFC_OLD_NAME), - DescType(SBFC_OLD_DESC), - UniqueIdType(SBFC_OLD_UNIQUE_ID), - RecordId(0) + : m_data( new ServiceBookData(ServiceBookOldFieldLinks) ) + , RecordId(0) { Clear(); } @@ -242,7 +327,8 @@ } const unsigned char* ServiceBook::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -254,63 +340,37 @@ if( !btohs(field->size) ) // if field has no size, something's up return begin; - // cycle through the type table - for( FieldLink *b = ServiceBookFieldLinks; - b->type != SBFC_END; - b++ ) - { - if( b->type == field->type ) { - if( b->strMember ) { - std::string &s = this->*(b->strMember); - s = ParseFieldString(field); - return begin; // done! - } - else if( b->timeMember && btohs(field->size) == 4 ) { - time_t &t = this->*(b->timeMember); - t = min2time(field->u.min1900); - return begin; - } + // cycle through the type tables + FieldLink *typeSet = + ParseFieldByTable(this, field, ic, ServiceBookLinkTable); + if( typeSet ) { + if( m_data->m_typeSet && m_data->m_typeSet != typeSet ) { + dout("ServiceBook record has a mix of old and new field types."); } + m_data->m_typeSet = typeSet; + return begin; + } + else { + if( ParseFieldByTable(this, field, ic, ServiceBookFieldLinks) ) + return begin; // done! } // handle special cases switch( field->type ) { - case SBFC_OLD_NAME: // strings with old/new type codes - case SBFC_NAME: - Name = ParseFieldString(field); - NameType = field->type; - return begin; - - case SBFC_OLD_DESC: - case SBFC_DESCRIPTION: - Description = ParseFieldString(field); - DescType = field->type; - return begin; - - case SBFC_OLD_UNIQUE_ID: - case SBFC_UNIQUE_ID: - UniqueId = ParseFieldString(field); - UniqueIdType = field->type; - return begin; - - case SBFC_CONTENT_ID: - ContentId = ParseFieldString(field); - return begin; - - case SBFC_BES_DOMAIN: - BesDomain = ParseFieldString(field); - return begin; - case SBFC_CONFIG: - { + try { Data config((const void *)field->u.raw, btohs(field->size)); size_t offset = 0; Config.ParseHeader(config, offset); Config.ParseFields(config, offset); + return begin; // success + } + catch( BadPackedFormat & ) { + // break here so unprocessed raw packet is still + // visible in dump + break; } - break; // break here so raw packet is still visible in dump -// return begin; } // if still not handled, add to the Unknowns list @@ -328,10 +388,10 @@ // no header in this record (?) } -void ServiceBook::ParseFields(const Data &data, size_t &offset) +void ServiceBook::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } @@ -345,51 +405,67 @@ // /// Build fields part of record /// -void ServiceBook::BuildFields(Data &data, size_t &offset) const +void ServiceBook::BuildFields(Data &data, size_t &offset, const IConverter *ic) const { throw std::logic_error("ServiceBook::BuildFields not yet implemented"); } void ServiceBook::Clear() { + m_data->m_typeSet = ServiceBookOldFieldLinks; Unknowns.clear(); Config.Clear(); } +std::string ServiceBook::GetDescription() const +{ + return Name; +} + +inline void FormatStr(std::ostream &os, const char *name, const std::string &str) +{ + if( str.size() ) { + os << " " << setw(20) << name; + os << ": " << str << "\n"; + } +} + void ServiceBook::Dump(std::ostream &os) const { + ios::fmtflags oldflags = os.setf(ios::left); + char fill = os.fill(' '); + os << "ServiceBook entry: 0x" << setbase(16) << RecordId << " (" << (unsigned int)RecType << ")\n"; - // cycle through the type table - for( const FieldLink *b = ServiceBookFieldLinks; - b->type != SBFC_END; - b++ ) - { - if( b->strMember ) { - const std::string &s = this->*(b->strMember); - if( s.size() ) - os << " " << b->name << ": " << s << "\n"; - } - else if( b->timeMember ) { - time_t t = this->*(b->timeMember); - if( t > 0 ) - os << " " << b->name << ": " << ctime(&t); - } - } - - // special cases - if( UniqueId.size() ) - os << " Unique ID: " << UniqueId << "\n"; - if( ContentId.size() ) - os << " Content ID: " << ContentId << "\n"; - if( BesDomain.size() ) - os << " (BES) Domain: " << BesDomain << "\n"; + FormatStr(os, "Name", Name); + FormatStr(os, "Hidden Name", HiddenName); + FormatStr(os, "Description", Description); + FormatStr(os, "DSID", DSID); + FormatStr(os, "Unique ID", UniqueId); + FormatStr(os, "Content ID", ContentId); + FormatStr(os, "(BES) Domain", BesDomain); os << Config; // print any unknowns os << Unknowns; + + // cleanup the stream + os.flags(oldflags); + os.fill(fill); +} + +bool ServiceBook::operator<(const ServiceBook &other) const +{ + int cmp = BesDomain.compare(other.BesDomain); + if( cmp == 0 ) + cmp = DSID.compare(other.DSID); + if( cmp == 0 ) + cmp = Name.compare(other.Name); + if( cmp == 0 ) + cmp = UniqueId.compare(other.UniqueId); + return cmp < 0; } } // namespace Barry diff -Nru barry-0.14/src/r_servicebook.h barry-0.0.20110506/src/r_servicebook.h --- barry-0.14/src/r_servicebook.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_servicebook.h 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -33,6 +33,9 @@ namespace Barry { +// forward declarations +class IConverter; + // // NOTE: All classes here must be container-safe! Perhaps add sorting // operators in the future. @@ -47,7 +50,7 @@ class BXEXPORT ServiceBookConfig { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; uint8_t Format; @@ -55,7 +58,7 @@ public: const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); public: ServiceBookConfig(); @@ -63,9 +66,9 @@ // Parser / Builder API (see parser.h / builder.h) void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; void Clear(); @@ -78,9 +81,11 @@ } +class ServiceBookData; + class BXEXPORT ServiceBook { - int NameType, DescType, UniqueIdType; + ServiceBookData *m_data; public: typedef std::vector UnknownsType; @@ -100,7 +105,7 @@ public: const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); public: ServiceBook(); @@ -111,16 +116,17 @@ uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; - void BuildFields(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; + std::string GetDescription() const; // sorting - bool operator<(const ServiceBook &other) const { return RecordId < RecordId; } + bool operator<(const ServiceBook &other) const; // database name static const char * GetDBName() { return "Service Book"; } diff -Nru barry-0.14/src/r_sms.cc barry-0.0.20110506/src/r_sms.cc --- barry-0.14/src/r_sms.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_sms.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,407 @@ +/// +/// \file r_sms.cc +/// Record parsing class for the SMS database. +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2009, Ryan Li(ryan@ryanium.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "r_sms.h" +#include "record-internal.h" +#include "protostructs.h" +#include "data.h" +#include "time.h" +#include "debug.h" +#include "iconv.h" +#include "strnlen.h" +#include +#include +#include + +using namespace std; +using namespace Barry::Protocol; + +namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// Sms Class + +// SMS Field Codes +#define SMSFC_METADATA 0x01 +#define SMSFC_ADDRESS 0x02 +#define SMSFC_BODY 0x04 + +// SMS Field Sizes and Header Sizes +#define SMS_ADDRESS_HEADER_SIZE 0x04 + +#define MILLISECONDS_IN_A_SECOND 1000 + +time_t Sms::GetTime() const +{ + return (time_t)(Timestamp / MILLISECONDS_IN_A_SECOND); +} + +time_t Sms::GetServiceCenterTime() const +{ + return (time_t)(ServiceCenterTimestamp / MILLISECONDS_IN_A_SECOND); +} + +void Sms::SetTime(const time_t timestamp, const unsigned milliseconds) +{ + Timestamp = (uint64_t)timestamp * MILLISECONDS_IN_A_SECOND + milliseconds; +} + +void Sms::SetServiceCenterTime(const time_t timestamp, const unsigned milliseconds) +{ + ServiceCenterTimestamp = (uint64_t)timestamp * MILLISECONDS_IN_A_SECOND + milliseconds; +} + +Sms::Sms() +{ + Clear(); +} + +Sms::~Sms() +{ +} + +const unsigned char* Sms::ParseField(const unsigned char *begin, + const unsigned char *end, + const IConverter *ic) +{ + const CommonField *field = (const CommonField *)begin; + + // advance and check size + begin += COMMON_FIELD_HEADER_SIZE + btohs(field->size); + if (begin > end) // if begin==end, we are ok + return begin; + + if (!btohs(field->size)) // if field has no size, something's up + return begin; + + switch (field->type) + { + case SMSFC_METADATA: + { + if (btohs(field->size) < SMS_METADATA_SIZE) + break; // size not match + + const SMSMetaData &metadata = field->u.sms_metadata; + NewConversation = metadata.flags & SMS_FLG_NEW_CONVERSATION; + Saved = metadata.flags & SMS_FLG_SAVED; + Deleted = metadata.flags & SMS_FLG_DELETED; + Opened = metadata.flags & SMS_FLG_OPENED; + + IsNew = metadata.new_flag; + + uint32_t status = btohl(metadata.status); + + switch (status) + { + case SMS_STA_RECEIVED: + MessageStatus = Received; + break; + case SMS_STA_DRAFT: + MessageStatus = Draft; + break; + default: + MessageStatus = Sent; // consider all others as sent + } + + ErrorId = btohl(metadata.error_id); + + Timestamp = btohll(metadata.timestamp); + ServiceCenterTimestamp = btohll(metadata.service_center_timestamp); + + switch (metadata.dcs) + { + case SMS_DCS_7BIT: + DataCodingScheme = SevenBit; + break; + case SMS_DCS_8BIT: + DataCodingScheme = EightBit; + break; + case SMS_DCS_UCS2: + DataCodingScheme = UCS2; + break; + default: + DataCodingScheme = SevenBit; // consider all unknowns as 7bit + } + + return begin; + } + + case SMSFC_ADDRESS: + { + uint16_t length = btohs(field->size); + if (length < SMS_ADDRESS_HEADER_SIZE + 1) // trailing '\0' + break; // too short + + length -= SMS_ADDRESS_HEADER_SIZE; + const char *address = (const char *)field->u.raw + SMS_ADDRESS_HEADER_SIZE; + Addresses.push_back(std::string(address, strnlen(address, length))); + return begin; + } + + case SMSFC_BODY: + { + // + // Some SMS bodies contain a null terminator + // in the middle, and it is unknown at the moment + // why this is. For regular 8bit char strings, + // we just strip out the nulls. For UCS2 + // 16bit char strings, we strip out the + // 16bit nulls. + // + // Any further information on why these null + // terminators appear is welcome. + // + const char *str = (const char *)field->u.raw; + uint16_t maxlen = btohs(field->size); + if (DataCodingScheme != UCS2) { + for (uint16_t i = 0; i < maxlen; ++i) { + if (str[i]) // if not null, push it + Body += str[i]; + } + } + else { + for (uint16_t i = 0; maxlen && i < (maxlen-1); i += 2) { + if (str[i] || str[i + 1]) // if not null, push it + Body += std::string(str + i, 2); + } + } + if (ic) { + if (DataCodingScheme == SevenBit) { + // SevenBit -> UTF-8 -> ic's tocode + IConvHandle utf8("UTF-8", *ic); + Body = ic->Convert(utf8, ConvertGsmToUtf8(Body)); // convert the Body string from GSM 03.38 defined to UTF-8 + } + else if (DataCodingScheme == EightBit) + Body = ic->FromBB(Body); + else { + IConvHandle ucs2("UCS-2BE", *ic); + Body = ic->Convert(ucs2, Body); + } + } + return begin; + } + } + + // if still not handled, add to the Unknowns list + UnknownField uf; + uf.type = field->type; + uf.data.assign((const char*)field->u.raw, btohs(field->size)); + Unknowns.push_back(uf); + + // return new pointer for next field + return begin; +} + +void Sms::ParseHeader(const Data &data, size_t &offset) +{ + // no header in SMS records +} + +void Sms::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} + +void Sms::BuildHeader(Data &data, size_t &offset) const +{ + // not yet implemented +} + +void Sms::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + // not yet implemented +} + +void Sms::Clear() +{ + RecType = GetDefaultRecType(); + RecordId = 0; + + MessageStatus = Unknown; + DeliveryStatus = NoReport; + + IsNew = NewConversation = Saved = Deleted = Opened = false; + + Timestamp = ServiceCenterTimestamp = 0; + + DataCodingScheme = SevenBit; + + ErrorId = 0; + + Addresses.clear(); + Body.clear(); + + Unknowns.clear(); +} + +std::string Sms::GetDescription() const +{ + if( Addresses.size() ) + return Addresses[0]; + else + return "Unknown destination"; +} + +void Sms::Dump(std::ostream &os) const +{ + + os << "SMS record: 0x" << setbase(16) << RecordId + << " (" << (unsigned int)RecType << ")\n"; + time_t t = GetTime(); + os << "\tTimestamp: " << ctime(&t); + + if (MessageStatus == Received) { + t = GetServiceCenterTime(); + os << "\tService Center Timestamp: " << ctime(&t); + } + + if (ErrorId) + os << "\tSend Error: 0x" << setbase(16) << ErrorId << "\n"; + + switch (MessageStatus) + { + case Received: + os << "\tReceived From:\n"; + break; + case Sent: + os << "\tSent to:\n"; + break; + case Draft: + os << "\tDraft for:\n"; + break; + case Unknown: + os << "\tUnknown status for:\n"; + break; + } + + os << "\t"; + for (std::vector::const_iterator i = Addresses.begin(); i < Addresses.end(); ++i) { + if (i != Addresses.begin()) + os << ", "; + os << *i; + } + os << "\n"; + + if (IsNew || Opened || Saved || Deleted || NewConversation) { + os << "\t"; + if (IsNew) + os << "New "; + if (Opened) + os << "Opened "; + if (Saved) + os << "Saved "; + if (Deleted) + os << "Deleted "; + os << "Message" << (NewConversation ? " that starts a new conversation" : "") << "\n"; + } + os << "\tContent: " << Body << "\n"; + os << "\n"; +} + +// +// This function helps to convert GSM 03.38 defined 7-bit +// SMS to UTF-8. +// Detailed information can be found in: +// ftp://ftp.3gpp.org/Specs/html-info/0338.htm (Official) +// http://en.wikipedia.org/wiki/SMS#GSM +// + +std::string Sms::ConvertGsmToUtf8(const std::string &s) +{ + // + // This array stores the GSM 03.38 defined encoding's + // corresponding UTF-8 values. + // For example: GsmTable[0] = "\x40", which refers to + // a "@" in UTF-8 encoding. + // The 0x1b item, leads to the extension table, using + // the char right next to it as the index. + // According to the official specification, when not + // able to handle it, it should be treated simply as + // a space, which is denoted in UTF-8 as "\x20". + // + static const std::string GsmTable[0x80] = { + // 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 + "\x40", "\xc2\xa3", "\x24", "\xc2\xa5", "\xc3\xa8", "\xc3\xa9", "\xc3\xb9", "\xc3\xac", // 0x00 + "\xc3\xb2", "\xc3\x87", "\x0a", "\xc3\x98", "\xc3\xb8", "\x0d", "\xc3\x85", "\xc3\xa5", // 0x08 + "\xce\x94", "\x5f", "\xce\xa6", "\xce\x93", "\xce\x9b", "\xce\xa9", "\xce\xa0", "\xce\xa8", // 0x10 + "\xce\xa3", "\xce\x98", "\xce\x9e", "\x20", "\xc3\x86", "\xc3\xa6", "\xc3\x9f", "\xc3\x89", // 0x18 + "\x20", "\x21", "\x22", "\x23", "\xc2\xa4", "\x25", "\x26", "\x27", // 0x20 + "\x28", "\x29", "\x2a", "\x2b", "\x2c", "\x2d", "\x2e", "\x2f", // 0x28 + "\x30", "\x31", "\x32", "\x33", "\x34", "\x35", "\x36", "\x37", // 0x30 + "\x38", "\x39", "\x3a", "\x3b", "\x3c", "\x3d", "\x3e", "\x3f", // 0x38 + "\xc2\xa1", "\x41", "\x42", "\x43", "\x44", "\x45", "\x46", "\x47", // 0x40 + "\x48", "\x49", "\x4a", "\x4b", "\x4c", "\x4d", "\x4e", "\x4f", // 0x48 + "\x50", "\x51", "\x52", "\x53", "\x54", "\x55", "\x56", "\x57", // 0x50 + "\x58", "\x59", "\x5a", "\xc3\x84", "\xc3\x96", "\xc3\x91", "\xc3\x9c", "\xc2\xa7", // 0x58 + "\xc2\xbf", "\x61", "\x62", "\x63", "\x64", "\x65", "\x66", "\x67", // 0x60 + "\x68", "\x69", "\x6a", "\x6b", "\x6c", "\x6d", "\x6e", "\x6f", // 0x68 + "\x70", "\x71", "\x72", "\x73", "\x74", "\x75", "\x76", "\x77", // 0x70 + "\x78", "\x79", "\x7a", "\xc3\xa4", "\xc3\xb6", "\xc3\xb1", "\xc3\xbc", "\xc3\xa0" // 0x78 + }; + // + // This sparse array stores the GSM 03.38 defined + // encoding extension table. + // The \x1b item is also preserved, for possibly + // another extension table. + // + static const std::string GsmExtensionTable[0x80] = { + // 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 + "", "", "", "", "", "", "", "", // 0x00 + "", "", "\x0c", "", "", "", "", "", // 0x08 + "", "", "", "", "\x5e", "", "", "", // 0x10 + "", "", "", " ", "", "", "", "", // 0x18 + "", "", "", "", "", "", "", "", // 0x20 + "\x7b", "\x7d", "", "", "", "", "", "\x5c", // 0x28 + "", "", "", "", "", "", "", "", // 0x30 + "", "", "", "", "\x5b", "\x7e", "\x5d", "", // 0x38 + "\x7c", "", "", "", "", "", "", "", // 0x40 + "", "", "", "", "", "", "", "", // 0x48 + "", "", "", "", "", "", "", "", // 0x50 + "", "", "", "", "", "", "", "", // 0x58 + "", "", "", "", "", "\xe2\x82\xac", "", "", // 0x60 + "", "", "", "", "", "", "", "", // 0x68 + "", "", "", "", "", "", "", "", // 0x70 + "", "", "", "", "", "", "", "" // 0x78 + }; + std::string ret; + unsigned len = s.length(); + for (unsigned i = 0; i < len; ++i) { + unsigned char c = (unsigned char) s[i]; + if (c > 0x7f) // prevent from illegal index + continue; + else if (c == 0x1b) { // go to extension table + if (i < len - 1) { + c = (unsigned char) s[++i]; + if (c <= 0x7f) // prevent from illegal index + ret += GsmExtensionTable[c]; + } + } + else + ret += GsmTable[c]; + } + return ret; +} + +} // namespace Barry + diff -Nru barry-0.14/src/r_sms.h barry-0.0.20110506/src/r_sms.h --- barry-0.14/src/r_sms.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/r_sms.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,129 @@ +/// +/// \file r_task.h +/// Record parsing class for the task database. +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2009, Ryan Li(ryan@ryanium.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_RECORD_SMS_H__ +#define __BARRY_RECORD_SMS_H__ + +#include "dll.h" +#include "record.h" +#include +#include +#include + +namespace Barry { + +// forward declarations +class IConverter; + +class BXEXPORT Sms +{ +public: + typedef Barry::UnknownsType UnknownsType; + + uint8_t RecType; + uint32_t RecordId; + + enum MessageType + { + Unknown = 0, + Received, + Sent, + Draft + }; + MessageType MessageStatus; + + enum DeliveryType + { + NoReport = 0, + Failed, + Succedded + }; + DeliveryType DeliveryStatus; // not implemented yet + + bool IsNew; + bool NewConversation; + bool Saved; + bool Deleted; + bool Opened; + + uint64_t Timestamp; // milliseconds from Jan 1, 1970 + uint64_t ServiceCenterTimestamp; // not applicable for non-incoming messages + + enum DataCodingSchemeType + { + SevenBit = 0, + EightBit, + UCS2 + }; + DataCodingSchemeType DataCodingScheme; + + uint32_t ErrorId; + + std::vector Addresses; + std::string Body; + + UnknownsType Unknowns; + +public: + Sms(); + ~Sms(); + + time_t GetTime() const; + time_t GetServiceCenterTime() const; + void SetTime(const time_t timestamp, unsigned int milliseconds = 0); + void SetServiceCenterTime(const time_t timestamp, unsigned int milliseconds = 0); + + const unsigned char* ParseField(const unsigned char *begin, const unsigned char *end, const IConverter *ic = 0); + uint8_t GetRecType() const { return RecType; } + uint32_t GetUniqueId() const { return RecordId; } + void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } + void ParseHeader(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); + void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + + // operations (common among record classes) + void Clear(); + void Dump(std::ostream &os) const; + std::string GetDescription() const; + + static std::string ConvertGsmToUtf8(const std::string &); + + // sorting + bool operator<(const Sms &other) const { + return Timestamp < other.Timestamp; + } + + // database name + static const char * GetDBName() { return "SMS Messages"; } + static uint8_t GetDefaultRecType() { return 5; } +}; + +BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Sms &msg) { + msg.Dump(os); + return os; +} + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/r_task.cc barry-0.0.20110506/src/r_task.cc --- barry-0.14/src/r_task.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_task.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -21,10 +21,12 @@ */ #include "r_task.h" +#include "r_calendar.h" // for CAL_* defines #include "record-internal.h" #include "protostructs.h" #include "data.h" #include "time.h" +#include "iconv.h" #include "debug.h" #include #include @@ -35,6 +37,49 @@ namespace Barry { + +/////////////////////////////////////////////////////////////////////////////// +// Task Class, static members + +// +// Note! These functions currently only pass the same values through. +// In actuality, these are technically two different values: +// one on the raw protocol side, and the other part of the +// guaranteed Barry API. If the Blackberry ever changes the +// meanings for these codes, do the translation here. +// + +Task::AlarmFlagType Task::AlarmProto2Rec(uint8_t a) +{ + return (AlarmFlagType)a; +} + +uint8_t Task::AlarmRec2Proto(AlarmFlagType a) +{ + return a; +} + +Task::PriorityFlagType Task::PriorityProto2Rec(uint8_t p) +{ + return (PriorityFlagType)p; +} + +uint8_t Task::PriorityRec2Proto(PriorityFlagType p) +{ + return p; +} + +Task::StatusFlagType Task::StatusProto2Rec(uint8_t s) +{ + return (StatusFlagType)s; +} + +uint8_t Task::StatusRec2Proto(StatusFlagType s) +{ + return s; +} + + /////////////////////////////////////////////////////////////////////////////// // Task Class @@ -42,26 +87,25 @@ #define TSKFC_TASK_TYPE 0x01 #define TSKFC_TITLE 0x02 #define TSKFC_NOTES 0x03 -#define TSKFC_START_TIME 0x05 -#define TSKFC_DUE_TIME 0x06 +#define TSKFC_DUE_TIME 0x05 +#define TSKFC_START_TIME 0x06 // This is fuzzy... most devices seem + // to anchor this value == to DUE_TIME #define TSKFC_DUE_FLAG 0x08 #define TSKFC_STATUS 0x09 #define TSKFC_PRIORITY 0x0a -#define TSKFC_RECURRENCE_DATA 0x0c #define TSKFC_ALARM_TYPE 0x0e #define TSKFC_ALARM_TIME 0x0f #define TSKFC_TIMEZONE_CODE 0x10 #define TSKFC_CATEGORIES 0x11 #define TSKFC_END 0xffff -FieldLink TaskFieldLinks[] = { - { TSKFC_TITLE, "Summary", 0, 0, &Task::Summary, 0, 0 }, - { TSKFC_NOTES, "Notes", 0, 0, &Task::Notes, 0, 0 }, - { TSKFC_START_TIME, "Start Time", 0, 0, 0, 0, &Task::StartTime }, - { TSKFC_DUE_TIME, "Due Time", 0, 0, 0, 0, &Task::DueTime }, - { TSKFC_ALARM_TIME, "Alarm Time", 0, 0, 0, 0, &Task::AlarmTime }, - { TSKFC_CATEGORIES, "Categories", 0, 0, &Task::Categories, 0, 0 }, - { TSKFC_END, "End of List", 0, 0, 0, 0, 0 }, +static FieldLink TaskFieldLinks[] = { + { TSKFC_TITLE, "Summary", 0, 0, &Task::Summary, 0, 0, 0, 0, true }, + { TSKFC_NOTES, "Notes", 0, 0, &Task::Notes, 0, 0, 0, 0, true }, + { TSKFC_START_TIME, "Start Time", 0, 0, 0, 0, &Task::StartTime, 0, 0, false }, + { TSKFC_DUE_TIME, "Due Time", 0, 0, 0, 0, &Task::DueTime, 0, 0, false }, + { TSKFC_ALARM_TIME, "Alarm Time", 0, 0, 0, 0, &Task::AlarmTime, 0, 0, false }, + { TSKFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false }, }; Task::Task() @@ -74,7 +118,8 @@ } const unsigned char* Task::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -87,7 +132,7 @@ return begin; if( field->type == TSKFC_TASK_TYPE ) { - if( ( TaskType = field->u.raw[0] ) != 't' ) { + if( field->u.raw[0] != 't' ) { throw Error("Task::ParseField: Task Type is not 't'"); } return begin; @@ -102,6 +147,8 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } else if( b->timeMember && btohs(field->size) == 4 ) { @@ -115,55 +162,58 @@ switch( field->type ) { case TSKFC_PRIORITY: - if( field->u.raw[0] > Low ) { + if( field->u.raw[0] > TR_PRIORITY_RANGE_HIGH ) { throw Error( "Task::ParseField: priority field out of bounds" ); } else { - PriorityFlag = (PriorityFlagType)field->u.raw[0]; + PriorityFlag = PriorityProto2Rec(field->u.raw[0]); } return begin; case TSKFC_STATUS: - if( field->u.raw[0] > Deferred ) { + if( field->u.raw[0] > TR_STATUS_RANGE_HIGH ) { throw Error( "Task::ParseField: priority field out of bounds" ); } else { - StatusFlag = (StatusFlagType)field->u.raw[0]; + StatusFlag = StatusProto2Rec(field->u.raw[0]); } return begin; case TSKFC_TIMEZONE_CODE: if( btohs(field->size) == 4 ) { TimeZoneCode = btohs(field->u.code); + TimeZoneValid = true; } else { throw Error("Task::ParseField: not enough data in time zone code field"); } return begin; - case TSKFC_RECURRENCE_DATA: - if( btohs(field->size) >= CALENDAR_RECURRENCE_DATA_FIELD_SIZE ) { - Recurring = true; - ParseRecurrenceData(&field->u.raw[0]); - } - else { - throw Error("Task::ParseField: not enough data in recurrence data field"); - } - return begin; - case TSKFC_DUE_FLAG: DueDateFlag = field->u.raw[0]; - return begin; + return begin; case TSKFC_ALARM_TYPE: - if( field->u.raw[0] > Relative ) { + if( field->u.raw[0] > TR_ALARM_RANGE_HIGH ) { throw Error("Task::ParseField: AlarmType out of bounds" ); } else { - AlarmType = (AlarmFlagType)field->u.raw[0]; + AlarmType = AlarmProto2Rec(field->u.raw[0]); + } + return begin; + + case TSKFC_CATEGORIES: + { + std::string catstring = ParseFieldString(field); + if( ic ) + catstring = ic->FromBB(catstring); + Categories.CategoryStr2List(catstring); } return begin; } + // base class handles recurring data + if( RecurBase::ParseField(field->type, field->u.raw, btohs(field->size), ic) ) + return begin; // if still not handled, add to the Unknowns list UnknownField uf; @@ -175,171 +225,131 @@ return begin; } -// this function assumes the size has already been checked -void Task::ParseRecurrenceData(const void *data) +void Task::ParseHeader(const Data &data, size_t &offset) { - const CalendarRecurrenceDataField *rec = - (const CalendarRecurrenceDataField*) data; + // no header in Task records +} - Interval = btohs(rec->interval); - if( Interval < 1 ) - Interval = 1; // must always be >= 1 +void Task::ParseFields(const Data &data, size_t &offset, const IConverter *ic) +{ + const unsigned char *finish = ParseCommonFields(*this, + data.GetData() + offset, data.GetData() + data.GetSize(), ic); + offset += finish - (data.GetData() + offset); +} - if( rec->endTime == 0xffffffff ) { - Perpetual = true; - } - else { - RecurringEndTime = min2time(rec->endTime); - Perpetual = false; - } - switch( rec->type ) - { - case CRDF_TYPE_DAY: - RecurringType = Day; - // no extra data - break; - - case CRDF_TYPE_MONTH_BY_DATE: - RecurringType = MonthByDate; - DayOfMonth = rec->u.month_by_date.monthDay; - break; - - case CRDF_TYPE_MONTH_BY_DAY: - RecurringType = MonthByDay; - DayOfWeek = rec->u.month_by_day.weekDay; - WeekOfMonth = rec->u.month_by_day.week; - break; - - case CRDF_TYPE_YEAR_BY_DATE: - RecurringType = YearByDate; - DayOfMonth = rec->u.year_by_date.monthDay; - MonthOfYear = rec->u.year_by_date.month; - break; - - case CRDF_TYPE_YEAR_BY_DAY: - RecurringType = YearByDay; - DayOfWeek = rec->u.year_by_day.weekDay; - WeekOfMonth = rec->u.year_by_day.week; - MonthOfYear = rec->u.year_by_day.month; - break; - - case CRDF_TYPE_WEEK: - RecurringType = Week; - - // Note: this simple copy is only possible since - // the CAL_WD_* constants are the same as CRDF_WD_* constants. - // If this ever changes, this code will need to change. - WeekDays = rec->u.week.days; - break; - - default: - eout("Unknown recurrence data type: 0x" - << setbase(16) << (unsigned int) rec->type); - throw Error("Unknown recurrence data type"); - } +void Task::BuildHeader(Data &data, size_t &offset) const +{ + // no header in Task records } -// this function assumes there is CALENDAR_RECURRENCE_DATA_FIELD_SIZE bytes -// available in data -void Task::BuildRecurrenceData(void *data) -{ - if( !Recurring ) - throw Error("Task::BuildRecurrenceData: Attempting to build recurrence data on non-recurring record."); - - CalendarRecurrenceDataField *rec = (CalendarRecurrenceDataField*) data; - - // set all to zero - memset(data, 0, CALENDAR_RECURRENCE_DATA_FIELD_SIZE); - - rec->interval = htobs(Interval); - rec->startTime = time2min(StartTime); - if( Perpetual ) - rec->endTime = 0xffffffff; + +// +// Build +// +/// Build fields part of record. +/// +void Task::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + data.Zap(); + + // tack on the 't' task type field first + BuildField(data, offset, TSKFC_TASK_TYPE, 't'); + + BuildField(data, offset, TSKFC_STATUS, StatusRec2Proto(StatusFlag)); + BuildField(data, offset, TSKFC_PRIORITY, PriorityRec2Proto(PriorityFlag)); + BuildField(data, offset, TSKFC_ALARM_TYPE, AlarmRec2Proto(AlarmType)); + + if ( DueDateFlag ) + BuildField(data, offset, TSKFC_DUE_FLAG, (char) 1); else - rec->endTime = time2min(RecurringEndTime); + BuildField(data, offset, TSKFC_DUE_FLAG, (char) 0); + + if( TimeZoneValid ) { + // the time zone code field is 4 bytes, but we only use + // the first two... pad it with zeros + uint32_t code = TimeZoneCode; + BuildField(data, offset, TSKFC_TIMEZONE_CODE, code); + } - switch( RecurringType ) + // cycle through the type table + for( FieldLink *b = TaskFieldLinks; + b->type != TSKFC_END; + b++ ) { - case Day: - rec->type = CRDF_TYPE_DAY; - // no extra data - break; - - case MonthByDate: - rec->type = CRDF_TYPE_MONTH_BY_DATE; - rec->u.month_by_date.monthDay = DayOfMonth; - break; - - case MonthByDay: - rec->type = CRDF_TYPE_MONTH_BY_DAY; - rec->u.month_by_day.weekDay = DayOfWeek; - rec->u.month_by_day.week = WeekOfMonth; - break; - - case YearByDate: - rec->type = CRDF_TYPE_YEAR_BY_DATE; - rec->u.year_by_date.monthDay = DayOfMonth; - rec->u.year_by_date.month = MonthOfYear; - break; - - case YearByDay: - rec->type = CRDF_TYPE_YEAR_BY_DAY; - rec->u.year_by_day.weekDay = DayOfWeek; - rec->u.year_by_day.week = WeekOfMonth; - rec->u.year_by_day.month = MonthOfYear; - break; - - case Week: - rec->type = CRDF_TYPE_WEEK; - - // Note: this simple copy is only possible since - // the CAL_WD_* constants are the same as CRDF_WD_* constants. - // If this ever changes, this code will need to change. - rec->u.week.days = WeekDays; - break; - - default: - eout("Task::BuildRecurrenceData: " - "Unknown recurrence data type: " << rec->type); - throw Error("Task::BuildRecurrenceData: Unknown recurrence data type"); + // print only fields with data + if( b->strMember ) { + const std::string &field = this->*(b->strMember); + if( field.size() ) { + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); + } + } + else if( b->timeMember ) { + time_t t = this->*(b->timeMember); + if( t > 0 ) + BuildField1900(data, offset, b->type, t); + } + else if( b->postMember && b->postField ) { + const std::string &field = (this->*(b->postMember)).*(b->postField); + if( field.size() ) { + std::string s = (b->iconvNeeded && ic) ? ic->ToBB(field) : field; + BuildField(data, offset, b->type, s); + } + } } -} -void Task::ParseHeader(const Data &data, size_t &offset) -{ - // no header in Task records -} + // Categories + if( Categories.size() ) { + string store; + Categories.CategoryList2Str(store); + BuildField(data, offset, TSKFC_CATEGORIES, ic ? ic->ToBB(store) : store); + } -void Task::ParseFields(const Data &data, size_t &offset) -{ - const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); - offset += finish - (data.GetData() + offset); + // and finally save unknowns + UnknownsType::const_iterator + ub = Unknowns.begin(), ue = Unknowns.end(); + for( ; ub != ue; ub++ ) { + BuildField(data, offset, *ub); + } + + data.ReleaseBuffer(offset); } + + void Task::Clear() { + // clear the base class first + RecurBase::Clear(); + + // our variables... + RecType = GetDefaultRecType(); + RecordId = 0; + Summary.clear(); Notes.clear(); Categories.clear(); + UID.clear(); + StartTime = DueTime = AlarmTime = 0; + TimeZoneCode = GetTimeZoneCode( 0, 0 ); // default to GMT + TimeZoneValid = false; + AlarmType = (AlarmFlagType)0; PriorityFlag = (PriorityFlagType)0; StatusFlag = (StatusFlagType)0; - AlarmType = (AlarmFlagType)0; - - TaskType = 0; - Perpetual = false; DueDateFlag = false; - Recurring = false; - - TimeZoneCode = GetTimeZoneCode( 0, 0 ); Unknowns.clear(); } +std::string Task::GetDescription() const +{ + return Summary; +} + void Task::Dump(std::ostream &os) const { static const char *PriorityName[] = { "High", "Normal", "Low" }; @@ -371,11 +381,14 @@ } } + os << " Due Date Flag: " << (DueDateFlag ? "true" : "false") << "\n"; os << " Priority: " << PriorityName[PriorityFlag] << "\n"; os << " Status: " << StatusName[StatusFlag] << "\n"; if( AlarmType ) { os << " Alarm Type: " << AlarmTypeName[AlarmType] << "\n"; } + if( TimeZoneValid ) + os << " Time Zone: " << GetTimeZone(TimeZoneCode)->Name << "\n"; // print recurrence data if available os << " Recurring: " << (Recurring ? "yes" : "no") << "\n"; @@ -440,11 +453,30 @@ os << " Ends: never\n"; else os << " Ends: " << ctime(&RecurringEndTime); - } + } + + if( Categories.size() ) { + string display; + Categories.CategoryList2Str(display); + os << " Categories: " << display << "\n"; + } os << Unknowns; os << "\n\n"; } +bool Task::operator<(const Task &other) const +{ + if( StartTime != other.StartTime ) + return StartTime < other.StartTime; + if( AlarmTime != other.AlarmTime ) + return AlarmTime < other.AlarmTime; + + int cmp = Summary.compare(other.Summary); + if( cmp == 0 ) + cmp = Notes.compare(other.Notes); + return cmp < 0; +} + } // namespace Barry diff -Nru barry-0.14/src/r_task.h barry-0.0.20110506/src/r_task.h --- barry-0.14/src/r_task.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_task.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -25,29 +25,35 @@ #include "dll.h" #include "record.h" +#include "r_recur_base.h" #include #include #include namespace Barry { -class BXEXPORT Task +// forward declarations +class IConverter; + +class BXEXPORT Task : public RecurBase { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; + uint8_t RecType; uint32_t RecordId; - uint8_t TaskType; std::string Summary; std::string Notes; - std::string Categories; + CategoryList Categories; std::string UID; time_t StartTime; time_t DueTime; time_t AlarmTime; - int TimeZoneCode; + unsigned short TimeZoneCode; + bool TimeZoneValid; // true if the record contained a + // time zone code enum AlarmFlagType { @@ -56,32 +62,6 @@ }; AlarmFlagType AlarmType; - unsigned short Interval; - enum RecurringCodeType { - Day = 1, //< eg. every day - //< set: nothing - MonthByDate = 3, //< eg. every month on the 12th - //< set: DayOfMonth - MonthByDay = 4, //< eg. every month on 3rd Wed - //< set: DayOfWeek and WeekOfMonth - YearByDate = 5, //< eg. every year on March 5 - //< set: DayOfMonth and MonthOfYear - YearByDay = 6, //< eg. every year on 3rd Wed of Jan - //< set: DayOfWeek, WeekOfMonth, and - //< MonthOfYear - Week = 12 //< eg. every week on Mon and Fri - //< set: WeekDays - }; - RecurringCodeType RecurringType; - time_t RecurringEndTime; - unsigned short // recurring details, depending on type - DayOfWeek, // 0-6 - WeekOfMonth, // 1-5 - DayOfMonth, // 1-31 - MonthOfYear; // 1-12 - unsigned char WeekDays; // bitmask, bit 0 = sunday - - int ClassType; enum PriorityFlagType { High = 0, @@ -100,31 +80,41 @@ }; StatusFlagType StatusFlag; - bool Recurring; - bool Perpetual; bool DueDateFlag; // true if due date is set + // unknown UnknownsType Unknowns; -public: +protected: + static AlarmFlagType AlarmProto2Rec(uint8_t a); + static uint8_t AlarmRec2Proto(AlarmFlagType a); + + static PriorityFlagType PriorityProto2Rec(uint8_t p); + static uint8_t PriorityRec2Proto(PriorityFlagType p); + + static StatusFlagType StatusProto2Rec(uint8_t s); + static uint8_t StatusRec2Proto(StatusFlagType s); + +public: Task(); ~Task(); const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); - void ParseRecurrenceData(const void *data); - void BuildRecurrenceData(void *data); + const unsigned char *end, const IConverter *ic = 0); uint8_t GetRecType() const { return RecType; } uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; - bool operator<(const Task &other) const { return Summary < other.Summary; } + std::string GetDescription() const; + + bool operator<(const Task &other) const; // database name static const char * GetDBName() { return "Tasks"; } diff -Nru barry-0.14/src/r_timezone.cc barry-0.0.20110506/src/r_timezone.cc --- barry-0.14/src/r_timezone.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_timezone.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -25,8 +25,10 @@ #include "protostructs.h" #include "data.h" #include "time.h" +#include "iconv.h" #include "debug.h" -#include +#include +#include #include using namespace std; @@ -43,15 +45,15 @@ #define TZFC_NAME 0x02 #define TZFC_OFFSET 0x03 #define TZFC_DST 0x04 -#define TZFC_STARTMONTH 0x06 -#define TZFC_ENDMONTH 0x0B +#define TZFC_STARTMONTH 0x06 +#define TZFC_ENDMONTH 0x0B #define TZFC_TZTYPE 0x64 #define TZFC_END 0xffff -FieldLink TimezoneFieldLinks[] = { - { TZFC_NAME, "Name", 0, 0, &Timezone::TimeZoneName, 0, 0 }, - { TZFC_END, "End of List", 0, 0, 0, 0, 0 }, +static FieldLink TimezoneFieldLinks[] = { + { TZFC_NAME, "Name", 0, 0, &Timezone::TimeZoneName, 0, 0, 0, 0, true }, + { TZFC_END, "End of List", 0, 0, 0, 0, 0, 0, 0, false }, }; Timezone::Timezone() @@ -64,7 +66,8 @@ } const unsigned char* Timezone::ParseField(const unsigned char *begin, - const unsigned char *end) + const unsigned char *end, + const IConverter *ic) { const CommonField *field = (const CommonField *) begin; @@ -75,7 +78,7 @@ if( !btohs(field->size) ) // if field has no size, something's up return begin; - + if( field->type == TZFC_TZTYPE ) { if( ( TZType = field->u.uint32 ) != 1 ) { throw Error("Timezone::ParseField: Timezone Type is not valid"); @@ -92,6 +95,8 @@ if( b->strMember ) { std::string &s = this->*(b->strMember); s = ParseFieldString(field); + if( b->iconvNeeded && ic ) + s = ic->FromBB(s); return begin; // done! } } @@ -102,7 +107,7 @@ case TZFC_INDEX: Index = btohl(field->u.uint32); return begin; - + case TZFC_OFFSET: Offset = btohs(field->u.int16); if (Offset < 0) { @@ -117,23 +122,23 @@ Left = false; } return begin; - + case TZFC_DST: DSTOffset = btohl(field->u.uint32); if (DSTOffset) { UseDST = true; } return begin; - + case TZFC_STARTMONTH: StartMonth = btohl(field->u.uint32); return begin; - + case TZFC_ENDMONTH: EndMonth = btohl(field->u.uint32); return begin; } - + // if still not handled, add to the Unknowns list UnknownField uf; uf.type = field->type; @@ -149,36 +154,59 @@ // no header in Task records } -void Timezone::ParseFields(const Data &data, size_t &offset) +void Timezone::ParseFields(const Data &data, size_t &offset, const IConverter *ic) { const unsigned char *finish = ParseCommonFields(*this, - data.GetData() + offset, data.GetData() + data.GetSize()); + data.GetData() + offset, data.GetData() + data.GetSize(), ic); offset += finish - (data.GetData() + offset); } +void Timezone::BuildHeader(Data &data, size_t &offset) const +{ + // not yet implemented +} + +void Timezone::BuildFields(Data &data, size_t &offset, const IConverter *ic) const +{ + // not yet implemented +} + void Timezone::Clear() { - TimeZoneName.clear(); - + RecType = GetDefaultRecType(); + RecordId = 0; + + TZType = 0; + DSTOffset = 0; Index = 0; - Left = false; - UseDST = false; Offset = 0; OffsetFraction = 0; - DSTOffset = 0; StartMonth = -1; EndMonth = -1; + Left = false; + UseDST = false; + + TimeZoneName.clear(); Unknowns.clear(); } +std::string Timezone::GetDescription() const +{ + ostringstream oss; + oss << TimeZoneName << " (" + << (Left ? "-" : "+") << dec << Offset << "." << OffsetFraction + << ")"; + return oss.str(); +} + void Timezone::Dump(std::ostream &os) const { static const char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", - "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - + os << "Task entry: 0x" << setbase(16) << RecordId << " (" << (unsigned int)RecType << ")\n"; diff -Nru barry-0.14/src/r_timezone.h barry-0.0.20110506/src/r_timezone.h --- barry-0.14/src/r_timezone.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/r_timezone.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008, Brian Edginton This program is free software; you can redistribute it and/or modify @@ -29,13 +29,15 @@ #include #include -namespace Barry -{ +namespace Barry { + +// forward declarations +class IConverter; class BXEXPORT Timezone { public: - typedef std::vector UnknownsType; + typedef Barry::UnknownsType UnknownsType; uint8_t RecType; uint32_t RecordId; @@ -53,26 +55,29 @@ std::string TimeZoneName; UnknownsType Unknowns; - + public: - + Timezone(); virtual ~Timezone(); - + const unsigned char* ParseField(const unsigned char *begin, - const unsigned char *end); + const unsigned char *end, const IConverter *ic = 0); void ParseRecurrenceData(const void *data); void BuildRecurrenceData(void *data); uint8_t GetRecType() const { return RecType; } uint32_t GetUniqueId() const { return RecordId; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void ParseHeader(const Data &data, size_t &offset); - void ParseFields(const Data &data, size_t &offset); + void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0); void BuildHeader(Data &data, size_t &offset) const; + void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const; + // operations (common among record classes) void Clear(); - void Dump(std::ostream &os) const; + std::string GetDescription() const; + bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; } // database name diff -Nru barry-0.14/src/s11n-boost.h barry-0.0.20110506/src/s11n-boost.h --- barry-0.14/src/s11n-boost.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/s11n-boost.h 2011-05-06 12:20:17.000000000 +0000 @@ -7,7 +7,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -25,6 +25,7 @@ #ifndef __BARRY_S11N_BOOST_H__ #define __BARRY_S11N_BOOST_H__ +#include "dll.h" #include "record.h" #include @@ -60,6 +61,13 @@ } template +void serialize(ArchiveT &ar, Barry::CategoryList &cl, const unsigned int ver) +{ + std::vector &sl = cl; + ar & make_nvp("CategoryList", sl); +} + +template void serialize(ArchiveT &ar, Barry::Contact &c, const unsigned int ver) { ar & make_nvp("RecType", c.RecType); @@ -68,9 +76,11 @@ ar & make_nvp("EmailAddresses", c.EmailAddresses); ar & make_nvp("Phone", c.Phone); ar & make_nvp("Fax", c.Fax); + ar & make_nvp("HomeFax", c.HomeFax); ar & make_nvp("WorkPhone", c.WorkPhone); ar & make_nvp("HomePhone", c.HomePhone); ar & make_nvp("MobilePhone", c.MobilePhone); + ar & make_nvp("MobilePhone2", c.MobilePhone2); ar & make_nvp("Pager", c.Pager); ar & make_nvp("PIN", c.PIN); ar & make_nvp("Radio", c.Radio); @@ -106,7 +116,8 @@ ar & make_nvp("HomePostalCode", c.HomeAddress.PostalCode); ar & make_nvp("HomeCountry", c.HomeAddress.Country); ar & make_nvp("Image", c.Image); - + ar & make_nvp("Nickname", c.Nickname); + if( ver < BARRY_POD_MAP_VERSION ) { ar & make_nvp("GroupLinks", c.GroupLinks); ar & make_nvp("Unknowns", c.Unknowns); @@ -121,6 +132,13 @@ } template +void serialize(ArchiveT &ar, Barry::EmailAddressList &eal, const unsigned int ver) +{ + std::vector &v = eal; + ar & make_nvp("EmailAddressList", v); +} + +template void serialize(ArchiveT &ar, Barry::Message &m, const unsigned int ver) { ar & make_nvp("From", m.From); @@ -142,8 +160,8 @@ ar & make_nvp("MessageSaved", m.MessageSaved); ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted); - ar & make_nvp("MessagePriority", m.MessagePriority); - ar & make_nvp("MessageSensitivity", m.MessageSensitivity); + ar & make_nvp("MessagePriority", m.Priority); + ar & make_nvp("MessageSensitivity", m.Sensitivity); if( ver < BARRY_POD_MAP_VERSION ) { ar & make_nvp("Unknowns", m.Unknowns); @@ -165,15 +183,20 @@ ar & make_nvp("NotificationTime", c.NotificationTime); ar & make_nvp("StartTime", c.StartTime); ar & make_nvp("EndTime", c.EndTime); - + + ar & make_nvp("Organizer", c.Organizer); + ar & make_nvp("AcceptedBy", c.AcceptedBy); + ar & make_nvp("Invited", c.Invited); + ar & make_nvp("FreeBusyFlag", c.FreeBusyFlag); ar & make_nvp("ClassFlag", c.ClassFlag); - + ar & make_nvp("Recurring", c.Recurring); ar & make_nvp("RecurringType", c.RecurringType); ar & make_nvp("Interval", c.Interval); ar & make_nvp("RecurringEndTime", c.RecurringEndTime); ar & make_nvp("Perpetual", c.Perpetual); + ar & make_nvp("CalendarID", c.CalendarID); ar & make_nvp("TimeZoneCode", c.TimeZoneCode); ar & make_nvp("TimeZoneValid", c.TimeZoneValid); @@ -189,6 +212,55 @@ } template +void serialize(ArchiveT &ar, Barry::CalendarAll &c, const unsigned int ver) +{ + serialize(ar, static_cast(c), ver); + + ar & make_nvp("MailAccount", c.MailAccount); +} + +template +void serialize(ArchiveT &ar, Barry::CallLog &c, const unsigned int ver) +{ + ar & make_nvp("RecType", c.RecType); + ar & make_nvp("RecordId", c.RecordId); + + ar & make_nvp("Duration", c.Duration); + ar & make_nvp("Timestamp", c.Timestamp); + ar & make_nvp("ContactName", c.ContactName); + ar & make_nvp("PhoneNumber", c.PhoneNumber); + + ar & make_nvp("DirectionFlag", c.DirectionFlag); + ar & make_nvp("StatusFlag", c.StatusFlag); + ar & make_nvp("PhoneTypeFlag", c.PhoneTypeFlag); + ar & make_nvp("PhoneInfoFlag", c.PhoneInfoFlag); + + if( ver < BARRY_POD_MAP_VERSION ) { + ar & make_nvp("Unknowns", c.Unknowns); + } +} + +template +void serialize(ArchiveT &ar, Barry::Bookmark &c, const unsigned int ver) +{ + ar & make_nvp("RecType", c.RecType); + ar & make_nvp("RecordId", c.RecordId); + ar & make_nvp("Index", c.Index); + + ar & make_nvp("Name", c.Name); + ar & make_nvp("Icon", c.Icon); + ar & make_nvp("Url", c.Url); + + ar & make_nvp("BrowserIdentity", c.BrowserIdentity); + ar & make_nvp("DisplayMode", c.DisplayMode); + ar & make_nvp("JavaScriptMode", c.JavaScriptMode); + + if( ver < BARRY_POD_MAP_VERSION ) { + ar & make_nvp("Unknowns", c.Unknowns); + } +} + +template void serialize(ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned int ver) { ar & make_nvp("Format", c.Format); @@ -224,11 +296,10 @@ ar & make_nvp("RecType", m.RecType); ar & make_nvp("RecordId", m.RecordId); - ar & make_nvp("MemoType", m.MemoType); ar & make_nvp("Title", m.Title); ar & make_nvp("Body", m.Body); - ar & make_nvp("Category", m.Category); - + ar & make_nvp("Categories", m.Categories); + if( ver < BARRY_POD_MAP_VERSION ) { ar & make_nvp( "Unknowns", m.Unknowns); } @@ -240,7 +311,6 @@ ar & make_nvp("RecType", t.RecType); ar & make_nvp("RecordId", t.RecordId); - ar & make_nvp("TaskType", t.TaskType); ar & make_nvp("Summary", t.Summary); ar & make_nvp("Notes", t.Notes); ar & make_nvp("Categories", t.Categories); @@ -249,8 +319,9 @@ ar & make_nvp("StartTime", t.StartTime); ar & make_nvp("DueTime", t.DueTime); ar & make_nvp("AlarmTime", t.AlarmTime); - + ar & make_nvp("TimeZoneCode", t.TimeZoneCode); + ar & make_nvp("TimeZoneValid", t.TimeZoneValid); ar & make_nvp("AlarmType", t.AlarmType); ar & make_nvp("Interval", t.Interval); @@ -262,7 +333,6 @@ ar & make_nvp("MonthOfYear", t.MonthOfYear); ar & make_nvp("WeekDays", t.WeekDays); - ar & make_nvp("ClassType", t.ClassType); ar & make_nvp("PriorityFlag", t.PriorityFlag); ar & make_nvp("StatusFlag", t.StatusFlag); ar & make_nvp("Recurring", t.Recurring); @@ -297,8 +367,8 @@ ar & make_nvp("MessageSaved", p.MessageSaved); ar & make_nvp("MessageSavedDeleted", p.MessageSavedDeleted); - ar & make_nvp("MessagePriority", p.MessagePriority); - ar & make_nvp("MessageSensitivity", p.MessageSensitivity); + ar & make_nvp("MessagePriority", p.Priority); + ar & make_nvp("MessageSensitivity", p.Sensitivity); if(ver < BARRY_POD_MAP_VERSION) { ar & make_nvp("Unknowns", p.Unknowns); @@ -331,8 +401,37 @@ ar & make_nvp("MessageSaved", m.MessageSaved); ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted); - ar & make_nvp("MessagePriority", m.MessagePriority); - ar & make_nvp("MessageSensitivity", m.MessageSensitivity); + ar & make_nvp("MessagePriority", m.Priority); + ar & make_nvp("MessageSensitivity", m.Sensitivity); + + if( ver < BARRY_POD_MAP_VERSION ) { + ar & make_nvp("Unknowns", m.Unknowns); + } +} + +template +void serialize(ArchiveT &ar, Barry::Sms &m, const unsigned int ver) +{ + ar & make_nvp("RecType", m.RecType); + ar & make_nvp("RecordId", m.RecordId); + + ar & make_nvp("MessageStatus", m.MessageStatus); + ar & make_nvp("DeliveryStatus", m.DeliveryStatus); + + ar & make_nvp("IsNew", m.IsNew); + ar & make_nvp("NewConversation", m.NewConversation); + ar & make_nvp("Saved", m.Saved); + ar & make_nvp("Deleted", m.Deleted); + ar & make_nvp("Opened", m.Opened); + + ar & make_nvp("Timestamp", m.Timestamp); + ar & make_nvp("ServiceCenterTimestamp", m.ServiceCenterTimestamp); + + ar & make_nvp("DataCodingScheme", m.DataCodingScheme); + ar & make_nvp("ErrorId", m.ErrorId); + + ar & make_nvp("Addresses", m.Addresses); + ar & make_nvp("Body", m.Body); if( ver < BARRY_POD_MAP_VERSION ) { ar & make_nvp("Unknowns", m.Unknowns); @@ -345,10 +444,10 @@ ar & make_nvp("RecType", f.RecType); ar & make_nvp("RecordId", f.RecordId); - ar & make_nvp("FolderName", f.FolderName); - ar & make_nvp("FolderNumber", f.FolderNumber); - ar & make_nvp("FolderLevel", f.FolderLevel); - ar & make_nvp("FolderType", f.FolderType); + ar & make_nvp("FolderName", f.Name); + ar & make_nvp("FolderNumber", f.Number); + ar & make_nvp("FolderLevel", f.Level); + ar & make_nvp("FolderType", f.Type); if( ver < BARRY_POD_MAP_VERSION ) { ar & make_nvp( "Unknowns", f.Unknowns); @@ -378,7 +477,301 @@ } } +template +void serialize(ArchiveT &ar, Barry::ContentStore &c, const unsigned int ver) +{ + ar & make_nvp("RecType", c.RecType); + ar & make_nvp("RecordId", c.RecordId); + + ar & make_nvp("Filename", c.Filename); + ar & make_nvp("FolderFlag", c.FolderFlag); + ar & make_nvp("FileContent", c.FileContent); + ar & make_nvp("FileDescriptor", c.FileDescriptor); + + // FileSize is not used for building, so no need to save it here + + if( ver < BARRY_POD_MAP_VERSION ) { + ar & make_nvp("Unknowns", c.Unknowns); + } +} + +template +void serialize(ArchiveT &ar, Barry::HandheldAgent &h, const unsigned int ver) +{ + ar & make_nvp("RecType", h.RecType); + ar & make_nvp("RecordId", h.RecordId); + + ar & make_nvp("MEID", h.MEID); + ar & make_nvp("Model", h.Model); + ar & make_nvp("Bands", h.Bands); + ar & make_nvp("Pin", h.Pin); + ar & make_nvp("Version", h.Version); + ar & make_nvp("PlatformVersion", h.PlatformVersion); + ar & make_nvp("Manufacturer", h.Manufacturer); + ar & make_nvp("Network", h.Network); + + if( ver < BARRY_POD_MAP_VERSION ) { + ar & make_nvp("Unknowns", h.Unknowns); + } +} + }} // namespace boost::serialization + +////////////////////////////////////////////////////////////////////////////// +// Helper wrapper templates for loading and saving records to an iostream + +namespace Barry { + +// Can be used as a Storage class for RecordBuilder<> +template +class BoostLoader +{ +public: + typedef RecordT rec_type; + typedef std::vector list_type; + +private: + list_type m_records; + typename list_type::iterator rec_it; + +public: + explicit BoostLoader(std::istream &is) + { + boost::archive::text_iarchive ia(is); + ia >> m_records; + rec_it = m_records.begin(); + } + + list_type& GetRecords() { return m_records; } + const list_type& GetRecords() const { return m_records; } + + // retrieval operator + bool operator()(RecordT &rec, Builder &builder) + { + if( rec_it == m_records.end() ) + return false; + rec = *rec_it; + ++rec_it; + return true; + } +}; + +// Can be used as a Storage class for RecordParser<> +template +class BoostSaver +{ +public: + typedef RecordT rec_type; + typedef std::vector list_type; + +private: + std::ostream &m_os; + list_type m_records; + typename list_type::iterator rec_it; + +public: + explicit BoostSaver(std::ostream &os) + : m_os(os) + { + } + + ~BoostSaver() + { + WriteArchive(); + } + + void WriteArchive() const + { + // write dbname first, so parsing is possible + m_os << RecordT::GetDBName() << std::endl; + + // write boost archive of all records + boost::archive::text_oarchive oa(m_os); + + // boost is fussy that the vector must be const + // we do this explicitly, for documentation's sake + const list_type &recs = m_records; + oa << recs; + m_os << std::endl; + } + + list_type& GetRecords() { return m_records; } + const list_type& GetRecords() const { return m_records; } + + // storage operator + void operator()(const RecordT &rec) + { + m_records.push_back(rec); + } +}; + +// +// BoostParser +// +/// This Parser turns incoming records (which can be of any record type +/// included in ALL_KNOWN_PARSER_TYPES) into a Boost Serialization stream +/// on the given iostream. +/// +/// This class is defined completely in the header, so that it is +/// optional for applications to link against the boost libraries. +/// +class BXEXPORT BoostParser : public Barry::Parser +{ + std::auto_ptr m_parser; + std::ofstream *m_ofs; + std::ostream &m_os; // references either an external object, + // or *m_ifs... this is the reference to + // use in the entire class... the constructor + // sets it up + + std::string m_current_db; + +public: + explicit BoostParser(const std::string &filename) + : m_ofs( new std::ofstream(filename.c_str()) ) + , m_os(*m_ofs) + { + } + + explicit BoostParser(std::ostream &os) + : m_ofs(0) + , m_os(os) + { + } + + ~BoostParser() + { + // flush any remaining parser output + // (note this still potentially uses m_ofs, so do this first) + m_parser.reset(); + + // cleanup the stream + delete m_ofs; + } + + void StartDB(const std::string &dbname) + { + // done with current parser, flush it's output + m_parser.reset(); + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + if( dbname == tname::GetDBName() ) { \ + m_parser.reset( \ + new RecordParser >( \ + new BoostSaver(m_os) ) ); \ + return; \ + } + + ALL_KNOWN_PARSER_TYPES + + // if we make it here, we don't have a record parser + // for this dbname, so just dump it to stderr (not stdout, + // since the user might be sending normal output there) + m_parser.reset( new HexDumpParser(std::cerr) ); + } + + void ParseRecord(const DBData &data, const IConverter *ic) + { + if( m_current_db != data.GetDBName() ) { + StartDB(data.GetDBName()); + m_current_db = data.GetDBName(); + } + + m_parser->ParseRecord(data, ic); + } +}; + +// +// BoostBuilder +// +/// This Builder class reads a boost serialization stream, and converts +/// them into DBData records. Can only produce records for record types +/// in ALL_KNOWN_BUILDER_TYPES. +/// +class BXEXPORT BoostBuilder : public Barry::Builder +{ + std::auto_ptr m_builder; + std::ifstream *m_ifs; + + std::istream &m_is; // references either an external object, + // or *m_ifs... this is the reference to + // use in the entire class... the constructor + // sets it up + +public: + explicit BoostBuilder(const std::string &filename) + : m_ifs( new std::ifstream(filename.c_str()) ) + , m_is(*m_ifs) + { + FinishDB(); + } + + explicit BoostBuilder(std::istream &is) + : m_ifs(0) + , m_is(is) + { + FinishDB(); + } + + ~BoostBuilder() + { + delete m_ifs; + } + + void FinishDB() + { + // done with current builder + m_builder.reset(); + + // read the next DBName + std::string dbName; + while( getline(m_is, dbName) ) { + +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(tname) \ + if( dbName == tname::GetDBName() ) { \ + m_builder.reset( \ + new RecordBuilder >( \ + new BoostLoader(m_is) ) ); \ + return; \ + } + + ALL_KNOWN_BUILDER_TYPES + } + } + + bool BuildRecord(DBData &data, size_t &offset, const IConverter *ic) + { + if( !m_builder.get() ) + return false; + + bool ret = m_builder->BuildRecord(data, offset, ic); + if( !ret ) + FinishDB(); + return ret; + } + + bool FetchRecord(DBData &data, const IConverter *ic) + { + if( !m_builder.get() ) + return false; + + bool ret = m_builder->FetchRecord(data, ic); + if( !ret ) + FinishDB(); + return ret; + } + + bool EndOfFile() const + { + return m_builder.get() ? false : true; + } +}; + + +} // namespace Barry + #endif diff -Nru barry-0.14/src/scoped_lock.h barry-0.0.20110506/src/scoped_lock.h --- barry-0.14/src/scoped_lock.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/scoped_lock.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/semaphore.h barry-0.0.20110506/src/semaphore.h --- barry-0.14/src/semaphore.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/semaphore.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,89 @@ +/// +/// \file semaphore.h +/// Simple class implementing a semaphore using pthreads mutex and condvar. +/// + +/* + Copyright (C) 2010, RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SEMAPHORE_H__ +#define __BARRY_SEMAPHORE_H__ + +#include "scoped_lock.h" +#include + +namespace Barry { + +class semaphore +{ + pthread_mutex_t *m_mutex; + pthread_cond_t *m_cv; + int m_value; +public: + semaphore(pthread_mutex_t &mutex, pthread_cond_t &cv, int value = 0) + : m_mutex(&mutex) + , m_cv(&cv) + , m_value(value) + { + } + + // Waits for the value of this semaphore to be greater than 0 and then + // decrements it by one before returning. + void WaitForSignal() + { + scoped_lock lock(*m_mutex); + while( m_value <= 0 ) { + int ret = pthread_cond_wait(m_cv, m_mutex); + if( ret != 0 ) { + throw Barry::Error("semaphore: failed to wait on condvar"); + } + } + --m_value; + lock.unlock(); + } + + // Checks for a semaphore signal without blocking. Returns true and decrements + // the semaphore if the value is greater than 0, otherwise returns false. + bool ReceiveSignal() + { + bool ret = false; + scoped_lock lock(*m_mutex); + if( m_value > 0 ) { + --m_value; + ret = true; + } + lock.unlock(); + return ret; + } + + // Increments the value of this semaphore by 1, waking any sleeping threads waiting + // on this semaphore. + void Signal() + { + scoped_lock lock(*m_mutex); + ++m_value; + int ret = pthread_cond_signal(m_cv); + if( ret != 0 ) { + throw Barry::Error("Condvar: failed to signal condvar"); + } + lock.unlock(); + } +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/sha1.cc barry-0.0.20110506/src/sha1.cc --- barry-0.14/src/sha1.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/sha1.cc 2011-05-06 12:20:17.000000000 +0000 @@ -1,29 +1,29 @@ -/* +/* * 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 SHA 180-1 Reference Implementation (Compact version) - * + * * The Initial Developer of the Original Code is Paul Kocher of - * Cryptography Research. Portions created by Paul Kocher are + * Cryptography Research. Portions created by Paul Kocher are * Copyright (C) 1995-9 by Cryptography Research, Inc. All * Rights Reserved. - * + * * Contributor(s): * * Paul Kocher - * + * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your * version of this file only under the terms of the GPL and not to * allow others to use your version of this file under the MPL, * indicate your decision by deleting the provisions above and diff -Nru barry-0.14/src/sha1.h barry-0.0.20110506/src/sha1.h --- barry-0.14/src/sha1.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/sha1.h 2011-05-06 12:20:17.000000000 +0000 @@ -1,29 +1,29 @@ -/* +/* * 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 SHA 180-1 Header File - * + * * The Initial Developer of the Original Code is Paul Kocher of - * Cryptography Research. Portions created by Paul Kocher are + * Cryptography Research. Portions created by Paul Kocher are * Copyright (C) 1995-9 by Cryptography Research, Inc. All * Rights Reserved. - * + * * Contributor(s): * * Paul Kocher - * + * * Alternatively, the contents of this file may be used under the * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your + * "GPL"), in which case the provisions of the GPL are applicable + * instead of those above. If you wish to allow use of your * version of this file only under the terms of the GPL and not to * allow others to use your version of this file under the MPL, * indicate your decision by deleting the provisions above and diff -Nru barry-0.14/src/socket.cc barry-0.0.20110506/src/socket.cc --- barry-0.14/src/socket.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/socket.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -43,30 +43,32 @@ SocketZero::SocketZero( SocketRoutingQueue &queue, int writeEndpoint, uint8_t zeroSocketSequenceStart) - : m_dev(0), - m_queue(&queue), - m_writeEp(writeEndpoint), - m_readEp(0), - m_zeroSocketSequence(zeroSocketSequenceStart), - m_sequenceId(0), - m_halfOpen(false), - m_challengeSeed(0), - m_remainingTries(0) + : m_dev(0) + , m_queue(&queue) + , m_writeEp(writeEndpoint) + , m_readEp(0) + , m_zeroSocketSequence(zeroSocketSequenceStart) + , m_sequenceId(0) + , m_halfOpen(false) + , m_challengeSeed(0) + , m_remainingTries(0) + , m_modeSequencePacketSeen(false) { } SocketZero::SocketZero( Device &dev, int writeEndpoint, int readEndpoint, uint8_t zeroSocketSequenceStart) - : m_dev(&dev), - m_queue(0), - m_writeEp(writeEndpoint), - m_readEp(readEndpoint), - m_zeroSocketSequence(zeroSocketSequenceStart), - m_sequenceId(0), - m_halfOpen(false), - m_challengeSeed(0), - m_remainingTries(0) + : m_dev(&dev) + , m_queue(0) + , m_writeEp(writeEndpoint) + , m_readEp(readEndpoint) + , m_zeroSocketSequence(zeroSocketSequenceStart) + , m_sequenceId(0) + , m_halfOpen(false) + , m_challengeSeed(0) + , m_remainingTries(0) + , m_modeSequencePacketSeen(false) { } @@ -186,7 +188,7 @@ } else { dout("Bad sequence on socket 0: expected: " - << msequenceId + << m_sequenceId << ". Packet sequence: " << sequenceId); } } @@ -210,20 +212,17 @@ try { RawSend(send); RawReceive(receive); + if( Protocol::IsSequencePacket(receive) ) { + m_modeSequencePacketSeen = true; + // during open, we could get a sequence packet in + // the middle, from the SelectMode operation + RawReceive(receive); + } } catch( Usb::Error & ) { eeout(send, receive); throw; } - // check sequence ID - Protocol::CheckSize(receive); - if( IS_COMMAND(receive, SB_COMMAND_SEQUENCE_HANDSHAKE) ) { - CheckSequence(0, receive); - - // still need our ACK - RawReceive(receive); - } - // receive now holds the Open response } @@ -274,8 +273,9 @@ send.Zap(); // check sequence ID - Protocol::CheckSize(receive); - if( IS_COMMAND(receive, SB_COMMAND_SEQUENCE_HANDSHAKE) ) { + if( Protocol::IsSequencePacket(receive) ) { + m_modeSequencePacketSeen = true; + CheckSequence(0, receive); // still need our ACK @@ -288,6 +288,8 @@ void SocketZero::RawSend(Data &send, int timeout) { Usb::Device *dev = m_queue ? m_queue->GetUsbDevice() : m_dev; + if( !dev ) + throw Error("SocketZero: No device available for RawSend"); // Special case: it seems that sending packets with a size that's an // exact multiple of 0x40 causes the device to get confused. @@ -302,50 +304,25 @@ packet.buffer[2] = 0; // zero the top byte Data sizeCommand(&packet, 3); - dev->BulkWrite(m_writeEp, sizeCommand); + dev->BulkWrite(m_writeEp, sizeCommand, timeout); } - dev->BulkWrite(m_writeEp, send); + dev->BulkWrite(m_writeEp, send, timeout); } void SocketZero::RawReceive(Data &receive, int timeout) { - do { - if( m_queue ) { - if( !m_queue->DefaultRead(receive, timeout) ) - throw Timeout("SocketZero::RawReceive: queue DefaultRead returned false (likely a timeout)"); - } - else { - m_dev->BulkRead(m_readEp, receive, timeout); - } - ddout("SocketZero::RawReceive: Endpoint " << m_readEp - << "\nReceived:\n" << receive); - } while( SequencePacket(receive) ); -} - -// -// SequencePacket -// -/// Returns true if this is a sequence packet that should be ignored. -/// This function is used in SocketZero::RawReceive() in order -/// to determine whether to keep reading or not. By default, -/// this function checks whether the packet is a sequence packet -/// or not, and returns true if so. Also, if it is a sequence -/// packet, it checks the validity of the sequence number. -/// -/// If sequence packets become important in the future, this -/// function could be changed to call a user-defined callback, -/// in order to handle these things out of band. -/// -bool SocketZero::SequencePacket(const Data &data) -{ - if( data.GetSize() >= MIN_PACKET_SIZE ) { - if( IS_COMMAND(data, SB_COMMAND_SEQUENCE_HANDSHAKE) ) { - CheckSequence(0, data); - return true; - } + if( m_queue ) { + if( !m_queue->DefaultRead(receive, timeout) ) + throw Timeout("SocketZero::RawReceive: queue DefaultRead returned false (likely a timeout)"); } - return false; // not a sequence packet + else { + m_dev->BulkRead(m_readEp, receive, timeout); + } + + ddout("SocketZero::RawReceive: Endpoint " + << (m_queue ? m_queue->GetReadEp() : m_readEp) + << "\nReceived:\n" << receive); } @@ -390,7 +367,12 @@ void SocketZero::Send(Barry::Packet &packet, int timeout) { - Send(packet.m_send, packet.m_receive, timeout); + Send(packet.m_send, *packet.m_receive, timeout); +} + +void SocketZero::Receive(Data &receive, int timeout) +{ + RawReceive(receive, timeout); } @@ -434,6 +416,14 @@ // starting fresh m_remainingTries = 0; + // this gets set to true if we see a starting sequence packet + // during any of our open and password commands... After + // a mode command (like "RIM Desktop", etc.) a starting + // sequence packet is sent, and may arrive before or after + // the socket open handshake. + m_modeSequencePacketSeen = false; + + // go for it! SendOpen(socket, receive); // check for password challenge, or success @@ -482,6 +472,22 @@ // fall through to success check... } + // If the device thinks that the socket was already open then + // it will tell us by sending an SB_COMMAND_CLOSE_SOCKET. + // + // This happens most commonly when using raw channels which + // haven't been cleanly closed (such as by killing the process + // running Barry) and so the device still thinks the socket + // is open. + // + // Retrying the open will usually succeed, but relies on the + // device software re-creating the channel after it's closed + // so return an error here instead of automatically retrying. + if( packet.Command() == SB_COMMAND_CLOSE_SOCKET ) + { + throw SocketCloseOnOpen("Socket: Device closed socket when trying to open (can be caused by the wrong password, or if the device thinks the socket is already open... please try again)"); + } + if( packet.Command() != SB_COMMAND_OPENED_SOCKET || packet.SocketResponse() != socket || packet.SocketSequence() != closeFlag ) @@ -490,8 +496,29 @@ throw Error("Socket: Bad OPENED packet in Open"); } + // if no sequence packet has yet arrived, wait for it here + if( !m_modeSequencePacketSeen ) { + Data sequence; + RawReceive(sequence); + if( !Protocol::IsSequencePacket(sequence) ) + throw Error("Could not find mode's starting sequence packet"); + } + // success! save the socket - return SocketHandle(new Socket(*this, socket, closeFlag)); + Socket *sock = new Socket(*this, socket, closeFlag); + SocketHandle sh(sock); + + // if we are running with a routing queue, register the + // socket's interest in all its own data. By default, this + // data will be queued without a callback handler. + // If other application code needs to intercept this with + // its own handler, it must call UnregisterInterest() and + // re-register its own handler. + if( m_queue ) { + sock->RegisterInterest(); + } + + return sh; } // @@ -531,8 +558,7 @@ } // starting fresh, reset sequence ID - Protocol::CheckSize(response); - if( IS_COMMAND(response, SB_COMMAND_SEQUENCE_HANDSHAKE) ) { + if( Protocol::IsSequencePacket(response) ) { CheckSequence(0, response); // still need our ACK @@ -541,7 +567,15 @@ Protocol::CheckSize(response, SB_SOCKET_PACKET_HEADER_SIZE); MAKE_PACKET(rpack, response); - if( rpack->command != SB_COMMAND_CLOSED_SOCKET || + // The reply will be SB_COMMAND_CLOSED_SOCKET if the device + // has closed the socket in response to our request. + // + // It's also possible for the reply to be + // SB_COMMAND_REMOTE_CLOSE_SOCKET if the device wanted to + // close the socket at the same time, such as if the channel + // API is being used by the device. + if( ( rpack->command != SB_COMMAND_CLOSED_SOCKET && + rpack->command != SB_COMMAND_REMOTE_CLOSE_SOCKET ) || btohs(rpack->u.socket.socket) != socket.GetSocket() || rpack->u.socket.sequence != socket.GetCloseFlag() ) { @@ -549,7 +583,19 @@ socket.ForceClosed(); eout("Packet:\n" << response); - throw Error("Socket: Bad CLOSED packet in Close"); + throw BadPacket(rpack->command, "Socket: Bad CLOSED packet in Close"); + } + + if( socket.IsResetOnClose() ) { + Data send, receive; + ZeroPacket reset_packet(send, receive); + reset_packet.Reset(); + + Send(reset_packet); + if( reset_packet.CommandResponse() != SB_COMMAND_RESET_REPLY ) { + throw BadPacket(reset_packet.CommandResponse(), + "Socket: Missing RESET_REPLY in Close"); + } } // // and finally, there always seems to be an extra read of @@ -568,224 +614,140 @@ - ////////////////////////////////////////////////////////////////////////////// -// Socket class - -Socket::Socket( SocketZero &zero, - uint16_t socket, - uint8_t closeFlag) - : m_zero(&zero) - , m_socket(socket) - , m_closeFlag(closeFlag) - , m_registered(false) -{ -} +// SocketBase class -Socket::~Socket() +SocketBase::~SocketBase() { - // trap exceptions in the destructor - try { - // a non-default socket has been opened, close it - Close(); - } - catch( std::runtime_error &re ) { - // do nothing... log it? - dout("Exception caught in ~Socket: " << re.what()); - } } - -//////////////////////////////////// -// Socket protected API - -void Socket::CheckSequence(const Data &seq) +void SocketBase::CheckSequence(const Data &seq) { - m_zero->CheckSequence(m_socket, seq); + // FIXME - needs implementation } -void Socket::ForceClosed() -{ - m_socket = 0; - m_closeFlag = 0; -} - - -//////////////////////////////////// -// Socket public API - -void Socket::Close() -{ - UnregisterInterest(); - m_zero->Close(*this); -} - - // -// Send +// DBFragSend // -/// Sends 'send' data to device, no receive. +/// Sends a fragmented Desktop / Database command packet. +/// Assumes that 'send' contains a valid packet, which may or may not +/// need fragmentation. If it does, fragmentation will be done +/// automatically. /// -/// \returns void -/// -/// \exception Usb::Error on underlying bus errors. -/// -void Socket::Send(Data &send, int timeout) +void SocketBase::DBFragSend(Data &send, int timeout) { - // force the socket number to this socket - if( send.GetSize() >= SB_PACKET_HEADER_SIZE ) { - MAKE_PACKETPTR_BUF(spack, send.GetBuffer()); - spack->socket = htobs(m_socket); + MAKE_PACKET(spack, send); + if( send.GetSize() < MIN_PACKET_SIZE || + (spack->command != SB_COMMAND_DB_DATA && + spack->command != SB_COMMAND_DB_DONE) ) + { + // we don't do that around here + eout("unknown send data in DBFragSend(): " << send); + throw std::logic_error("Socket: unknown send data in DBFragSend()"); } - m_zero->RawSend(send, timeout); + + if( send.GetSize() <= MAX_PACKET_SIZE ) { + // send non-fragmented + SyncSend(send, timeout); + } + else { + // send fragmented + unsigned int offset = 0; + Data outFrag; + + do { + offset = SocketZero::MakeNextFragment(send, outFrag, offset); + SyncSend(outFrag, timeout); + } while( offset > 0 ); + } + } // // Send // -/// Sends 'send' data to device, and waits for response. +/// SyncSends 'send' data to device, and waits for response. /// /// \returns void /// /// \exception Usb::Error on underlying bus errors. /// -void Socket::Send(Data &send, Data &receive, int timeout) +void SocketBase::Send(Data &send, Data &receive, int timeout) { - Send(send, timeout); + SyncSend(send, timeout); Receive(receive, timeout); } -void Socket::Send(Barry::Packet &packet, int timeout) +void SocketBase::Send(Barry::Packet &packet, int timeout) { - Send(packet.m_send, packet.m_receive, timeout); -} - -void Socket::Receive(Data &receive, int timeout) -{ - if( m_registered ) { - if( m_zero->m_queue ) { - if( !m_zero->m_queue->SocketRead(m_socket, receive, timeout) ) - throw Timeout("Socket::Receive: queue SocketRead returned false (likely a timeout)"); - } - else { - throw std::logic_error("NULL queue pointer in a registered socket read."); - } - } - else { - m_zero->RawReceive(receive, timeout); - } + Send(packet.m_send, *packet.m_receive, timeout); } // sends the send packet down to the device, fragmenting if // necessary, and returns the response in receive, defragmenting // if needed // Blocks until response received or timed out in Usb::Device -void Socket::Packet(Data &send, Data &receive, int timeout) +// +// This is primarily for Desktop Database packets... Javaloader +// packets use PacketData(). +// +void SocketBase::Packet(Data &send, Data &receive, int timeout) { -/* -// FIXME - this might be a good idea someday, or perhaps provide a wrapper -// function that forces the socket number to the correct current value, -// but putting it here means a copy on every packet. - - // force socket to our socket - Data send = sendorig; - Barry::Protocol::Packet *sspack = (Barry::Protocol::Packet *)send.GetBuffer(2); - sspack->socket = htobs(GetSocket()); -*/ - - MAKE_PACKET(spack, send); - if( send.GetSize() < MIN_PACKET_SIZE || - (spack->command != SB_COMMAND_DB_DATA && - spack->command != SB_COMMAND_DB_DONE) ) - { - // we don't do that around here - throw std::logic_error("Socket: unknown send data in Packet()"); - } - - Data inFrag; + // assume the common case of no fragmentation, + // and use the receive buffer for input... allocate a frag buffer + // later if necessary + Data *inputBuf = &receive; receive.Zap(); - if( send.GetSize() <= MAX_PACKET_SIZE ) { - // send non-fragmented - Send(send, inFrag, timeout); - } - else { - // send fragmented - unsigned int offset = 0; - Data outFrag; - - do { - offset = SocketZero::MakeNextFragment(send, outFrag, offset); - Send(outFrag, inFrag, timeout); - - MAKE_PACKET(rpack, inFrag); - // only process sequence handshakes... once we - // get to the last fragment, we fall through to normal - // processing below - if( offset && inFrag.GetSize() > 0 ) { - - Protocol::CheckSize(inFrag); - - switch( rpack->command ) - { - case SB_COMMAND_SEQUENCE_HANDSHAKE: - CheckSequence(inFrag); - break; - - default: { - std::ostringstream oss; - oss << "Socket: unhandled packet in Packet() (send): 0x" << std::hex << (unsigned int)rpack->command; - eout(oss.str()); - throw Error(oss.str()); - } - break; - } - } - - - } while( offset > 0 ); - } + DBFragSend(send, timeout); + Receive(*inputBuf, timeout); + std::auto_ptr inFrag; bool done = false, frag = false; int blankCount = 0; while( !done ) { - MAKE_PACKET(rpack, inFrag); + MAKE_PACKET(rpack, *inputBuf); // check the packet's validity - if( inFrag.GetSize() > 0 ) { + if( inputBuf->GetSize() > 0 ) { blankCount = 0; - Protocol::CheckSize(inFrag); + Protocol::CheckSize(*inputBuf, SB_PACKET_HEADER_SIZE); switch( rpack->command ) { case SB_COMMAND_SEQUENCE_HANDSHAKE: - CheckSequence(inFrag); + CheckSequence(*inputBuf); break; case SB_COMMAND_DB_DATA: if( frag ) { - SocketZero::AppendFragment(receive, inFrag); + SocketZero::AppendFragment(receive, *inputBuf); } else { - receive = inFrag; + // no copy needed, already in receive, + // since inputBuf starts out that way } done = true; break; case SB_COMMAND_DB_FRAGMENTED: - SocketZero::AppendFragment(receive, inFrag); + // only copy if frag is true, since the + // first time through, receive == inputBuf + if( frag ) { + SocketZero::AppendFragment(receive, *inputBuf); + } frag = true; break; case SB_COMMAND_DB_DONE: - receive = inFrag; + // no copy needed, already in receive done = true; break; default: { std::ostringstream oss; - oss << "Socket: unhandled packet in Packet() (read): 0x" << std::hex << (unsigned int)rpack->command; + oss << "Socket: (read) unhandled packet in Packet(): 0x" << std::hex << (unsigned int)rpack->command; eout(oss.str()); throw Error(oss.str()); } @@ -803,21 +765,191 @@ } if( !done ) { + // not done yet, ask for another read, and + // create new buffer for fragmented reads + if( frag && !inFrag.get() ) { + inFrag.reset( new Data ); + inputBuf = inFrag.get(); + } + Receive(*inputBuf); + } + } +} + +void SocketBase::Packet(Barry::Packet &packet, int timeout) +{ + Packet(packet.m_send, *packet.m_receive, timeout); +} + +void SocketBase::Packet(Barry::JLPacket &packet, int timeout) +{ + if( packet.HasData() ) { + SyncSend(packet.m_cmd); + PacketData(packet.m_data, *packet.m_receive, false, timeout); + } + else { + PacketData(packet.m_cmd, *packet.m_receive, false, timeout); + } +} + +void SocketBase::Packet(Barry::JVMPacket &packet, int timeout) +{ + PacketJVM(packet.m_cmd, *packet.m_receive, timeout); +} + +// sends the send packet down to the device +// Blocks until response received or timed out in Usb::Device +// +// This function is used to send packet to JVM +void SocketBase::PacketJVM(Data &send, Data &receive, int timeout) +{ + if( ( send.GetSize() < MIN_PACKET_DATA_SIZE ) || + ( send.GetSize() > MAX_PACKET_DATA_SIZE ) ) { + // we don't do that around here + throw std::logic_error("Socket: unknown send data in PacketJVM()"); + } + + Data &inFrag = receive; + receive.Zap(); + + // send non-fragmented + RawSend(send, timeout); + Receive(inFrag, timeout); + + bool done = false; + int blankCount = 0; + + while( !done ) { + // check the packet's validity + if( inFrag.GetSize() > 6 ) { + MAKE_PACKET(rpack, inFrag); + + blankCount = 0; + + Protocol::CheckSize(inFrag, SB_PACKET_HEADER_SIZE); + + switch( rpack->command ) + { + case SB_COMMAND_SEQUENCE_HANDSHAKE: + CheckSequence(inFrag); + break; + + default: { + std::ostringstream oss; + oss << "Socket: (read) unhandled packet in Packet(): 0x" << std::hex << (unsigned int)rpack->command; + eout(oss.str()); + throw Error(oss.str()); + } + break; + } + } + else if( inFrag.GetSize() == 6 ) { + done = true; + } + else { + blankCount++; + + //std::cerr << "Blank! " << blankCount << std::endl; + if( blankCount == 10 ) { + // only ask for more data on stalled sockets + // for so long + throw Error("Socket: 10 blank packets received"); + } + } + + if( !done ) { // not done yet, ask for another read - Receive(inFrag); + Receive(inFrag, timeout); } } } -void Socket::Packet(Barry::Packet &packet, int timeout) +// sends the send packet down to the device +// Blocks until response received or timed out in Usb::Device +void SocketBase::PacketData(Data &send, + Data &receive, + bool done_on_sequence, + int timeout) { - Packet(packet.m_send, packet.m_receive, timeout); + if( ( send.GetSize() < MIN_PACKET_DATA_SIZE ) || + ( send.GetSize() > MAX_PACKET_DATA_SIZE ) ) { + // we don't do that around here + throw std::logic_error("Socket: unknown send data in PacketData()"); + } + + Data &inFrag = receive; + receive.Zap(); + + // send non-fragmented + SyncSend(send, timeout); + Receive(inFrag, timeout); + + bool done = false; + int blankCount = 0; + + while( !done ) { + // check the packet's validity + if( inFrag.GetSize() > 0 ) { + MAKE_PACKET(rpack, inFrag); + + blankCount = 0; + + Protocol::CheckSize(inFrag, SB_PACKET_HEADER_SIZE); + + switch( rpack->command ) + { + case SB_COMMAND_SEQUENCE_HANDSHAKE: +// CheckSequence(inFrag); + if( done_on_sequence ) + done = true; + break; + + case SB_COMMAND_JL_READY: + case SB_COMMAND_JL_ACK: + case SB_COMMAND_JL_HELLO_ACK: + case SB_COMMAND_JL_RESET_REQUIRED: + done = true; + break; + + case SB_COMMAND_JL_GET_DATA_ENTRY: // This response means that the next packet is the stream + done = true; + break; + + case SB_DATA_JL_INVALID: + throw BadPacket(rpack->command, "file is not a valid Java code file"); + break; + + case SB_COMMAND_JL_NOT_SUPPORTED: + throw BadPacket(rpack->command, "device does not support requested command"); + break; + + default: + // unknown packet, pass it up to the + // next higher code layer + done = true; + break; + } + } + else { + blankCount++; + //std::cerr << "Blank! " << blankCount << std::endl; + if( blankCount == 10 ) { + // only ask for more data on stalled sockets + // for so long + throw Error("Socket: 10 blank packets received"); + } + } + + if( !done ) { + // not done yet, ask for another read + Receive(inFrag); + } + } } -void Socket::NextRecord(Data &receive) +void SocketBase::NextRecord(Data &receive) { Barry::Protocol::Packet packet; - packet.socket = htobs(GetSocket()); packet.size = htobs(7); packet.command = SB_COMMAND_DB_DONE; packet.u.db.tableCmd = 0; @@ -827,8 +959,105 @@ Packet(command, receive); } -void Socket::RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, - void *context) + + +////////////////////////////////////////////////////////////////////////////// +// Socket class + +Socket::Socket( SocketZero &zero, + uint16_t socket, + uint8_t closeFlag) + : m_zero(&zero) + , m_socket(socket) + , m_closeFlag(closeFlag) + , m_registered(false) + , m_sequence(new Data) +{ +} + +Socket::~Socket() +{ + // trap exceptions in the destructor + try { + // a non-default socket has been opened, close it + Close(); + } + catch( std::runtime_error &re ) { + // do nothing... log it? + dout("Exception caught in ~Socket: " << re.what()); + } +} + + +//////////////////////////////////// +// Socket protected API + +void Socket::ForceClosed() +{ + m_socket = 0; + m_closeFlag = 0; +} + + +//////////////////////////////////// +// Socket public API + +void Socket::Close() +{ + UnregisterInterest(); + m_zero->Close(*this); +} + + +// +// Send +// +/// Sends 'send' data to device, no receive. +/// +/// \returns void +/// +/// \exception Usb::Error on underlying bus errors. +/// +void Socket::RawSend(Data &send, int timeout) +{ + // force the socket number to this socket + if( send.GetSize() >= SB_PACKET_HEADER_SIZE ) { + MAKE_PACKETPTR_BUF(spack, send.GetBuffer()); + spack->socket = htobs(m_socket); + } + m_zero->RawSend(send, timeout); +} + +void Socket::SyncSend(Data &send, int timeout) +{ + RawSend(send, timeout); + Receive(*m_sequence, timeout); + if( !Protocol::IsSequencePacket(*m_sequence) ) + throw Barry::Error("Non-sequence packet in Socket::SyncSend()"); + CheckSequence(*m_sequence); +} + +void Socket::Receive(Data &receive, int timeout) +{ + if( m_registered ) { + if( m_zero->m_queue ) { + if( !m_zero->m_queue->SocketRead(m_socket, receive, timeout) ) + throw Timeout("Socket::Receive: queue SocketRead returned false (likely a timeout)"); + } + else { + throw std::logic_error("NULL queue pointer in a registered socket read."); + } + ddout("Socket::Receive: Endpoint " + << (m_zero->m_queue ? m_zero->m_queue->GetReadEp() : m_zero->m_readEp) + << "\nReceived:\n" << receive); + } + else { + m_zero->RawReceive(receive, timeout); + } +} + + +void Socket::RegisterInterest(SocketRoutingQueue::SocketDataHandlerPtr handler) { if( !m_zero->m_queue ) throw std::logic_error("SocketRoutingQueue required in SocketZero in order to call Socket::RegisterInterest()"); @@ -836,7 +1065,7 @@ if( m_registered ) throw std::logic_error("Socket already registered in Socket::RegisterInterest()!"); - m_zero->m_queue->RegisterInterest(m_socket, handler, context); + m_zero->m_queue->RegisterInterest(m_socket, handler); m_registered = true; } diff -Nru barry-0.14/src/socket.h barry-0.0.20110506/src/socket.h --- barry-0.14/src/socket.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/socket.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -33,16 +33,20 @@ namespace Barry { class Data; class Packet; + class JLPacket; + class JVMPacket; class SocketRoutingQueue; } namespace Barry { +class SocketBase; class Socket; -typedef std::auto_ptr SocketHandle; +typedef std::auto_ptr SocketHandle; class BXEXPORT SocketZero { + friend class SocketBase; friend class Socket; Usb::Device *m_dev; @@ -56,6 +60,7 @@ bool m_halfOpen; uint32_t m_challengeSeed; unsigned int m_remainingTries; + bool m_modeSequencePacketSeen; private: static void AppendFragment(Data &whole, const Data &fragment); @@ -72,7 +77,7 @@ void RawReceive(Data &receive, int timeout = -1); protected: - bool SequencePacket(const Data &data); + bool IsSequencePacketHidden() { return false; } public: explicit SocketZero(SocketRoutingQueue &queue, int writeEndpoint, @@ -94,13 +99,77 @@ void Send(Data &send, int timeout = -1); // send only void Send(Data &send, Data &receive, int timeout = -1); // send+recv void Send(Barry::Packet &packet, int timeout = -1); -// void Receive(Data &receive, int timeout = -1); + void Receive(Data &receive, int timeout = -1); // Opens a new socket and returns a Socket object to manage it SocketHandle Open(uint16_t socket, const char *password = 0); void Close(Socket &socket); }; +class BXEXPORT SocketBase +{ + bool m_resetOnClose; + +protected: + void CheckSequence(const Data &seq); + +public: + SocketBase() + : m_resetOnClose(false) + { + } + + virtual ~SocketBase(); + + // + // Virtual Socket API + // + virtual void Close() = 0; + + // FIXME - do I need RawSend? Or just a good fragmenter? + virtual void RawSend(Data &send, int timeout = -1) = 0; + virtual void SyncSend(Data &send, int timeout = -1) = 0; + virtual void Receive(Data &receive, int timeout = -1) = 0; + + virtual void RegisterInterest(Barry::SocketRoutingQueue::SocketDataHandlerPtr handler = Barry::SocketRoutingQueue::SocketDataHandlerPtr()) = 0; + virtual void UnregisterInterest() = 0; + + void ResetOnClose(bool reset = true) { m_resetOnClose = reset; } + bool IsResetOnClose() const { return m_resetOnClose; } + + // + // Convenience functions that just call the virtuals above + // + void DBFragSend(Data &send, int timeout = -1); + void Send(Data &send, Data &receive, int timeout = -1); + void Send(Barry::Packet &packet, int timeout = -1); + + // + // Protocol based functions... all use the above virtual functions + // + + // sends the send packet down to the device, fragmenting if + // necessary, and returns the response in receive, defragmenting + // if needed + // Blocks until response received or timed out in Usb::Device + void Packet(Data &send, Data &receive, int timeout = -1); + void Packet(Barry::Packet &packet, int timeout = -1); + void Packet(Barry::JLPacket &packet, int timeout = -1); + void Packet(Barry::JVMPacket &packet, int timeout = -1); + + // Use this function to send packet to JVM instead of Packet function + // FIXME + void PacketJVM(Data &send, Data &receive, int timeout = -1); + + // Use this function to send data packet instead of Packet function + // Indeed, Packet function is used to send command (and not data) + // FIXME + void PacketData(Data &send, Data &receive, bool done_on_sequence, + int timeout = -1); + + // some handy wrappers for the Packet() interface + void NextRecord(Data &receive); +}; // // Socket class @@ -116,7 +185,7 @@ /// /// Requires an active Usb::Device object to work on. /// -class BXEXPORT Socket +class BXEXPORT Socket : public SocketBase { friend class SocketZero; @@ -126,44 +195,36 @@ bool m_registered; + // buffer data + std::auto_ptr m_sequence; + protected: - void CheckSequence(const Data &seq); void ForceClosed(); + uint16_t GetSocket() const { return m_socket; } + uint8_t GetCloseFlag() const { return m_closeFlag; } + Socket(SocketZero &zero, uint16_t socket, uint8_t closeFlag); public: ~Socket(); - uint16_t GetSocket() const { return m_socket; } - uint8_t GetCloseFlag() const { return m_closeFlag; } - + // + // virtual overrides + // void Close(); - - // Send and Receive are available before Open... - // an unopened socket defaults to socket 0, which you need - // in order to set the blackberry mode - // The send function will overwrite the zeroSocketSequence byte - // *inside* the packet, if the current m_socket is 0. - void Send(Data &send, int timeout = -1); // send only - void Send(Data &send, Data &receive, int timeout = -1); // send+recv - void Send(Barry::Packet &packet, int timeout = -1); + void RawSend(Data &send, int timeout = -1); + void SyncSend(Data &send, int timeout = -1); void Receive(Data &receive, int timeout = -1); - // sends the send packet down to the device, fragmenting if - // necessary, and returns the response in receive, defragmenting - // if needed - // Blocks until response received or timed out in Usb::Device - void Packet(Data &send, Data &receive, int timeout = -1); - void Packet(Barry::Packet &packet, int timeout = -1); - - // some handy wrappers for the Packet() interface - void NextRecord(Data &receive); // Register a callback for incoming data from the device. // This function assumes that this socket is based on a socketZero // that has a SocketRoutingQueue, otherwise throws logic_error. - void RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, void *context); + // It also assumes that nothing has been registered before. + // If you wish to re-register, call UnregisterInterest() first, + // which is safe to call as many times as you like. + void RegisterInterest(Barry::SocketRoutingQueue::SocketDataHandlerPtr handler = Barry::SocketRoutingQueue::SocketDataHandlerPtr()); void UnregisterInterest(); }; diff -Nru barry-0.14/src/strnlen.c barry-0.0.20110506/src/strnlen.c --- barry-0.14/src/strnlen.c 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/strnlen.c 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 diff -Nru barry-0.14/src/strnlen.h barry-0.0.20110506/src/strnlen.h --- barry-0.14/src/strnlen.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/strnlen.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -22,9 +22,13 @@ #ifndef __BARRY_STRNLEN_H__ #define __BARRY_STRNLEN_H__ -#include "config.h" +#include "config.h" // strnlen.h is not installed, so this is safe #include +#ifdef WIN32 +#define HAVE_WORKING_STRNLEN 1 +#endif + // this is always defined by configure, if not, then the autoconf // sources changed (likely in /usr/share/autoconf/autoconf/functions.m4) // and configure.ac is no longer accurate diff -Nru barry-0.14/src/tarfile.cc barry-0.0.20110506/src/tarfile.cc --- barry-0.14/src/tarfile.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/tarfile.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,334 @@ +/// +/// \file tarfile.cc +/// API for reading and writing sequentially from compressed +/// tar files. + +/* + Copyright (C) 2007-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "tarfile.h" +#include "data.h" + +#include +#include +#include +#include + +namespace reuse { + +TarFile::TarFile(const char *filename, + bool create, + tartype_t *compress_ops, + bool always_throw) + : m_tar(0), + m_throw(always_throw), + m_writemode(create) +{ + // figure out how to handle the file flags/modes + int flags = 0; + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + + if( m_writemode ) { + flags = O_WRONLY | O_CREAT | O_EXCL; + } + else { + flags = O_RDONLY; + } + + // open... throw on error, as we are in the constructor + if( tar_open(&m_tar, const_cast(filename), + compress_ops, flags, mode, TAR_VERBOSE | TAR_GNU) == -1 ) { + throw TarError(std::string("Unable to open tar file: ") + strerror(errno)); + } +} + +TarFile::~TarFile() +{ + try { + Close(); + } catch( TarError &te ) {} +} + +bool TarFile::False(const char *msg) +{ + m_last_error = msg; + if( m_throw ) + throw TarError(msg); + else + return false; +} + +bool TarFile::False(const std::string &msg, int err) +{ + std::string str = msg; + str += ": "; + str += strerror(err); + return False(str); +} + +bool TarFile::Close() +{ + if( m_tar ) { + if( m_writemode ) { + if( tar_append_eof(m_tar) != 0 ) + return False("Unable to write eof", errno); + } + + if( tar_close(m_tar) != 0 ) { + return False("Unable to close file", errno); + } + m_tar = 0; + } + return true; +} + +/// Appends a new file to the current tarfile, using tarpath as +/// its internal filename, and data as the complete file contents. +/// Uses current date and time as file mtime. +bool TarFile::AppendFile(const char *tarpath, const std::string &data) +{ + // write standard file header + th_set_type(m_tar, REGTYPE); + th_set_mode(m_tar, 0644); + th_set_path(m_tar, const_cast(tarpath)); + th_set_user(m_tar, 0); + th_set_group(m_tar, 0); + th_set_size(m_tar, data.size()); + th_set_mtime(m_tar, time(NULL)); + if( th_write(m_tar) != 0 ) { + return False("Unable to write tar header", errno); + } + + // write the data in blocks until finished + char block[T_BLOCKSIZE]; + for( size_t pos = 0; pos < data.size(); pos += T_BLOCKSIZE ) { + memset(block, 0, T_BLOCKSIZE); + + size_t size = T_BLOCKSIZE; + if( data.size() - pos < T_BLOCKSIZE ) + size = data.size() - pos; + + memcpy(block, data.data() + pos, size); + + if( tar_block_write(m_tar, block) != T_BLOCKSIZE ) { + return False("Unable to write block", errno); + } + } + + return true; +} + +/// Reads next available file into data, filling tarpath with +/// internal filename from tarball. +bool TarFile::ReadNextFile(std::string &tarpath, std::string &data) +{ + // start fresh + tarpath.clear(); + data.clear(); + + // read next tar file header... skip all directories + do { + if( th_read(m_tar) != 0 ) { + // this is not necessarily an error, as it could just + // be the end of file, so a simple false is good here, + // don't throw an exception + m_last_error = ""; + return false; + } + } while( TH_ISDIR(m_tar) ); + + // write standard file header + if( !TH_ISREG(m_tar) ) { + return False("Only regular files are supported inside a tarball."); + } + + char *pathname = th_get_pathname(m_tar); + tarpath = pathname; + // + // FIXME (leak) - someday, when all distros use a patched version of + // libtar, we may be able to avoid this memory leak, but + // th_get_pathname() does not consistently return a user-freeable + // string on all distros. + // + // See the following links for more information: + // https://bugs.launchpad.net/ubuntu/+source/libtar/+bug/41804 + // https://lists.feep.net:8080/pipermail/libtar/2006-April/000222.html + // +// free(pathname); + size_t size = th_get_size(m_tar); + + // read the data in blocks until finished + char block[T_BLOCKSIZE]; + for( size_t pos = 0; pos < size; pos += T_BLOCKSIZE ) { + memset(block, 0, T_BLOCKSIZE); + + size_t readsize = T_BLOCKSIZE; + if( size - pos < T_BLOCKSIZE ) + readsize = size - pos; + + if( tar_block_read(m_tar, block) != T_BLOCKSIZE ) { + return False("Unable to read block", errno); + } + + data.append(block, readsize); + } + + return true; +} + +// FIXME - yes, this is blatant copying of code, but this is +// specific to Barry, to use a Barry::Data object instead of std::string +// in order to reduce copies. +bool TarFile::ReadNextFile(std::string &tarpath, Barry::Data &data) +{ + // start fresh + tarpath.clear(); + data.QuickZap(); + + // read next tar file header... skip all directories + do { + if( th_read(m_tar) != 0 ) { + // this is not necessarily an error, as it could just + // be the end of file, so a simple false is good here, + // don't throw an exception + m_last_error = ""; + return false; + } + } while( TH_ISDIR(m_tar) ); + + // write standard file header + if( !TH_ISREG(m_tar) ) { + return False("Only regular files are supported inside a tarball."); + } + + char *pathname = th_get_pathname(m_tar); + tarpath = pathname; + // + // FIXME (leak) - someday, when all distros use a patched version of + // libtar, we may be able to avoid this memory leak, but + // th_get_pathname() does not consistently return a user-freeable + // string on all distros. + // + // See the following links for more information: + // https://bugs.launchpad.net/ubuntu/+source/libtar/+bug/41804 + // https://lists.feep.net:8080/pipermail/libtar/2006-April/000222.html + // +// free(pathname); + size_t size = th_get_size(m_tar); + + // read the data in blocks until finished + char block[T_BLOCKSIZE]; + for( size_t pos = 0; pos < size; pos += T_BLOCKSIZE ) { + memset(block, 0, T_BLOCKSIZE); + + size_t readsize = T_BLOCKSIZE; + if( size - pos < T_BLOCKSIZE ) + readsize = size - pos; + + if( tar_block_read(m_tar, block) != T_BLOCKSIZE ) { + return False("Unable to read block", errno); + } + + data.Append(block, readsize); + } + + return true; +} + +/// Read next available filename, skipping the data if it is +/// a regular file +bool TarFile::ReadNextFilenameOnly(std::string &tarpath) +{ + // start fresh + tarpath.clear(); + + // read next tar file header... skip all directories + do { + if( th_read(m_tar) != 0 ) { + // this is not necessarily an error, as it could just + // be the end of file, so a simple false is good here, + // don't throw an exception + m_last_error = ""; + return false; + } + } while( TH_ISDIR(m_tar) ); + + // write standard file header + if( !TH_ISREG(m_tar) ) { + return False("Only regular files are supported inside a tarball."); + } + + char *pathname = th_get_pathname(m_tar); + tarpath = pathname; + // See above FIXME (leak) comment +// free(pathname); + + if( tar_skip_regfile(m_tar) != 0 ) { + return False("Unable to skip tar file", errno); + } + + return true; +} + + +} // namespace reuse + + +#ifdef __TEST_MODE__ + +#include +#include + +using namespace std; + +int main() +{ + try { + cout << "Writing test file..." << endl; + reuse::TarFile output("tartest.tar.gz", true, true, true); + std::string data; + for( int i = 0; i < 60; i++ ) { + data.append("0123456789", 10); + } + + output.AppendFile("path1/test1.txt", data); + output.AppendFile("path2/test2.txt", data); + output.Close(); + + + cout << "Reading test file..." << endl; + reuse::TarFile input("tartest.tar.gz", false, true, true); + std::string path, incoming; + + while( input.ReadNextFile(path, incoming) ) { + cout << "Read: " << path + << " Data: " + << (( data == incoming ) ? "equal" : "different") + << endl; + } + + input.Close(); + + unlink("tartest.tar.gz"); + + } catch( reuse::TarFile::TarError &te ) { + cerr << te.what() << endl; + return 1; + } +} + +#endif + diff -Nru barry-0.14/src/tarfile.h barry-0.0.20110506/src/tarfile.h --- barry-0.14/src/tarfile.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/tarfile.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,91 @@ +/// +/// \file tarfile.h +/// API for reading and writing sequentially from compressed +/// tar files. + +/* + Copyright (C) 2007-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __REUSE_TARFILE_H__ +#define __REUSE_TARFILE_H__ + +#include "dll.h" +#include +#include +#include + +namespace Barry { + class Data; +} + +namespace reuse { + +// +// Compression options... more op sets can be added based on +// threading needs, or threading library support. +// + +/// Compression op set for zlib, non-threadsafe. +extern tartype_t gztar_ops_nonthread; + +class BXLOCAL TarFile +{ + TAR *m_tar; + bool m_throw; + bool m_writemode; + std::string m_last_error; + +private: + bool False(const char *msg); + bool False(const std::string &str) { return False(str.c_str()); } + bool False(const std::string &msg, int err); + +public: + class TarError : public std::runtime_error + { + public: + TarError(const std::string &msg) : std::runtime_error(msg) {} + }; + +public: + explicit TarFile(const char *filename, bool write = false, + tartype_t *compress_ops = 0, bool always_throw = false); + ~TarFile(); + + const std::string& get_last_error() const { return m_last_error; } + + bool Close(); + + /// Appends a new file to the current tarfile, using tarpath as + /// its internal filename, and data as the complete file contents. + /// Uses current date and time as file mtime. + bool AppendFile(const char *tarpath, const std::string &data); + + /// Reads next available file into data, filling tarpath with + /// internal filename from tarball. + /// Returns false on end of archive. + bool ReadNextFile(std::string &tarpath, std::string &data); + bool ReadNextFile(std::string &tarpath, Barry::Data &data); + + /// Read next available filename, skipping the data if it is + /// a regular file + bool ReadNextFilenameOnly(std::string &tarpath); +}; + +} + +#endif + diff -Nru barry-0.14/src/tarfile-ops-nt.cc barry-0.0.20110506/src/tarfile-ops-nt.cc --- barry-0.14/src/tarfile-ops-nt.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/tarfile-ops-nt.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,112 @@ +/// +/// \file tarfile-ops-nt.cc +/// Non-thread safe operation functions for a libtar-compatible +/// zlib compression interface. + +/* + Copyright (C) 2007-2011, Chris Frey + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "tarfile.h" + +#include +#include +#include +#include + +#include + +#include + +namespace reuse { + +namespace gztar_nonthread { + + namespace { + // array of compressed file handles... needed for architectures + // where sizeof(int) != sizeof(gzFile) + gzFile *gzHandles = 0; + unsigned int gzArraySize = 0; + } + + int open_compressed(const char *file, int flags, mode_t mode) + { + unsigned int index = 0; + for( ; index < gzArraySize; index++ ) { + if( gzHandles[index] == 0 ) + break; + } + if( index >= gzArraySize ) { + gzFile *h = (gzFile*) realloc(gzHandles, + (gzArraySize + 100) * sizeof(gzFile)); + if( h ) { + gzHandles = h; + gzArraySize += 100; + } + else { + return -1; + } + } + + int fd = open(file, flags, mode); + if( fd == -1 ) + return -1; + + gzFile gfd = gzdopen(fd, (flags & O_WRONLY) ? "wb9" : "rb"); + if( gfd == NULL ) { + close(fd); + return -1; + } + + gzHandles[index] = gfd; + return index; + } + + int close_compressed(int fd) + { + unsigned int ufd = fd; + assert( ufd < gzArraySize ); + int ret = gzclose(gzHandles[ufd]); + gzHandles[ufd] = 0; + return ret; + } + + ssize_t read_compressed(int fd, void *buf, size_t size) + { + unsigned int ufd = fd; + assert( ufd < gzArraySize ); + return gzread(gzHandles[ufd], buf, size); + } + + ssize_t write_compressed(int fd, const void *buf, size_t size) + { + unsigned int ufd = fd; + assert( ufd < gzArraySize ); + return gzwrite(gzHandles[ufd], buf, size); + } + +} // namespace gztar_nonthread + + +tartype_t gztar_ops_nonthread = { + (openfunc_t) gztar_nonthread::open_compressed, + gztar_nonthread::close_compressed, + gztar_nonthread::read_compressed, + gztar_nonthread::write_compressed +}; + + +} // namespace reuse + diff -Nru barry-0.14/src/threadwrap.cc barry-0.0.20110506/src/threadwrap.cc --- barry-0.14/src/threadwrap.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/threadwrap.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,52 @@ +/// +/// \file threadwrap.cc +/// RAII Wrapper for a single thread. +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "threadwrap.h" +#include "error.h" + + +namespace Barry { + +Thread::Thread(int socket, void *(*callback)(void *data), void *data) +{ + int ret = pthread_create(&thread, NULL, callback, data); + if( ret ) { + throw Barry::ErrnoError("Thread: pthread_create failed.", ret); + } +} + + +Thread::~Thread() +{ + pthread_join(thread, NULL); +} + + +void Thread::Dispose() +{ + int ret = pthread_cancel(thread); + if( ret ) { + throw Barry::ErrnoError("Thread: pthread_cancel failed.", ret); + } +} + +} // namespace Barry + diff -Nru barry-0.14/src/threadwrap.h barry-0.0.20110506/src/threadwrap.h --- barry-0.14/src/threadwrap.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/threadwrap.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,45 @@ +/// +/// \file threadwrap.h +/// RAII Wrapper for a single thread. +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_THREADWRAP_H__ +#define __BARRY_THREADWRAP_H__ + +#include "dll.h" +#include + +namespace Barry { + +class BXEXPORT Thread +{ +private: + pthread_t thread; + +public: + Thread(int socket, void *(*callback)(void *data), void *data); + ~Thread(); + + void Dispose(); +}; + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/time.cc barry-0.0.20110506/src/time.cc --- barry-0.14/src/time.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/time.cc 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,6 +24,7 @@ #include "time.h" #include "endian.h" #include "debug.h" +#include "platform.h" namespace Barry { @@ -180,14 +181,14 @@ /// the year. /// /// FIXME This function assumes the year hasn't changed, -/// but I don't have enough information to determine +/// but I don't have enough information to determine /// where the year is in this header info -/// +/// time_t DayToDate( unsigned short Day ) { struct tm *now, then; time_t t = time( NULL ); - + now = localtime( &t ); // need this to get year // set to Jan 1 midnight, this year; then.tm_sec = 0; @@ -200,7 +201,7 @@ t = mktime(&then); t -= 60*60; // need to subract an hour t += Day * 24 * 60 * 60; // Add the day converted to seconds - + return t; } @@ -227,6 +228,38 @@ return result; } +// +// ThreadTimeout +// +/// Creates a pthread_cond_timedwait() compatible timespec struct, +/// based on a given timeout in milliseconds. Note that the resulting +/// timespec is time-sensitive: the 'timer' starts as soon as this function +/// returns, since timespec is a specific time in the future, +/// and ThreadTimeout() calculates it based on the current time. +/// +/// Returns the spec pointer, to make it easy to use with +/// pthread_cond_timedwait() +/// +BXEXPORT struct timespec* ThreadTimeout(int timeout_ms, struct timespec *spec) +{ +#ifndef WIN32 + struct timeval now; + gettimeofday(&now, NULL); + + spec->tv_sec = now.tv_sec + timeout_ms / 1000; + spec->tv_nsec = (now.tv_usec + timeout_ms % 1000 * 1000) * 1000; +#else + SYSTEMTIME now; + GetSystemTime(&now); + + spec->tv_sec = now.wSecond + timeout_ms / 1000; + spec->tv_nsec = (now.wMilliseconds + timeout_ms) * 1000; +#endif + + return spec; +} + + } // namespace Barry diff -Nru barry-0.14/src/time.h barry-0.0.20110506/src/time.h --- barry-0.14/src/time.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/time.h 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -25,6 +25,7 @@ #define __BARRY_TIME_H__ #include "dll.h" +#include // for struct timespec #include #include @@ -69,11 +70,14 @@ BXEXPORT const TimeZone* GetTimeZone(unsigned short Code); BXEXPORT unsigned short GetTimeZoneCode(signed short HourOffset, signed short MinOffset = 0); - + // Message time conversion stuff BXEXPORT time_t DayToDate( unsigned short Day ); BXEXPORT time_t Message2Time(uint16_t r_date, uint16_t r_time); +// Thread timeout creation +BXEXPORT struct timespec* ThreadTimeout(int timeout_ms, struct timespec *spec); + } // namespace Barry #endif diff -Nru barry-0.14/src/trim.h barry-0.0.20110506/src/trim.h --- barry-0.14/src/trim.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/trim.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,36 @@ +// Found at: +// http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring + +// Note that these functions trim the same arguments passed in, and do not +// make copies. + +#ifndef __BARRY_TRIM_H__ +#define __BARRY_TRIM_H__ + +#include +#include +#include + +namespace Barry { namespace Inplace { + +// trim from start +static inline std::string <rim(std::string &s) { + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(std::isspace)))); + return s; +} + +// trim from end +static inline std::string &rtrim(std::string &s) { + s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(std::isspace))).base(), s.end()); + return s; +} + +// trim from both ends +static inline std::string &trim(std::string &s) { + return ltrim(rtrim(s)); +} + +}} // namespace Barry::Inplace + +#endif + diff -Nru barry-0.14/src/tzwrapper.cc barry-0.0.20110506/src/tzwrapper.cc --- barry-0.14/src/tzwrapper.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/tzwrapper.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,287 @@ +/// +/// \file tzwrapper.cc +/// Timezone adjustment class, wrapping the TZ environment +/// variable to make struct tm -> time_t conversions easier. +/// + +/* + Copyright (C) 2010-2011, Chris Frey , To God be the glory + Released to the public domain. + Included in Barry and Barrified the namespace July 2010 +*/ + +#include "tzwrapper.h" +#include +#include +#include + +using namespace std; + +namespace Barry { namespace Sync { + +time_t utc_mktime(struct tm *utctime) +{ + time_t result; + struct tm tmp, check; + + // loop, converting "local time" to time_t and back to utc tm, + // and adjusting until there are no differences... this + // automatically takes care of DST issues. + + // do first conversion + tmp = *utctime; + tmp.tm_isdst = -1; + result = mktime(&tmp); + if( result == (time_t)-1 ) + return (time_t)-1; + if( gmtime_r(&result, &check) == NULL ) + return (time_t)-1; + + // loop until match + while( check.tm_year != utctime->tm_year || + check.tm_mon != utctime->tm_mon || + check.tm_mday != utctime->tm_mday || + check.tm_hour != utctime->tm_hour || + check.tm_min != utctime->tm_min ) + { + tmp.tm_min += utctime->tm_min - check.tm_min; + tmp.tm_hour += utctime->tm_hour - check.tm_hour; + tmp.tm_mday += utctime->tm_mday - check.tm_mday; + tmp.tm_year += utctime->tm_year - check.tm_year; + tmp.tm_isdst = -1; + + result = mktime(&tmp); + if( result == (time_t)-1 ) + return (time_t)-1; + gmtime_r(&result, &check); + if( gmtime_r(&result, &check) == NULL ) + return (time_t)-1; + } + + return result; +} + +struct tm* iso_to_tm(const char *timestamp, + struct tm *result, + bool &utc, + bool *zone, + int *zoneminutes) +{ + memset(result, 0, sizeof(struct tm)); + + // handle YYYY-MM-DDTHH:MM:SS.uuu-HH:MM format + // by stripping out the dashes and colons + string ts = timestamp; + string::iterator i = ts.begin(); + bool date = true; + while( i != ts.end() ) { + if( *i == 'T' ) + date = false; + if( (date && *i == '-') || *i == ':' ) + ts.erase(i); + else + ++i; + } + + int found = sscanf(ts.c_str(), "%04d%02d%02dT%02d%02d%02d", + &(result->tm_year), &(result->tm_mon), &(result->tm_mday), + &(result->tm_hour), &(result->tm_min), &(result->tm_sec)); + + result->tm_year -= 1900; + result->tm_mon -= 1; + result->tm_isdst = -1; + if( found == 3 ) { + // only a date available, so force time to 00:00:00 + result->tm_hour = 0; + result->tm_min = 0; + result->tm_sec = 0; + } + else if( found != 6 ) { + return 0; + } + + utc = ts.find('Z', 15) != string::npos; + + if( zone && zoneminutes ) { + *zone = false; + + size_t neg = ts.find('-', 15); + size_t pos = ts.find('+', 15); + + if( neg != string::npos || pos != string::npos ) { + // capture timezone offset + size_t it = neg != string::npos ? neg : pos; + it++; + string offset = ts.substr(it); + + int hour, min; + found = sscanf(offset.c_str(), "%02d%02d", + &hour, &min); + if( offset.size() == 4 && found == 2 ) { + *zone = true; + *zoneminutes = hour * 60 + min; + if( neg != string::npos ) + *zoneminutes *= -1; + } + } + } + + return result; +} + +std::string tm_to_iso(const struct tm *t, bool utc) +{ + char tmp[128]; + + int cc = snprintf(tmp, sizeof(tmp), "%04d%02d%02dT%02d%02d%02d", + t->tm_year + 1900, + t->tm_mon + 1, + t->tm_mday, + t->tm_hour, + t->tm_min, + t->tm_sec + ); + if( cc < 0 || (size_t)cc >= sizeof(tmp) ) + return ""; + + if( utc ) { + if( (size_t)cc >= (sizeof(tmp) - 1) ) + return ""; // not enough room for Z + tmp[cc++] = 'Z'; + tmp[cc] = 0; + } + + return tmp; +} + +TzWrapper& TzWrapper::SetOffset(int zoneminutes) +{ + // + // Set a custom TZ with the offset in hours/minutes. + // + // Note that TZ sees negative offsets as *ahead* of + // UTC and positive offsets as behind UTC. Therefore, + // Berlin, one hour ahead of UTC is -01:00 and + // Canada/Eastern standard time is +05:00. + // + // This is exactly opposite to the ISO timestamp format + // which would have +01:00 and -05:00 respectively, + // and therefore exactly opposite to the sign of zoneminutes. + // + // We use a fake timezone name of XXX here, since it + // doesn't matter, we are only interested in the offset. + + char buf[128]; + sprintf(buf, "XXX%c%02d:%02d", + (zoneminutes < 0 ? '+' : '-'), + abs(zoneminutes) / 60, + abs(zoneminutes) % 60 + ); + return Set(buf); +} + +time_t TzWrapper::iso_mktime(const char *timestamp) +{ + bool utc, zone; + struct tm t; + int zoneminutes; + if( !iso_to_tm(timestamp, &t, utc, &zone, &zoneminutes) ) + return (time_t)-1; + + TzWrapper tzw; + if( utc ) { + tzw.SetUTC(); + } + else if( zone ) { + tzw.SetOffset(zoneminutes); + } + return tzw.mktime(&t); +} + +}} // namespace Barry::Sync + + +#ifdef TZ_TEST_MODE +#include +using namespace std; +using namespace Barry::Sync; +int main() +{ + time_t now = time(NULL); + + cout << "TZ: " << TzWrapper().ctime(&now); + cout << "UTC: " << TzWrapper("").ctime(&now); + cout << "UTC: " << TzWrapper().SetUTC().ctime(&now); + cout << "SysLocaltime: " << TzWrapper().SetUTC().SetSysLocal().ctime(&now); + cout << "TZ: " << TzWrapper().SetUTC().SetDefault().ctime(&now); + cout << "Canada/Eastern: " << TzWrapper("Canada/Eastern").ctime(&now); + cout << "Canada/Pacific: " << TzWrapper("Canada/Pacific").ctime(&now); + + { + TzWrapper tzw("UTC"); + cout << "UTC: " << ctime(&now); + } + + cout << "TZ: " << ctime(&now); + + // test iso_mktime()... the test values assume a Canada/Eastern TZ + cout << "Using Canada/Eastern:" << endl; + TzWrapper tzw("Canada/Eastern"); + const char *iso1 = "20100430T231500"; + const char *iso2 = "20100501T031500Z"; + time_t t1 = TzWrapper::iso_mktime(iso1); + time_t t2 = TzWrapper::iso_mktime(iso2); + cout << " " << iso1 << ": (" << t1 << ") " << ctime(&t1); + cout << iso2 << ": (" << t2 << ") " << ctime(&t2); + if( t1 == t2 ) + cout << "t1 == t2: passed" << endl; + else + cout << "t1 != t2: ERROR" << endl; + + time_t t3 = TzWrapper::iso_mktime("2010-05-01T03:15:00.000Z"); + cout << ctime(&t3); + if( t2 == t3 ) + cout << "t2 == t3: passed" << endl; + else + cout << "t2 != t3: ERROR" << endl; + + time_t t4 = TzWrapper::iso_mktime("2010-05-01T04:15:00.000+01:00"); + cout << ctime(&t4); + if( t3 == t4 ) + cout << "t3 == t4: passed" << endl; + else + cout << "t3 != t4: ERROR" << endl; + + time_t t5 = TzWrapper::iso_mktime("2010-05-01T00:15:00.000-03:00"); + cout << ctime(&t5); + if( t4 == t5 ) + cout << "t4 == t5: passed" << endl; + else + cout << "t4 != t5: ERROR: t4: " << t4 << " t5: " << t5 << endl; + + if( TzWrapper::iso_mktime("20100430") != (time_t)-1 ) + cout << "Date check: passed" << endl; + else + cout << "Date check: ERROR" << endl; + + cout << "t1: " << tm_to_iso(gmtime(&t1), true) << endl; + + bool utc, zone; + int zoneminutes; + struct tm zonetest; + if( !iso_to_tm("2010-05-01T04:15:00.000-", &zonetest, utc, &zone, &zoneminutes) ) + cout << "iso_to_tm failed wrongly: ERROR" << endl; + if( zone ) + cout << "zone true?: ERROR" << endl; + else + cout << "zone fail check: passed" << endl; + + if( !iso_to_tm("2010-05-01T04:15:00.000-010", &zonetest, utc, &zone, &zoneminutes) ) + cout << "iso_to_tm failed wrongly: ERROR" << endl; + if( zone ) + cout << "zone true?: ERROR" << endl; + else + cout << "zone fail check2: passed" << endl; +} +#endif + diff -Nru barry-0.14/src/tzwrapper.h barry-0.0.20110506/src/tzwrapper.h --- barry-0.14/src/tzwrapper.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/tzwrapper.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,239 @@ +/// +/// \file tzwrapper.h +/// Timezone adjustment class, wrapping the TZ environment +/// variable to make struct tm -> time_t conversions easier. +/// + +/* + Copyright (C) 2010-2011, Chris Frey , To God be the glory + Released to the public domain. + Included in Barry and Barrified the namespace July 2010 +*/ + +#ifndef __TZWRAPPER_H__ +#define __TZWRAPPER_H__ + +#include "dll.h" +#include +#include +#include + +namespace Barry { namespace Sync { + +/// Parses ISO timestamp in the format of YYYYMMDDTHHMMSS[Z] +/// or YYYY-MM-DDTHH:MM:SS.uuu-HH:MM +/// and places broken down time in result. +/// The trailing Z is optional in the format. +/// If the Z exists, utc will be set to true, otherwise false. +/// If zoneminutes is not null, and if a timezone offset is +/// specified, it will be filled in and *zone set to true. +/// Otherwise, *zone will be set to false. +/// Returns NULL on error. +/// Thread-safe. +BXEXPORT struct tm* iso_to_tm(const char *timestamp, + struct tm *result, + bool &utc, + bool *zone = 0, + int *zoneminutes = 0); + +/// Turns the struct tm into an ISO timestamp in the format +/// of YYYYMMDDTHHMMSS[Z]. The Z is appended if utc is true. +/// This function assumes that t contains sane values, and will +/// create the target string directly from its content. +/// Returns the ISO timestamp, or empty string on error. +/// If t contains sane values, this function should never fail. +/// Thread-safe. +BXEXPORT std::string tm_to_iso(const struct tm *t, bool utc); + +/// utc_mktime() converts a struct tm that contains +/// broken down time in utc to a time_t. This function uses +/// a brute-force method of conversion that does not require +/// the environment variable TZ to be changed at all, and is +/// therefore slightly more thread-safe in that regard. +/// +/// The difference between mktime() and utc_mktime() is that +/// standard mktime() expects the struct tm to be in localtime, +/// according to the current TZ and system setting, while utc_mktime() +/// always assumes that the struct tm is in UTC, and converts it +/// to time_t regardless of what TZ is currently set. +/// +/// The difference between utc_mktime() and TzWrapper::iso_mktime() +/// is that iso_mktime() will parse straight from an ISO string, +/// and if the ISO timestamp ends in a 'Z', it will behave like +/// utc_mktime() except it will alter the TZ environment variable +/// to do it. If the ISO timestamp has no 'Z', then iso_mktime() +/// behaves like mktime(). +/// +BXEXPORT time_t utc_mktime(struct tm *utctime); + +// +// class TzWrapper +// +/// Wrapper class for the TZ environment variable. This class allows +/// setting TZ to any number of variables, and will restore the original +/// setting on destruction. +/// +/// By default, TzWrapper does not change the environment at all, but +/// only saves it. Alternately, you can use the timezone constructor +/// to save and set a new timezone on the fly. +/// +/// Each Set() and Unset() function returns a reference to TzWrapper, +/// so that you can chain function calls like this: +/// +/// time_t utc = TzWrapper("Canada/Pacific").mktime(&pacific_tm); +/// +/// In addition, there are two static utility functions used to +/// convert ISO timestamps to struct tm* and time_t values. +/// +/// Note: This class is not thread-safe, since it modifies the TZ +/// environment variable without locking. If other threads +/// use time functions, this may interfere with their behaviour. +/// +class BXEXPORT TzWrapper +{ + std::string m_orig_tz; + bool m_tz_exists; + bool m_dirty; + +protected: + void SaveTz() + { + char *ptz = getenv("TZ"); + if( ptz ) + m_orig_tz = ptz; + m_tz_exists = ptz; + } + + void RestoreTz() + { + if( m_dirty ) { + if( m_tz_exists ) + Set(m_orig_tz.c_str()); + else + Unset(); + + m_dirty = false; + } + } + +public: + /// Does not change TZ, only saves current setting + TzWrapper() + : m_dirty(false) + { + SaveTz(); + } + + /// Saves current setting and sets TZ to new timezone value. + /// If timezone is null, it is the same as calling Unset(). + explicit TzWrapper(const char *timezone) + : m_dirty(false) + { + SaveTz(); + Set(timezone); + } + + ~TzWrapper() + { + RestoreTz(); + } + + /// Set TZ to a new value. If timezone is null, it is the + /// same as calling Unset(). + /// + /// If timezone is an empty or invalid timezone string, it + /// is the same as calling SetUTC(). + TzWrapper& Set(const char *timezone) + { + if( timezone ) + setenv("TZ", timezone, 1); + else + unsetenv("TZ"); + tzset(); + m_dirty = true; + return *this; + } + + /// Deletes TZ from the environment, which has the same effect + /// as calling SetSysLocal(). This is not a permanent + /// condition, since TZ will be restored to original state + /// upon destruction. + TzWrapper& Unset() + { + unsetenv("TZ"); + tzset(); + m_dirty = true; + return *this; + } + + /// Set timezone to UTC + TzWrapper& SetUTC() + { + return Set(""); + } + + /// Set timezone via offset in minutes + /// Negative minutes goes west, positive goes east + /// i.e. -05:00 is EST + TzWrapper& SetOffset(int zoneminutes); + + /// Use system localtime. This overrides any TZ value that the + /// user may have set before running your program. + TzWrapper& SetSysLocal() + { + return Unset(); + } + + /// Use the default TZ value that the user set before running + /// this program. In most cases, this will be the user's + /// preferred local timezone. + TzWrapper& SetDefault() + { + RestoreTz(); + return *this; + } + /// Same as SetDefault() + TzWrapper& SetOrig() + { + return SetDefault(); + } + + // + // C library wrappers, for calls like: + // time_t t = TzWrapper("Canada/Pacific").mktime(tm); + // + char* asctime(const struct tm *t) const { return ::asctime(t); } + char* asctime_r(const struct tm *t, char *buf) const + { return ::asctime_r(t, buf); } + char* ctime(const time_t *t) const { return ::ctime(t); } + char* ctime_r(const time_t *t, char *buf) const + { return ::ctime_r(t, buf); } + struct tm* gmtime(const time_t *t) const { return ::gmtime(t); } + struct tm* gmtime_r(const time_t *t, struct tm *result) const + { return ::gmtime_r(t, result); } + struct tm* localtime(const time_t *t) const { return ::localtime(t); } + struct tm* localtime_r(const time_t *t, struct tm *result) const + { return ::localtime_r(t, result); } + time_t mktime(struct tm *t) { return ::mktime(t); } + + // + // Additional utility functions + // + + /// Converts an ISO timestamp (YYYYMMDDTHHMMWW[Z]) into a + /// unix time_t. If the 'Z' UTC flag is not specified, then + /// the timestamp will be assumed to be in the current + /// default timezone. Otherwise, SetUTC() will be used for the + /// conversion. + /// + /// This function uses an internal TzWrapper to adjust TZ + /// if necessary, which is why it is a static function + /// of TzWrapper, instead of a standalone function. + /// + static time_t iso_mktime(const char *timestamp); +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/usbwrap.cc barry-0.0.20110506/src/usbwrap.cc --- barry-0.14/src/usbwrap.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/usbwrap.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Chris Frey + Copyright (C) 2005-2011, Chris Frey 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 @@ -29,6 +29,7 @@ #include #include #include +#include #ifndef __DEBUG_MODE__ #define __DEBUG_MODE__ @@ -44,7 +45,7 @@ { std::ostringstream oss; oss << "("; - + if( libusb_errcode ) { oss << std::setbase(10) << libusb_errcode << ", "; } @@ -163,6 +164,8 @@ m_timeout(timeout) { dout("usb_open(" << std::dec << id << ")"); + if( !id ) + throw Error("invalid USB device ID"); m_handle = usb_open(id); if( !m_handle ) throw Error("open failed"); @@ -176,7 +179,7 @@ bool Device::SetConfiguration(unsigned char cfg) { - dout("usb_set_configuration(" << std::dec << m_handle << "," << std::dec << (unsigned int) cfg << ")"); + dout("usb_set_configuration(" << std::dec << m_handle << ", 0x" << std::hex << (unsigned int) cfg << ")"); int ret = usb_set_configuration(m_handle, cfg); m_lasterror = ret; return ret >= 0; @@ -184,7 +187,7 @@ bool Device::ClearHalt(int ep) { - dout("usb_clear_halt(" << std::dec << m_handle << "," << std::dec << ep << ")"); + dout("usb_clear_halt(" << std::dec << m_handle << ", 0x" << std::hex << ep << ")"); int ret = usb_clear_halt(m_handle, ep); m_lasterror = ret; return ret >= 0; @@ -202,6 +205,7 @@ { int ret; do { + data.QuickZap(); ret = usb_bulk_read(m_handle, ep, (char*) data.GetBuffer(), data.GetBufSize(), timeout == -1 ? m_timeout : timeout); @@ -212,7 +216,8 @@ else throw Error(ret, "Error in usb_bulk_read"); } - data.ReleaseBuffer(ret); + else if( ret > 0 ) + data.ReleaseBuffer(ret); } while( ret == -EINTR || ret == -EAGAIN ); return ret >= 0; @@ -220,7 +225,7 @@ bool Device::BulkWrite(int ep, const Barry::Data &data, int timeout) { - ddout("BulkWrite to endpoint " << std::dec << ep << ":\n" << data); + ddout("BulkWrite to endpoint 0x" << std::hex << ep << ":\n" << data); int ret; do { ret = usb_bulk_write(m_handle, ep, @@ -229,9 +234,9 @@ if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { m_lasterror = ret; if( ret == -ETIMEDOUT ) - throw Timeout(ret, "Timeout in usb_bulk_write"); + throw Timeout(ret, "Timeout in usb_bulk_write (1)"); else - throw Error(ret, "Error in usb_bulk_write"); + throw Error(ret, "Error in usb_bulk_write (1)"); } } while( ret == -EINTR || ret == -EAGAIN ); @@ -242,7 +247,7 @@ { #ifdef __DEBUG_MODE__ Barry::Data dump(data, size); - ddout("BulkWrite to endpoint " << std::dec << ep << ":\n" << dump); + ddout("BulkWrite to endpoint 0x" << std::hex << ep << ":\n" << dump); #endif int ret; @@ -253,9 +258,9 @@ if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { m_lasterror = ret; if( ret == -ETIMEDOUT ) - throw Timeout(ret, "Timeout in usb_bulk_read"); + throw Timeout(ret, "Timeout in usb_bulk_write (2)"); else - throw Error(ret, "Error in usb_bulk_read"); + throw Error(ret, "Error in usb_bulk_write (2)"); } } while( ret == -EINTR || ret == -EAGAIN ); @@ -266,17 +271,19 @@ { int ret; do { + data.QuickZap(); ret = usb_interrupt_read(m_handle, ep, (char*) data.GetBuffer(), data.GetBufSize(), timeout == -1 ? m_timeout : timeout); if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { m_lasterror = ret; if( ret == -ETIMEDOUT ) - throw Timeout(ret, "Timeout in usb_bulk_read"); + throw Timeout(ret, "Timeout in usb_interrupt_read"); else - throw Error(ret, "Error in usb_bulk_read"); + throw Error(ret, "Error in usb_interrupt_read"); } - data.ReleaseBuffer(ret); + else if( ret > 0 ) + data.ReleaseBuffer(ret); } while( ret == -EINTR || ret == -EAGAIN ); return ret >= 0; @@ -284,7 +291,7 @@ bool Device::InterruptWrite(int ep, const Barry::Data &data, int timeout) { - ddout("InterruptWrite to endpoint " << std::dec << ep << ":\n" << data); + ddout("InterruptWrite to endpoint 0x" << std::hex << ep << ":\n" << data); int ret; do { @@ -294,9 +301,9 @@ if( ret < 0 && ret != -EINTR && ret != -EAGAIN ) { m_lasterror = ret; if( ret == -ETIMEDOUT ) - throw Timeout(ret, "Timeout in usb_bulk_read"); + throw Timeout(ret, "Timeout in usb_interrupt_write"); else - throw Error(ret, "Error in usb_bulk_read"); + throw Error(ret, "Error in usb_interrupt_write"); } } while( ret == -EINTR || ret == -EAGAIN ); @@ -334,6 +341,22 @@ return result >= 0; } +// +// SetAltInterface +// +/// Uses the usb_set_altinterface() function to set the currently +/// selected USB alternate setting of the current interface. +/// The iface parameter passed in should be a value specified +/// in the bAlternateSetting descriptor field. +/// If unsuccessful, returns false. +/// +bool Device::SetAltInterface(int iface) +{ + int result = usb_set_altinterface(m_handle, iface); + m_lasterror = result; + return result >= 0; +} + /////////////////////////////////////////////////////////////////////////////// @@ -342,7 +365,7 @@ Interface::Interface(Device &dev, int iface) : m_dev(dev), m_iface(iface) { - dout("usb_claim_interface(" << dev.GetHandle() << "," << std::dec << iface << ")"); + dout("usb_claim_interface(" << dev.GetHandle() << ", 0x" << std::hex << iface << ")"); int ret = usb_claim_interface(dev.GetHandle(), iface); if( ret < 0 ) throw Error(ret, "claim interface failed"); @@ -350,7 +373,7 @@ Interface::~Interface() { - dout("usb_release_interface(" << m_dev.GetHandle() << "," << std::dec << m_iface << ")"); + dout("usb_release_interface(" << m_dev.GetHandle() << ", 0x" << std::hex << m_iface << ")"); usb_release_interface(m_dev.GetHandle(), m_iface); } @@ -376,21 +399,21 @@ // load descriptor usb_endpoint_descriptor desc; desc = interface->endpoint[i]; - dout(" endpoint_desc #" << i << " loaded" - << "\nbLength: " << (unsigned ) desc.bLength - << "\nbDescriptorType: " << (unsigned ) desc.bDescriptorType - << "\nbEndpointAddress: " << (unsigned ) desc.bEndpointAddress - << "\nbmAttributes: " << (unsigned ) desc.bmAttributes - << "\nwMaxPacketSize: " << (unsigned ) desc.wMaxPacketSize - << "\nbInterval: " << (unsigned ) desc.bInterval - << "\nbRefresh: " << (unsigned ) desc.bRefresh - << "\nbSynchAddress: " << (unsigned ) desc.bSynchAddress + dout(" endpoint_desc #" << std::dec << i << " loaded" + << "\nbLength: " << std::dec << (unsigned ) desc.bLength + << "\nbDescriptorType: " << std::dec << (unsigned ) desc.bDescriptorType + << "\nbEndpointAddress: 0x" << std::hex << (unsigned ) desc.bEndpointAddress + << "\nbmAttributes: 0x" << std::hex << (unsigned ) desc.bmAttributes + << "\nwMaxPacketSize: " << std::dec << (unsigned ) desc.wMaxPacketSize + << "\nbInterval: " << std::dec << (unsigned ) desc.bInterval + << "\nbRefresh: " << std::dec << (unsigned ) desc.bRefresh + << "\nbSynchAddress: " << std::dec << (unsigned ) desc.bSynchAddress << "\n" ); // add to the map (*this)[desc.bEndpointAddress] = desc; - dout(" endpoint added to map with bEndpointAddress: " << (unsigned int)desc.bEndpointAddress); + dout(" endpoint added to map with bEndpointAddress: 0x" << std::hex << (unsigned int)desc.bEndpointAddress); // parse the endpoint into read/write sets, if possible, // going in discovery order... @@ -403,7 +426,7 @@ if( desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK ) { // read endpoint pair.read = desc.bEndpointAddress; - dout(" pair.read = " << (unsigned int)pair.read); + dout(" pair.read = 0x" << std::hex << (unsigned int)pair.read); if( pair.IsTypeSet() && pair.type != type ) { // if type is already set, we must start over pair.write = 0; @@ -412,7 +435,7 @@ else { // write endpoint pair.write = desc.bEndpointAddress; - dout(" pair.write = " << (unsigned int)pair.write); + dout(" pair.write = 0x" << std::hex << (unsigned int)pair.write); if( pair.IsTypeSet() && pair.type != type ) { // if type is already set, we must start over pair.read = 0; @@ -420,15 +443,15 @@ } // save the type last pair.type = type; - dout(" pair.type = " << (unsigned int)pair.type); + dout(" pair.type = 0x" << std::hex << (unsigned int)pair.type); // if pair is complete, add to array if( pair.IsComplete() ) { m_endpoints.push_back(pair); dout(" pair added! (" - << "read: " << (unsigned int)pair.read << "," - << "write: " << (unsigned int)pair.write << "," - << "type: " << (unsigned int)pair.type << ")"); + << "read: 0x" << std::hex << (unsigned int)pair.read << "," + << "write: 0x" << std::hex << (unsigned int)pair.write << "," + << "type: 0x" << std::hex << (unsigned int)pair.type << ")"); pair = EndpointPair(); // clear } } @@ -462,28 +485,28 @@ // load descriptor InterfaceDesc desc; desc.desc = interface->altsetting[i]; - dout(" interface_desc #" << i << " loaded" - << "\nbLength: " << (unsigned) desc.desc.bLength - << "\nbDescriptorType: " << (unsigned) desc.desc.bDescriptorType - << "\nbInterfaceNumber: " << (unsigned) desc.desc.bInterfaceNumber - << "\nbAlternateSetting: " << (unsigned) desc.desc.bAlternateSetting - << "\nbNumEndpoints: " << (unsigned) desc.desc.bNumEndpoints - << "\nbInterfaceClass: " << (unsigned) desc.desc.bInterfaceClass - << "\nbInterfaceSubClass: " << (unsigned) desc.desc.bInterfaceSubClass - << "\nbInterfaceProtocol: " << (unsigned) desc.desc.bInterfaceProtocol - << "\niInterface: " << (unsigned) desc.desc.iInterface + dout(" interface_desc #" << std::dec << i << " loaded" + << "\nbLength: " << std::dec << (unsigned) desc.desc.bLength + << "\nbDescriptorType: " << std::dec << (unsigned) desc.desc.bDescriptorType + << "\nbInterfaceNumber: " << std::dec << (unsigned) desc.desc.bInterfaceNumber + << "\nbAlternateSetting: " << std::dec << (unsigned) desc.desc.bAlternateSetting + << "\nbNumEndpoints: " << std::dec << (unsigned) desc.desc.bNumEndpoints + << "\nbInterfaceClass: " << std::dec << (unsigned) desc.desc.bInterfaceClass + << "\nbInterfaceSubClass: " << std::dec << (unsigned) desc.desc.bInterfaceSubClass + << "\nbInterfaceProtocol: " << std::dec << (unsigned) desc.desc.bInterfaceProtocol + << "\niInterface: " << std::dec << (unsigned) desc.desc.iInterface << "\n" ); // load all endpoints on this interface if( !desc.endpoints.Discover(&desc.desc, desc.desc.bNumEndpoints) ) { - dout(" endpoint discovery failed for bInterfaceNumber: " << (unsigned int)desc.desc.bInterfaceNumber << ", not added to map."); + dout(" endpoint discovery failed for bInterfaceNumber: " << std::dec << (unsigned int)desc.desc.bInterfaceNumber << ", not added to map."); return false; } // add to the map (*this)[desc.desc.bInterfaceNumber] = desc; - dout(" interface added to map with bInterfaceNumber: " << (unsigned int)desc.desc.bInterfaceNumber); + dout(" interface added to map with bInterfaceNumber: " << std::dec << (unsigned int)desc.desc.bInterfaceNumber); } return true; } @@ -525,15 +548,15 @@ return false; } desc.desc = devid->config[i]; - dout(" config_desc #" << i << " loaded" - << "\nbLength: " << (unsigned int) desc.desc.bLength - << "\nbDescriptorType: " << (unsigned int) desc.desc.bDescriptorType - << "\nwTotalLength: " << (unsigned int) desc.desc.wTotalLength - << "\nbNumInterfaces: " << (unsigned int) desc.desc.bNumInterfaces - << "\nbConfigurationValue: " << (unsigned int) desc.desc.bConfigurationValue - << "\niConfiguration: " << (unsigned int) desc.desc.iConfiguration - << "\nbmAttributes: " << (unsigned int) desc.desc.bmAttributes - << "\nMaxPower: " << (unsigned int) desc.desc.MaxPower + dout(" config_desc #" << std::dec << i << " loaded" + << "\nbLength: " << std::dec << (unsigned int) desc.desc.bLength + << "\nbDescriptorType: " << std::dec << (unsigned int) desc.desc.bDescriptorType + << "\nwTotalLength: " << std::dec << (unsigned int) desc.desc.wTotalLength + << "\nbNumInterfaces: " << std::dec << (unsigned int) desc.desc.bNumInterfaces + << "\nbConfigurationValue: " << std::dec << (unsigned int) desc.desc.bConfigurationValue + << "\niConfiguration: " << std::dec << (unsigned int) desc.desc.iConfiguration + << "\nbmAttributes: 0x" << std::hex << (unsigned int) desc.desc.bmAttributes + << "\nMaxPower: " << std::dec << (unsigned int) desc.desc.MaxPower << "\n" ); @@ -547,13 +570,13 @@ // load all interfaces on this configuration if( !desc.interfaces.Discover(devid, i, desc.desc.bNumInterfaces) ) { - dout(" config discovery failed for bConfigurationValue: " << (unsigned int)desc.desc.bConfigurationValue << ", not added to map."); + dout(" config discovery failed for bConfigurationValue: " << std::dec << (unsigned int)desc.desc.bConfigurationValue << ", not added to map."); return false; } // add to the map (*this)[desc.desc.bConfigurationValue] = desc; - dout(" config added to map with bConfigurationValue: " << (unsigned int)desc.desc.bConfigurationValue); + dout(" config added to map with bConfigurationValue: " << std::dec << (unsigned int)desc.desc.bConfigurationValue); } return m_valid = true; @@ -583,20 +606,20 @@ desc = devid->descriptor; dout("device_desc loaded" - << "\nbLength: " << (unsigned int) desc.bLength - << "\nbDescriptorType: " << (unsigned int) desc.bDescriptorType - << "\nbcdUSB: " << (unsigned int) desc.bcdUSB - << "\nbDeviceClass: " << (unsigned int) desc.bDeviceClass - << "\nbDeviceSubClass: " << (unsigned int) desc.bDeviceSubClass - << "\nbDeviceProtocol: " << (unsigned int) desc.bDeviceProtocol - << "\nbMaxPacketSize0: " << (unsigned int) desc.bMaxPacketSize0 - << "\nidVendor: " << (unsigned int) desc.idVendor - << "\nidProduct: " << (unsigned int) desc.idProduct - << "\nbcdDevice: " << (unsigned int) desc.bcdDevice - << "\niManufacturer: " << (unsigned int) desc.iManufacturer - << "\niProduct: " << (unsigned int) desc.iProduct - << "\niSerialNumber: " << (unsigned int) desc.iSerialNumber - << "\nbNumConfigurations: " << (unsigned int) desc.bNumConfigurations + << "\nbLength: " << std::dec << (unsigned int) desc.bLength + << "\nbDescriptorType: " << std::dec << (unsigned int) desc.bDescriptorType + << "\nbcdUSB: 0x" << std::hex << (unsigned int) desc.bcdUSB + << "\nbDeviceClass: " << std::dec << (unsigned int) desc.bDeviceClass + << "\nbDeviceSubClass: " << std::dec << (unsigned int) desc.bDeviceSubClass + << "\nbDeviceProtocol: " << std::dec << (unsigned int) desc.bDeviceProtocol + << "\nbMaxPacketSize0: " << std::dec << (unsigned int) desc.bMaxPacketSize0 + << "\nidVendor: 0x" << std::hex << (unsigned int) desc.idVendor + << "\nidProduct: 0x" << std::hex << (unsigned int) desc.idProduct + << "\nbcdDevice: 0x" << std::hex << (unsigned int) desc.bcdDevice + << "\niManufacturer: " << std::dec << (unsigned int) desc.iManufacturer + << "\niProduct: " << std::dec << (unsigned int) desc.iProduct + << "\niSerialNumber: " << std::dec << (unsigned int) desc.iSerialNumber + << "\nbNumConfigurations: " << std::dec << (unsigned int) desc.bNumConfigurations << "\n" ); diff -Nru barry-0.14/src/usbwrap.h barry-0.0.20110506/src/usbwrap.h --- barry-0.14/src/usbwrap.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/usbwrap.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Chris Frey + Copyright (C) 2005-2011, Chris Frey 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 @@ -24,7 +24,34 @@ #define __SB_USBWRAP_H__ #include "dll.h" +#include "publiccfg.h" + +////////////////////////////////////////////////////////////////////////////// +#if USE_LIBUSB + #include + +#if defined( WIN32 ) +// On Windows systems, usb.h includes which defines min/max, +// which causes trouble for other headers +#undef min +#undef max +#endif + +#else // USE_LIBUSB + +#if defined( WIN32 ) +// If not using libusb, we need to include windows.h ourselves, since +// other code is depending on it. +#include +#undef min +#undef max +#endif + +#endif // USE_LIBUSB + +////////////////////////////////////////////////////////////////////////////// + #include #include #include "error.h" @@ -65,14 +92,31 @@ /// Typedefs used by the wrapper class, in the hope to make it /// easier to switch from libusb stable to devel and back. +#if USE_LIBUSB typedef struct usb_device* DeviceIDType; typedef struct usb_dev_handle* DeviceHandleType; +typedef struct usb_device_descriptor DeviceDescriptorType; +typedef struct usb_bus* BusListType; +typedef struct usb_endpoint_descriptor EndpointDescriptorType; +typedef struct usb_interface_descriptor InterfaceDescriptorType; +typedef struct usb_interface InterfaceType; +typedef struct usb_config_descriptor ConfigDescriptorType; +#else +typedef uint32_t DeviceIDType; +typedef void* DeviceHandleType; +typedef int DeviceDescriptorType; +typedef int BusListType; +typedef int EndpointDescriptorType; +typedef int InterfaceDescriptorType; +typedef int InterfaceType; +typedef int ConfigDescriptorType; +#endif class BXEXPORT Match { private: - struct usb_bus *m_busses; - struct usb_device *m_dev; + BusListType m_busses; + DeviceIDType m_dev; int m_vendor, m_product; int m_lasterror; const char *m_busname; @@ -91,10 +135,12 @@ bool next_device(Usb::DeviceIDType *devid); }; +struct PrivateDeviceData; class BXEXPORT Device { private: + PrivateDeviceData *m_data; Usb::DeviceIDType m_id; Usb::DeviceHandleType m_handle; @@ -113,6 +159,7 @@ int GetLastError() const { return m_lasterror; } //< not thread safe... //< use the error code stored in the exceptions to track //< errors in threaded usage + int GetDefaultTimeout() const { return m_timeout; } ///////////////////////////// @@ -139,6 +186,7 @@ // Combo functions bool GetConfiguration(unsigned char &cfg); + bool SetAltInterface(int iface); }; class BXEXPORT Interface @@ -165,19 +213,19 @@ bool IsComplete() const { return read && write && IsTypeSet(); } }; -class BXEXPORT EndpointDiscovery : public std::map +class BXEXPORT EndpointDiscovery : public std::map { friend class InterfaceDiscovery; public: - typedef std::mapbase_type; + typedef std::map base_type; typedef std::vector endpoint_array_type; private: bool m_valid; endpoint_array_type m_endpoints; - BXLOCAL bool Discover(struct usb_interface_descriptor *interface, int epcount); + BXLOCAL bool Discover(InterfaceDescriptorType *interface, int epcount); public: EndpointDiscovery() : m_valid(false) {} @@ -192,7 +240,7 @@ // Map of Interface numbers (not indexes) to interface descriptors and endpoint map struct BXEXPORT InterfaceDesc { - usb_interface_descriptor desc; + InterfaceDescriptorType desc; EndpointDiscovery endpoints; }; @@ -204,7 +252,7 @@ private: bool m_valid; - BXLOCAL bool DiscoverInterface(struct usb_interface *interface); + BXLOCAL bool DiscoverInterface(InterfaceType *interface); public: InterfaceDiscovery() : m_valid(false) {} @@ -219,7 +267,7 @@ // Map of Config numbers (not indexes) to config descriptors and interface map struct BXEXPORT ConfigDesc { - usb_config_descriptor desc; + ConfigDescriptorType desc; InterfaceDiscovery interfaces; }; @@ -246,7 +294,7 @@ bool m_valid; public: - usb_device_descriptor desc; + DeviceDescriptorType desc; ConfigDiscovery configs; public: diff -Nru barry-0.14/src/vbase.cc barry-0.0.20110506/src/vbase.cc --- barry-0.14/src/vbase.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vbase.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,502 @@ +// +// \file vbase.cc +// vformat support routines in base class +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vbase.h" +//#include "trace.h" +#include "vformat.h" // comes from opensync, but not a public header yet +#include "tzwrapper.h" +#include +#include +#include +#include +#include +#include + +using namespace std; + +namespace Barry { namespace Sync { + +////////////////////////////////////////////////////////////////////////////// +// vTimeConverter + +std::string vTimeConverter::unix2vtime(const time_t *timestamp) +{ + struct tm split; + if( !gmtime_r(timestamp, &split) ) { + ostringstream oss; + oss << "gmtime_r() failed on time_t of "; + if( timestamp ) + oss << *timestamp; + else + oss << "(null pointer)"; + throw Barry::ConvertError(oss.str()); + } + + return tm_to_iso(&split, true); +} + +time_t vTimeConverter::vtime2unix(const char *vtime) +{ + return TzWrapper::iso_mktime(vtime); +} + +// +// The following implementation is taken from opensync's +// opensync_time.c implementation with the following copyright +// notices at the top as of July 2010: +// +// * Copyright (C) 2004-2005 Armin Bauer +// * Copyright (C) 2006-2008 Daniel Gollub +// * Copyright (C) 2007 Chris Frey +// +// License: LGPL 2.1 or later +// +int vTimeConverter::alarmduration2sec(const char *alarm) +{ + int i, secs, digits = 0; + int is_digit = 0; + int sign = 1; // when ical stamp doesn't start with '-' => seconds after event + int days = 0, weeks = 0, hours = 0, minutes = 0, seconds = 0; + int len = strlen(alarm); + + for (i=0; i < len; i++) { + + switch (alarm[i]) { + case '-': + sign = -1; // seconds before event - change the sign + case 'P': + case 'T': + is_digit = 0; + break; + case 'W': + is_digit = 0; + weeks = digits; + break; + case 'D': + is_digit = 0; + days = digits; + break; + case 'H': + is_digit = 0; + hours = digits; + break; + case 'M': + is_digit = 0; + minutes = digits; + break; + case 'S': + is_digit = 0; + seconds = digits; + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (is_digit) + break; + + if (sscanf((char*)(alarm+i),"%d",&digits) == EOF) + return -1; + + is_digit = 1; + break; + } + } + + secs = (weeks * 7 * 24 * 3600) + (days * 24 * 3600) + (hours * 3600) + (minutes * 60) + seconds; + + secs = secs * sign; // change sign if the alarm is in seconds before event (leading '-') + + return secs; + +} + + +////////////////////////////////////////////////////////////////////////////// +// vAttr + +std::string vAttr::GetName() +{ + std::string ret; + + if( !m_attr ) + return ret; + + const char *name = b_vformat_attribute_get_name(m_attr); + if( name ) + ret = name; + return ret; +} + +std::string vAttr::GetValue(int nth) +{ + std::string ret; + const char *value = 0; + + if( m_attr ) { + if( b_vformat_attribute_is_single_valued(m_attr) ) { + if( nth == 0 ) + value = b_vformat_attribute_get_value(m_attr); + } + else { + value = b_vformat_attribute_get_nth_value(m_attr, nth); + } + } + + if( value ) + ret = value; + + return ret; +} + +std::string vAttr::GetDecodedValue() +{ + std::string ret; + GString *value = NULL; + + if( m_attr ) { + if( b_vformat_attribute_is_single_valued(m_attr) ) { + value = b_vformat_attribute_get_value_decoded(m_attr); + } + } + + if( value ) + ret.assign(value->str, value->len); + + return ret; +} + +std::string vAttr::GetParam(const char *name, int nth) +{ + std::string ret; + + if( !m_attr ) + return ret; + + b_VFormatParam *param = b_vformat_attribute_find_param(m_attr, name, 0); + if( !param ) + return ret; + + const char *value = b_vformat_attribute_param_get_nth_value(param, nth); + if( value ) + ret = value; + + return ret; +} + +/// Does an exhaustive search through the attribute, searching for all +/// param values that exist for the given name, and returns all values +/// in a comma delimited string. +std::string vAttr::GetAllParams(const char *name) +{ + std::string ret; + + if( !m_attr ) + return ret; + + b_VFormatParam *param = 0; + for( int level = 0; + (param = b_vformat_attribute_find_param(m_attr, name, level)); + level++ ) + { + const char *value = 0; + for( int nth = 0; + (value = b_vformat_attribute_param_get_nth_value(param, nth)); + nth++ ) + { + if( ret.size() ) + ret += ","; + ret += value; + } + } + + return ret; +} + + +////////////////////////////////////////////////////////////////////////////// +// vCalendar + +vBase::vBase() + : m_format(b_vformat_new()) +{ +} + +vBase::vBase(b_VFormat *format) + : m_format(format) +{ + if( !format ) + throw Barry::Error("Cannot construct vBase with null format"); +} + +vBase::~vBase() +{ + if( m_format ) { + b_vformat_free(m_format); + m_format = 0; + } +} + +void vBase::SetFormat(b_VFormat *format) +{ + if( !format ) + throw Barry::Error("Cannot set vBase with null format"); + + if( m_format ) { + b_vformat_free(m_format); + m_format = 0; + } + m_format = format; +} + +void vBase::Clear() +{ + if( m_format ) { + b_vformat_free(m_format); + m_format = b_vformat_new(); + } +} + +vAttrPtr vBase::NewAttr(const char *name) +{ +// Trace trace("vBase::NewAttr"); + +// trace.logf("creating valueless attr: %s", name); + + vAttrPtr attr(b_vformat_attribute_new(NULL, name)); + if( !attr.Get() ) + throw Barry::ConvertError("resource error allocating vformat attribute"); + return attr; +} + +vAttrPtr vBase::NewAttr(const char *name, const char *value) +{ +// Trace trace("vBase::NewAttr"); + +/* +some vCard values are positional (like name), so blank should be allowed... + + if( strlen(value) == 0 ) { + trace.logf("attribute '%s' contains no data, skipping", name); + return vAttrPtr(); + } +*/ + +// trace.logf("creating attr: %s, %s", name, value); + + vAttrPtr attr(b_vformat_attribute_new(NULL, name)); + if( !attr.Get() ) + throw ConvertError("resource error allocating vformat attribute"); + + b_vformat_attribute_add_value(attr.Get(), value); + return attr; +} + +void vBase::AddAttr(vAttrPtr attr) +{ +// Trace trace("vBase::AddAttr"); + + if( !attr.Get() ) { +// trace.log("attribute contains no data, skipping"); + return; + } + + b_vformat_add_attribute(m_format, attr.Extract()); +} + +void vBase::AddValue(vAttrPtr &attr, const char *value) +{ +// Trace trace("vBase::AddValue"); + if( !attr.Get() ) { +// trace.log("attribute pointer contains no data, skipping"); + return; + } +/* + if( strlen(value) == 0 ) { + trace.log("attribute value is empty, skipping"); + return; + } +*/ + b_vformat_attribute_add_value(attr.Get(), value); +} + +void vBase::AddEncodedValue(vAttrPtr &attr, b_VFormatEncoding encoding, const char *value, int len) +{ +// Trace trace("vBase::AddValue"); + if( !attr.Get() ) { +// trace.log("attribute pointer contains no data, skipping"); + return; + } + + attr.Get()->encoding = encoding; + attr.Get()->encoding_set = TRUE; + + b_vformat_attribute_add_value_decoded(attr.Get(), value, len); +} + +void vBase::AddParam(vAttrPtr &attr, const char *name, const char *value) +{ +// Trace trace("vBase::AddParam"); + + if( !attr.Get() ) { +// trace.log("attribute pointer contains no data, skipping"); + return; + } +/* + if( strlen(value) == 0 ) { + trace.log("parameter value is empty, skipping"); + return; + } +*/ + + b_VFormatParam *pParam = b_vformat_attribute_param_new(name); + b_vformat_attribute_param_add_value(pParam, value); + b_vformat_attribute_add_param(attr.Get(), pParam); +} + +std::string vBase::GetAttr(const char *attrname, const char *block) +{ +// Trace trace("vBase::GetAttr"); +// trace.logf("getting attr: %s", attrname); + + std::string ret; + const char *value = 0; + + bool needs_freeing = false; + + b_VFormatAttribute *attr = b_vformat_find_attribute(m_format, attrname, 0, block); + if( attr ) { + if( b_vformat_attribute_is_single_valued(attr) ) { + value = b_vformat_attribute_get_value(attr); + needs_freeing = true; + } + else { + // FIXME, this is hardcoded + value = b_vformat_attribute_get_nth_value(attr, 0); + } + } + + if( value ) + ret = value; + + if( needs_freeing ) + g_free((char *)value); + +// trace.logf("attr value: %s", ret.c_str()); + return ret; +} + +std::vector vBase::GetValueVector(const char *attrname, const char *block) +{ +// Trace trace("vBase::GetValueVector"); +// trace.logf("getting value vector for: %s", attrname); + + std::vector ret; + const char *value = 0; + bool needs_freeing = false; + + b_VFormatAttribute *attr = b_vformat_find_attribute(m_format, attrname, 0, block); + if( attr ) { + if( b_vformat_attribute_is_single_valued(attr) ) { + value = b_vformat_attribute_get_value(attr); + needs_freeing = true; + } else { + // nasty, but avoids tweaking vformat. + int idx = 0; + do { + value = b_vformat_attribute_get_nth_value(attr, idx++); + if( value ) { + ret.push_back(value); + } + } while( value ); + } + } + + if( needs_freeing ) + g_free((char *)value); + + return ret; +} + +vAttr vBase::GetAttrObj(const char *attrname, int nth, const char *block) +{ +// Trace trace("vBase::GetAttrObj"); +// trace.logf("getting attr: %s", attrname); + + return vAttr(b_vformat_find_attribute(m_format, attrname, nth, block)); +} + +std::vector vBase::Tokenize(const std::string& str, const char delim) +{ + std::vector tokens; + std::string::size_type delimPos = 0, tokenPos = 0, pos = 0; + + if( str.length() < 1 ) { + return tokens; + } + + while( 1 ) { + delimPos = str.find_first_of(delim, pos); + tokenPos = str.find_first_not_of(delim, pos); + + if( std::string::npos != delimPos ) { + if( std::string::npos != tokenPos ) { + if( tokenPos < delimPos ) { + tokens.push_back(str.substr(pos, delimPos-pos)); + } else { + tokens.push_back(""); + } + } else { + tokens.push_back(""); + } + pos = delimPos + 1; + } else { + if( std::string::npos != tokenPos ){ + tokens.push_back(str.substr(pos)); + } else { + tokens.push_back(""); + } + break; + } + } + return tokens; +} + +std::string vBase::ToStringList(const std::vector &list, const char delim) +{ + std::string str; + for( unsigned int idx = 0; idx < list.size(); idx++ ) { + if( idx ) { + str += delim; + } + str += list[idx]; + } + return str; +} + +}} // namespace Barry::Sync + diff -Nru barry-0.14/src/vbase.h barry-0.0.20110506/src/vbase.h --- barry-0.14/src/vbase.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vbase.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,152 @@ +/// +/// \file vbase.h +/// Base class for vformat support +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_VBASE_H__ +#define __BARRY_SYNC_VBASE_H__ + +#include "dll.h" +#include "vsmartptr.h" +#include "vformat.h" +#include "error.h" +#include + +namespace Barry { namespace Sync { + +// +// vTimeZone +// +/// A virtual base class that the plugins may override, to do +/// time related conversions. Default implementations for these +/// functions are provided, but may be overrided depending on need. +/// +/// We do this in a "callback" style, so that it doesn't matter what +/// version of the opensync library we link against, in case the +/// user wishes to use the opensync time functions. +/// +class BXEXPORT vTimeConverter +{ +public: + virtual ~vTimeConverter() {} + + /// Convert a time_t into an ISO timestamp string + /// Throws Barry::ConvertError on error, but these errors + /// must be rare. + virtual std::string unix2vtime(const time_t *timestamp); + + /// Convert an ISO timestamp string into a time_t, using + /// the current system timezone if vtime is not in UTC. + /// Returns (time_t)-1 on error. + virtual time_t vtime2unix(const char *vtime); + + /// Convert a VEVENT alarm duration string in the format + /// of "[+-]P.W.DT.H.M.S" where the periods represent numbers + /// and each letter besides P and T represent Week, Day, + /// Hour, Minute, and Second respectively. + virtual int alarmduration2sec(const char *alarm); +}; + + +typedef Barry::vSmartPtr vAttrPtr; +typedef Barry::vSmartPtr vParamPtr; +typedef Barry::vSmartPtr gStringPtr; + + +// +// vAttr +// +/// Class for reading a b_VFormatAttribute. Reading does not require +/// memory management, so none is done. +/// +class BXEXPORT vAttr +{ + b_VFormatAttribute *m_attr; + +public: + vAttr() + : m_attr(0) + { + } + + vAttr(b_VFormatAttribute *attr) + : m_attr(attr) + { + } + + vAttr& operator=(b_VFormatAttribute *attr) + { + m_attr = attr; + return *this; + } + + b_VFormatAttribute* Get() { return m_attr; } + + // These functions do not throw an error if the value + // is NULL or does not exist (for example, if you ask for + // value #5 and there are only 4). + std::string GetName(); + std::string GetValue(int nth = 0); + std::string GetDecodedValue(); + std::string GetParam(const char *name, int nth = 0); + std::string GetAllParams(const char *name); +}; + + +// +// vBase +// +/// Base class containing vformat helper API. +/// +class BXEXPORT vBase +{ + // internal data for managing the vformat + b_VFormat *m_format; + +public: +protected: + vBase(); + explicit vBase(b_VFormat *format); + virtual ~vBase(); + + b_VFormat* Format() { return m_format; } + const b_VFormat* Format() const { return m_format; } + void SetFormat(b_VFormat *format); + + void Clear(); + + vAttrPtr NewAttr(const char *name); + vAttrPtr NewAttr(const char *name, const char *value); + void AddAttr(vAttrPtr attr); + void AddValue(vAttrPtr &attr, const char *value); + void AddEncodedValue(vAttrPtr &attr, b_VFormatEncoding encoding, const char *value, int len); + void AddParam(vAttrPtr &attr, const char *name, const char *value); + + std::string GetAttr(const char *attrname, const char *block = 0); + std::vector GetValueVector(const char *attrname, const char *block = 0); + vAttr GetAttrObj(const char *attrname, int nth = 0, const char *block = 0); + + std::vector Tokenize(const std::string &str, const char delim = ','); + std::string ToStringList(const std::vector &list, const char delim = ','); +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/vcard.cc barry-0.0.20110506/src/vcard.cc --- barry-0.14/src/vcard.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vcard.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,577 @@ +/// +/// \file vcard.cc +/// Conversion routines for vcards +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vcard.h" +#include +#include +#include +#include + +namespace Barry { namespace Sync { + +////////////////////////////////////////////////////////////////////////////// +// Utility functions + +namespace { + + void ToLower(std::string &str) + { + size_t i = 0; + while( i < str.size() ) { + str[i] = tolower(str[i]); + i++; + } + } + +} + +////////////////////////////////////////////////////////////////////////////// +// vCard + +vCard::vCard() + : m_gCardData(0) +{ +} + +vCard::~vCard() +{ + if( m_gCardData ) { + g_free(m_gCardData); + } +} + +void vCard::AddAddress(const char *rfc_type, const Barry::PostalAddress &address) +{ + // add label first + vAttrPtr label = NewAttr("LABEL"); + AddParam(label, "TYPE", rfc_type); + AddValue(label, address.GetLabel().c_str()); + AddAttr(label); + + // add breakout address form + vAttrPtr adr = NewAttr("ADR"); // RFC 2426, 3.2.1 + AddParam(adr, "TYPE", rfc_type); + AddValue(adr, address.Address3.c_str()); // PO Box + AddValue(adr, address.Address2.c_str()); // Extended address + AddValue(adr, address.Address1.c_str()); // Street address + AddValue(adr, address.City.c_str()); // Locality (city) + AddValue(adr, address.Province.c_str()); // Region (province) + AddValue(adr, address.PostalCode.c_str()); // Postal code + AddValue(adr, address.Country.c_str()); // Country name + AddAttr(adr); +} + +void vCard::AddCategories(const Barry::CategoryList &categories) +{ + if( !categories.size() ) + return; + + vAttrPtr cat = NewAttr("CATEGORIES"); // RFC 2426, 3.6.1 + Barry::CategoryList::const_iterator i = categories.begin(); + for( ; i < categories.end(); ++i ) { + AddValue(cat, i->c_str()); + } + AddAttr(cat); +} + +/// Add phone conditionally, only if phone has data in it. This version +/// does not add a TYPE parameter to the item. +void vCard::AddPhoneCond(const std::string &phone) +{ + if( phone.size() ) { + vAttrPtr tel = NewAttr("TEL", phone.c_str()); + AddAttr(tel); + } +} + +/// Add phone conditionally, only if phone has data in it +void vCard::AddPhoneCond(const char *rfc_type, const std::string &phone) +{ + if( phone.size() ) { + vAttrPtr tel = NewAttr("TEL", phone.c_str()); + AddParam(tel, "TYPE", rfc_type); + AddAttr(tel); + } +} + +void vCard::ParseAddress(vAttr &adr, Barry::PostalAddress &address) +{ + // RFC 2426, 3.2.1 + address.Address3 = adr.GetValue(0); // PO Box + address.Address2 = adr.GetValue(1); // Extended address + address.Address1 = adr.GetValue(2); // Street address + address.City = adr.GetValue(3); // Locality (city) + address.Province = adr.GetValue(4); // Region (province) + address.PostalCode = adr.GetValue(5); // Postal code + address.Country = adr.GetValue(6); // Country name +} + +void vCard::ParseCategories(vAttr &cat, Barry::CategoryList &cats) +{ + int i = 0; + std::string value = cat.GetValue(i); + while( value.size() ) { + cats.push_back(value); + i++; + value = cat.GetValue(i); + } +} + + + +// Main conversion routine for converting from Barry::Contact to +// a vCard string of data. +const std::string& vCard::ToVCard(const Barry::Contact &con) +{ +// Trace trace("vCard::ToVCard"); + std::ostringstream oss; + con.Dump(oss); +// trace.logf("ToVCard, initial Barry record: %s", oss.str().c_str()); + + // start fresh + Clear(); + SetFormat( b_vformat_new() ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + // store the Barry object we're working with + m_BarryContact = con; + + // + // begin building vCard data + // + + AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Contact Record//EN")); + + std::string fullname = con.GetFullName(); + if( fullname.size() ) { + AddAttr(NewAttr("FN", fullname.c_str())); + } + else { + // + // RFC 2426, 3.1.1 states that FN MUST be present in the + // vcard object. Unfortunately, the Blackberry doesn't + // require a name, only a name or company name. + // + // In this case we do nothing, and generate an invalid + // vcard, since if we try to fix our output here, we'll + // likely end up with duplicated company names in the + // Blackberry record after a few syncs. + // + } + + if( con.FirstName.size() || con.LastName.size() ) { + vAttrPtr name = NewAttr("N"); // RFC 2426, 3.1.2 + AddValue(name, con.LastName.c_str()); // Family Name + AddValue(name, con.FirstName.c_str()); // Given Name + AddValue(name, ""); // Additional Names + AddValue(name, con.Prefix.c_str()); // Honorific Prefixes + AddValue(name, ""); // Honorific Suffixes + AddAttr(name); + } + + if( con.WorkAddress.HasData() ) + AddAddress("work", con.WorkAddress); + if( con.HomeAddress.HasData() ) + AddAddress("home", con.HomeAddress); + + // add all applicable phone numbers... there can be multiple + // TEL fields, even with the same TYPE value... therefore, the + // second TEL field with a TYPE=work, will be stored in WorkPhone2 + AddPhoneCond("voice,pref", con.Phone); + AddPhoneCond("fax", con.Fax); + AddPhoneCond("voice,work", con.WorkPhone); + AddPhoneCond("voice,work", con.WorkPhone2); + AddPhoneCond("voice,home", con.HomePhone); + AddPhoneCond("voice,home", con.HomePhone2); + AddPhoneCond("msg,cell", con.MobilePhone); + AddPhoneCond("msg,pager", con.Pager); + AddPhoneCond("voice", con.OtherPhone); + + // add all email addresses, marking first one as "pref" + Barry::Contact::EmailList::const_iterator eai = con.EmailAddresses.begin(); + for( unsigned int i = 0; eai != con.EmailAddresses.end(); ++eai, ++i ) { + const std::string& e = con.GetEmail(i); + if( e.size() ) { + vAttrPtr email = NewAttr("EMAIL", e.c_str()); + if( i == 0 ) { + AddParam(email, "TYPE", "internet,pref"); + } + else { + AddParam(email, "TYPE", "internet"); + } + AddAttr(email); + } + } + + if( con.JobTitle.size() ) { + AddAttr(NewAttr("TITLE", con.JobTitle.c_str())); + AddAttr(NewAttr("ROLE", con.JobTitle.c_str())); + } + + if( con.Company.size() ) { + // RFC 2426, 3.5.5 + vAttrPtr org = NewAttr("ORG", con.Company.c_str()); // Organization name + AddValue(org, ""); // Division name + AddAttr(org); + } + + if( con.Birthday.HasData() ) + AddAttr(NewAttr("BDAY", con.Birthday.ToYYYYMMDD().c_str())); + + if( con.Notes.size() ) + AddAttr(NewAttr("NOTE", con.Notes.c_str())); + if( con.URL.size() ) + AddAttr(NewAttr("URL", con.URL.c_str())); + if( con.Categories.size() ) + AddCategories(con.Categories); + + // Image / Photo + if (con.Image.size()) { + vAttrPtr photo = NewAttr("PHOTO"); + AddEncodedValue(photo, VF_ENCODING_BASE64, con.Image.c_str(), con.Image.size()); + AddParam(photo, "ENCODING", "BASE64"); + AddAttr(photo); + } + + // generate the raw VCARD data + m_gCardData = b_vformat_to_string(Format(), VFORMAT_CARD_30); + m_vCardData = m_gCardData; + +// trace.logf("ToVCard, resulting vcard data: %s", m_vCardData.c_str()); + return m_vCardData; +} + +// +// NOTE: +// Treat the following pairs of variables like +// sliding buffers, where higher priority values +// can push existings values from 1 to 2, or from +// 2 to oblivion: +// +// HomePhone + HomePhone2 +// WorkPhone + WorkPhone2 +// Phone + OtherPhone +// +// +// class SlidingPair +// +// This class handles the sliding pair logic for a pair of std::strings. +// +class SlidingPair +{ + std::string &m_first; + std::string &m_second; + int m_evolutionSlot1, m_evolutionSlot2; +public: + static const int DefaultSlot = 99; + SlidingPair(std::string &first, std::string &second) + : m_first(first) + , m_second(second) + , m_evolutionSlot1(DefaultSlot) + , m_evolutionSlot2(DefaultSlot) + { + } + + bool assign(const std::string &value, const char *type_str, int evolutionSlot) + { + bool used = false; + + if( strstr(type_str, "pref") || evolutionSlot < m_evolutionSlot1 ) { + m_second = m_first; + m_evolutionSlot2 = m_evolutionSlot1; + + m_first = value; + m_evolutionSlot1 = evolutionSlot; + + used = true; + } + else if( evolutionSlot < m_evolutionSlot2 ) { + m_second = value; + m_evolutionSlot2 = evolutionSlot; + used = true; + } + else if( m_first.size() == 0 ) { + m_first = value; + m_evolutionSlot1 = evolutionSlot; + used = true; + } + else if( m_second.size() == 0 ) { + m_second = value; + m_evolutionSlot2 = evolutionSlot; + used = true; + } + + return used; + } +}; + + +// Main conversion routine for converting from vCard data string +// to a Barry::Contact object. +const Barry::Contact& vCard::ToBarry(const char *vcard, uint32_t RecordId) +{ + using namespace std; + +// Trace trace("vCard::ToBarry"); +// trace.logf("ToBarry, working on vcard data: %s", vcard); + + // start fresh + Clear(); + + // store the vCard raw data + m_vCardData = vcard; + + // create format parser structures + SetFormat( b_vformat_new_from_string(vcard) ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + + // + // Parse the vcard data + // + + Barry::Contact &con = m_BarryContact; + con.SetIds(Barry::Contact::GetDefaultRecType(), RecordId); + + vAttr name = GetAttrObj("N"); + if( name.Get() ) { + // RFC 2426, 3.1.2 + con.LastName = name.GetValue(0); // Family Name + con.FirstName = name.GetValue(1); // Given Name + con.Prefix = name.GetValue(3); // Honorific Prefixes + } + + vAttr adr = GetAttrObj("ADR"); + for( int i = 0; adr.Get(); adr = GetAttrObj("ADR", ++i) ) + { + std::string type = adr.GetAllParams("TYPE"); + ToLower(type); + + // do not use "else" here, since TYPE can have multiple keys + if( strstr(type.c_str(), "work") ) + ParseAddress(adr, con.WorkAddress); + if( strstr(type.c_str(), "home") ) + ParseAddress(adr, con.HomeAddress); + } + + + // + // NOTE: + // Treat the following pairs of variables like + // sliding buffers, where higher priority values + // can push existings values from 1 to 2, or from + // 2 to oblivion: + // + // HomePhone + HomePhone2 + // WorkPhone + WorkPhone2 + // Phone + OtherPhone + // + SlidingPair HomePair(con.HomePhone, con.HomePhone2); + SlidingPair WorkPair(con.WorkPhone, con.WorkPhone2); + SlidingPair OtherPair(con.Phone, con.OtherPhone); + + // add all applicable phone numbers... there can be multiple + // TEL fields, even with the same TYPE value... therefore, the + // second TEL field with a TYPE=work, will be stored in WorkPhone2 + vAttr tel = GetAttrObj("TEL"); + for( int i = 0; tel.Get(); tel = GetAttrObj("TEL", ++i) ) + { + // grab all parameter values for this param name + std::string stype = tel.GetAllParams("TYPE"); + + // grab evolution-specific parameter... evolution is too + // lazy to sort its VCARD output, but instead it does + // its own non-standard tagging... so we try to + // accommodate it, so Work and Home phone numbers keep + // their order if possible + int evolutionSlot = atoi(tel.GetAllParams("X-EVOLUTION-UI-SLOT").c_str()); + if( evolutionSlot == 0 ) + evolutionSlot = SlidingPair::DefaultSlot; + + // turn to lower case for comparison + // FIXME - is this i18n safe? + ToLower(stype); + + // state + const char *type = stype.c_str(); + bool used = false; + + // Check for possible TYPE conflicts: + // pager can coexist with cell/pcs/car + // fax conflicts with cell/pcs/car + // fax conflicts with pager + bool mobile_type = strstr(type, "cell") || + strstr(type, "pcs") || + strstr(type, "car"); + bool fax_type = strstr(type, "fax"); + bool pager_type = strstr(type, "pager"); + if( fax_type && (mobile_type || pager_type) ) { + // conflict found, log and skip +// trace.logf("ToBarry: skipping phone number due to TYPE conflict: fax cannot coexist with %s: %s", +// mobile_type ? "cell/pcs/car" : "pager", +// type); + continue; + } + + // If phone number has the "pref" flag + if( strstr(type, "pref") ) { + // Always use cell phone if the "pref" flag is set + if( strstr(type, "cell") ) { + used = OtherPair.assign(tel.GetValue(), type, evolutionSlot); + } + // Otherwise, the phone has to be "voice" type + else if( strstr(type, "voice") && con.Phone.size() == 0 ) { + used = OtherPair.assign(tel.GetValue(), type, evolutionSlot); + } + } + + // For each known phone type + // Fax : + if( strstr(type, "fax") && (strstr(type, "pref") || con.Fax.size() == 0) ) { + con.Fax = tel.GetValue(); + used = true; + } + // Mobile phone : + else if( mobile_type && (strstr(type, "pref") || con.MobilePhone.size() == 0) ) { + con.MobilePhone = tel.GetValue(); + used = true; + } + // Pager : + else if( strstr(type, "pager") && (strstr(type, "pref") || con.Pager.size() == 0) ) { + con.Pager = tel.GetValue(); + used = true; + } + // Check for any TEL-ignore types, and use other phone field if possible + // bbs/video/modem entire TEL ignored by Barry + // isdn entire TEL ignored by Barry + else if( strstr(type, "bbs") || strstr(type, "video") || strstr(type, "modem") ) { + } + else if( strstr(type, "isdn") ) { + } + // Voice telephone : + else { + if( strstr(type, "work") ) { + used = WorkPair.assign(tel.GetValue(), type, evolutionSlot); + } + + if( strstr(type, "home") ) { + used = HomePair.assign(tel.GetValue(), type, evolutionSlot); + } + } + + // if this value has not been claimed by any of the + // cases above, claim it now as "OtherPhone" + if( !used && con.OtherPhone.size() == 0 ) { + OtherPair.assign(tel.GetValue(), type, evolutionSlot); + } + } + + // scan for all email addresses... append addresses to the + // list by default, but prepend if its type is set to "pref" + // i.e. we want the preferred email address first + vAttr email = GetAttrObj("EMAIL"); + for( int i = 0; email.Get(); email = GetAttrObj("EMAIL", ++i) ) + { + std::string type = email.GetAllParams("TYPE"); + ToLower(type); + + bool of_interest = (i == 0 || strstr(type.c_str(), "pref")); + bool x400 = strstr(type.c_str(), "x400"); + + if( of_interest && !x400 ) { + con.EmailAddresses.insert(con.EmailAddresses.begin(), email.GetValue()); + } + else { + con.EmailAddresses.push_back( email.GetValue() ); + } + } + + // figure out which company title we want to keep... + // favour the TITLE field, but if it's empty, use ROLE + con.JobTitle = GetAttr("TITLE"); + if( !con.JobTitle.size() ) + con.JobTitle = GetAttr("ROLE"); + + con.Company = GetAttr("ORG"); + con.Notes = GetAttr("NOTE"); + con.URL = GetAttr("URL"); + if( GetAttr("BDAY").size() && !con.Birthday.FromYYYYMMDD( GetAttr("BDAY") ) ) + throw ConvertError("Unable to parse BDAY field"); + + // Photo vCard ? + vAttr photo = GetAttrObj("PHOTO"); + if (photo.Get()) { + std::string sencoding = photo.GetAllParams("ENCODING"); + + ToLower(sencoding); + + const char *encoding = sencoding.c_str(); + + if (strstr(encoding, "quoted-printable")) { + photo.Get()->encoding = VF_ENCODING_QP; + + con.Image = photo.GetDecodedValue(); + } + else if (strstr(encoding, "b")) { + photo.Get()->encoding = VF_ENCODING_BASE64; + + con.Image = photo.GetDecodedValue(); + } + // Else + // We ignore the photo, I don't know decoded ! + } + + vAttr cat = GetAttrObj("CATEGORIES"); + if( cat.Get() ) + ParseCategories(cat, con.Categories); + + // Last sanity check: Blackberry requires that at least + // name or Company has data. + if( !con.GetFullName().size() && !con.Company.size() ) + throw ConvertError("FN and ORG fields both blank in VCARD data"); + + return m_BarryContact; +} + +// Transfers ownership of m_gCardData to the caller. +char* vCard::ExtractVCard() +{ + char *ret = m_gCardData; + m_gCardData = 0; + return ret; +} + +void vCard::Clear() +{ + vBase::Clear(); + m_vCardData.clear(); + m_BarryContact.Clear(); + + if( m_gCardData ) { + g_free(m_gCardData); + m_gCardData = 0; + } +} + +}} // namespace Barry::Sync + diff -Nru barry-0.14/src/vcard.h barry-0.0.20110506/src/vcard.h --- barry-0.14/src/vcard.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vcard.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,78 @@ +/// +/// \file vcard.h +/// Conversion routines for vcards +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_VCARD_H__ +#define __BARRY_SYNC_VCARD_H__ + +#include "dll.h" +#include "vbase.h" +#include "r_contact.h" +#include +#include + +namespace Barry { namespace Sync { + +// +// vCard +// +/// Class for converting between RFC 2425/2426 vCard data format, +/// and the Barry::Contact class. +/// +class BXEXPORT vCard : public vBase +{ + // data to pass to external requests + char *m_gCardData; // dynamic memory returned by vformat()... can + // be used directly by the plugin, without + // overmuch allocation and freeing (see Extract()) + std::string m_vCardData;// copy of m_gCardData, for C++ use + Barry::Contact m_BarryContact; + +protected: + void AddAddress(const char *rfc_type, const Barry::PostalAddress &addr); + void AddCategories(const Barry::CategoryList &categories); + void AddPhoneCond(const std::string &phone); + void AddPhoneCond(const char *rfc_type, const std::string &phone); + + void ParseAddress(vAttr &adr, Barry::PostalAddress &address); + void ParseCategories(vAttr &cat, Barry::CategoryList &cats); + +public: + vCard(); + ~vCard(); + + const std::string& ToVCard(const Barry::Contact &con); + const Barry::Contact& ToBarry(const char *vcal, uint32_t RecordId); + + const std::string& GetVCard() const { return m_vCardData; } + const Barry::Contact& GetBarryContact() const { return m_BarryContact; } + + char* ExtractVCard(); + + void Clear(); + + // This is the v-name of the innermost BEGIN/END block + static const char* GetVName() { return "VCARD"; } +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/version.cc barry-0.0.20110506/src/version.cc --- barry-0.14/src/version.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/version.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,20 +23,21 @@ #include "config.h" #ifdef WORDS_BIGENDIAN -#define BARRY_VERSION_STRING "Barry library version 0.14 (big endian)" +#define BARRY_VERSION_STRING "Barry library version 0.18.0 (big endian)" #else -#define BARRY_VERSION_STRING "Barry library version 0.14 (little endian)" +#define BARRY_VERSION_STRING "Barry library version 0.18.0 (little endian)" #endif -#define BARRY_VERSION_MAJOR 0 -#define BARRY_VERSION_MINOR 14 +#define BARRY_VERSION_LOGICAL 0 +#define BARRY_VERSION_MAJOR 18 +#define BARRY_VERSION_MINOR 0 namespace Barry { /// Fills major and minor with integer version numbers, and /// returns a string containing human readable version /// information in English. -const char* Version(int &major, int &minor) +const char* Version(int &logical, int &major, int &minor) { major = BARRY_VERSION_MAJOR; minor = BARRY_VERSION_MINOR; diff -Nru barry-0.14/src/version.h barry-0.0.20110506/src/version.h --- barry-0.14/src/version.h 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/src/version.h 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,7 +26,7 @@ namespace Barry { -BXEXPORT const char* Version(int &major, int &minor); +BXEXPORT const char* Version(int &logical, int &major, int &minor); } // namespace Barry diff -Nru barry-0.14/src/vevent.cc barry-0.0.20110506/src/vevent.cc --- barry-0.14/src/vevent.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vevent.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,650 @@ +// +// \file vevent.cc +// Conversion routines for vevents (VCALENDAR, etc) +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2009, Dr J A Gow + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vevent.h" +//#include "trace.h" +#include +#include +#include +#include +#include +#include + +using namespace std; + +namespace Barry { namespace Sync { + +////////////////////////////////////////////////////////////////////////////// +// vCalendar + +vCalendar::vCalendar(vTimeConverter &vtc) + : m_vtc(vtc) + , m_gCalData(0) +{ +} + +vCalendar::~vCalendar() +{ + if( m_gCalData ) { + g_free(m_gCalData); + } +} + +const char *vCalendar::WeekDays[] = { "SU", "MO", "TU", "WE", "TH", "FR", "SA" }; + +unsigned short vCalendar::GetWeekDayIndex(const char *dayname) +{ + for( int i = 0; i < 7; i++ ) { + if( strcasecmp(dayname, WeekDays[i]) == 0 ) + return i; + } + return 0; +} + +unsigned short vCalendar::GetMonthWeekNumFromBYDAY(const std::string& ByDay) +{ + return atoi(ByDay.substr(0,ByDay.length()-2).c_str()); +} + +unsigned short vCalendar::GetWeekDayIndexFromBYDAY(const std::string& ByDay) +{ + return GetWeekDayIndex(ByDay.substr(ByDay.length()-2).c_str()); +} + + +bool vCalendar::HasMultipleVEvents() const +{ + int count = 0; + b_VFormat *format = const_cast(Format()); + GList *attrs = format ? b_vformat_get_attributes(format) : 0; + for( ; attrs; attrs = attrs->next ) { + b_VFormatAttribute *attr = (b_VFormatAttribute*) attrs->data; + if( strcasecmp(b_vformat_attribute_get_name(attr), "BEGIN") == 0 && + strcasecmp(b_vformat_attribute_get_nth_value(attr, 0), "VEVENT") == 0 ) + { + count++; + } + } + return count > 1; +} + +void vCalendar::RecurToVCal() +{ + using namespace Barry; + using namespace std; + Barry::Calendar &cal = m_BarryCal; + + if( !cal.Recurring ) + return; + + vAttrPtr attr = NewAttr("RRULE"); + + switch( cal.RecurringType ) + { + case Calendar::Day: // eg. every day + AddValue(attr,"FREQ=DAILY"); + break; + + case Calendar::MonthByDate: // eg. every month on the 12th + // see: DayOfMonth + AddValue(attr,"FREQ=MONTHLY"); + { + ostringstream oss; + oss << "BYMONTHDAY=" << cal.DayOfMonth; + AddValue(attr, oss.str().c_str()); + } + break; + + case Calendar::MonthByDay: // eg. every month on 3rd Wed + // see: DayOfWeek and WeekOfMonth + AddValue(attr, "FREQ=MONTHLY"); + if( cal.DayOfWeek <= 6 ) { // DayOfWeek is unsigned + ostringstream oss; + oss << "BYDAY=" << cal.WeekOfMonth << WeekDays[cal.DayOfWeek]; + AddValue(attr, oss.str().c_str()); + } + break; + + case Calendar::YearByDate: // eg. every year on March 5 + // see: DayOfMonth and MonthOfYear + AddValue(attr, "FREQ=YEARLY"); + { + ostringstream oss; + oss << "BYMONTH=" << cal.MonthOfYear; + AddValue(attr, oss.str().c_str()); + } + { + ostringstream oss; + oss << "BYMONTHDAY=" << cal.DayOfMonth; + AddValue(attr, oss.str().c_str()); + } + break; + + case Calendar::YearByDay: // eg. every year on 3rd Wed of Jan + // see: DayOfWeek, WeekOfMonth, and + // MonthOfYear + AddValue(attr, "FREQ=YEARLY"); + if( cal.DayOfWeek <= 6 ) { // DayOfWeek is unsigned + ostringstream oss; + oss << "BYDAY=" << cal.WeekOfMonth << WeekDays[cal.DayOfWeek]; + AddValue(attr, oss.str().c_str()); + + oss.str(""); + oss << "BYMONTH=" << cal.MonthOfYear; + AddValue(attr, oss.str().c_str()); + } + break; + + case Calendar::Week: // eg. every week on Mon and Fri + // see: WeekDays + AddValue(attr, "FREQ=WEEKLY"); + { + ostringstream oss; + oss << "BYDAY="; + for( int i = 0, bm = 1, cnt = 0; i < 7; i++, bm <<= 1 ) { + if( cal.WeekDays & bm ) { + if( cnt ) + oss << ","; + oss << WeekDays[i]; + cnt++; + } + } + AddValue(attr, oss.str().c_str()); + } + break; + + default: + throw ConvertError("Unknown RecurringType in Barry Calendar object"); + } + + // add some common parameters + if( cal.Interval > 1 ) { + ostringstream oss; + oss << "INTERVAL=" << cal.Interval; + AddValue(attr, oss.str().c_str()); + } + if( !cal.Perpetual ) { + ostringstream oss; + oss << "UNTIL=" << m_vtc.unix2vtime(&cal.RecurringEndTime); + AddValue(attr, oss.str().c_str()); + } + + AddAttr(attr); + +/* + bool AllDayEvent; + + /// + /// Recurring data + /// + /// Note: interval can be used on all of these recurring types to + /// make it happen "every other time" or more, etc. + /// + + bool Recurring; + RecurringCodeType RecurringType; + unsigned short Interval; // must be >= 1 + time_t RecurringEndTime; // only pertains if Recurring is true + // sets the date and time when + // recurrence of this appointment + // should no longer occur + // If a perpetual appointment, this + // is 0xFFFFFFFF in the low level data + // Instead, set the following flag. + bool Perpetual; // if true, this will always recur + unsigned short TimeZoneCode; // the time zone originally used + // for the recurrence data... + // seems to have little use, but + // set to your current time zone + // as a good default + + unsigned short // recurring details, depending on type + DayOfWeek, // 0-6 + WeekOfMonth, // 1-5 + DayOfMonth, // 1-31 + MonthOfYear; // 1-12 + unsigned char WeekDays; // bitmask, bit 0 = sunday + + #define CAL_WD_SUN 0x01 + #define CAL_WD_MON 0x02 + #define CAL_WD_TUE 0x04 + #define CAL_WD_WED 0x08 + #define CAL_WD_THU 0x10 + #define CAL_WD_FRI 0x20 + #define CAL_WD_SAT 0x40 + +*/ + +} + +void vCalendar::RecurToBarryCal(vAttr& rrule, time_t starttime) +{ + using namespace Barry; + using namespace std; + Barry::Calendar &cal = m_BarryCal; +// Trace trace("vCalendar::RecurToBarryCal"); + std::map pmap; + pmap["SU"] = CAL_WD_SUN; + pmap["MO"] = CAL_WD_MON; + pmap["TU"] = CAL_WD_TUE; + pmap["WE"] = CAL_WD_WED; + pmap["TH"] = CAL_WD_THU; + pmap["FR"] = CAL_WD_FRI; + pmap["SA"] = CAL_WD_SAT; + + + int i=0; + unsigned int count=0; + string val; + std::map args; + do { + val=rrule.GetValue(i++); + if(val.length()==0) { + break; + } + string n=val.substr(0,val.find("=")); + string v=val.substr(val.find("=")+1); + args[n]=v; +// trace.logf("RecurToBarryCal: |%s|%s|",n.c_str(),v.c_str()); + } while(1); + + // now process the interval. + cal.Recurring=TRUE; + + if(args.find(string("INTERVAL"))!=args.end()) { + cal.Interval = atoi(args["INTERVAL"].c_str()); + } + if(args.find(string("UNTIL"))!=args.end()) { + cal.Perpetual = FALSE; + cal.RecurringEndTime=m_vtc.vtime2unix(args["UNTIL"].c_str()); + if( cal.RecurringEndTime == (time_t)-1 ) { +// trace.logf("osync_time_vtime2unix() failed: UNTIL = %s, zoneoffset = %d", args["UNTIL"].c_str(), zoneoffset); + } + } else { + // if we do not also have COUNT, then we must be forerver + if(args.find(string("COUNT"))==args.end()) { + cal.Perpetual=TRUE; + } else { + // we do have COUNT. This means we won't have UNTIL. + // So we need to process the RecurringEndTime from + // the current start date. Set the count level to + // something other than zero to indicate we need + // to process it as the exact end date will + // depend upon the frequency. + count=atoi(args["COUNT"].c_str()); + if( count == 0 ) { + throw std::runtime_error("Invalid COUNT in recurring rule: " + args["COUNT"]); + } + } + } + + // we need these if COUNT is true, or if we are a yearly job. + + // TO-DO: we must process COUNT in terms of an end date if we have it. + + // Now deal with the freq + + if(args.find(string("FREQ"))==args.end()) { +// trace.logf("RecurToBarryCal: No frequency specified!"); + return; + } + + if(args["FREQ"]==string("DAILY")) { + cal.RecurringType=Calendar::Day; + + } else if(args["FREQ"]==string("WEEKLY")) { + cal.RecurringType=Calendar::Week; + // we must have a dayofweek entry + if(args.find(string("BYDAY"))!=args.end()) { + std::vector v=Tokenize(args["BYDAY"]); + // iterate along our vector and convert + for(unsigned int idx=0;idx28 and the resulting + // month falls on a February. We don't need + // to worry about day of week as mktime() + // clobbers it. + datestruct.tm_year += (datestruct.tm_mon+count)/12; + datestruct.tm_mon = (datestruct.tm_mon+count)%12; + if(datestruct.tm_mday>28 && datestruct.tm_mon==1) { + // force it to 1st Mar + // TODO Potential bug on leap years + datestruct.tm_mon=2; + datestruct.tm_mday=1; + } + if(datestruct.tm_mday==31 && (datestruct.tm_mon==8 || + datestruct.tm_mon==3 || + datestruct.tm_mon==5 || + datestruct.tm_mon==10)) { + datestruct.tm_mon+=1; + datestruct.tm_mday=1; + } + cal.RecurringEndTime=mktime(&datestruct); + } + } else if(args["FREQ"]=="YEARLY") { + if(args.find(string("BYMONTH"))!=args.end()) { + cal.MonthOfYear=atoi(args["BYMONTH"].c_str()); + if(args.find(string("BYMONTHDAY"))!=args.end()) { + cal.RecurringType=Calendar::YearByDate; + cal.DayOfMonth=atoi(args["BYMONTHDAY"].c_str()); + } else { + if(args.find(string("BYDAY"))!=args.end()) { + cal.RecurringType=Calendar::YearByDay; + cal.WeekOfMonth=GetMonthWeekNumFromBYDAY(args["BYDAY"]); + cal.DayOfWeek=GetWeekDayIndexFromBYDAY(args["BYDAY"]); + } else { +// trace.logf("RecurToBarryCal: No qualifier on YEARLY freq"); + } + } + } else { + // otherwise use the start date and translate + // to a BYMONTHDAY. + // cal.StartTime has already been processed + // when we get here we need month of year, + // and day of month. + struct tm datestruct; + localtime_r(&starttime,&datestruct); + cal.RecurringType=Calendar::YearByDate; + cal.MonthOfYear=datestruct.tm_mon; + cal.DayOfMonth=datestruct.tm_mday; + } + if(count) { + // convert to struct tm, then simply add to the year. + struct tm datestruct; + localtime_r(&starttime,&datestruct); + datestruct.tm_year += count; + cal.RecurringEndTime=mktime(&datestruct); + } + } + +// unsigned char WeekDays; // bitmask, bit 0 = sunday +// +// #define CAL_WD_SUN 0x01 +// #define CAL_WD_MON 0x02 +// #define CAL_WD_TUE 0x04 +// #define CAL_WD_WED 0x08 +// #define CAL_WD_THU 0x10 +// #define CAL_WD_FRI 0x20 +// #define CAL_WD_SAT 0x40 +} + +// Main conversion routine for converting from Barry::Calendar to +// a vCalendar string of data. +const std::string& vCalendar::ToVCal(const Barry::Calendar &cal) +{ +// Trace trace("vCalendar::ToVCal"); + std::ostringstream oss; + cal.Dump(oss); +// trace.logf("ToVCal, initial Barry record: %s", oss.str().c_str()); + + // start fresh + Clear(); + SetFormat( b_vformat_new() ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + // store the Barry object we're working with + m_BarryCal = cal; + + // begin building vCalendar data + AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Calendar Record//EN")); + AddAttr(NewAttr("BEGIN", "VEVENT")); + AddAttr(NewAttr("SEQUENCE", "0")); + AddAttr(NewAttr("SUMMARY", cal.Subject.c_str())); + AddAttr(NewAttr("DESCRIPTION", cal.Notes.c_str())); + AddAttr(NewAttr("LOCATION", cal.Location.c_str())); + + string start(m_vtc.unix2vtime(&cal.StartTime)); + string end(m_vtc.unix2vtime(&cal.EndTime)); + string notify(m_vtc.unix2vtime(&cal.NotificationTime)); + + // if an all day event, only print the date parts of the string + if( cal.AllDayEvent && start.find('T') != string::npos ) { + // truncate start date + start = start.substr(0, start.find('T')); + + // create end date 1 day in future + time_t end_t = cal.StartTime + 24 * 60 * 60; + end = m_vtc.unix2vtime(&end_t); + end = end.substr(0, end.find('T')); + } + + AddAttr(NewAttr("DTSTART", start.c_str())); + AddAttr(NewAttr("DTEND", end.c_str())); + // FIXME - add a truly globally unique "UID" string? + + + AddAttr(NewAttr("BEGIN", "VALARM")); + AddAttr(NewAttr("ACTION", "AUDIO")); + + // notify must be UTC, when specified in DATE-TIME + vAttrPtr trigger = NewAttr("TRIGGER", notify.c_str()); + AddParam(trigger, "VALUE", "DATE-TIME"); + AddAttr(trigger); + + AddAttr(NewAttr("END", "VALARM")); + + + if( cal.Recurring ) { + RecurToVCal(); + } + + AddAttr(NewAttr("END", "VEVENT")); + + // generate the raw VCALENDAR data + m_gCalData = b_vformat_to_string(Format(), VFORMAT_EVENT_20); + m_vCalData = m_gCalData; + +// trace.logf("ToVCal, resulting vcal data: %s", m_vCalData.c_str()); + return m_vCalData; +} + +// Main conversion routine for converting from vCalendar data string +// to a Barry::Calendar object. +const Barry::Calendar& vCalendar::ToBarry(const char *vcal, uint32_t RecordId) +{ + using namespace std; + +// Trace trace("vCalendar::ToBarry"); +// trace.logf("ToBarry, working on vcal data: %s", vcal); + + // we only handle vCalendar data with one vevent block + if( HasMultipleVEvents() ) + throw ConvertError("vCalendar data contains more than one VEVENT block, unsupported"); + + // start fresh + Clear(); + + // store the vCalendar raw data + m_vCalData = vcal; + + // create format parser structures + SetFormat( b_vformat_new_from_string(vcal) ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + string start = GetAttr("DTSTART", "/vevent"); +// trace.logf("DTSTART attr retrieved: %s", start.c_str()); + string end = GetAttr("DTEND", "/vevent"); +// trace.logf("DTEND attr retrieved: %s", end.c_str()); + string subject = GetAttr("SUMMARY", "/vevent"); +// trace.logf("SUMMARY attr retrieved: %s", subject.c_str()); + if( subject.size() == 0 ) { + subject = ""; +// trace.logf("ERROR: bad data, blank SUMMARY: %s", vcal); + } + vAttr trigger_obj = GetAttrObj("TRIGGER", 0, "/valarm"); + + string location = GetAttr("LOCATION", "/vevent"); +// trace.logf("LOCATION attr retrieved: %s", location.c_str()); + + string notes = GetAttr("DESCRIPTION", "/vevent"); +// trace.logf("DESCRIPTION attr retrieved: %s", notes.c_str()); + + vAttr rrule = GetAttrObj("RRULE",0,"/vevent"); + + + // + // Now, run checks and convert into Barry object + // + + + // FIXME - we are assuming that any non-UTC timestamps + // in the vcalendar record will be in the current timezone... + // This is wrong! fix this later. + // + // Also, we currently ignore any time zone + // parameters that might be in the vcalendar format... this + // must be fixed. + // + Barry::Calendar &rec = m_BarryCal; + rec.SetIds(Barry::Calendar::GetDefaultRecType(), RecordId); + + if( !start.size() ) + throw ConvertError("Blank DTSTART"); + rec.StartTime = m_vtc.vtime2unix(start.c_str()); + + if( !end.size() ) { + // DTEND is actually optional! According to the + // RFC, a DTSTART with no DTEND should be treated + // like a "special day" like an anniversary, which occupies + // no time. + // + // Since the Blackberry doesn't really map well to this + // case, we'll set the end time to 1 day past start. + // + rec.EndTime = rec.StartTime + 24 * 60 * 60; + } + else { + rec.EndTime = m_vtc.vtime2unix(end.c_str()); + } + + // check for "all day event" which is specified by a DTSTART + // and a DTEND with no times, and one day apart + if( start.find('T') == string::npos && end.size() && + end.find('T') == string::npos && + (rec.EndTime - rec.StartTime) == 24 * 60 * 60 ) + { + rec.AllDayEvent = true; + } + + rec.Subject = subject; + rec.Location = location; + rec.Notes = notes; + + if(rrule.Get()) { + RecurToBarryCal(rrule, rec.StartTime); + } + + // convert trigger time into notification time + // assume no notification, by default + rec.NotificationTime = 0; + if( trigger_obj.Get() ) { + string trigger_type = trigger_obj.GetParam("VALUE"); + string trigger = trigger_obj.GetValue(); + + if( trigger.size() == 0 ) { +// trace.logf("ERROR: no TRIGGER found in calendar entry, assuming notification time as 15 minutes before start."); + } + else if( trigger_type == "DATE-TIME" ) { + rec.NotificationTime = m_vtc.vtime2unix(trigger.c_str()); + } + else if( trigger_type == "DURATION" || trigger_type.size() == 0 ) { + // default is DURATION (RFC 4.8.6.3) + string related = trigger_obj.GetParam("RELATED"); + + // default to relative to start time + time_t *relative = &rec.StartTime; + if( related == "END" ) + relative = &rec.EndTime; + + rec.NotificationTime = *relative + m_vtc.alarmduration2sec(trigger.c_str()); + } + else { + throw ConvertError("Unknown TRIGGER VALUE"); + } + } + else { +// trace.logf("ERROR: no TRIGGER found in calendar entry, assuming notification time as 15 minutes before start."); + } + + std::ostringstream oss; + m_BarryCal.Dump(oss); +// trace.logf("ToBarry, resulting Barry record: %s", oss.str().c_str()); + return m_BarryCal; +} + +// Transfers ownership of m_gCalData to the caller. +char* vCalendar::ExtractVCal() +{ + char *ret = m_gCalData; + m_gCalData = 0; + return ret; +} + +void vCalendar::Clear() +{ + vBase::Clear(); + m_vCalData.clear(); + m_BarryCal.Clear(); + + if( m_gCalData ) { + g_free(m_gCalData); + m_gCalData = 0; + } +} + +}} // namespace Barry::Sync + diff -Nru barry-0.14/src/vevent.h barry-0.0.20110506/src/vevent.h --- barry-0.14/src/vevent.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vevent.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,85 @@ +// +// \file vevent.h +// Conversion routines for vevents (VCALENDAR, etc) +// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_VEVENT_H__ +#define __BARRY_SYNC_VEVENT_H__ + +#include "dll.h" +#include "vbase.h" +#include "vformat.h" +#include "r_calendar.h" +#include +#include + +namespace Barry { namespace Sync { + +// +// vCalendar +// +/// Class for converting between RFC 2445 iCalendar data format, +/// and the Barry::Calendar class. +/// +class BXEXPORT vCalendar : public vBase +{ + // external reference + vTimeConverter &m_vtc; + + // data to pass to external requests + char *m_gCalData; // dynamic memory returned by vformat()... can + // be used directly by the plugin, without + // overmuch allocation and freeing (see Extract()) + std::string m_vCalData; // copy of m_gCalData, for C++ use + Barry::Calendar m_BarryCal; + + static const char *WeekDays[7]; + + unsigned short GetMonthWeekNumFromBYDAY(const std::string& ByDay); + unsigned short GetWeekDayIndexFromBYDAY(const std::string& ByDay); + +protected: + void RecurToVCal(); + void RecurToBarryCal(vAttr& rrule, time_t starttime); + + static unsigned short GetWeekDayIndex(const char *dayname); + bool HasMultipleVEvents() const; + +public: + explicit vCalendar(vTimeConverter &vtc); + ~vCalendar(); + + const std::string& ToVCal(const Barry::Calendar &cal); + const Barry::Calendar& ToBarry(const char *vcal, uint32_t RecordId); + + const std::string& GetVCal() const { return m_vCalData; } + const Barry::Calendar& GetBarryCal() const { return m_BarryCal; } + + char* ExtractVCal(); + + void Clear(); + + // This is the v-name of the innermost BEGIN/END block + static const char* GetVName() { return "VEVENT"; } +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/vformat.c barry-0.0.20110506/src/vformat.c --- barry-0.14/src/vformat.c 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vformat.c 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,2137 @@ +/* + * Copyright (C) 2003 Ximian, Inc. + * + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Author: Chris Toshok (toshok@ximian.com) + * Author: Armin Bauer (armin.bauer@opensync.org) + * + */ + +#include "vformat.h" +#include "clog.h" + +//#ifdef HAVE_CONFIG_H +//#include "config.h" +//#endif + +#include +#include +#include +#include +#include +//#include + +#define TRACE_INTERNAL 1 +#define TRACE_ENTRY 1 +#define TRACE_EXIT 1 +#define TRACE_ERROR 0 + +static size_t base64_encode_step(const unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save); +static size_t base64_decode_step(const unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save); +static size_t base64_decode_simple (char *data, size_t len); +static char *base64_encode_simple (const char *data, size_t len); + +static size_t quoted_decode_simple (char *data, size_t len); +static char *quoted_encode_simple (const unsigned char *string, int len); + + +/** + * _helper_is_base64 is helper function to check i a string is "b" or "base64" + * @param check_string string that should be compared with "b" or "base64" + * @return 0 if check_string is not base64 and 1 if it is + */ +static int _helper_is_base64(const char *check_string) +{ + if(!g_ascii_strcasecmp ((char *) check_string, "BASE64") || + !g_ascii_strcasecmp ((char *) check_string, "b") ) + return (1); + return (0); +} + +time_t b_vformat_time_to_unix(const char *inptime) +{ + char *date = NULL; + char *time = NULL; + char *ftime = NULL; + if ((ftime = g_strrstr(inptime, "T"))) { + + date = g_strndup(inptime, ftime - inptime); + if (ftime[3] == ':') + time = g_strndup(ftime + 1, 8); + else + time = g_strndup(ftime + 1, 6); + } else { + date = g_strdup(inptime); + } + + struct tm btime; + memset(&btime, 0, sizeof(struct tm)); + btime.tm_isdst = -1; + + if (strlen(date) == 10) { + btime.tm_year = date[0] * 1000 + date[1] * 100 + date[2] * 10 + date[3] - '0' * 1111 - 1900; + btime.tm_mon = date[5] * 10 + date[6] - '0' * 11 - 1; + btime.tm_mday = date[8] * 10 + date[9] - '0' * 11; + } else { + btime.tm_year = date[0] * 1000 + date[1] * 100 + date[2] * 10 + date[3] - '0' * 1111- 1900; + btime.tm_mon = date[4] * 10 + date[5] - '0' * 11 - 1; + btime.tm_mday = date[6] * 10 + date[7] - '0' * 11; + } + + if (time && strlen(time) == 8) { + //Time + btime.tm_hour = time[0] * 10 + time[1] - '0' * 11; + btime.tm_min = time[3] * 10 + time[4] - '0' * 11; + btime.tm_sec = time[6] * 10 + time[7] - '0' * 11; + } else if (time && strlen(time) == 6) { + btime.tm_hour = time[0] * 10 + time[1] - '0' * 11; + btime.tm_min = time[2] * 10 + time[3] - '0' * 11; + btime.tm_sec = time[4] * 10 + time[5] - '0' * 11; + } + + time_t utime = mktime(&btime); + return utime; +} + +static char *_fold_lines (char *buf) +{ + GString *str = g_string_new (""); + GString *line = g_string_new (""); + char *p = buf; + char *next, *next2, *q; + gboolean newline = TRUE; + gboolean quotedprintable = FALSE; + + /* + * We're pretty liberal with line folding here. We handle + * lines folded with \r\n, \n\r, \n, =\r\n and =\n\r. + * We also turn single \r's and \n's not followed by into \r\n's. + */ + + while (*p) { + + /* search new lines for quoted printable encoding */ + if (newline) { + for (q=p; *q != '\n' && *q != '\0'; q++) + line = g_string_append_unichar (line, g_utf8_get_char (q)); + + if (strstr(line->str, "ENCODING=QUOTED-PRINTABLE")) + quotedprintable = TRUE; + + g_string_free(line, TRUE); + line = g_string_new (""); + + newline = FALSE; + } + + + if ((quotedprintable && *p == '=') || *p == '\r' || *p == '\n') { + next = g_utf8_next_char (p); + if (*next == '\n' || *next == '\r') { + next2 = g_utf8_next_char (next); + if (*next2 == '\n' || *next2 == '\r' || *next2 == ' ' || *next2 == '\t') { + p = g_utf8_next_char (next2); + } + else if(quotedprintable) { + p = g_utf8_next_char (next); + } + else { + str = g_string_append (str, CRLF); + p = g_utf8_next_char (next); + newline = TRUE; + quotedprintable = FALSE; + } + } + else if (*p == '=') { + str = g_string_append_unichar (str, g_utf8_get_char (p)); + p = g_utf8_next_char (p); + } + else if (*next == ' ' || *next == '\t') { + p = g_utf8_next_char (next); + } + else { + str = g_string_append (str, CRLF); + p = g_utf8_next_char (p); + newline = TRUE; + quotedprintable = FALSE; + } + } + else { + str = g_string_append_unichar (str, g_utf8_get_char (p)); + p = g_utf8_next_char (p); + } + } + + g_free (buf); + g_string_free(line, TRUE); + + return g_string_free (str, FALSE); +} + +/* skip forward until we hit the CRLF, or \0 */ +static void _skip_to_next_line (char **p) +{ + char *lp; + lp = *p; + + while (*lp != '\r' && *lp != '\0') + lp = g_utf8_next_char (lp); + + if (*lp == '\r') { + lp = g_utf8_next_char (lp); /* \n */ + lp = g_utf8_next_char (lp); /* start of the next line */ + } + + *p = lp; +} + +/* skip forward until we hit a character in @s, CRLF, or \0. leave *p + pointing at the character that causes us to stop */ +static void _skip_until (char **p, char *s) +{ + char *lp; + + lp = *p; + + while (*lp != '\r' && *lp != '\0') { + gboolean s_matches = FALSE; + char *ls; + for (ls = s; *ls; ls = g_utf8_next_char (ls)) { + if (g_utf8_get_char (ls) == g_utf8_get_char (lp)) { + s_matches = TRUE; + break; + } + } + + if (s_matches) + break; + lp++; + } + + *p = lp; +} + +static void _read_attribute_value_add (b_VFormatAttribute *attr, GString *str, GString *charset) +{ + /* don't convert empty strings */ + if (str->len == 0) { + b_vformat_attribute_add_value(attr, str->str); + return; + } + + char *inbuf, *outbuf, *p; + size_t inbytesleft, outbytesleft; + + inbuf = str->str; + p = outbuf = malloc(str->len*2); + inbytesleft = str->len; + outbytesleft = str->len*2; + + iconv_t cd; + + /* if a CHARSET was given, let's try to convert inbuf to UTF-8 */ + if (charset) { + + cd = iconv_open("UTF-8", charset->str); +#ifdef SOLARIS + if (iconv(cd, (const char**)&inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { +#else + if (iconv(cd, &inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { +#endif + *p = 0; + b_vformat_attribute_add_value(attr, outbuf); + + } else { + + /* hmm, should not happen */ + b_vformat_attribute_add_value(attr, str->str); + + } + + iconv_close(cd); + + } else { + + /* no CHARSET was given, if inbuf is already UTF-8 we add str->str */ + if (g_utf8_validate (inbuf, -1, NULL)) { + + b_vformat_attribute_add_value (attr, str->str); + + } else { + + /* because inbuf is not UTF-8, we think it is ISO-8859-1 */ + cd = iconv_open("UTF-8", "ISO-8859-1"); +#ifdef SOLARIS + if (iconv(cd, (const char**)&inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { +#else + if (iconv(cd, &inbuf, &inbytesleft, &p, &outbytesleft) != (size_t)(-1)) { +#endif + *p = 0; + b_vformat_attribute_add_value (attr, outbuf); + + } else { + + b_vformat_attribute_add_value (attr, str->str); + + } + + iconv_close(cd); + + } + + } + + free(outbuf); + +} + +static void _read_attribute_value (b_VFormatAttribute *attr, char **p, int format_encoding, GString *charset) +{ + char *lp = *p; + GString *str; + + /* read in the value */ + str = g_string_new (""); + while (*lp != '\r' && *lp != '\0') { + if (*lp == '=' && format_encoding == VF_ENCODING_QP) { + char a, b, x1=0, x2=0; + + if ((a = *(++lp)) == '\0') break; + if ((b = *(++lp)) == '\0') break; + + if (isalnum(a)) { + if (isalnum(b)) { + /* e.g. ...N=C3=BCrnberg\r\n + * ^^^ + */ + x1=a; + x2=b; + } + else if (b == '=') { + /* e.g. ...N=C=\r\n + * ^^^ + * 3=BCrnberg... + * ^ + */ + char *tmplp = lp; + if (*(++tmplp) == '\r' && *(++tmplp) == '\n' && isalnum(*(++tmplp))) { + x1 = a; + x2 = *tmplp; + lp = tmplp; + } + } + else { + /* append malformed input, and + continue parsing */ + str = g_string_append_c(str, a); + str = g_string_append_c(str, b); + } + } + else if (a == '=') { + char *tmplp = lp; + char c, d, e; + c = *(++tmplp); + d = *(++tmplp); + e = *(++tmplp); + if (b == '\r' && c == '\n' && isalnum(d) && isalnum(e)) { + x1 = d; + x2 = e; + lp = tmplp; + } + else { + /* append malformed input, and + continue parsing */ + str = g_string_append_c(str, a); + str = g_string_append_c(str, b); + } + } + else { + /* append malformed input, and + continue parsing */ + str = g_string_append_c(str, a); + str = g_string_append_c(str, b); + } + if (x1 && x2) { + char c; + + a = tolower (x1); + b = tolower (x2); + + c = (((a>='a'?a-'a'+10:a-'0')&0x0f) << 4) + | ((b>='a'?b-'a'+10:b-'0')&0x0f); + + str = g_string_append_c (str, c); + } + lp++; + x1 = x2 = 0; + } + else if (format_encoding == VF_ENCODING_BASE64) { + if((*lp != ' ') && (*lp != '\t') ) + str = g_string_append_unichar (str, g_utf8_get_char (lp)); + lp = g_utf8_next_char(lp); + } + else if (*lp == '\\') { + /* convert back to the non-escaped version of + the characters */ + lp = g_utf8_next_char(lp); + if (*lp == '\0') { + str = g_string_append_c (str, '\\'); + break; + } + switch (*lp) { + case 'n': str = g_string_append_c (str, '\n'); break; + case 'r': str = g_string_append_c (str, '\r'); break; + case ';': str = g_string_append_c (str, ';'); break; + case ',': + if (!g_ascii_strcasecmp (attr->name, "CATEGORIES")) { + //We need to handle categories here to work + //aroung a bug in evo2 + _read_attribute_value_add (attr, str, charset); + g_string_assign (str, ""); + } else + str = g_string_append_c (str, ','); + break; + case '\\': str = g_string_append_c (str, '\\'); break; + case '"': str = g_string_append_c (str, '"'); break; + /* \t is (incorrectly) used by kOrganizer, so handle it here */ + case 't': str = g_string_append_c (str, '\t'); break; + default: + BarryLogf(TRACE_INTERNAL, "invalid escape, passing it through. escaped char was %u", (unsigned int)*lp); + str = g_string_append_c (str, '\\'); + str = g_string_append_unichar (str, g_utf8_get_char(lp)); + break; + } + lp = g_utf8_next_char(lp); + } + else if ((*lp == ';') || + (*lp == ',' && !g_ascii_strcasecmp (attr->name, "CATEGORIES"))) { + _read_attribute_value_add (attr, str, charset); + g_string_assign (str, ""); + lp = g_utf8_next_char(lp); + } + else { + str = g_string_append_unichar (str, g_utf8_get_char (lp)); + lp = g_utf8_next_char(lp); + } + } + if (str) { + _read_attribute_value_add (attr, str, charset); + g_string_free (str, TRUE); + } + + if (*lp == '\r') { + lp = g_utf8_next_char (lp); /* \n */ + lp = g_utf8_next_char (lp); /* start of the next line */ + } + + *p = lp; +} + +static void _read_attribute_params(b_VFormatAttribute *attr, char **p, int *format_encoding, GString **charset) +{ + char *lp = *p; + GString *str; + b_VFormatParam *param = NULL; + gboolean in_quote = FALSE; + str = g_string_new (""); + + while (*lp != '\0') { + if (*lp == '"') { + in_quote = !in_quote; + lp = g_utf8_next_char (lp); + } + else if (in_quote || g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_' || *lp == '/' || *lp == '.' || *lp == ' ') { + str = g_string_append_unichar (str, g_utf8_get_char (lp)); + lp = g_utf8_next_char (lp); + } + /* accumulate until we hit the '=' or ';'. If we hit + * a '=' the string contains the parameter name. if + * we hit a ';' the string contains the parameter + * value and the name is either ENCODING (if value == + * QUOTED-PRINTABLE) or TYPE (in any other case.) + */ + else if (*lp == '=') { + if (str->len > 0) { + param = b_vformat_attribute_param_new (str->str); + g_string_assign (str, ""); + lp = g_utf8_next_char (lp); + } + else { + _skip_until (&lp, ":;"); + if (*lp == '\r') { + lp = g_utf8_next_char (lp); /* \n */ + lp = g_utf8_next_char (lp); /* start of the next line */ + break; + } + else if (*lp == ';') + lp = g_utf8_next_char (lp); + } + } + else if (*lp == ';' || *lp == ':' || *lp == ',') { + gboolean colon = (*lp == ':'); + gboolean comma = (*lp == ','); + + if (param) { + if (str->len > 0) { + b_vformat_attribute_param_add_value (param, str->str); + g_string_assign (str, ""); + if (!colon) + lp = g_utf8_next_char (lp); + } + else { + /* we've got a parameter of the form: + * PARAM=(.*,)?[:;] + * so what we do depends on if there are already values + * for the parameter. If there are, we just finish + * this parameter and skip past the offending character + * (unless it's the ':'). If there aren't values, we free + * the parameter then skip past the character. + */ + if (!param->values) { + b_vformat_attribute_param_free (param); + param = NULL; + if (!colon) + lp = g_utf8_next_char (lp); + } + } + + if (param + && !g_ascii_strcasecmp (param->name, "encoding")) { + if (!g_ascii_strcasecmp (param->values->data, "quoted-printable")) { + *format_encoding = VF_ENCODING_QP; + b_vformat_attribute_param_free (param); + param = NULL; + } else if ( _helper_is_base64(param->values->data)) { + *format_encoding = VF_ENCODING_BASE64; +// b_vformat_attribute_param_free (param); +// param = NULL; + } + } else if (param && !g_ascii_strcasecmp(param->name, "charset")) { + *charset = g_string_new(param->values->data); + b_vformat_attribute_param_free (param); + param = NULL; + } + } + else { + if (str->len > 0) { + char *param_name; + if (!g_ascii_strcasecmp (str->str, + "quoted-printable")) { + param_name = "ENCODING"; + *format_encoding = VF_ENCODING_QP; + } + /* apple's broken addressbook app outputs naked BASE64 + parameters, which aren't even vcard 3.0 compliant. */ + else if (!g_ascii_strcasecmp (str->str, + "base64")) { + param_name = "ENCODING"; + g_string_assign (str, "b"); + *format_encoding = VF_ENCODING_BASE64; + } + else { + param_name = "TYPE"; + } + + if (param_name) { + param = b_vformat_attribute_param_new (param_name); + b_vformat_attribute_param_add_value (param, str->str); + } + g_string_assign (str, ""); + if (!colon) + lp = g_utf8_next_char (lp); + } + else { + /* we've got an attribute with a truly empty + attribute parameter. So it's of the form: + + ATTR;[PARAM=value;]*;[PARAM=value;]*: + + (note the extra ';') + + the only thing to do here is, well.. nothing. + we skip over the character if it's not a colon, + and the rest is handled for us: We'll either + continue through the loop again if we hit a ';', + or we'll break out correct below if it was a ':' */ + if (!colon) + lp = g_utf8_next_char (lp); + } + } + if (param && !comma) { + b_vformat_attribute_add_param (attr, param); + param = NULL; + } + if (colon) + break; + } + else { + BarryLogf(TRACE_INTERNAL, "invalid character found in parameter spec: \"%i\" String so far: %s", lp[0], str->str); + g_string_assign (str, ""); + _skip_until (&lp, ":;"); + } + } + + if (str) + g_string_free (str, TRUE); + + *p = lp; +} + +/* reads an entire attribute from the input buffer, leaving p pointing + at the start of the next line (past the \r\n) */ +static b_VFormatAttribute *_read_attribute (char **p) +{ + char *attr_group = NULL; + char *attr_name = NULL; + b_VFormatAttribute *attr = NULL; + GString *str, *charset = NULL; + char *lp = *p; + + gboolean is_qp = FALSE; + + /* first read in the group/name */ + str = g_string_new (""); + while (*lp != '\r' && *lp != '\0') { + if (*lp == ':' || *lp == ';') { + if (str->len != 0) { + /* we've got a name, break out to the value/attribute parsing */ + attr_name = g_string_free (str, FALSE); + break; + } + else { + /* a line of the form: + * (group.)?[:;] + * + * since we don't have an attribute + * name, skip to the end of the line + * and try again. + */ + g_string_free (str, TRUE); + *p = lp; + _skip_to_next_line(p); + goto lose; + } + } + else if (*lp == '.') { + if (attr_group) { + BarryLogf(TRACE_INTERNAL, "extra `.' in attribute specification. ignoring extra group `%s'", str->str); + g_string_free (str, TRUE); + str = g_string_new (""); + } + if (str->len != 0) { + attr_group = g_string_free (str, FALSE); + str = g_string_new (""); + } + } + else if (g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_' || *lp == '/') { + str = g_string_append_unichar (str, g_utf8_get_char (lp)); + } + else { + BarryLogf(TRACE_INTERNAL, "invalid character found in attribute group/name: \"%i\" String so far: %s", lp[0], str->str); + g_string_free (str, TRUE); + *p = lp; + _skip_to_next_line(p); + goto lose; + } + + lp = g_utf8_next_char(lp); + } + + if (!attr_name) { + _skip_to_next_line (p); + goto lose; + } + + attr = b_vformat_attribute_new (attr_group, attr_name); + g_free (attr_group); + g_free (attr_name); + + if (*lp == ';') { + /* skip past the ';' */ + lp = g_utf8_next_char(lp); + _read_attribute_params (attr, &lp, &is_qp, &charset); + } + if (*lp == ':') { + /* skip past the ':' */ + lp = g_utf8_next_char(lp); + _read_attribute_value (attr, &lp, is_qp, charset); + } + + if (charset) g_string_free(charset, TRUE); + *p = lp; + + if (!attr->values) + goto lose; + + return attr; + lose: + if (attr) + b_vformat_attribute_free (attr); + return NULL; +} + +static void open_block(char **block, const char *block_name) +{ + char *start = *block ? *block : ""; + char *result = NULL; + + result = g_strconcat(start, "/", block_name, NULL); + if( *block ) + g_free(*block); + *block = result; +} + +static void close_block(char **block, const char *block_name) +{ + int name_len = strlen(block_name); + int block_len = *block ? strlen(*block) : 0; + char *cmp_start = NULL; + + if( block_len < name_len + 1 ) + return; + + cmp_start = *block + (block_len - name_len - 1); + if( cmp_start[0] == '/' && + g_ascii_strcasecmp(cmp_start+1, block_name) == 0 ) + { + // end of block hierarchy contains block name, + // so safe to remove + + // cut off the end of the string... no need to free/realloc + *cmp_start = '\0'; + } +} + +/* we try to be as forgiving as we possibly can here - this isn't a + * validator. Almost nothing is considered a fatal error. We always + * try to return *something*. + */ +static void _parse(b_VFormat *evc, const char *str) +{ + char *buf = g_strdup (str); + char *p, *end; + b_VFormatAttribute *attr; + + /* first validate the string is valid utf8 */ + if (!g_utf8_validate (buf, -1, (const char **)&end)) { + /* if the string isn't valid, we parse as much as we can from it */ + BarryLogf(TRACE_INTERNAL, "invalid utf8 passed to b_VFormat. Limping along."); + *end = '\0'; + } + + buf = _fold_lines (buf); + + p = buf; + + attr = _read_attribute (&p); + if (!attr) + attr = _read_attribute (&p); + + if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "begin")) { + BarryLogf(TRACE_INTERNAL, "vformat began without a BEGIN\n"); + } + if (attr && !g_ascii_strcasecmp (attr->name, "begin")) + b_vformat_attribute_free (attr); + else if (attr) + b_vformat_add_attribute (evc, attr); + + char *block = NULL; + while (*p) { + b_VFormatAttribute *next_attr = _read_attribute (&p); + + if (next_attr) { + if( g_ascii_strcasecmp(next_attr->name, "begin") == 0 ) { + // add to block hierarchy string + char *value = b_vformat_attribute_get_value(next_attr); + open_block(&block, value); + //BarryLogf(TRACE_INTERNAL, "open block: %s", block); + g_free(value); + } + else if( g_ascii_strcasecmp(next_attr->name, "end") == 0 ) { + // close off the block + char *value = b_vformat_attribute_get_value(next_attr); + close_block(&block, value); + //BarryLogf(TRACE_INTERNAL, "close block: %s", block); + g_free(value); + } + + // apply the block to the attr + next_attr->block = g_strdup(block); + + // add! + b_vformat_add_attribute (evc, next_attr); + attr = next_attr; + } + } + + if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "end")) { + BarryLogf(TRACE_INTERNAL, "vformat ended without END"); + } + + g_free (buf); + g_free (block); +} + +char *b_vformat_escape_string (const char *s, b_VFormatType type) +{ + GString *str; + const char *p; + + str = g_string_new (""); + + /* Escape a string as described in RFC2426, section 5 */ + for (p = s; p && *p; p++) { + switch (*p) { + case '\n': + str = g_string_append (str, "\\n"); + break; + case '\r': + if (*(p+1) == '\n') + p++; + str = g_string_append (str, "\\n"); + break; + case ';': + str = g_string_append (str, "\\;"); + break; + case ',': + if (type == VFORMAT_CARD_30 || type == VFORMAT_EVENT_20 || type == VFORMAT_TODO_20) + str = g_string_append (str, "\\,"); + else + str = g_string_append_c (str, *p); + break; + case '\\': + /** + * We won't escape backslashes + * on vcard 2.1, unless it is in the end of a value. + * See comments above for a better explanation + **/ + if (*p != '\0' && type == VFORMAT_CARD_21) { + BarryLogf(TRACE_INTERNAL, "[%s]We won't escape backslashes", __func__); + str = g_string_append_c(str, *p); + } + else { + BarryLogf(TRACE_INTERNAL, "[%s] escape backslashes!!", __func__); + str = g_string_append (str, "\\\\"); + } + break; + default: + str = g_string_append_c (str, *p); + break; + } + } + + return g_string_free (str, FALSE); +} + +char* +b_vformat_unescape_string (const char *s) +{ + GString *str; + const char *p; + + g_return_val_if_fail (s != NULL, NULL); + + str = g_string_new (""); + + /* Unescape a string as described in RFC2426, section 4 (Formal Grammar) */ + for (p = s; *p; p++) { + if (*p == '\\') { + p++; + if (*p == '\0') { + str = g_string_append_c (str, '\\'); + break; + } + switch (*p) { + case 'n': str = g_string_append_c (str, '\n'); break; + case 'r': str = g_string_append_c (str, '\r'); break; + case ';': str = g_string_append_c (str, ';'); break; + case ',': str = g_string_append_c (str, ','); break; + case '\\': str = g_string_append_c (str, '\\'); break; + case '"': str = g_string_append_c (str, '"'); break; + /* \t is (incorrectly) used by kOrganizer, so handle it here */ + case 't': str = g_string_append_c (str, '\t'); break; + default: + BarryLogf(TRACE_INTERNAL, "invalid escape, passing it through. escaped char was %u", (unsigned int)*p); + str = g_string_append_c (str, '\\'); + str = g_string_append_unichar (str, g_utf8_get_char(p)); + break; + } + } + } + + return g_string_free (str, FALSE); +} + +void +b_vformat_construct (b_VFormat *evc, const char *str) +{ + g_return_if_fail (str != NULL); + + if (*str) + _parse (evc, str); +} + +void b_vformat_free(b_VFormat *format) +{ + g_list_foreach (format->attributes, (GFunc)b_vformat_attribute_free, NULL); + g_list_free (format->attributes); + g_free(format); +} + +b_VFormat *b_vformat_new_from_string (const char *str) +{ + g_return_val_if_fail (str != NULL, NULL); + b_VFormat *evc = g_malloc0(sizeof(b_VFormat)); + + b_vformat_construct (evc, str); + + return evc; +} + +b_VFormat *b_vformat_new(void) +{ + return b_vformat_new_from_string (""); +} + +static int _block_match(b_VFormatAttribute *attr, const char *block) +{ + // a block matches if the end of the attribute's block + // string matches a case insensitive compare with block + // + // for example, a calendar may or may not start with a + // BEGIN: VCALENDAR, so DTSTART's block string could be + // "/vcalendar/vevent" or just "/vevent". By passing + // "/vevent" or even "vevent" as the block argument above, + // we should get a match for any of the above. + + int attr_len = attr->block ? strlen(attr->block) : 0; + int block_len = block ? strlen(block) : 0; + + if( block == NULL ) + return 1; // if block is null, match everything + + if( attr_len < block_len ) + return 0; // not enough string to compare + + if( attr_len == 0 && block_len == 0 ) + return 1; // empty and null strings match + + if( attr->block == NULL ) + return 0; // don't compare if one side is null + + return g_ascii_strcasecmp(&attr->block[attr_len - block_len], block) == 0; +} + +b_VFormatAttribute *b_vformat_find_attribute(b_VFormat *vcard, const char *name, int nth, const char *block) +{ + GList *attributes = b_vformat_get_attributes(vcard); + GList *a = NULL; + int i = 0; + for (a = attributes; a; a = a->next) { + b_VFormatAttribute *attr = a->data; + if (!g_ascii_strcasecmp(b_vformat_attribute_get_name(attr), name)) { + if( block == NULL || _block_match(attr, block) ) { + if( i == nth ) + return attr; + i++; + } + } + } + return NULL; +} + +/* +b_VFormatAttribute *b_vformat_find_attribute_next(b_VFormatAttribute *last, + const char *name, + int nth) +{ + GList *attributes = last ? last->next : 0; + GList *a = NULL; + int i = 0; + for (a = attributes; a; a = a->next) { + b_VFormatAttribute *attr = a->data; + if (!g_ascii_strcasecmp(b_vformat_attribute_get_name(attr), name)) { + if( i == nth ) + return attr; + i++; + } + } + return NULL; +} +*/ + +char *b_vformat_to_string (b_VFormat *evc, b_VFormatType type) +{ + BarryLogf(TRACE_ENTRY, "%s(%p, %i)", __func__, evc, type); + GList *l; + GList *v; + + GString *str = g_string_new (""); + + switch (type) { + case VFORMAT_CARD_21: + str = g_string_append (str, "BEGIN:VCARD\r\nVERSION:2.1\r\n"); + break; + case VFORMAT_CARD_30: + str = g_string_append (str, "BEGIN:VCARD\r\nVERSION:3.0\r\n"); + break; + case VFORMAT_TODO_10: + case VFORMAT_EVENT_10: + str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:1.0\r\n"); + break; + case VFORMAT_TODO_20: + case VFORMAT_EVENT_20: + case VFORMAT_JOURNAL: + str = g_string_append (str, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n"); + break; + case VFORMAT_NOTE: + str = g_string_append (str, "BEGIN:VNOTE\r\nVERSION:1.1\r\n"); + break; + } + + for (l = evc->attributes; l; l = l->next) { + GList *p; + b_VFormatAttribute *attr = l->data; + GString *attr_str; + int l; + int format_encoding = VF_ENCODING_RAW; + + attr_str = g_string_new (""); + + /* From rfc2425, 5.8.2 + * + * contentline = [group "."] name *(";" param) ":" value CRLF + */ + + if (attr->group) { + attr_str = g_string_append (attr_str, attr->group); + attr_str = g_string_append_c (attr_str, '.'); + } + attr_str = g_string_append (attr_str, attr->name); + /* handle the parameters */ + for (p = attr->params; p; p = p->next) { + b_VFormatParam *param = p->data; + /* 5.8.2: + * param = param-name "=" param-value *("," param-value) + */ + if( type == VFORMAT_CARD_30 || type == VFORMAT_TODO_20 + || type == VFORMAT_EVENT_20 || type == VFORMAT_JOURNAL) { + + /** + * Character set can only be specified on the CHARSET + * parameter on the Content-Type MIME header field. + **/ + if (!g_ascii_strcasecmp (param->name, "CHARSET")) + continue; + attr_str = g_string_append_c (attr_str, ';'); + attr_str = g_string_append (attr_str, param->name); + if (param->values) { + attr_str = g_string_append_c (attr_str, '='); + } + for (v = param->values; v; v = v->next) { + if (_helper_is_base64((const char *) v->data)) { + format_encoding = VF_ENCODING_BASE64; + /*Only the "B" encoding of [RFC 2047] is an allowed*/ + v->data=g_strdup("B"); + } + /** + * QUOTED-PRINTABLE inline encoding has been + * eliminated. + **/ + if (!g_ascii_strcasecmp (param->name, "ENCODING") && !g_ascii_strcasecmp ((char *) v->data, "QUOTED-PRINTABLE")) { + BarryLogf(TRACE_ERROR, "%s false encoding QUOTED-PRINTABLE is not allowed", __func__); + format_encoding = VF_ENCODING_QP; + } + attr_str = g_string_append (attr_str, v->data); + + if (v->next) + attr_str = g_string_append_c (attr_str, ','); + } + } + else { + attr_str = g_string_append_c (attr_str, ';'); + /** + * The "TYPE=" is optional skip it. + * LOGO, PHOTO and SOUND multimedia formats MUST + * have a "TYPE=" parameter + **/ + gboolean must_have_type = FALSE; + if (!g_ascii_strcasecmp (attr->name, "PHOTO") || !g_ascii_strcasecmp (attr->name, "LOGO") || !g_ascii_strcasecmp (attr->name, "SOUND") ) + must_have_type = TRUE; + if ( must_have_type || g_ascii_strcasecmp (param->name, "TYPE") ) + attr_str = g_string_append (attr_str, param->name); + if ( param->values && (must_have_type || g_ascii_strcasecmp (param->name, "TYPE")) ) + attr_str = g_string_append_c (attr_str, '='); + for (v = param->values; v; v = v->next) { + // check for quoted-printable encoding + if (!g_ascii_strcasecmp (param->name, "ENCODING") && !g_ascii_strcasecmp ((char *) v->data, "QUOTED-PRINTABLE")) + format_encoding = VF_ENCODING_QP; + // check for base64 encoding + if (_helper_is_base64((const char *) v->data)) { + format_encoding = VF_ENCODING_BASE64; + v->data=g_strdup("BASE64"); + } + attr_str = g_string_append (attr_str, v->data); + if (v->next) + attr_str = g_string_append_c (attr_str, ','); + } + } + } + + attr_str = g_string_append_c (attr_str, ':'); + + for (v = attr->values; v; v = v->next) { + char *value = v->data; + char *escaped_value = NULL; + + if (!g_ascii_strcasecmp (attr->name, "RRULE") && + strstr (value, "BYDAY") == v->data) { + attr_str = g_string_append (attr_str, value); + } else { + escaped_value = b_vformat_escape_string (value, type); + attr_str = g_string_append (attr_str, escaped_value); + } + + if (v->next) { + + /* XXX toshok - i hate you, rfc 2426. + why doesn't CATEGORIES use a ; like + a normal list attribute? */ + if (!g_ascii_strcasecmp (attr->name, "CATEGORIES")) + attr_str = g_string_append_c (attr_str, ','); + else + attr_str = g_string_append_c (attr_str, ';'); + } + + g_free (escaped_value); + } + + /* Folding lines: + * ^^^^^^^^^^^^^^ + * + * rfc 2426 (vCard), 2.6 Line Delimiting and Folding: + * After generating a content line, + * lines longer than 75 characters SHOULD be folded according to the + * folding procedure described in [MIME-DIR]. + * + * rfc 2445 (iCalendar), 4.1 Content Lines: + * Lines of text SHOULD NOT be longer than 75 octets, excluding the line + * break. Long content lines SHOULD be split into a multiple line + * representations using a line "folding" technique. That is, a long + * line can be split between any two characters by inserting a CRLF + * immediately followed by a single linear white space character (i.e., + * SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence + * of CRLF followed immediately by a single linear white space character + * is ignored (i.e., removed) when processing the content type. + * + * SUMMARY: When generating a content line, lines longer then 75 characters SHOULD be folded! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * Differences between encodings: + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * rfc 2425 [MIME-DIR], 5.8.1: + * A logical line MAY be continued on the next physical line anywhere + * between two characters by inserting a CRLF immediately followed by a + * single (white space) character. + * + * rfc 2045, 6.7, chapter 5: + * The quoted-printable specs says that softbreaks should be generated by inserting a =\r\n + * without follwing + * + * UTF-8 + * ^^^^^ + * + * Note that all the line folding above is described in terms of characters + * not bytes. In particular, it would be an error to put a line break + * within a UTF-8 character. + */ + + l = 0; + do { + if (g_utf8_strlen(attr_str->str, attr_str->len) - l > 75) { + l += 75; + + /* If using QP, must be sure that we do not fold within a quote sequence */ + if (format_encoding == VF_ENCODING_QP) { + if (g_utf8_get_char(g_utf8_offset_to_pointer(attr_str->str, l-1)) == '=') l--; + else if (g_utf8_get_char(g_utf8_offset_to_pointer(attr_str->str, l-2)) == '=') l -= 2; + } + + char *p = g_utf8_offset_to_pointer(attr_str->str, l); + + if (format_encoding == VF_ENCODING_QP) + attr_str = g_string_insert_len (attr_str, p - attr_str->str, "=" CRLF "", sizeof ("=" CRLF "") - 1); + else + attr_str = g_string_insert_len (attr_str, p - attr_str->str, CRLF " ", sizeof (CRLF " ") - 1); + } + else + break; + } while (l < g_utf8_strlen(attr_str->str, attr_str->len)); + + attr_str = g_string_append (attr_str, CRLF); + /** + * base64= + * the end of the text is marked with two CRLF sequences + * this results in one blank line before the start of the + * next property + **/ + if( format_encoding == VF_ENCODING_BASE64 + && (type == VFORMAT_CARD_21)) + attr_str = g_string_append (attr_str, CRLF); + + str = g_string_append (str, attr_str->str); + g_string_free (attr_str, TRUE); + } + + switch (type) { + case VFORMAT_CARD_21: + str = g_string_append (str, "END:VCARD\r\n"); + break; + case VFORMAT_CARD_30: + str = g_string_append (str, "END:VCARD\r\n"); + break; + case VFORMAT_TODO_10: + case VFORMAT_EVENT_10: + str = g_string_append (str, "END:VCALENDAR\r\n"); + break; + case VFORMAT_TODO_20: + case VFORMAT_EVENT_20: + case VFORMAT_JOURNAL: + str = g_string_append (str, "END:VCALENDAR\r\n"); + break; + case VFORMAT_NOTE: + str = g_string_append (str, "END:VNOTE\r\n"); + break; + } + + BarryLogf(TRACE_EXIT, "%s", __func__); + return g_string_free (str, FALSE); +} + +void b_vformat_dump_structure (b_VFormat *evc) +{ + GList *a; + GList *v; + int i; + + printf ("b_VFormat\n"); + for (a = evc->attributes; a; a = a->next) { + GList *p; + b_VFormatAttribute *attr = a->data; + printf ("+-- %s\n", attr->name); + if (attr->params) { + printf (" +- params=\n"); + + for (p = attr->params, i = 0; p; p = p->next, i++) { + b_VFormatParam *param = p->data; + printf (" | [%d] = %s", i,param->name); + printf ("("); + for (v = param->values; v; v = v->next) { + char *value = b_vformat_escape_string ((char*)v->data, VFORMAT_CARD_21); + printf ("%s", value); + if (v->next) + printf (","); + g_free (value); + } + + printf (")\n"); + } + } + printf (" +- values=\n"); + for (v = attr->values, i = 0; v; v = v->next, i++) { + printf (" [%d] = `%s'\n", i, (char*)v->data); + } + } +} + +b_VFormatAttribute *b_vformat_attribute_new (const char *attr_group, const char *attr_name) +{ + b_VFormatAttribute *attr; + + attr = g_new0 (b_VFormatAttribute, 1); + + attr->group = g_strdup (attr_group); + attr->name = g_strdup (attr_name); + + return attr; +} + +void +b_vformat_attribute_free (b_VFormatAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + g_free (attr->block); + g_free (attr->group); + g_free (attr->name); + + b_vformat_attribute_remove_values (attr); + + b_vformat_attribute_remove_params (attr); + + g_free (attr); +} + +b_VFormatAttribute* +b_vformat_attribute_copy (b_VFormatAttribute *attr) +{ + b_VFormatAttribute *a; + GList *p; + + g_return_val_if_fail (attr != NULL, NULL); + + a = b_vformat_attribute_new (b_vformat_attribute_get_group (attr), + b_vformat_attribute_get_name (attr)); + + for (p = attr->values; p; p = p->next) + b_vformat_attribute_add_value (a, p->data); + + for (p = attr->params; p; p = p->next) + b_vformat_attribute_add_param (a, b_vformat_attribute_param_copy (p->data)); + + return a; +} + +void +b_vformat_remove_attributes (b_VFormat *evc, const char *attr_group, const char *attr_name) +{ + GList *attr; + + g_return_if_fail (attr_name != NULL); + + attr = evc->attributes; + while (attr) { + GList *next_attr; + b_VFormatAttribute *a = attr->data; + + next_attr = attr->next; + + if (((!attr_group && !a->group) || + (attr_group && !g_ascii_strcasecmp (attr_group, a->group))) && + ((!attr_name && !a->name) || !g_ascii_strcasecmp (attr_name, a->name))) { + + /* matches, remove/delete the attribute */ + evc->attributes = g_list_remove_link (evc->attributes, attr); + + b_vformat_attribute_free (a); + } + + attr = next_attr; + } +} + +void +b_vformat_remove_attribute (b_VFormat *evc, b_VFormatAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + evc->attributes = g_list_remove (evc->attributes, attr); + b_vformat_attribute_free (attr); +} + +void +b_vformat_add_attribute (b_VFormat *evc, b_VFormatAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + evc->attributes = g_list_append (evc->attributes, attr); +} + +void +b_vformat_add_attribute_with_value (b_VFormat *b_VFormat, + b_VFormatAttribute *attr, const char *value) +{ + g_return_if_fail (attr != NULL); + + b_vformat_attribute_add_value (attr, value); + + b_vformat_add_attribute (b_VFormat, attr); +} + +void +b_vformat_add_attribute_with_values (b_VFormat *b_VFormat, b_VFormatAttribute *attr, ...) +{ + va_list ap; + char *v; + + g_return_if_fail (attr != NULL); + + va_start (ap, attr); + + while ((v = va_arg (ap, char*))) { + b_vformat_attribute_add_value (attr, v); + } + + va_end (ap); + + b_vformat_add_attribute (b_VFormat, attr); +} + +void +b_vformat_attribute_add_value (b_VFormatAttribute *attr, const char *value) +{ + g_return_if_fail (attr != NULL); + + attr->values = g_list_append (attr->values, g_strdup (value)); +} + +void +b_vformat_attribute_add_value_decoded (b_VFormatAttribute *attr, const char *value, int len) +{ + g_return_if_fail (attr != NULL); + + switch (attr->encoding) { + case VF_ENCODING_RAW: + BarryLogf(TRACE_INTERNAL, "can't add_value_decoded with an attribute using RAW encoding. you must set the ENCODING parameter first"); + break; + case VF_ENCODING_BASE64: { + char *b64_data = base64_encode_simple (value, len); + GString *decoded = g_string_new_len (value, len); + + /* make sure the decoded list is up to date */ + b_vformat_attribute_get_values_decoded (attr); + + attr->values = g_list_append (attr->values, b64_data); + attr->decoded_values = g_list_append (attr->decoded_values, decoded); + break; + } + case VF_ENCODING_QP: { + char *qp_data = quoted_encode_simple ((unsigned char*)value, len); + GString *decoded = g_string_new (value); + + /* make sure the decoded list is up to date */ + b_vformat_attribute_get_values_decoded (attr); + + attr->values = g_list_append (attr->values, qp_data); + attr->decoded_values = g_list_append (attr->decoded_values, decoded); + break; + } + case VF_ENCODING_8BIT: { + char *data = g_strdup(value); + GString *decoded = g_string_new (value); + + /* make sure the decoded list is up to date */ + b_vformat_attribute_get_values_decoded (attr); + + attr->values = g_list_append (attr->values, data); + attr->decoded_values = g_list_append (attr->decoded_values, decoded); + break; + } + } +} + +void +b_vformat_attribute_add_values (b_VFormatAttribute *attr, ...) +{ + va_list ap; + char *v; + + g_return_if_fail (attr != NULL); + + va_start (ap, attr); + + while ((v = va_arg (ap, char*))) { + b_vformat_attribute_add_value (attr, v); + } + + va_end (ap); +} + +static void +free_gstring (GString *str) +{ + g_string_free (str, TRUE); +} + +void +b_vformat_attribute_remove_values (b_VFormatAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + g_list_foreach (attr->values, (GFunc)g_free, NULL); + g_list_free (attr->values); + attr->values = NULL; + + g_list_foreach (attr->decoded_values, (GFunc)free_gstring, NULL); + g_list_free (attr->decoded_values); + attr->decoded_values = NULL; +} + +void +b_vformat_attribute_remove_params (b_VFormatAttribute *attr) +{ + g_return_if_fail (attr != NULL); + + g_list_foreach (attr->params, (GFunc)b_vformat_attribute_param_free, NULL); + g_list_free (attr->params); + attr->params = NULL; + + /* also remove the cached encoding on this attribute */ + attr->encoding_set = FALSE; + attr->encoding = VF_ENCODING_RAW; +} + +b_VFormatParam* +b_vformat_attribute_param_new (const char *name) +{ + b_VFormatParam *param = g_new0 (b_VFormatParam, 1); + param->name = g_strdup (name); + + return param; +} + +void +b_vformat_attribute_param_free (b_VFormatParam *param) +{ + g_return_if_fail (param != NULL); + + g_free (param->name); + + b_vformat_attribute_param_remove_values (param); + + g_free (param); +} + +b_VFormatParam* +b_vformat_attribute_param_copy (b_VFormatParam *param) +{ + b_VFormatParam *p; + GList *l; + + g_return_val_if_fail (param != NULL, NULL); + + p = b_vformat_attribute_param_new (b_vformat_attribute_param_get_name (param)); + + for (l = param->values; l; l = l->next) { + b_vformat_attribute_param_add_value (p, l->data); + } + + return p; +} + +void +b_vformat_attribute_add_param (b_VFormatAttribute *attr, + b_VFormatParam *param) +{ + g_return_if_fail (attr != NULL); + g_return_if_fail (param != NULL); + + attr->params = g_list_append (attr->params, param); + + /* we handle our special encoding stuff here */ + + if (!g_ascii_strcasecmp (param->name, "ENCODING")) { + if (attr->encoding_set) { + BarryLogf(TRACE_INTERNAL, "ENCODING specified twice"); + return; + } + + if (param->values && param->values->data) { + if (_helper_is_base64((const char*)param->values->data)) + attr->encoding = VF_ENCODING_BASE64; + else if (!g_ascii_strcasecmp ((char*)param->values->data, "QUOTED-PRINTABLE")) + attr->encoding = VF_ENCODING_QP; + else if (!g_ascii_strcasecmp ((char *)param->values->data, "8BIT")) + attr->encoding = VF_ENCODING_8BIT; + else { + BarryLogf(TRACE_INTERNAL, "Unknown value `%s' for ENCODING parameter. values will be treated as raw", (char*)param->values->data); + } + + attr->encoding_set = TRUE; + } + else { + BarryLogf(TRACE_INTERNAL, "ENCODING parameter added with no value"); + } + } +} + +b_VFormatParam *b_vformat_attribute_find_param(b_VFormatAttribute *attr, const char *name, int level) +{ + g_return_val_if_fail (attr != NULL, NULL); + GList *p = NULL; + for (p = attr->params; p; p = p->next) { + b_VFormatParam *param = p->data; + if (!g_ascii_strcasecmp (param->name, name)) { + if( level == 0 ) + return param; + else + level--; + } + } + return NULL; +} + +void +b_vformat_attribute_set_value (b_VFormatAttribute *attr, + int nth, const char *value) +{ + GList *param = g_list_nth(attr->values, nth); + g_free(param->data); + param->data = g_strdup(value); +} + +void +b_vformat_attribute_param_add_value (b_VFormatParam *param, + const char *value) +{ + g_return_if_fail (param != NULL); + + param->values = g_list_append (param->values, g_strdup (value)); +} + +void +b_vformat_attribute_param_add_values (b_VFormatParam *param, + ...) +{ + va_list ap; + char *v; + + g_return_if_fail (param != NULL); + + va_start (ap, param); + + while ((v = va_arg (ap, char*))) { + b_vformat_attribute_param_add_value (param, v); + } + + va_end (ap); +} + +void +b_vformat_attribute_add_param_with_value (b_VFormatAttribute *attr, const char *name, const char *value) +{ + g_return_if_fail (attr != NULL); + g_return_if_fail (name != NULL); + + if (!value) + return; + + b_VFormatParam *param = b_vformat_attribute_param_new(name); + + b_vformat_attribute_param_add_value (param, value); + + b_vformat_attribute_add_param (attr, param); +} + +void +b_vformat_attribute_add_param_with_values (b_VFormatAttribute *attr, + b_VFormatParam *param, ...) +{ + va_list ap; + char *v; + + g_return_if_fail (attr != NULL); + g_return_if_fail (param != NULL); + + va_start (ap, param); + + while ((v = va_arg (ap, char*))) { + b_vformat_attribute_param_add_value (param, v); + } + + va_end (ap); + + b_vformat_attribute_add_param (attr, param); +} + +void +b_vformat_attribute_param_remove_values (b_VFormatParam *param) +{ + g_return_if_fail (param != NULL); + + g_list_foreach (param->values, (GFunc)g_free, NULL); + g_list_free (param->values); + param->values = NULL; +} + +GList* +b_vformat_get_attributes (b_VFormat *format) +{ + return format->attributes; +} + +const char* +b_vformat_attribute_get_group (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + return attr->group; +} + +const char* +b_vformat_attribute_get_name (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + return attr->name; +} + +const char* +b_vformat_attribute_get_block (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + return attr->block; +} + +GList* +b_vformat_attribute_get_values (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + return attr->values; +} + +GList* +b_vformat_attribute_get_values_decoded (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + if (!attr->decoded_values) { + GList *l; + switch (attr->encoding) { + case VF_ENCODING_RAW: + case VF_ENCODING_8BIT: + for (l = attr->values; l; l = l->next) + attr->decoded_values = g_list_append (attr->decoded_values, g_string_new ((char*)l->data)); + break; + case VF_ENCODING_BASE64: + for (l = attr->values; l; l = l->next) { + char *decoded = g_strdup ((char*)l->data); + int len = base64_decode_simple (decoded, strlen (decoded)); + attr->decoded_values = g_list_append (attr->decoded_values, g_string_new_len (decoded, len)); + g_free (decoded); + } + break; + case VF_ENCODING_QP: + for (l = attr->values; l; l = l->next) { + if (!(l->data)) + continue; + char *decoded = g_strdup ((char*)l->data); + int len = quoted_decode_simple (decoded, strlen (decoded)); + attr->decoded_values = g_list_append (attr->decoded_values, g_string_new_len (decoded, len)); + g_free (decoded); + } + break; + } + } + + return attr->decoded_values; +} + +gboolean +b_vformat_attribute_is_single_valued (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, FALSE); + + if (attr->values == NULL + || attr->values->next != NULL) + return FALSE; + + return TRUE; +} + +char* +b_vformat_attribute_get_value (b_VFormatAttribute *attr) +{ + GList *values; + + g_return_val_if_fail (attr != NULL, NULL); + + values = b_vformat_attribute_get_values (attr); + + if (!b_vformat_attribute_is_single_valued (attr)) + BarryLogf(TRACE_INTERNAL, "b_vformat_attribute_get_value called on multivalued attribute"); + + return values ? g_strdup ((char*)values->data) : NULL; +} + +GString* +b_vformat_attribute_get_value_decoded (b_VFormatAttribute *attr) +{ + GList *values; + GString *str = NULL; + + g_return_val_if_fail (attr != NULL, NULL); + + values = b_vformat_attribute_get_values_decoded (attr); + + if (!b_vformat_attribute_is_single_valued (attr)) + BarryLogf(TRACE_INTERNAL, "b_vformat_attribute_get_value_decoded called on multivalued attribute"); + + if (values) + str = values->data; + + return str ? g_string_new_len (str->str, str->len) : NULL; +} + +const char *b_vformat_attribute_get_nth_value(b_VFormatAttribute *attr, int nth) +{ + GList *values = b_vformat_attribute_get_values_decoded(attr); + if (!values) + return NULL; + GString *retstr = (GString *)g_list_nth_data(values, nth); + if (!retstr) + return NULL; + + if (!g_utf8_validate(retstr->str, -1, NULL)) { + values = b_vformat_attribute_get_values(attr); + if (!values) + return NULL; + return g_list_nth_data(values, nth); + } + + return retstr->str; +} + +gboolean +b_vformat_attribute_has_type (b_VFormatAttribute *attr, const char *typestr) +{ + GList *params; + GList *p; + + g_return_val_if_fail (attr != NULL, FALSE); + g_return_val_if_fail (typestr != NULL, FALSE); + + params = b_vformat_attribute_get_params (attr); + + for (p = params; p; p = p->next) { + b_VFormatParam *param = p->data; + + if (!strcasecmp (b_vformat_attribute_param_get_name (param), "TYPE")) { + GList *values = b_vformat_attribute_param_get_values (param); + GList *v; + + for (v = values; v; v = v->next) { + if (!strcasecmp ((char*)v->data, typestr)) + return TRUE; + } + } + } + + return FALSE; +} + + +gboolean b_vformat_attribute_has_param(b_VFormatAttribute *attr, const char *name) +{ + g_return_val_if_fail (attr != NULL, FALSE); + g_return_val_if_fail (name != NULL, FALSE); + + GList *params = b_vformat_attribute_get_params(attr); + GList *p; + for (p = params; p; p = p->next) { + b_VFormatParam *param = p->data; + if (!strcasecmp(name, b_vformat_attribute_param_get_name(param))) + return TRUE; + } + return FALSE; +} + +GList* +b_vformat_attribute_get_params (b_VFormatAttribute *attr) +{ + g_return_val_if_fail (attr != NULL, NULL); + + return attr->params; +} + +const char* +b_vformat_attribute_param_get_name (b_VFormatParam *param) +{ + g_return_val_if_fail (param != NULL, NULL); + + return param->name; +} + +GList* +b_vformat_attribute_param_get_values (b_VFormatParam *param) +{ + g_return_val_if_fail (param != NULL, NULL); + + return param->values; +} + +const char *b_vformat_attribute_param_get_nth_value(b_VFormatParam *param, int nth) +{ + const char *ret = NULL; + GList *values = b_vformat_attribute_param_get_values(param); + if (!values) + return NULL; + ret = g_list_nth_data(values, nth); + return ret; +} + +static const char *base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +//static unsigned char _evc_base64_rank[256]; + +static void base64_init(char *rank) +{ + int i; + + memset(rank, 0xff, sizeof(rank)); + for (i=0;i<64;i++) { + rank[(unsigned int)base64_alphabet[i]] = i; + } + rank['='] = 0; +} + +/* call this when finished encoding everything, to + flush off the last little bit */ +static size_t base64_encode_close(const unsigned char *in, size_t inlen, gboolean break_lines, unsigned char *out, int *state, int *save) +{ + int c1, c2; + unsigned char *outptr = out; + + if (inlen>0) + outptr += base64_encode_step(in, inlen, break_lines, outptr, state, save); + + c1 = ((unsigned char *)save)[1]; + c2 = ((unsigned char *)save)[2]; + + switch (((char *)save)[0]) { + case 2: + outptr[2] = base64_alphabet[ ( (c2 &0x0f) << 2 ) ]; + g_assert(outptr[2] != 0); + goto skip; + case 1: + outptr[2] = '='; + skip: + outptr[0] = base64_alphabet[ c1 >> 2 ]; + outptr[1] = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 )]; + outptr[3] = '='; + outptr += 4; + break; + } + if (break_lines) + *outptr++ = '\n'; + + *save = 0; + *state = 0; + + return outptr-out; +} + +/* + performs an 'encode step', only encodes blocks of 3 characters to the + output at a time, saves left-over state in state and save (initialise to + 0 on first invocation). +*/ +static size_t base64_encode_step(const unsigned char *in, size_t len, gboolean break_lines, unsigned char *out, int *state, int *save) +{ + register const unsigned char *inptr; + register unsigned char *outptr; + + if (len<=0) + return 0; + + inptr = in; + outptr = out; + + if (len + ((char *)save)[0] > 2) { + const unsigned char *inend = in+len-2; + register int c1, c2, c3; + register int already; + + already = *state; + + switch (((char *)save)[0]) { + case 1: c1 = ((unsigned char *)save)[1]; goto skip1; + case 2: c1 = ((unsigned char *)save)[1]; + c2 = ((unsigned char *)save)[2]; goto skip2; + } + + /* yes, we jump into the loop, no i'm not going to change it, it's beautiful! */ + while (inptr < inend) { + c1 = *inptr++; + skip1: + c2 = *inptr++; + skip2: + c3 = *inptr++; + *outptr++ = base64_alphabet[ c1 >> 2 ]; + *outptr++ = base64_alphabet[ c2 >> 4 | ( (c1&0x3) << 4 ) ]; + *outptr++ = base64_alphabet[ ( (c2 &0x0f) << 2 ) | (c3 >> 6) ]; + *outptr++ = base64_alphabet[ c3 & 0x3f ]; + /* this is a bit ugly ... */ + if (break_lines && (++already)>=19) { + *outptr++='\n'; + already = 0; + } + } + + ((char *)save)[0] = 0; + len = 2-(inptr-inend); + *state = already; + } + + if (len>0) { + register char *saveout; + + /* points to the slot for the next char to save */ + saveout = & (((char *)save)[1]) + ((char *)save)[0]; + + /* len can only be 0 1 or 2 */ + switch(len) { + case 2: *saveout++ = *inptr++; + case 1: *saveout++ = *inptr++; + } + ((char *)save)[0]+=len; + } + + return outptr-out; +} + + +/** + * base64_decode_step: decode a chunk of base64 encoded data + * @in: input stream + * @len: max length of data to decode + * @out: output stream + * @state: holds the number of bits that are stored in @save + * @save: leftover bits that have not yet been decoded + * + * Decodes a chunk of base64 encoded data + **/ +static size_t base64_decode_step(const unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save) +{ + unsigned char base64_rank[256]; + base64_init((char*)base64_rank); + + register const unsigned char *inptr; + register unsigned char *outptr; + const unsigned char *inend; + unsigned char c; + register unsigned int v; + int i; + + inend = in+len; + outptr = out; + + /* convert 4 base64 bytes to 3 normal bytes */ + v=*save; + i=*state; + inptr = in; + while (inptr>16; + *outptr++ = v>>8; + *outptr++ = v; + i=0; + } + } + } + + *save = v; + *state = i; + + /* quick scan back for '=' on the end somewhere */ + /* fortunately we can drop 1 output char for each trailing = (upto 2) */ + i=2; + while (inptr>in && i) { + inptr--; + if (base64_rank[*inptr] != 0xff) { + if (*inptr == '=' && outptr>out) + outptr--; + i--; + } + } + + /* if i!= 0 then there is a truncation error! */ + return outptr-out; +} + +static char *base64_encode_simple (const char *data, size_t len) +{ + unsigned char *out; + int state = 0, outlen; + unsigned int save = 0; + + g_return_val_if_fail (data != NULL, NULL); + + out = g_malloc (len * 4 / 3 + 5); + outlen = base64_encode_close ((unsigned char *)data, len, FALSE, + out, &state, (int*)&save); + out[outlen] = '\0'; + return (char *)out; +} + +static size_t base64_decode_simple (char *data, size_t len) +{ + int state = 0; + unsigned int save = 0; + + g_return_val_if_fail (data != NULL, 0); + + return base64_decode_step ((unsigned char *)data, len, + (unsigned char *)data, &state, &save); +} + +static char *quoted_encode_simple(const unsigned char *string, int len) +{ + GString *tmp = g_string_new(""); + + int i = 0; + while(string[i] != 0) { + if (string[i] > 127 || string[i] == 13 || string[i] == 10 || string[i] == '=') { + g_string_append_printf(tmp, "=%02X", string[i]); + } else { + g_string_append_c(tmp, string[i]); + } + i++; + } + + char *ret = tmp->str; + g_string_free(tmp, FALSE); + return ret; +} + + +static size_t quoted_decode_simple (char *data, size_t len) +{ + g_return_val_if_fail (data != NULL, 0); + + GString *string = g_string_new(data); + if (!string) + return 0; + + char hex[5]; + hex[4] = 0; + + while (1) { + //Get the index of the next encoded char + int i = strcspn(string->str, "="); + if (i >= strlen(string->str)) + break; + + strcpy(hex, "0x"); + strncat(hex, &string->str[i + 1], 2); + char rep = ((int)(strtod(hex, NULL))); + g_string_erase(string, i, 2); + g_string_insert_c(string, i, rep); + } + + memset(data, 0, strlen(data)); + strcpy(data, string->str); + g_string_free(string, 1); + + return strlen(data); +} diff -Nru barry-0.14/src/vformat.h barry-0.0.20110506/src/vformat.h --- barry-0.14/src/vformat.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vformat.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2003 Ximian, Inc. 2005 Armin Bauer + * + * Copyright (C) 2003 Ximian, Inc. + * + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Author: Chris Toshok (toshok@ximian.com) + * Author: Armin Bauer (armin.bauer@opensync.org) + * + */ + +#ifndef _VFORMAT_H +#define _VFORMAT_H + +#include "dll.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + VFORMAT_CARD_21, + VFORMAT_CARD_30, + VFORMAT_NOTE, + VFORMAT_EVENT_10, + VFORMAT_EVENT_20, + VFORMAT_TODO_10, + VFORMAT_TODO_20, + VFORMAT_JOURNAL +} b_VFormatType; + +typedef struct b_VFormat { + //b_VFormatType type; + GList *attributes; +} b_VFormat; + +#define CRLF "\r\n" + +typedef enum { + VF_ENCODING_RAW, /* no encoding */ + VF_ENCODING_BASE64, /* base64 */ + VF_ENCODING_QP, /* quoted-printable */ + VF_ENCODING_8BIT +} b_VFormatEncoding; + +typedef struct b_VFormatAttribute { + char *block; /* "vtimezone/standard", or "vevent", depending on + current begin/end location... may be null */ + char *group; + char *name; + GList *params; /* b_VFormatParam */ + GList *values; + GList *decoded_values; + b_VFormatEncoding encoding; + gboolean encoding_set; +} b_VFormatAttribute; + +typedef struct b_VFormatParam { + char *name; + GList *values; /* GList of char*'s*/ +} b_VFormatParam; + + +/*b_VFormat *vcard_new(b_VFormatType type); +b_VFormat *vcard_new_from_string (const char *str, b_VFormatType type); +//char *vcard_to_string(VFormat *card, VFormatType format); + +VFormat *vnote_new(void); +VFormat *vnote_new_from_string(const char *str); +//char *vnote_to_string(VFormat *note); + + +VFormat *vevent_new(void); +VFormat *vevent_new_from_string(const char *str); +//char *vevent_to_string(VFormat *event); + +VFormat *vtodo_new(void); +VFormat *vtodo_new_from_string(const char *str);*/ +//char *vtodo_to_string(VFormat *todo); + +/* mostly for debugging */ +b_VFormat *b_vformat_new(void); +b_VFormat *b_vformat_new_from_string(const char *str); +void b_vformat_dump_structure(b_VFormat *format); +char *b_vformat_to_string(b_VFormat *evc, b_VFormatType type); +time_t b_vformat_time_to_unix(const char *inptime); +void b_vformat_free(b_VFormat *format); + +/* attributes */ +b_VFormatAttribute *b_vformat_attribute_new (const char *attr_group, const char *attr_name); +void b_vformat_attribute_free (b_VFormatAttribute *attr); +b_VFormatAttribute *b_vformat_attribute_copy (b_VFormatAttribute *attr); +void b_vformat_remove_attributes (b_VFormat *vformat, const char *attr_group, const char *attr_name); +void b_vformat_remove_attribute (b_VFormat *vformat, b_VFormatAttribute *attr); +void b_vformat_add_attribute (b_VFormat *vformat, b_VFormatAttribute *attr); +void b_vformat_add_attribute_with_value (b_VFormat *vformat, b_VFormatAttribute *attr, const char *value); +void b_vformat_add_attribute_with_values (b_VFormat *vformat, b_VFormatAttribute *attr, ...); +void b_vformat_attribute_add_value (b_VFormatAttribute *attr, const char *value); +void b_vformat_attribute_set_value (b_VFormatAttribute *attr, int nth, const char *value); +void b_vformat_attribute_add_value_decoded (b_VFormatAttribute *attr, const char *value, int len); +void b_vformat_attribute_add_values (b_VFormatAttribute *attr, ...); +void b_vformat_attribute_remove_values (b_VFormatAttribute *attr); +void b_vformat_attribute_remove_params (b_VFormatAttribute *attr); +b_VFormatAttribute *b_vformat_find_attribute (b_VFormat *evc, const char *name, int nth, const char *block); + +/* attribute parameters */ +b_VFormatParam* b_vformat_attribute_param_new (const char *param_name); +void b_vformat_attribute_param_free (b_VFormatParam *param); +b_VFormatParam* b_vformat_attribute_param_copy (b_VFormatParam *param); +void b_vformat_attribute_add_param (b_VFormatAttribute *attr, b_VFormatParam *param); +b_VFormatParam *b_vformat_attribute_find_param(b_VFormatAttribute *attr, const char *name, int level); +void b_vformat_attribute_add_param_with_value (b_VFormatAttribute *attr, const char *name, const char *value); +void b_vformat_attribute_add_param_with_values (b_VFormatAttribute *attr, + b_VFormatParam *param, ...); + +void b_vformat_attribute_param_add_value (b_VFormatParam *param, + const char *value); +void b_vformat_attribute_param_add_values (b_VFormatParam *param, + ...); +void b_vformat_attribute_param_remove_values (b_VFormatParam *param); +gboolean b_vformat_attribute_has_param(b_VFormatAttribute *attr, const char *name); + +/* b_VFormat* accessors. nothing returned from these functions should be + freed by the caller. */ +GList* b_vformat_get_attributes (b_VFormat *vformat); +const char* b_vformat_attribute_get_group (b_VFormatAttribute *attr); +const char* b_vformat_attribute_get_name (b_VFormatAttribute *attr); +const char* b_vformat_attribute_get_block (b_VFormatAttribute *attr); +GList* b_vformat_attribute_get_values (b_VFormatAttribute *attr); /* GList elements are of type char* */ +GList* b_vformat_attribute_get_values_decoded (b_VFormatAttribute *attr); /* GList elements are of type GString* */ +const char *b_vformat_attribute_get_nth_value(b_VFormatAttribute *attr, int nth); + +/* special accessors for single valued attributes */ +gboolean b_vformat_attribute_is_single_valued (b_VFormatAttribute *attr); +char* b_vformat_attribute_get_value (b_VFormatAttribute *attr); +GString* b_vformat_attribute_get_value_decoded (b_VFormatAttribute *attr); + +GList* b_vformat_attribute_get_params (b_VFormatAttribute *attr); +const char* b_vformat_attribute_param_get_name (b_VFormatParam *param); +GList* b_vformat_attribute_param_get_values (b_VFormatParam *param); +const char *b_vformat_attribute_param_get_nth_value(b_VFormatParam *param, int nth); + +/* special TYPE= parameter predicate (checks for TYPE=@typestr */ +gboolean b_vformat_attribute_has_type (b_VFormatAttribute *attr, const char *typestr); + +/* Utility functions. */ +char* b_vformat_escape_string (const char *str, b_VFormatType type); +char* b_vformat_unescape_string (const char *str); + +#ifdef __cplusplus +} +#endif + +#endif /* _VFORMAT_H */ diff -Nru barry-0.14/src/vjournal.cc barry-0.0.20110506/src/vjournal.cc --- barry-0.14/src/vjournal.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vjournal.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,177 @@ +// +// \file vjournal.cc +// Conversion routines for vjournals (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vjournal.h" +//#include "trace.h" +#include +#include +#include +#include + +namespace Barry { namespace Sync { + +////////////////////////////////////////////////////////////////////////////// +// vJournal + +vJournal::vJournal() + : m_gJournalData(0) +{ +} + +vJournal::~vJournal() +{ + if( m_gJournalData ) { + g_free(m_gJournalData); + } +} + +bool vJournal::HasMultipleVJournals() const +{ + int count = 0; + b_VFormat *format = const_cast(Format()); + GList *attrs = format ? b_vformat_get_attributes(format) : 0; + for( ; attrs; attrs = attrs->next ) { + b_VFormatAttribute *attr = (b_VFormatAttribute*) attrs->data; + if( strcasecmp(b_vformat_attribute_get_name(attr), "BEGIN") == 0 && + strcasecmp(b_vformat_attribute_get_nth_value(attr, 0), "VJOURNAL") == 0 ) + { + count++; + } + } + return count > 1; +} + + +// Main conversion routine for converting from Barry::Memo to +// a vJournal string of data. +const std::string& vJournal::ToMemo(const Barry::Memo &memo) +{ +// Trace trace("vJournal::ToMemo"); + std::ostringstream oss; + memo.Dump(oss); +// trace.logf("ToMemo, initial Barry record: %s", oss.str().c_str()); + + // start fresh + Clear(); + SetFormat( b_vformat_new() ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + // store the Barry object we're working with + m_BarryMemo = memo; + + // begin building vJournal data + AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Memo Record//EN")); + AddAttr(NewAttr("BEGIN", "VJOURNAL")); + AddAttr(NewAttr("SEQUENCE", "0")); + AddAttr(NewAttr("SUMMARY", memo.Title.c_str())); + AddAttr(NewAttr("DESCRIPTION", memo.Body.c_str())); + AddAttr(NewAttr("CATEGORIES", ToStringList(memo.Categories).c_str())); + + + // FIXME - add a truly globally unique "UID" string? + + AddAttr(NewAttr("END", "VJOURNAL")); + + // generate the raw VJOURNAL data + m_gJournalData = b_vformat_to_string(Format(), VFORMAT_NOTE); + m_vJournalData = m_gJournalData; + +// trace.logf("ToMemo, resulting vjournal data: %s", m_vJournalData.c_str()); + return m_vJournalData; +} + +// Main conversion routine for converting from vJournal data string +// to a Barry::Memo object. +const Barry::Memo& vJournal::ToBarry(const char *vjournal, uint32_t RecordId) +{ + using namespace std; + +// Trace trace("vJournal::ToBarry"); +// trace.logf("ToBarry, working on vmemo data: %s", vjournal); + + // we only handle vJournal data with one vmemo block + if( HasMultipleVJournals() ) + throw ConvertError("vCalendar data contains more than one VJOURNAL block, unsupported"); + + // start fresh + Clear(); + + // store the vJournal raw data + m_vJournalData = vjournal; + + // create format parser structures + SetFormat( b_vformat_new_from_string(vjournal) ); + if( !Format() ) + throw ConvertError("resource error allocating vjournal"); + + string title = GetAttr("SUMMARY", "/vjournal"); +// trace.logf("SUMMARY attr retrieved: %s", title.c_str()); + if( title.size() == 0 ) { + title = ""; +// trace.logf("ERROR: bad data, blank SUMMARY: %s", vjournal); + } + + string body = GetAttr("DESCRIPTION", "/vjournal"); +// trace.logf("DESCRIPTION attr retrieved: %s", body.c_str()); + + + // + // Now, run checks and convert into Barry object + // + + + Barry::Memo &rec = m_BarryMemo; + rec.SetIds(Barry::Memo::GetDefaultRecType(), RecordId); + + rec.Title = title; + rec.Body = body; + rec.Categories = GetValueVector("CATEGORIES","/vjournal"); + + std::ostringstream oss; + m_BarryMemo.Dump(oss); +// trace.logf("ToBarry, resulting Barry record: %s", oss.str().c_str()); + return m_BarryMemo; +} + +// Transfers ownership of m_gMemoData to the caller. +char* vJournal::ExtractVJournal() +{ + char *ret = m_gJournalData; + m_gJournalData = 0; + return ret; +} + +void vJournal::Clear() +{ + vBase::Clear(); + m_vJournalData.clear(); + m_BarryMemo.Clear(); + + if( m_gJournalData ) { + g_free(m_gJournalData); + m_gJournalData = 0; + } +} + +}} // namespace Barry::Sync + diff -Nru barry-0.14/src/vjournal.h barry-0.0.20110506/src/vjournal.h --- barry-0.14/src/vjournal.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vjournal.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,71 @@ +// +// \file vjournal.h +// Conversion routines for vjournals (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_VJOURNAL_H__ +#define __BARRY_SYNC_VJOURNAL_H__ + +#include "dll.h" +#include "vbase.h" +#include "vformat.h" +#include "r_memo.h" +#include +#include + +namespace Barry { namespace Sync { + +// +// vJournal +// +/// Class for converting between RFC 2445 iCalendar data format, +/// and the Barry::Memo class. +/// +class BXEXPORT vJournal : public vBase +{ + // data to pass to external requests + char *m_gJournalData; // dynamic memory returned by vformat()... can + // be used directly by the plugin, without + // overmuch allocation and freeing (see Extract()) + std::string m_vJournalData; // copy of m_gJournalData, for C++ use + Barry::Memo m_BarryMemo; + +protected: + bool HasMultipleVJournals() const; + +public: + vJournal(); + ~vJournal(); + + const std::string& ToMemo(const Barry::Memo &memo); + const Barry::Memo& ToBarry(const char *vjournal, uint32_t RecordId); + + char* ExtractVJournal(); + + void Clear(); + + // This is the v-name of the innermost BEGIN/END block + static const char* GetVName() { return "VJOURNAL"; } +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/vsmartptr.h barry-0.0.20110506/src/vsmartptr.h --- barry-0.14/src/vsmartptr.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vsmartptr.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,199 @@ +/// +/// \file vsmartptr +/// Variable 'free' smart pointer +/// + +/* + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_VSMARTPTR_H__ +#define __BARRY_VSMARTPTR_H__ + +namespace Barry { + +// +// vSmartPtr +// +/// A special smart pointer for variables that have their own +/// special 'free' functions. Behaves like std::auto_ptr<> +/// in that only one object at a time owns the pointer, +/// and destruction frees it by calling the given FreeFunc. +/// +template +class vSmartPtr +{ + mutable T *m_pt; + +public: + vSmartPtr() : m_pt(0) {} + vSmartPtr(T *pt) : m_pt(pt) {} + vSmartPtr(const vSmartPtr &sp) : m_pt(sp.m_pt) + { + sp.m_pt = 0; + } + ~vSmartPtr() + { + reset(); + } + + vSmartPtr& operator=(T *pt) + { + reset(pt); + return *this; + } + + vSmartPtr& operator=(const vSmartPtr &sp) + { + reset(sp.release()); + return *this; + } + + // Some non-standard APIs used by Barry + T* Extract() + { + return this->release(); + } + + T* Get() + { + return this->get(); + } + + // std::auto_ptr<> style API + T* get() + { + return m_pt; + } + + T* release() + { + T *rp = m_pt; + m_pt = 0; + return rp; + } + + void reset(T *new_obj = 0) + { + if( m_pt ) + FreeFunc(m_pt); + m_pt = new_obj; + } +}; + +// +// vLateSmartPtr +// +/// Variation of the above smart pointer that allows the user to +/// assign a free function after construction, in the case of +/// dlopen()'d frees. +/// +template +class vLateSmartPtr +{ + mutable T *m_pt; + FreeFuncPtrT m_FreeFuncPtr; + +public: + explicit vLateSmartPtr(FreeFuncPtrT freefunc = 0) + : m_pt(0) + , m_FreeFuncPtr(freefunc) + { + } + + vLateSmartPtr(T *pt, FreeFuncPtrT freefunc = 0) + : m_pt(pt) + , m_FreeFuncPtr(freefunc) + { + } + + vLateSmartPtr(const vLateSmartPtr &sp) + : m_pt(sp.m_pt) + , m_FreeFuncPtr(sp.m_FreeFuncPtr) + { + sp.m_pt = 0; + } + + ~vLateSmartPtr() + { + reset(); + } + + void SetFreeFunc(FreeFuncPtrT freefunc) + { + m_FreeFuncPtr = freefunc; + } + + vLateSmartPtr& operator=(T *pt) + { + reset(pt); + return *this; + } + + vLateSmartPtr& operator=(const vLateSmartPtr &sp) + { + reset(sp.release()); + m_FreeFuncPtr = sp.m_FreeFuncPtr; + return *this; + } + + // Some non-standard APIs used by Barry + T* Extract() + { + return this->release(); + } + + T* Get() + { + return this->get(); + } + + // std::auto_ptr<> style API + T* get() + { + return m_pt; + } + + T* release() + { + T *rp = m_pt; + m_pt = 0; + return rp; + } + + void reset(T *new_obj = 0) + { + // don't check for null m_FreeFuncPtr, since + // that should be an obvious crash and requires fixing + if( m_pt ) + (*m_FreeFuncPtr)(m_pt); + m_pt = new_obj; + } +}; + +/* + +Example usage: + +typedef vSmartPtr vAttrPtr; +typedef vSmartPtr vParamPtr; +typedef vSmartPtr gStringPtr; + +*/ + +} // namespace Barry + +#endif + diff -Nru barry-0.14/src/vtodo.cc barry-0.0.20110506/src/vtodo.cc --- barry-0.14/src/vtodo.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vtodo.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,291 @@ +// +// \file vtodo.cc +// Conversion routines for vtodos (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "vtodo.h" +//#include "trace.h" +#include +#include +#include +#include +#include + +namespace Barry { namespace Sync { + +////////////////////////////////////////////////////////////////////////////// +// Utility functions + +namespace { + static void ToLower(std::string &str) + { + size_t i = 0; + while( i < str.size() ) { + str[i] = tolower(str[i]); + i++; + } + } +} + +////////////////////////////////////////////////////////////////////////////// +// vTodo + +vTodo::vTodo(vTimeConverter &vtc) + : m_vtc(vtc) + , m_gTodoData(0) +{ +} + +vTodo::~vTodo() +{ + if( m_gTodoData ) { + g_free(m_gTodoData); + } +} + +bool vTodo::HasMultipleVTodos() const +{ + int count = 0; + b_VFormat *format = const_cast(Format()); + GList *attrs = format ? b_vformat_get_attributes(format) : 0; + for( ; attrs; attrs = attrs->next ) { + b_VFormatAttribute *attr = (b_VFormatAttribute*) attrs->data; + if( strcasecmp(b_vformat_attribute_get_name(attr), "BEGIN") == 0 && + strcasecmp(b_vformat_attribute_get_nth_value(attr, 0), "VTODO") == 0 ) + { + count++; + } + } + return count > 1; +} + + +// Main conversion routine for converting from Barry::Task to +// a vTodo string of data. +const std::string& vTodo::ToTask(const Barry::Task &task) +{ +// Trace trace("vTodo::ToTask"); + std::ostringstream oss; + task.Dump(oss); +// trace.logf("ToTask, initial Barry record: %s", oss.str().c_str()); + + // start fresh + Clear(); + SetFormat( b_vformat_new() ); + if( !Format() ) + throw ConvertError("resource error allocating vformat"); + + // store the Barry object we're working with + m_BarryTask = task; + + // begin building vCalendar data + AddAttr(NewAttr("PRODID", "-//OpenSync//NONSGML Barry Task Record//EN")); + AddAttr(NewAttr("BEGIN", "VTODO")); + AddAttr(NewAttr("SEQUENCE", "0")); + AddAttr(NewAttr("SUMMARY", task.Summary.c_str())); + AddAttr(NewAttr("DESCRIPTION", task.Notes.c_str())); + AddAttr(NewAttr("CATEGORIES", ToStringList(task.Categories).c_str())); + + // Status + if (task.StatusFlag == Barry::Task::InProgress) + AddAttr(NewAttr("STATUS", "IN-PROCESS")); + else if (task.StatusFlag == Barry::Task::Completed) + AddAttr(NewAttr("STATUS", "COMPLETED")); + else if (task.StatusFlag == Barry::Task::Deferred) + AddAttr(NewAttr("STATUS", "CANCELLED")); + else if (task.StatusFlag == Barry::Task::Waiting) + AddAttr(NewAttr("STATUS", "NEEDS-ACTION")); + + // Priority + if (task.PriorityFlag == Barry::Task::High) + AddAttr(NewAttr("PRIORITY", "3")); + else if (task.PriorityFlag == Barry::Task::Normal) + AddAttr(NewAttr("PRIORITY", "5")); + else + AddAttr(NewAttr("PRIORITY", "7")); + + // StartTime + if( task.StartTime ) { + AddAttr(NewAttr("DTSTART", + m_vtc.unix2vtime(&task.StartTime).c_str())); + } + + // DueTime DueFlag + if( task.DueDateFlag ) { + AddAttr(NewAttr("DUE", + m_vtc.unix2vtime(&task.DueTime).c_str())); + } + + // FIXME - add a truly globally unique "UID" string? + + AddAttr(NewAttr("END", "VTODO")); + + // generate the raw VTODO data + m_gTodoData = b_vformat_to_string(Format(), VFORMAT_TODO_20); + m_vTodoData = m_gTodoData; + +// trace.logf("ToTask, resulting vtodo data: %s", m_vTodoData.c_str()); + return m_vTodoData; +} + +// Main conversion routine for converting from vTodo data string +// to a Barry::Task object. +const Barry::Task& vTodo::ToBarry(const char *vtodo, uint32_t RecordId) +{ + using namespace std; + +// Trace trace("vTodo::ToBarry"); +// trace.logf("ToBarry, working on vtodo data: %s", vtodo); + + // we only handle vTodo data with one vtodo block + if( HasMultipleVTodos() ) + throw ConvertError("vCalendar data contains more than one VTODO block, unsupported"); + + // start fresh + Clear(); + + // store the vTodo raw data + m_vTodoData = vtodo; + + // create format parser structures + SetFormat( b_vformat_new_from_string(vtodo) ); + if( !Format() ) + throw ConvertError("resource error allocating vtodo"); + + string summary = GetAttr("SUMMARY", "/vtodo"); +// trace.logf("SUMMARY attr retrieved: %s", summary.c_str()); + if( summary.size() == 0 ) { + summary = ""; +// trace.logf("ERROR: bad data, blank SUMMARY: %s", vtodo); + } + + string notes = GetAttr("DESCRIPTION", "/vtodo"); +// trace.logf("DESCRIPTION attr retrieved: %s", notes.c_str()); + + string status = GetAttr("STATUS", "/vtodo"); +// trace.logf("STATUS attr retrieved: %s", status.c_str()); + + string priority = GetAttr("PRIORITY", "/vtodo"); +// trace.logf("PRIORITY attr retrieved: %s", priority.c_str()); + + string start = GetAttr("DTSTART", "/vtodo"); +// trace.logf("DTSTART attr retrieved: %s", start.c_str()); + + string due = GetAttr("DUE", "/vtodo"); +// trace.logf("DUE attr retrieved: %s", due.c_str()); + + + // + // Now, run checks and convert into Barry object + // + + // FIXME - we are assuming that any non-UTC timestamps + // in the vcalendar record will be in the current timezone... + // This is wrong! fix this later. + // + // Also, we current ignore any time zone + // parameters that might be in the vcalendar format... this + // must be fixed. + // + + Barry::Task &rec = m_BarryTask; + rec.SetIds(Barry::Task::GetDefaultRecType(), RecordId); + + // Categories + + rec.Categories = GetValueVector("CATEGORIES","/vtodo"); + + // SUMMARY & DESCRIPTION fields + rec.Summary = summary; + rec.Notes = notes; + + // STATUS field + if (status.size()) { + ToLower(status); + + const char *s = status.c_str(); + + if (strstr(s, "in-process")) + rec.StatusFlag = Barry::Task::InProgress; + else if (strstr(s, "completed")) + rec.StatusFlag = Barry::Task::Completed; + else if (strstr(s, "cancelled")) + rec.StatusFlag = Barry::Task::Deferred; + else if (strstr(s, "needs-action")) + rec.StatusFlag = Barry::Task::Waiting; + else + rec.StatusFlag = Barry::Task::NotStarted; + } + + // PRIORITY field + if (priority.size()) { + ToLower(priority); + + const char *s = priority.c_str(); + + const int val = atoi(s); + + if (val < 4) + rec.PriorityFlag = Barry::Task::High; + else if (val < 7) + rec.PriorityFlag = Barry::Task::Normal; + else + rec.PriorityFlag = Barry::Task::Low; + } + + + // STARTTIME & DUETIME + if (start.size()) { + rec.StartTime = m_vtc.vtime2unix(start.c_str()); + } + + if (due.size()) { + rec.DueDateFlag = true; + rec.DueTime = m_vtc.vtime2unix(due.c_str()); + } + + std::ostringstream oss; + m_BarryTask.Dump(oss); +// trace.logf("ToBarry, resulting Barry record: %s", oss.str().c_str()); + return m_BarryTask; +} + +// Transfers ownership of m_gTaskData to the caller. +char* vTodo::ExtractVTodo() +{ + char *ret = m_gTodoData; + m_gTodoData = 0; + return ret; +} + +void vTodo::Clear() +{ + vBase::Clear(); + m_vTodoData.clear(); + m_BarryTask.Clear(); + + if( m_gTodoData ) { + g_free(m_gTodoData); + m_gTodoData = 0; + } +} + +}} // namespace Barry::Sync + diff -Nru barry-0.14/src/vtodo.h barry-0.0.20110506/src/vtodo.h --- barry-0.14/src/vtodo.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/vtodo.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,74 @@ +// +// \file vtodo.h +// Conversion routines for vtodos (VCALENDAR, etc) +// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_SYNC_VTODO_H__ +#define __BARRY_SYNC_VTODO_H__ + +#include "dll.h" +#include "vbase.h" +#include "vformat.h" +#include "r_task.h" +#include +#include + +namespace Barry { namespace Sync { + +// +// vTodo +// +/// Class for converting between RFC 2445 iCalendar data format, +/// and the Barry::Task class. +/// +class BXEXPORT vTodo : public vBase +{ + // external reference + vTimeConverter &m_vtc; + + // data to pass to external requests + char *m_gTodoData; // dynamic memory returned by vformat()... can + // be used directly by the plugin, without + // overmuch allocation and freeing (see Extract()) + std::string m_vTodoData; // copy of m_gJournalData, for C++ use + Barry::Task m_BarryTask; + +protected: + bool HasMultipleVTodos() const; + +public: + vTodo(vTimeConverter &vtc); + ~vTodo(); + + const std::string& ToTask(const Barry::Task &task); + const Barry::Task& ToBarry(const char *vtodo, uint32_t RecordId); + + char* ExtractVTodo(); + + void Clear(); + + // This is the v-name of the innermost BEGIN/END block + static const char* GetVName() { return "VTODO"; } +}; + +}} // namespace Barry::Sync + +#endif + diff -Nru barry-0.14/src/xmlparser.cc barry-0.0.20110506/src/xmlparser.cc --- barry-0.14/src/xmlparser.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/xmlparser.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,141 @@ +/// +/// \file xmlparser.cc +/// A simple XML parser (use callback on start, end and data block +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include + +#include "xmlparser.h" + + +namespace Barry { + +namespace XML { + + +XMLParser::XMLParser(std::istream& input, const char *charset) + : xmlpp::SaxParser() + , input(input) +{ + this->depth = 0; + this->charset = charset; +} + + +XMLParser::~XMLParser(void) +{ +} + + +const unsigned long XMLParser::GetDepth(void) const +{ + return depth; +} + + +bool XMLParser::Run(void) +{ + try { + set_substitute_entities(true); + parse_chunk(""); + + std::string line; + while( getline(input, line) ) { + parse_chunk(line); + } + finish_chunk_parsing(); + } + catch (const xmlpp::exception& ex) { + std::cout << "libxml++ exception: " << ex.what() << std::endl; + return false; + } + + return true; +} + + +void XMLParser::on_start_document() +{ + std::cout << "on_start_document()" << std::endl; +} + + +void XMLParser::on_end_document() +{ + std::cout << "on_end_document()" << std::endl; +} + + +void XMLParser::on_start_element(const Glib::ustring& name, + const xmlpp::SaxParser::AttributeList& attributes) +{ + std::cout << "Start:" << name << std::endl; + depth++; + + // Print attributes: + for (xmlpp::SaxParser::AttributeList::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter) { + std::cout << " Attribute name=" << iter->name << std::endl; + + std::cout << " , value= " << iter->value << std::endl; + } +} + + +void XMLParser::on_end_element(const Glib::ustring& name) +{ + std::cout << "End:" << name << std::endl; + depth--; +} + + +void XMLParser::on_characters(const Glib::ustring& text) +{ + std::cout << " Data:" << text << std::endl; +} + + +void XMLParser::on_comment(const Glib::ustring& text) +{ + std::cout << "on_comment(): " << text << std::endl; +} + + +void XMLParser::on_warning(const Glib::ustring& text) +{ + std::cout << "on_warning(): " << text << std::endl; +} + + +void XMLParser::on_error(const Glib::ustring& text) +{ + std::cout << "on_error(): " << text << std::endl; +} + + +void XMLParser::on_fatal_error(const Glib::ustring& text) +{ + std::cout << "on_fatal_error(): " << text << std::endl; +} + + +} // namespace XML + +} // namespace Barry + diff -Nru barry-0.14/src/xmlparser.h barry-0.0.20110506/src/xmlparser.h --- barry-0.14/src/xmlparser.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/src/xmlparser.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,70 @@ +/// +/// \file xmlparser.h +/// A simple XML parser (use callback on start, end and data block +/// + +/* + Copyright (C) 2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __XMLPARSER_H__ +#define __XMLPARSER_H__ + + +#include + +#include "dll.h" +#include "a_common.h" + +namespace Barry { + +namespace XML { + + +class BXEXPORT XMLParser : public xmlpp::SaxParser +{ +public: + XMLParser(std::istream& input, const char *charset="UTF-8"); + virtual ~XMLParser(void); + + virtual bool Run(void); + virtual const unsigned long GetDepth(void) const; + +protected: + std::string charset; + std::istream& input; + unsigned long depth; + + // SaxParser overrides: + virtual void on_start_document(); + virtual void on_end_document(); + virtual void on_start_element(const Glib::ustring& name, + const xmlpp::SaxParser::AttributeList& properties); + virtual void on_end_element(const Glib::ustring& name); + virtual void on_characters(const Glib::ustring& characters); + virtual void on_comment(const Glib::ustring& text); + virtual void on_warning(const Glib::ustring& text); + virtual void on_error(const Glib::ustring& text); + virtual void on_fatal_error(const Glib::ustring& text); +}; + + +} // namespace XML + +} // namespace Barry + +#endif + diff -Nru barry-0.14/test/buildtest.sh barry-0.0.20110506/test/buildtest.sh --- barry-0.14/test/buildtest.sh 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/test/buildtest.sh 2011-05-06 12:20:17.000000000 +0000 @@ -3,7 +3,7 @@ # # Edit these settings to reflect your system # -MAKEOPTS=-j3 +MAKEOPTS=-j2 export CC="ccache gcc" export CXX="ccache g++" @@ -16,12 +16,16 @@ echo "Usage:" echo " ./buildtest.sh /path/to/libopensync-0.22.tar.bz2" echo - echo "Or, write a ~/.barrytest file that contains the directory" - echo "you used as a --prefix when building your own libopensync." + echo "Or, write a ~/.barrytest2 file that contains shell commands" + echo "setting OSYNCROOTDIR to the directory you used as a --prefix" + echo "when building your own libopensync." + echo echo "Note that this directory must be writable by the user that" echo "runs the test, as the plugin will be installed during the" echo "build test." echo + echo "You can also set OSYNCROOTDIR_0_40 to the 0.4x opensync directory." + echo } if [ "$1" = "-h" ] ; then @@ -30,6 +34,22 @@ fi # +# Check whether the desktop 0.22/0.4x optional build tests can be done +# +DESKTOP_OPTIONAL_BUILD_TEST=1 +if pkg-config --list-all |grep opensync ; then + DESKTOP_OPTIONAL_BUILD_TEST=0 + echo + echo "A version of opensync is already installed on your" + echo "system in default directories. Therefore the" + echo "tests of the optional desktop builds cannot be done," + echo "and will therefore be skipped." + echo + echo "Press enter to continue..." + read +fi + +# # Jump to directory that script is located, if necessary # @@ -52,12 +72,20 @@ mkdir -p build # +# Do we have a ~/.barrytest2 config? +# +if [ -f ~/.barrytest2 ] ; then + . ~/.barrytest2 +fi + + +# # First, build opensync in a local directory # -if [ -z "$OSYNCSOURCE" -a -f ~/.barrytest ] ; then - read OSYNCROOTDIR < ~/.barrytest -elif [ -n "$OSYNCSOURCE" ] ; then +if [ -n "$OSYNCROOTDIR" ] ; then + echo "Using opensync rootdir: $OSYNCROOTDIR" +elif [ -z "$OSYNCROOTDIR" -a -n "$OSYNCSOURCE" ] ; then echo "Extracting opensync sources and building..." (cd build && tar xjf "$OSYNCSOURCE" && \ cd libopensync-0.22 && \ @@ -68,7 +96,10 @@ Usage exit 1 fi -echo "Using opensync rootdir: $OSYNCROOTDIR" + +if [ -n "$OSYNCROOTDIR_0_40" ] ; then + echo "Using opensync-0.4x rootdir: $OSYNCROOTDIR_0_40" +fi @@ -79,7 +110,7 @@ mkdir -p build/barry (tar -C .. --exclude=CVS --exclude=.git --exclude=test/build -cf - . | \ tar -C build/barry -xf -) -diff -ruN --exclude=CVS --exclude=.git --exclude=test .. build/barry +diff -ruN --exclude=CVS --exclude=.git --exclude=test --exclude=build .. build/barry @@ -87,7 +118,7 @@ # Prepare for Barry building # cd build/barry -export PKG_CONFIG_PATH="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR/lib/pkgconfig" +export PKG_CONFIG_PATH="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR/lib/pkgconfig:$OSYNCROOTDIR_0_40/lib/pkgconfig" # @@ -103,29 +134,79 @@ rm -rf "$BASEPATH/build/rootdir" -export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" -./configure --prefix="$BASEPATH/build/rootdir" +export CXXFLAGS="-Wall -Werror -O0 -g" +./configure --prefix="$BASEPATH/build/rootdir" --disable-boost make $MAKEOPTS make distclean -./configure --prefix="$BASEPATH/build/rootdir" --with-boost +./configure --prefix="$BASEPATH/build/rootdir" --disable-sync +make $MAKEOPTS +make distclean +./configure --prefix="$BASEPATH/build/rootdir" --enable-boost --with-zlib make $MAKEOPTS make install make distclean cd gui -export CXXFLAGS="-Wall -Werror -pedantic -O0 -g" +export CXXFLAGS="-Wall -Werror -ansi -pedantic -O0 -g" ./configure --prefix="$BASEPATH/build/rootdir" -make $MAKEOPTS install +make $MAKEOPTS +make install make distclean cd .. cd opensync-plugin export CXXFLAGS="-Wall -Werror -O0 -g" ./configure --prefix="$BASEPATH/build/rootdir" -make $MAKEOPTS install +make $MAKEOPTS +make install make distclean cd .. +cd opensync-plugin-0.4x +export CXXFLAGS="-Wall -Werror -O0 -g" +./configure --prefix="$BASEPATH/build/rootdir" +make $MAKEOPTS +make install +make distclean +cd .. + +cd desktop +export CXXFLAGS="-Wall -Werror -O0 -g" +./configure --prefix="$BASEPATH/build/rootdir" +make $MAKEOPTS +make install +make distclean +cd .. + +if [ "$DESKTOP_OPTIONAL_BUILD_TEST" = "1" ] ; then + BACKUP_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" + + echo "Testing optional desktop builds in 10 seconds..." + sleep 10s + + cd desktop + + # Test only 0.22 + export PKG_CONFIG_PATH="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR/lib/pkgconfig" + + export CXXFLAGS="-Wall -Werror -O0 -g" + ./configure --prefix="$BASEPATH/build/rootdir" + make $MAKEOPTS + make install + make distclean + + # Test only 0.4x + export PKG_CONFIG_PATH="$BASEPATH/build/rootdir/lib/pkgconfig:$OSYNCROOTDIR_0_40/lib/pkgconfig" + + export CXXFLAGS="-Wall -Werror -O0 -g" + ./configure --prefix="$BASEPATH/build/rootdir" + make $MAKEOPTS + make install + make distclean + + cd .. + export PKG_CONFIG_PATH="$BACKUP_PKG_CONFIG_PATH" +fi # @@ -137,12 +218,19 @@ rm -rf "$BASEPATH/build/rootdir" export CXXFLAGS="-Wall -Werror -O0 -g" -./configure --prefix="$BASEPATH/build/rootdir" --with-boost \ - --enable-gui --enable-opensync-plugin +./configure --prefix="$BASEPATH/build/rootdir" \ + --enable-boost \ + --enable-gui \ + --enable-opensync-plugin \ + --enable-opensync-plugin-4x \ + --enable-desktop make $MAKEOPTS install make distclean ./configure --prefix="$BASEPATH/build/rootdir" \ - --enable-gui --enable-opensync-plugin + --enable-gui \ + --enable-opensync-plugin \ + --enable-opensync-plugin-4x \ + --enable-desktop make $MAKEOPTS make distclean @@ -152,7 +240,7 @@ # ./buildgen.sh cleanall cd "$BASEPATH" -diff -ruN --exclude=CVS --exclude=.git --exclude=test .. build/barry +diff -ruN --exclude=CVS --exclude=.git --exclude=test --exclude=build .. build/barry cd build/barry @@ -166,10 +254,35 @@ rm -rf "$BASEPATH/build/rootdir" ./buildgen.sh -./configure --enable-gui --enable-opensync-plugin +./configure \ + --enable-gui \ + --enable-opensync-plugin \ + --enable-opensync-plugin-4x \ + --enable-desktop make dist +mkdir ../disttree +tar -C ../disttree -xjf barry-*.*.*.tar.bz2 make distcheck make distclean +# remove the dist tarballs +rm -f barry-*.*.*.tar.{bz2,gz} +# compare our tree with the disttree +cd .. +# skip: +# autom4te.cache - autogenerated stuff we don't care about +# debian - dist tarball shouldn't have to care about that +# m4/ - more autogenerated stuff we dont' care about +# po/ - unsure +# publiccfg.h - this is an autogenerated header that gets installed +# by make install, and somehow sticks around after +# a 'make dist'... it is harmless, so ignore in the diff +diff -ruN \ + --exclude=autom4te.cache \ + --exclude=debian \ + --exclude='*.m4' \ + --exclude=po \ + --exclude=publiccfg.h \ + barry disttree/barry-*.*.* diff -Nru barry-0.14/test/data.cc barry-0.0.20110506/test/data.cc --- barry-0.14/test/data.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/test/data.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,134 @@ +/// +/// \file data.cc +/// Tests for the Data classes +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include "libtest.h" +#include +#include +#include +#include +#include +using namespace std; +using namespace Barry; + +static bool Equal(const Data &d1, const Data &d2) +{ + return d1.GetSize() == d2.GetSize() && + memcmp(d1.GetData(), d2.GetData(), d1.GetSize()) == 0; +} + +bool TestData() +{ +// typedef std::vector DataVec; +// DataVec array; +// if( !LoadDataArray("data/parsed.log", array) ) { +// cout << "Can't load file" << endl; +// return 1; +// } + +// DataVec::iterator i = array.begin(); +// Data::PrintAscii(false); +// for( ; i != array.end(); i++ ) { +// cout << "Endpoint: " << i->GetEndpoint() << endl; +// cout << *i; +// cout << "\n\n"; +// } + + Data d; + TEST( d.GetBufSize() == 0x4000, "Unexpected default buffer size"); + + const char *str = "hello world"; + Data ed(str, strlen(str)); + TEST( ed.GetSize() == strlen(str), + "Incorrect GetSize() on external data"); + TEST( ed.GetData() == (unsigned char*) str, + "GetData() external data pointer not the same"); + + bool caught = false; + std::string msg; + try { ed.ReleaseBuffer(1); } + catch( std::logic_error &e ) { + caught = true; + msg = e.what(); + } + TEST( caught == true, + "ReleaseBuffer() didn't catch GetBuffer() order: " << msg); + + TEST( ed.GetBuffer() != (unsigned char*) str, + "Data::GetBuffer() did not copy on write correctly"); + + d = ed; + TEST( Equal(d, ed), "Real copy didn't work"); + + caught = false; + try { ed.ReleaseBuffer(1300); } + catch( std::logic_error & ) { + caught = true; + } + TEST( caught == true, "Data::ReleaseBuffer() did not catch overflow"); + + ed.QuickZap(); + TEST( ed.GetSize() == 0 && ed.GetData(), "QuickZap did not work"); + + const unsigned char *old = ed.GetBuffer(); + Data ed2(str, strlen(str)); + ed = ed2; + TEST( ed.GetData() == (unsigned char* )str, + "operator=() did not recognize easy external data copy"); + TEST( ed.GetBuffer() == old, + "GetBuffer() did not recover existing memBlock"); + TEST( Equal(ed, ed2), "Data not equal!\n" << ed << endl << ed2); + + const char *str2 = " and goodbye"; + const char *str3 = "hello world and goodbye"; + ed2.Append(str2, strlen(str2)); + Data ed3(str3, strlen(str3)); + TEST( Equal(ed2, ed3), "Append failed"); + + old = ed.GetData(); + size_t old_size = ed.GetSize(); + ed.Prepend("pre", 3); + TEST( (ed.GetData() + 3) == old, + "Prepend buffer failed: " + << (void*)old << ":\n" << Data(old, old_size) + << (void*)ed.GetData() << ":\n" << ed); + ed.Prechop(3); + TEST( ed.GetData() == old, "Prechop failed"); + + cout << "Examples of Diff() output" << endl; + Data one, two; + one.GetBuffer()[0] = 0x01; + one.ReleaseBuffer(1); + two.GetBuffer()[0] = 0x02; + two.ReleaseBuffer(2); + + cout << Diff(one, two) << endl; + cout << Diff(two, one) << endl; + + two.GetBuffer(); + two.ReleaseBuffer(32); + cout << Diff(one, two) << endl; + + return true; +} + +NewTest testdata("Data classes", &TestData); + diff -Nru barry-0.14/test/date.cc barry-0.0.20110506/test/date.cc --- barry-0.14/test/date.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/test/date.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,66 @@ +/// +/// \file date.cc +/// Tests for the Date class +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include "libtest.h" +#include +#include +#include +#include +using namespace std; +using namespace Barry; + +bool TestDate() +{ + struct tm t; + memset(&t, 0, sizeof(t)); + t.tm_year = 111; + t.tm_mon = 1; + t.tm_mday = 28; + + Date d(&t); + TEST( d.ToYYYYMMDD() == "20110228", "ToYYYYMMDD() failed"); + TEST( d.ToBBString() == "28/02/2011", "ToBBString() failed"); + + ostringstream oss; + oss << hex << d; + TEST( oss.str() == "2011/02/28", "Stream output failed: " << oss.str()); + + Date d2; + d2.FromTm(&t); + TEST( d2.ToYYYYMMDD() == "20110228", "FromTm() failed"); + + struct tm myt; + d.ToTm(&myt); + d2.FromTm(&myt); + TEST( d2.ToYYYYMMDD() == "20110228", "ToTm() failed"); + + d2.FromBBString(d.ToBBString()); + TEST( d2.ToYYYYMMDD() == "20110228", "FromBBString() failed"); + + d2.FromYYYYMMDD(d.ToYYYYMMDD()); + TEST( d2.ToYYYYMMDD() == "20110228", "FromYYYMMDD() failed"); + + return true; +} + +NewTest testdate("Date class", &TestDate); + diff -Nru barry-0.14/test/libtest.cc barry-0.0.20110506/test/libtest.cc --- barry-0.14/test/libtest.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/test/libtest.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,67 @@ +/// +/// \file libtest.cc +/// Routines for testing the Barry libraries +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include "libtest.h" +#include +#include +#include +using namespace std; + +typedef std::pair TestPair; +typedef std::vector TestList; + +TestList& GetTests() +{ + static TestList tests; + return tests; +} + +void AddTest(const char *name, testfunc test) +{ + GetTests().push_back(TestPair(name, test)); +} + +int main() +{ + int failures = 0; + + TestList::iterator b = GetTests().begin(), e = GetTests().end(); + for( ; b != e; ++b ) { + cout << "Testing: " << b->first << "... " << flush; + if( !(*b->second)() ) { + failures++; + cout << "FAILED" << endl; + } + else { + cout << "passed" << endl; + } + } + + if( failures ) { + cout << dec << failures << " tests failed" << endl; + } + else { + cout << "All tests passed" << endl; + } + + return failures ? 1 : 0; +} + diff -Nru barry-0.14/test/libtest.h barry-0.0.20110506/test/libtest.h --- barry-0.14/test/libtest.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/test/libtest.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,44 @@ +/// +/// \file libtest.h +/// Routines for testing the Barry libraries +/// + +/* + Copyright (C) 2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_LIBTEST_H__ +#define __BARRY_LIBTEST_H__ + +#define TEST(t, err_msg) \ + if( !(t) ) { \ + std::cout << err_msg << std::endl; \ + return false; \ + } + +typedef bool (*testfunc)(); + +void AddTest(const char *name, testfunc test); + +struct NewTest +{ + explicit NewTest(const char *name, testfunc test) + { + AddTest(name, test); + } +}; + +#endif + diff -Nru barry-0.14/test/Makefile.am barry-0.0.20110506/test/Makefile.am --- barry-0.14/test/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/test/Makefile.am 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,38 @@ +EXTRA_DIST = buildtest.sh + +#DEFAULT_INCLUDES = +INCLUDES = $(LIBUSB_CFLAGS) +#AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g +AM_CXXFLAGS = -Wall -g + +# To use gettext +datadir = @datadir@ +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +noinst_HEADERS = libtest.h + +noinst_PROGRAMS = libtest + +libtest_SOURCES = \ + date.cc \ + data.cc \ + libtest.cc +libtest_LDADD = \ + ../src/libbarry.la \ + $(LIBUSB_LIBS) -lpthread @BOOST_LDADD@ $(LTLIBINTL) $(LTLIBICONV) +libtest_LDFLAGS = @BOOST_LIB_PATH@ +libtest_CXXFLAGS = $(AM_CXXFLAGS) + +if WITH_BOOST +libtest_CXXFLAGS += -D__BARRY_BOOST_MODE__ -D_REENTRANT @BOOST_INC_PATH@ +endif +if WITH_SYNC +libtest_LDADD += ../src/libbarrysync.la $(GLIB2_LIBS) +libtest_CXXFLAGS += -D__BARRY_SYNC_MODE__ $(GLIB2_CFLAGS) +endif +if WITH_BACKUP +libtest_LDADD += ../src/libbarrybackup.la +libtest_CXXFLAGS += -D__BARRY_BACKUP_MODE__ +endif + diff -Nru barry-0.14/TODO barry-0.0.20110506/TODO --- barry-0.14/TODO 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/TODO 2011-05-06 12:20:16.000000000 +0000 @@ -9,6 +9,85 @@ +Next Release Checklist (- todo, + done, x skipped) +============================================================================== +Target: release version 0.18 + - figure out a solution to the HideSequencePacket issue + - website documentation: + - www documentation / howto for bjdwp and friends + - add a more detailed set of instructions for how to + contribute to the project using git + (see email to Josh) + - incorporate Bill Paul's modem HOWTO for FreeBSD + into web docs (see list emails) + - add docs for opensync 0.4x plugin (note that it is + currently experimental, based on devel opensync) + - add docs for using libmtp with the Storm to access media + - incorporate Martin Owens' Barry logo/icon into Barry + - add to documentation page? + - add to identi.ca barry group + - add to sourceforge + - add to repo.or.cz + +Target: release version 0.19 + - test and fix all build and functionality issues on: + - Fedora 11 + - Fedora 12 (scheduled release on Nov 10) + - Ubuntu 8.10, 9.04 + - Ubuntu 9.10 (scheduled release on Oct 29) + - openSUSE 11.1 + - see mailing list reports + - give openBSD a test compile + - support our own repositories for apt and yum and zypper + to make installation easier + +Target: release version 0.20 + - polish up bfuse, and add feature to split out fields + - add record classes for Content Store based on + Martin Owens' doc/barry-research.ods + - look at incorporating contrib/ into main tree, or at least + into binary packages and tests + + + + +General Features +============================================================================== + +Add firmware upgrade support via USB +------------------------------------ +Duplicate the firmware upgrade functionality of the RIM Windows +software. There are USB captures of this in the USB Capture Log +archive at http://www.netdirect.ca/software/packages/barry/logs.php + + +Add media management via USB +---------------------------- +The Windows version of desktop software has the ability to manage +photos on the Blackberry that are not stored on a flash card, but +are instead stored in the Blackberry's internal memory. + +It is challenging, on some devices, to even copy such photos and +media to the flash card. + +Capture the USB traffic for this media management, and add support +to Barry. + + +Add HAL/dbus support to BarryBackup +----------------------------------- +The latest version of the backup program lists devices in a combo box, +with a Reload button to handle new devices being plugged in. + +Add an optional feature to listen to HAL/dbus for device addition and +removal and update the list automatically. Note that this must be +optional, since some systems may not have HAL available at compile time +(such as FreeBSD) or perhaps at runtime (HAL may not be running), +and so the Reload button must be available. + +Leave the Reload button even if HAL support is present, since the user +may wish to control the list manually, or force a reload. + Reverse engineer date/time functions ------------------------------------ @@ -21,14 +100,6 @@ http://sourceforge.net/mailarchive/message.php?msg_id=200706291619.05854.edge%40edginton.net -Fix GUI configure script to run a check for libtar --------------------------------------------------- -Currently, the autoconf scripts only take an argument on the command line -for the location of libtar, and assumes its location otherwise. -There should be an actual test for this, that tries linking against -libtar, and stops the configure script if not available. - - An automated test suite ----------------------- Testing Barry will be a challenge, since an actual device is required @@ -65,107 +136,16 @@ -Fix i18n bug in current 0.22 opensync plugin --------------------------------------------- -For some reason, contacts with international characters in the names -do not come through properly during the sync. The names are truncated -at the character. - -It appears consistent that the Blackberry uses the CP1252 charset, -a.k.a. WINDOWS-1252, which is like ISO-8859-1, except that characters -0x80 to 0x9F are used as characters instead of escape codes. - -This knowledge needs to be passed on to opensync in the data format. -This may be as simple as adding a proper charset field to the vCard data, -but it definitely needs testing and a patch. - -See this mailing list thread: -http://sourceforge.net/mailarchive/message.php?msg_id=20080418033504.GA12750%40foursquare.net - -Estimated time: a few dedicated hours in the best case - - - -Porting opensync plugin to opensync 0.40 ----------------------------------------- -There's two options to this item: - - - simple way - - proper way - -The difference between opensync 0.22 and 0.40 involves some API changes. -You should be able to note the changes in the example plugin code once -0.40 is released. - -The simple way involves merely updating Barry's opensync plugin to match -the new API. This shouldn't be too difficult, but you may run across -some small surprises. - -The proper way involves: - - - switching from the vcard/vevent formats to the opensync XML - formats - - switching from storing state information in text files to - storing it in the built in database (optional) - - making use of the new opensync time APIs to properly support - timezones for all time operations - -Switching away from text based vcard and vevent formats will remove -the burden of raw data parsing and formatting from the plugin itself, -and make use of the more tested opensync library. Any bugs fixed -in opensync's parsers will automatically fix bugs in the Barry plugin. - -Switching state storage formats may allow for greater flexibility -in supporting multiple devices. This needs more research, but it -is the "way things are done" in opensync, and likely worth moving -in that direction. - +Timezone support to opensync plugins +------------------------------------ Support for timezones will likely stress the opensync API as well as the Barry API, but definitely needs to be done for completeness on both sides of the equation. -Estimated time: simple way: 10 hours if lucky - proper way: open ended - - +This may involve switching from the text based vcard formats to +the opensync XML formats. -Adding support for Tasks database to opensync plugin ----------------------------------------------------- -This will require research into the proper vformat for tasks. If -the above port to 0.40 is complete, then use the XML format. If not, -then find the appropriate v-format. - -Estimated time: 16 hours -Depending on: ideally, wait for 0.40 XML format support - - - -Adding support for Memos (notes) to opensync plugin ---------------------------------------------------- -Same as above, for Tasks. If done together, may be able to save some time. - -Estimated time: 16 hours -Depending on: ideally, wait for 0.40 XML format support - - - -Adding support for recurring calendar items to opensync plugin --------------------------------------------------------------- -See vCalendar::RecurToBarryCal() in the opensync sources, and compare -with RecurToVCal(). See also iCal format RFC's. -http://tools.ietf.org/html/rfc2445 - - - -Reverse engineering java loader protocol ----------------------------------------- -This has not been done by any opensource Blackberry project out there, -to my knowledge, and would be most useful to Blackberry application -developers. - -If you are a Blackberry app developer, this may interest you. - -Estimated time: open ended +Estimated time: open ended @@ -216,19 +196,6 @@ -Add internationalization (i18n) support to the backup GUI and tools -------------------------------------------------------------------- -Translations are needed for the GUI and command line tool prompts, as -well as support in the code for this translation. - -Estimated tasks: - - update the code to support i18n - - translate to languages of interest - -Estimated time: unknown - - - Write simple GUI for streamlining sync setup and action ------------------------------------------------------- Syncing setup and operation is currently a tedious, complicated task. @@ -281,6 +248,14 @@ +Improve useability of web documentation +--------------------------------------- +Add a Q&A style of support web site, where Blackberry users can plug in +their device model, data provider, etc. and get exact command lines that +they can use for modem tethering, etc. + + + Code cleanup ------------ Code can always be improved. There are two big ways to help: @@ -340,37 +315,6 @@ -Command line backup and restore -------------------------------- -The only command line backup currently available is the one in btool, -using the -f and -s switches. This does not backup exact data from -the device, but parses it, stores it in the Boost serialization format, -and then reverses the process for restore. This is a great test -for the Barry library, but not so great for backup, since not all -databases can be parsed. - -There is already an exact backup and restore interface with the GUI, but -there is a lot of useful functionality trapped in a layer of GUI -that could be just as useful from the command line. Tasks such as a nightly -cron backup of any Blackberry devices attached to the system would be more -easily done via command line. - -You could add command line arguments to the barrybackup program to skip -the GUI (tricky and possibly error prone), or you could pull the backup -functionality into a standalone command line utility (more work, but smarter -in the long run). This is mostly a code refactoring job, consisting of -all working code that's already there, and I know there are people -who would thank you. :-) - -Note: see also the perl scripts in contrib/ - -Estimated tasks: - - split out tar and backup functionality code into shared library - - write and test command line tool -Estimated time: 6 hours - - - Misc Low Level Todo Items: -------------------------- - test whether sorting of contact records is required before diff -Nru barry-0.14/tools/balxparse.cc barry-0.0.20110506/tools/balxparse.cc --- barry-0.14/tools/balxparse.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/balxparse.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,179 @@ +/// +/// \file balxparse.cc +/// +/// + +/* + Copyright (C) 2009-2010, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#include +#include +#include +#include +#include +#include +#include "i18n.h" + +using namespace std; +using namespace Barry; + +struct Languages { + const char *code; + const char *alxid; + const char *description; +}; + + +const static struct Languages langs[] = { + { "en", OS_LANG_ENGLISH, "English" }, + { "ar", OS_LANG_ARABIC, "Arabic" }, + { "ca", OS_LANG_CATALAN, "Catalan" }, + { "cs", OS_LANG_CZECH, "Czech" }, + { "de", OS_LANG_GERMAN, "German" }, + { "sp", OS_LANG_SPANISH, "Spanish" }, + { "fr", OS_LANG_FRENCH, "French" }, + { "he", OS_LANG_HEBREW, "Hebrew" }, + { "hu", OS_LANG_HUNGARIAN, "Hungarian" }, + { "it", OS_LANG_ITALIAN, "Italian" }, + { "ja", OS_LANG_JAPANESE, "Japanese" }, + { "ko", OS_LANG_KOREAN, "Korean" }, + { NULL } +}; + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "balxparse - Command line ALX parser\n" + << " Copyright 2009-2010, Nicolas VIVIEN.\n" + << " Copyright 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << "\n" + << " -h This help\n" + << " -i lang Internationalization language\n" + << " -d path OS path with all ALX files\n" + << " -o file OS ALX filename (Platform.alx)\n" + << "\n" + << " ...\n" + << " Parse one or several ALX files.\n" + << "\n" + << " Language supported :\n" + << "\t"; + + for (int i=0; langs[i].code!=NULL; i++) { + string s = (string) langs[i].code + " : " + (string) langs[i].description; + + cerr << left << setfill(' ') << setw(18) << s; + + if (((i+1) % 4) == 0) + cerr << endl << "\t"; + } + + cerr << endl; +} + + +int main(int argc, char *argv[], char *envp[]) +{ + INIT_I18N(PACKAGE); + + try { + + string lang; + string pathname; + string filename; + string osfilename; + vector filenames; + + // process command line options + for(;;) { + int cmd = getopt(argc, argv, "hi:d:o:"); + if( cmd == -1 ) + break; + + switch( cmd ) + { + case 'd': // ALX path + pathname = optarg; + break; + + case 'o': // OS ALX filename (Platform.alx) + osfilename = optarg; + break; + + case 'i': // Language + lang = optarg; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + argc -= optind; + argv += optind; + + // Put the remaining arguments into an array + for (; argc > 0; argc --, argv ++) { + filenames.push_back(string(argv[0])); + } + + + // Init ALX parser + ALX::OSLoader os; + + os.AddProperties("_vendorID", ""); + + + if (lang.length() > 0) { + for (int i=0; langs[i].code!=NULL; i++) { + string code = langs[i].code; + + if (code == lang) + os.AddProperties("langid", langs[i].alxid); + } + } + + if (osfilename.length() > 0) + os.LoadALXFile(osfilename, false); + + if (pathname.length() > 0) + os.Load(pathname); + + if (!filenames.empty()) { + vector::iterator i = filenames.begin(), end = filenames.end(); + for( ; i != end; ++i ) { + os.LoadALXFile((*i), true); + } + } + + cout << os << endl; + + + } catch( std::exception &e ) { + cout << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/tools/bcharge.cc barry-0.0.20110506/tools/bcharge.cc --- barry-0.14/tools/bcharge.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/bcharge.cc 2011-05-06 12:20:17.000000000 +0000 @@ -6,7 +6,7 @@ /// /// This file is part of the Barry project: /// -/// http://www.netdirect.ca/software/packages/barry/index.php +/// http://www.netdirect.ca/software/packages/barry /// http://sourceforge.net/projects/barry /// /// Compile with the following command (needs libusb): @@ -15,7 +15,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -39,22 +39,17 @@ #include #include #include +#include +#include "i18n.h" -#define VENDOR_RIM 0x0fca -#define PRODUCT_RIM_BLACKBERRY 0x0001 -#define PRODUCT_RIM_PEARL_DUAL 0x0004 -#define PRODUCT_RIM_PEARL_8120 0x8004 -#define PRODUCT_RIM_PEARL 0x0006 - -#define IPRODUCT_RIM_HANDHELD 2 -#define IPRODUCT_RIM_MASS_STORAGE 4 -#define IPRODUCT_RIM_COMPOSITE 5 +enum ModeType { + NO_CHANGE, + PEARL_CLASSIC_MODE_0001, // force classic mode + PEARL_DUAL_MODE_0004, // force dual mode + CONDITIONAL_DUAL_MODE, // set dual mode if no class 255 + // interface is found (database iface) +}; -#define BLACKBERRY_INTERFACE 0 -#define BLACKBERRY_CONFIGURATION 1 - -bool old_style_pearl = false; -bool force_dual = false; std::string udev_devpath; std::string sysfs_path = "/sys"; @@ -62,10 +57,12 @@ { printf( "bcharge - Adjust Blackberry charging modes\n" - " Copyright 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + " Copyright 2006-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" "\n" - " -d Dual mode (mode 0004) (default)\n" + " -d Set to dual mode (0004)\n" " -o Set a Pearl to old Blackberry mode (0001)\n" + " -g Set dual mode only if database interface class 255\n" + " is not found\n" "\n" " -h This help message\n" " -p devpath The devpath argument from udev. If specified, will attempt\n" @@ -95,23 +92,23 @@ control(handle, 0x40, 0xa2, 0, 1, buffer, 0, 100); } -void pearl_mode(struct usb_dev_handle *handle) +void pearl_classic_mode(struct usb_dev_handle *handle) { char buffer[2]; - if( old_style_pearl ) { - // use this for "old style" interface: product ID 0001 - control(handle, 0xc0, 0xa9, 0, 1, buffer, 2, 100); - } - else { - // Product ID 0004 - control(handle, 0xc0, 0xa9, 1, 1, buffer, 2, 100); - } + // use this for "old style" interface: product ID 0001 + control(handle, 0xc0, 0xa9, 0, 1, buffer, 2, 100); } -int find_mass_storage_interface(struct usb_dev_handle *handle) +void pearl_dual_mode(struct usb_dev_handle *handle) +{ + char buffer[2]; + // Product ID 0004 + control(handle, 0xc0, 0xa9, 1, 1, buffer, 2, 100); +} + +int find_interface(struct usb_dev_handle *handle, int iface_class) { - // search the configuration descriptor for a Mass Storage - // interface (class 8) + // search the configuration descriptor for the given class ID struct usb_device *dev = usb_device(handle); struct usb_config_descriptor *cfg = dev ? dev->config : 0; @@ -121,18 +118,30 @@ struct usb_interface *iface = &cfg->interface[i]; for( int a = 0; iface->altsetting && a < iface->num_altsetting; a++ ) { struct usb_interface_descriptor *id = &iface->altsetting[a]; - if( id->bInterfaceClass == USB_CLASS_MASS_STORAGE ) + if( id->bInterfaceClass == iface_class ) return id->bInterfaceNumber; } } } - // if we get here, then we didn't find the Mass Storage interface - // ... this should never happen, but if it does, assume - // the device is s showing product ID 0006, and the Mass Storage - // interface is interface #0 - printf("Can't find Mass Storage interface, assuming 0.\n"); - return 0; + return -1; +} + +int find_mass_storage_interface(struct usb_dev_handle *handle) +{ + int iface = find_interface(handle, USB_CLASS_MASS_STORAGE); + + if( iface == -1 ) { + // if we get here, then we didn't find the Mass Storage + // interface ... this should never happen, but if it does, + // assume the device is showing product ID 0006, and the + // Mass Storage interface is interface #0 + printf("Can't find Mass Storage interface, assuming 0.\n"); + return 0; + } + else { + return iface; + } } void driver_conflict(struct usb_dev_handle *handle) @@ -140,7 +149,7 @@ // this is called if the first usb_set_configuration() // failed... this most probably means that usb_storage // has already claimed the Mass Storage interface, - // in which case we politely tell it to away. + // in which case we politely tell it to go away. #if LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP printf("Detecting possible kernel driver conflict, trying to resolve...\n"); @@ -155,7 +164,7 @@ } // returns true if device mode was modified, false otherwise -bool process(struct usb_device *dev, bool is_pearl) +bool process(struct usb_device *dev, ModeType mode) { bool apply = false; printf("Found device #%s...", dev->filename); @@ -178,25 +187,53 @@ else { printf("already at 500mA"); } + printf("\n"); // adjust Pearl mode - if( is_pearl || force_dual ) { - int desired_mode = old_style_pearl - ? PRODUCT_RIM_BLACKBERRY : PRODUCT_RIM_PEARL_DUAL; - - if( desired_mode != dev->descriptor.idProduct ) { - printf("...adjusting Pearl mode to %s", - old_style_pearl ? "single" : "dual"); - pearl_mode(handle); + switch( mode ) + { + case NO_CHANGE: + printf("...no Pearl mode adjustment"); + break; + + case PEARL_CLASSIC_MODE_0001: + if( dev->descriptor.idProduct != PRODUCT_RIM_BLACKBERRY ) { + printf("...adjusting Pearl mode to single"); + pearl_classic_mode(handle); apply = true; } else { - printf("...already in desired Pearl mode"); + printf("...already in classic/single mode"); } + break; + + case PEARL_DUAL_MODE_0004: + if( dev->descriptor.idProduct != PRODUCT_RIM_PEARL_DUAL ) { + printf("...adjusting Pearl mode to dual"); + pearl_dual_mode(handle); + apply = true; + } + else { + printf("...already in dual mode"); + } + break; + + case CONDITIONAL_DUAL_MODE: + if( find_interface(handle, 255) == -1 ) { + printf("...no database iface found, setting dual mode"); + pearl_dual_mode(handle); + apply = true; + } + else { + printf("...found database iface, no change"); + } + break; + + default: + printf("Bug: default case"); + break; } - else { - printf("...no Pearl adjustment"); - } + printf("\n"); // apply changes if( apply ) { @@ -205,7 +242,7 @@ // the Blackberry Pearl doesn't reset itself after the above, // so do it ourselves - if( is_pearl || force_dual ) { + if( mode == PEARL_DUAL_MODE_0004 ) { // // It has been observed that the 8830 behaves both like // a Pearl device (in that it has mass storage + @@ -224,11 +261,12 @@ } } - printf("...done\n"); + printf("...done"); } else { - printf("...no change\n"); + printf("...no change"); } + printf("\n"); // cleanup usb_close(handle); @@ -272,11 +310,11 @@ // Version 2.6.22 adds variables internal to the system called // autosuspend_disabled and autoresume_disabled. These are controlled by the // /sys/class/usb_device/*/device/power/level file. (See below) -// +// // Here's a summary of files under device/power. These may or may not exist // depending on your kernel version and configuration. -// -// +// +// // autosuspend // -1 or 0 means off, depending on kernel, // otherwise it is the number of seconds to @@ -336,30 +374,35 @@ int main(int argc, char *argv[]) { struct usb_bus *busses; + ModeType mode = NO_CHANGE; + + INIT_I18N(PACKAGE); // // allow -o command line switch to choose which mode to use for // Blackberry Pearls: - // Dual(default): 0004 -d + // Dual: 0004 -d // With switch: 0001 -o // // process command line options for(;;) { - int cmd = getopt(argc, argv, "dop:s:h"); + int cmd = getopt(argc, argv, "dogp:s:h"); if( cmd == -1 ) break; switch( cmd ) { - case 'd': // Dual (default) - force_dual = true; - old_style_pearl = false; + case 'd': // Dual + mode = PEARL_DUAL_MODE_0004; + break; + + case 'o': // Classic style pearl + mode = PEARL_CLASSIC_MODE_0001; break; - case 'o': // Old style pearl - force_dual = false; - old_style_pearl = true; + case 'g': // Guess whether dual is needed + mode = CONDITIONAL_DUAL_MODE; break; case 'p': // udev devpath @@ -393,19 +436,8 @@ for (dev = bus->devices; dev; dev = dev->next) { // Is this a blackberry? if( dev->descriptor.idVendor == VENDOR_RIM ) { - switch(dev->descriptor.idProduct) - { - case PRODUCT_RIM_BLACKBERRY: - if( !process(dev, false) ) - resume(); - break; - - case PRODUCT_RIM_PEARL_DUAL: - case PRODUCT_RIM_PEARL: - if( !process(dev, true) ) - resume(); - break; - } + if( !process(dev, mode) ) + resume(); } } } diff -Nru barry-0.14/tools/bdptest.cc barry-0.0.20110506/tools/bdptest.cc --- barry-0.14/tools/bdptest.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bdptest.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,70 @@ +/** + * @file bdptest.cc + * @author Nicolas VIVIEN + * @date 2009-08-01 + * + * @note CopyRight Nicolas VIVIEN + * + * @brief COD debug file parser + * RIM's JDE generates several files when you build a COD application. + * Indeed, with the COD files for the device, we have a ".debug" file. + * This file is usefull to debug an application from JVM. + * This tool is a parser to understand these ".debug" files. + * + * This tool is simply a test application. + * + * @par Modifications + * - 2009/08/01 : N. VIVIEN + * - First release + * + * @par Licences + * Copyright (C) 2009-2010, Nicolas VIVIEN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 in the COPYING file at the + * root directory of this project for more details. + */ + + + +#include +#include +#include +#include "i18n.h" + +#include + + +using namespace std; +using namespace Barry; + + +int main(int argc, char *argv[], char *envp[]) +{ + INIT_I18N(PACKAGE); + + Barry::Init(true, &cout); + + JDG::DebugFileList list; + + JDG::SearchDebugFile(list); + + cout << "List of debug files " << endl; + cout << list << endl; + + + JDG::CodInfo info; + + JDG::LoadDebugInfo(list, argv[1], info); + + return 0; +} + diff -Nru barry-0.14/tools/bfuse.cc barry-0.0.20110506/tools/bfuse.cc --- barry-0.14/tools/bfuse.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bfuse.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,805 @@ +/// +/// \file bfuse.cc +/// FUSE filesystem for Blackberry databases, using Barry. +/// + +/* + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#define FUSE_USE_VERSION 25 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "i18n.h" + +using namespace std; +using namespace std::tr1; +using namespace Barry; + +// Global filenames +const char *error_log_filename = "error.log"; + +// Global command line args +string cmdline_pin; +string cmdline_password; + +// +// Data from the command line +// + +///////////////////////////////////////////////////////////////////////////// +// Command line option handling, through fuse + +//struct opt { +// char +//}; + +void Blurb() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "bfuse - FUSE filesystem for Blackberry databases\n" + << " Copyright 2008-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << endl; +} + +void Usage() +{ + cerr + << "\n" + << "Barry specific options:\n" + << " -p pin PIN of device to talk with\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << endl; +/* + << " -d db Specify which database to mount. If no -d options exist\n" + << " then all databases will be mounted.\n" + << " Can be used multiple times to mount more than one DB\n" + << " -h This help\n" + << " -n Use null parser on all databases.\n" +*/ +} + +///////////////////////////////////////////////////////////////////////////// +// FUSE specific exception + +class fuse_error : public std::runtime_error +{ + int m_errno; +public: + fuse_error(int errno_, const std::string &msg) + : std::runtime_error(msg), m_errno(errno_) + {} + + int get_errno() const { return m_errno; } +}; + + +///////////////////////////////////////////////////////////////////////////// +// Barry record parsers + +class DataDumpParser : public Barry::Parser +{ + uint32_t m_id; + std::ostream &m_os; + +public: + explicit DataDumpParser(std::ostream &os) + : m_os(os) + { + } + + virtual void ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic) + { + m_id = data.GetUniqueId(); + m_os << "Raw record dump for record: " + << std::hex << m_id << std::endl; + m_os << data.GetData() << std::endl; + } +}; + +template +struct Store +{ + std::ostream &m_os; + + explicit Store(std::ostream &os) + : m_os(os) + { + } + + // storage operator + void operator()(const Record &rec) + { + m_os << rec; + } +}; + +typedef std::auto_ptr ParserPtr; + +ParserPtr GetParser(const string &name, std::ostream &os, bool null_parser) +{ + if( null_parser ) { + // use null parser + return ParserPtr( new DataDumpParser(os) ); + } + // check for recognized database names + else if( name == Contact::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == Message::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == Calendar::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == CalendarAll::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == ServiceBook::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + + else if( name == Memo::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == Task::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == PINMessage::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == SavedMessage::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == Folder::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else if( name == Timezone::GetDBName() ) { + return ParserPtr( + new RecordParser > ( + new Store(os))); + } + else { + // unknown database, use null parser + return ParserPtr( new DataDumpParser(os) ); + } +} + +///////////////////////////////////////////////////////////////////////////// +// PathSplit class + +class PathSplit +{ + std::string m_pin, m_db, m_record, m_field, m_remainder; + + int m_level; // the number of slashes, minus the first + // i.e. first level is 0 + bool m_is_root; + +public: + explicit PathSplit(const char *path) + : m_level(-1) + , m_is_root(false) + { + if( *path != '/' ) + return; // return in a failed state + + if( *(path+1) == 0 ) { + m_is_root = true; + return; + } + + const char *s = path, *e = path; + while( *e ) { + while( *e && *e != '/' ) + e++; + + m_level++; + + if( s != e && (s+1) != e ) { + string token(s+1, e); + + switch( m_level ) + { + case 0: // root level, should not have token here + m_level = -1; + return; // failed state + + case 1: // have pin + m_pin = token; + break; + + case 2: // have db + m_db = token; + break; + + case 3: // have record + m_record = token; + break; + + case 4: // have field + m_field = token; + break; + + default: // too many, store remainder and done + m_remainder = s; // keeps slash + return; + } + + // next + s = e; + if( *e ) + e++; + } + else if( *e ) { + // next + e++; + } + } + } + + bool IsRoot() const { return m_is_root; } + const std::string& Pin() const { return m_pin; } + const std::string& DB() const { return m_db; } + const std::string& Record() const { return m_record; } + const std::string& Field() const { return m_field; } + const std::string& Remainder() const { return m_remainder; } + int Level() const { return m_level; } +}; + + +///////////////////////////////////////////////////////////////////////////// +// API classes + +class Entry +{ +public: + virtual ~Entry() {} +}; + +class Directory : public Entry +{ +public: + virtual int ReadDir(void *buf, fuse_fill_dir_t filler) = 0; + virtual void FillDirStat(struct stat *st) + { + st->st_mode = S_IFDIR | 0555; + st->st_nlink = 2; + } +}; + +class File : public Entry +{ +public: + virtual void FillFileStat(const char *path, struct stat *st) = 0; + virtual bool AccessOk(int flags) + { + // default to readonly files + return (flags & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDONLY; + } + virtual int ReadFile(const char *path, char *buf, size_t size, off_t offset) = 0; +}; + +typedef Directory* DirectoryPtr; +typedef File* FilePtr; +typedef std::string NameT; +typedef std::map DirMap; +typedef std::map FileMap; + +static DirMap g_dirmap; +static FileMap g_filemap; + +static Directory* FindDir(const NameT &name) +{ + DirMap::iterator di = g_dirmap.find(name); + return di == g_dirmap.end() ? 0 : di->second; +} + +static File* FindFile(const NameT &name) +{ + FileMap::iterator fi = g_filemap.find(name); + return fi == g_filemap.end() ? 0 : fi->second; +} + +///////////////////////////////////////////////////////////////////////////// +// Context classes + +class Database : public Directory, public File +{ +public: + Barry::Mode::Desktop &m_desk; + std::string m_name; + const Barry::DatabaseItem *m_pdb; + +public: + Database(Barry::Mode::Desktop &desktop, + const std::string &pin, const Barry::DatabaseItem *pdb) + : m_desk(desktop) + , m_pdb(pdb) + { + m_name = string("/") + pin + "/" + m_pdb->Name; + + // add to directory list + g_dirmap[ m_name ] = this; + } + + ~Database() + { + // remove any entries that point to us + FileMap::iterator b = g_filemap.begin(), e = g_filemap.end(); + for( ; b != e; ++b ) { + if( b->second == this ) { + g_filemap.erase(b); + } + } + + // erase ourselves from the directory list + g_dirmap.erase( m_name ); + } + + void AddFile(const std::string &recordId) + { + // FIXME - this is a hack to redirect all record files + // to this database class... next step is to possibly + // split out records into field files if we have a + // parser, or just dump the hex if we don't + string name = m_name + "/" + recordId; + g_filemap[ name ] = this; + } + + virtual int ReadDir(void *buf, fuse_fill_dir_t filler) + { + filler(buf, ".", NULL, 0); + filler(buf, "..", NULL, 0); + + // list all records in database, by recordId + Barry::RecordStateTable rst; + m_desk.GetRecordStateTable(m_pdb->Number, rst); + + Barry::RecordStateTable::StateMapType::iterator + b = rst.StateMap.begin(), + e = rst.StateMap.end(); + for( ; b != e; ++ b ) { + ostringstream oss; + oss << hex << b->second.RecordId; + filler(buf, oss.str().c_str(), NULL, 0); + + AddFile(oss.str()); + } + return 0; + } + + virtual void FillFileStat(const char *path, struct stat *st) + { + // use the path to find the proper record + PathSplit ps(path); + + string constructed = string("/") + ps.Pin() + "/" + ps.DB(); + if( constructed != m_name ) { + // FIXME - this is shoddy error handling + throw std::logic_error("Constructed != name"); + } + + string data = GetRecordData(ps.Record()); + + st->st_mode = S_IFREG | 0444; + st->st_nlink = 1; + st->st_size = data.size(); + } + + virtual int ReadFile(const char *path, char *buf, size_t size, off_t offset) + { + // use the path to find the proper record + PathSplit ps(path); + + string constructed = string("/") + ps.Pin() + "/" + ps.DB(); + if( constructed != m_name ) { + // FIXME - this is shoddy error handling + throw std::logic_error("Constructed != name"); + } + + string data = GetRecordData(ps.Record()); + + size_t len = data.size(); + if( offset >= 0 && offset < (off_t)len ) { + if( (offset + size) > len ) + size = len - offset; + memcpy(buf, data.data() + offset, size); + } + else { + size = 0; + } + return size; + } + + const std::string& GetDBName() const { return m_pdb->Name; } + + std::string GetRecordData(const std::string &recordId) + { + string data; + + Barry::RecordStateTable rst; + m_desk.GetRecordStateTable(m_pdb->Number, rst); + + uint32_t recid = strtoul(recordId.c_str(), NULL, 16); + RecordStateTable::IndexType index; + if( rst.GetIndex(recid, &index) ) { + ostringstream oss; + ParserPtr parser = GetParser(m_pdb->Name, oss, false); + m_desk.GetRecord(m_pdb->Number, index, *parser); + data = oss.str(); + } + + return data; + } +}; + +class DesktopCon : public Directory +{ +public: + typedef std::tr1::shared_ptr DatabasePtr; + typedef std::list DBList; +public: + Barry::Controller m_con; + Barry::Mode::Desktop m_desk; + std::string m_pin; + DBList m_dblist; + + DesktopCon(const Barry::ProbeResult &result, const std::string &pin) + : m_con(result) + , m_desk(m_con) + , m_pin(pin) + { + // add to directory list + g_dirmap[ string("/") + pin ] = this; + } + + ~DesktopCon() + { + // remove from directory list + g_dirmap.erase( string("/") + m_pin ); + } + + virtual int ReadDir(void *buf, fuse_fill_dir_t filler) + { + filler(buf, ".", NULL, 0); + filler(buf, "..", NULL, 0); + + // list all databases in list + DBList::const_iterator b = m_dblist.begin(), e = m_dblist.end(); + for( ; b != e; ++ b ) { + filler(buf, (*b)->GetDBName().c_str(), NULL, 0); + } + return 0; + } + + void Open(const char *password = 0) + { + // open our device + m_desk.Open(password); + + // add all databases as directories + DatabaseDatabase::DatabaseArrayType::const_iterator + dbi = m_desk.GetDBDB().Databases.begin(), + dbe = m_desk.GetDBDB().Databases.end(); + for( ; dbi != dbe; ++dbi ) { + DatabasePtr db = DatabasePtr( + new Database(m_desk, m_pin, &(*dbi)) ); + m_dblist.push_back(db); + } + } +}; + +class Context : public Directory, public File +{ +public: + typedef std::auto_ptr ProbePtr; + typedef std::tr1::shared_ptr DesktopConPtr; + typedef std::string PinT; + typedef std::map PinMap; + + ProbePtr m_probe; + PinMap m_pinmap; + + string m_error_log; + + string m_limit_pin; // only mount device with this pin + string m_password; // use this password when connecting + +public: + Context(const string &limit_pin = "", const string &password = "") + : m_limit_pin(limit_pin) + , m_password(password) + { + g_dirmap["/"] = this; + g_filemap[string("/") + error_log_filename] = this; + + m_error_log = "Hello FUSE world. This is Barry. Pleased to meet you.\n"; + } + + ~Context() + { + g_dirmap.erase("/"); + g_filemap.erase(string("/") + error_log_filename); + } + + virtual int ReadDir(void *buf, fuse_fill_dir_t filler) + { + filler(buf, ".", NULL, 0); + filler(buf, "..", NULL, 0); + filler(buf, error_log_filename, NULL, 0); + + // list all pins in map + PinMap::const_iterator b = m_pinmap.begin(), e = m_pinmap.end(); + for( ; b != e; ++ b ) { + filler(buf, b->first.c_str(), NULL, 0); + } + return 0; + } + + virtual void FillFileStat(const char *path, struct stat *st) + { + st->st_mode = S_IFREG | 0444; + st->st_nlink = 1; + st->st_size = m_error_log.size(); + } + + virtual int ReadFile(const char *path, char *buf, size_t size, off_t offset) + { + size_t len = m_error_log.size(); + if( offset >= 0 && offset < (off_t)len ) { + if( (offset + size) > len ) + size = len - offset; + memcpy(buf, m_error_log.data() + offset, size); + } + else { + size = 0; + } + return size; + } + + void Log(const std::string &msg) + { + m_error_log += msg; + m_error_log += "\n"; + } + + const std::string& GetLog() const { return m_error_log; } + + void ProbeAll() + { + // probe the USB bus for Blackberry devices + m_probe.reset( new Probe ); + + // connect to all PINs found, and add them to our map + for( int i = 0; i < m_probe->GetCount(); i++ ) { + string curpin = m_probe->Get(i).m_pin.Str(); + + // don't add a blank or pre-existing pin + if( !curpin.size() || m_pinmap.find(curpin) != m_pinmap.end() ) { + continue; + } + + // don't add non-PIN device if pin specified + if( m_limit_pin.size() && curpin != m_limit_pin ) { + continue; + } + + DesktopConPtr dev = DesktopConPtr ( + new DesktopCon(m_probe->Get(i), curpin) ); + dev->Open(m_password.c_str()); + m_pinmap[ curpin ] = dev; + } + } + + DesktopCon* FindPin(PinT pin) + { + PinMap::iterator pi = m_pinmap.find(pin); + return pi == m_pinmap.end() ? 0 : pi->second.get(); + } +}; + + +///////////////////////////////////////////////////////////////////////////// +// FUSE API hooks + +static void* bfuse_init() +{ + // Initialize the barry library. Must be called before + // anything else. + Barry::Init(false); + + Context *ctx = 0; + + try { + ctx = new Context(cmdline_pin, cmdline_password); + ctx->ProbeAll(); + } + catch( std::exception &e ) { + if( ctx ) { + ctx->Log(e.what()); + } + } + + return ctx; +} + +static void bfuse_destroy(void *data) +{ + if( data ) { + Context *ctx = (Context*) data; + delete ctx; + } +} + +static int bfuse_getattr(const char *path, struct stat *st) +{ + memset(st, 0, sizeof(*st)); + + if( Directory *dir = FindDir(path) ) { + dir->FillDirStat(st); + return 0; + } + else if( File *file = FindFile(path) ) { + file->FillFileStat(path, st); + return 0; + } + else + return -ENOENT; +} + +static int bfuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler, + off_t /*offset*/, struct fuse_file_info * /*fi*/) +{ + Directory *dir = FindDir(path); + if( !dir ) + return -ENOENT; + return dir->ReadDir(buf, filler); +} + +static int bfuse_open(const char *path, struct fuse_file_info *fi) +{ + File *file = FindFile(path); + if( !file ) + return -ENOENT; + + if( !file->AccessOk(fi->flags) ) + return -EACCES; + + return 0; +} + +static int bfuse_read(const char *path, char *buf, size_t size, off_t offset, + struct fuse_file_info *fi) +{ + File *file = FindFile(path); + if( !file ) + return -ENOENT; + + return file->ReadFile(path, buf, size, offset); +} + +// static struct here automatically zeros data +static struct fuse_operations bfuse_oper; + + +///////////////////////////////////////////////////////////////////////////// +// main + +int main(int argc, char *argv[]) +{ + INIT_I18N(PACKAGE); + + cout.sync_with_stdio(true); // leave this on, since libusb uses + // stdio for debug messages + + Blurb(); + + // initialize the operation hooks + bfuse_oper.init = bfuse_init; + bfuse_oper.destroy = bfuse_destroy; + bfuse_oper.getattr = bfuse_getattr; + bfuse_oper.readdir = bfuse_readdir; + bfuse_oper.open = bfuse_open; + bfuse_oper.read = bfuse_read; + + // process command line options before FUSE does + // FUSE does its own command line processing, and + // doesn't seem to have a way to plug into it, + // so do our own first + int fuse_argc = 0; + char **fuse_argv = new char*[argc]; + + for( int i = 0; i < argc; i++ ) { + if( argv[i][0] == '-' ) { + + switch( argv[i][1] ) + { +// case 'd': // mount dbname +// dbNames.push_back(string(optarg)); +// break; + +// case 'n': // use null parser +// null_parser = true; +// break; + + case 'p': // Blackberry PIN + if( i+1 < argc ) { + cmdline_pin = argv[++i]; + } + continue; + + case 'P': // Device password + if( i+1 < argc ) { + cmdline_password = argv[++i]; + } + continue; + + case 'h': // help + Usage(); + break; + } + } + + // if we get here, add this option to FUSE's + fuse_argv[fuse_argc] = argv[i]; + fuse_argc++; + } + + int ret = fuse_main(fuse_argc, fuse_argv, &bfuse_oper); + delete [] fuse_argv; + return ret; +} + diff -Nru barry-0.14/tools/bidentify.cc barry-0.0.20110506/tools/bidentify.cc --- barry-0.14/tools/bidentify.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/bidentify.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -23,42 +23,71 @@ #include #include #include +#include "i18n.h" using namespace std; using namespace Barry; void Usage() { - int major, minor; - const char *Version = Barry::Version(major, minor); + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); cerr << "bidentify - USB Blackberry Identifier Tool\n" - << " Copyright 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Copyright 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" << " Using: " << Version << "\n" << "\n" << " -B bus Specify which USB bus to search on\n" << " -N dev Specify which system device, using system specific string\n" << "\n" + << " -c If used with -m, show both hex and dec where possible\n" + << " -m Also show the device's ESN / MEID / IMEI\n" << " -h This help\n" << " -v Dump protocol data during operation\n" << endl; } +std::string FetchMEID(Barry::Mode::Desktop &desktop) +{ + using namespace Barry; + + unsigned int dbId = desktop.GetDBID(HandheldAgent::GetDBName()); + RecordStateTable state; + desktop.GetRecordStateTable(dbId, state); + + unsigned int recId = HandheldAgent::GetMEIDRecordId(); + + RecordStateTable::IndexType meid_index; + if( state.GetIndex(recId, &meid_index) ) { + NullStore store; + RecordParser > parser(store); + desktop.GetRecord(dbId, meid_index, parser); + return parser.GetRecord().MEID; + } + else { + return string(); + } +} + int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(true); // leave this on, since libusb uses // stdio for debug messages try { - bool data_dump = false; + bool data_dump = false, + get_meid = false, + show_both = false; string busname; string devname; // process command line options for(;;) { - int cmd = getopt(argc, argv, "B:hN:v"); + int cmd = getopt(argc, argv, "B:hN:vmc"); if( cmd == -1 ) break; @@ -72,6 +101,14 @@ devname = optarg; break; + case 'c': // show both hex and dec + show_both = true; + break; + + case 'm': // get meid / esn + get_meid = true; + break; + case 'v': // data dump on data_dump = true; break; @@ -97,8 +134,38 @@ // show all successfully found devices for( int i = 0; i < probe.GetCount(); i++ ) { const ProbeResult &pr = probe.Get(i); - cout << hex << pr.m_pin << ", " - << pr.m_description << endl; + cout << pr.m_pin.Str() << ", " + << pr.m_description; + + if( get_meid ) try { + Barry::Controller con(pr); + Barry::Mode::Desktop desktop(con); + desktop.Open(); + + // store as temporary in case of exceptions + string meid = FetchMEID(desktop); + cout << ", " << meid; + + if( show_both ) { + if( HandheldAgent::IsESNHex(meid) ) { + cout << " (" << HandheldAgent::ESNHex2Dec(meid) << ")"; + } + else if( HandheldAgent::IsESNDec(meid) ) { + cout << " (" << HandheldAgent::ESNDec2Hex(meid) << ")"; + } + } + } + catch( Barry::BadPassword & ) { + // ignore password protected devices + } + catch( Barry::Error &e ) { + // output on cerr so as not to mess up + // the identify output + cerr << "Error on PIN: " << pr.m_pin.Str() << ": " << e.what() << endl; + } + + // finish the identity line + cout << endl; } return probe.GetFailCount(); diff -Nru barry-0.14/tools/bio.cc barry-0.0.20110506/tools/bio.cc --- barry-0.14/tools/bio.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bio.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,1111 @@ +/// +/// \file bio.cc +/// Barry Input / Output +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include + +#include "mimedump.h" +#include "brecsum.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace std::tr1; +using namespace Barry; + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "bio - Barry Input / Output\n" + << " Copyright 2010-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << " Compiled " +#ifdef __BARRY_BOOST_MODE__ + << "with" +#else + << "without" +#endif + << " Boost support\n" + << "\n" + << " Usage: bio -i [options...] -o [options...]\n" + << "\n" + << " -i type The input type (Builder) to use for producing records\n" + << " Can be one of: device, tar" +#ifdef __BARRY_BOOST_MODE__ + << ", boost" +#endif + << ", ldif, mime\n" + << " -o type The output type (Parser) to use for processing records.\n" + << " Multiple outputs are allowed, as long as they don't\n" + << " conflict (such as two outputs writing to the same file\n" + << " or device).\n" + << " Can be one of: device, tar" +#ifdef __BARRY_BOOST_MODE__ + << ", boost" +#endif + << ", ldif, mime, dump, sha1, cstore\n" + << "\n" + << " Options to use for 'device' type:\n" + << " -d db Name of input database. Can be used multiple times.\n" + << " -A Add all available device databases, instead of specifying\n" + << " them manually via -d\n" + << " -p pin PIN of device to talk to\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << " -w mode Set write mode when using 'device' for output. Must be\n" + << " specified, or will not write anything.\n" + << " Can be one of: erase, overwrite, addonly, addnew\n" +/* +// FIXME - modifiers not yet implemented + << "\n" + << " Input database modifiers: (can be used multiple times for more than 1 record)\n" + << "\n" + << " -r # Record index number as seen in the -T state table.\n" + << " This overrides the default -d behaviour, and only\n" + << " downloads the one specified record, sending to stdout.\n" + << " -R # Same as -r, but also clears the record's dirty flags.\n" + << " -D # Record index number as seen in the -T state table,\n" + << " which indicates the record to delete. Used with the -d\n" + << " command to specify the database.\n" +*/ + << "\n" + << " Options to use for 'tar' backup type:\n" + << " -d db Name of input database. Can be used multiple times.\n" + << " Not available in output mode. Note that by default,\n" + << " all databases in the backup are selected, when reading,\n" + << " unless at least one -d is specified.\n" + << " -f file Tar backup file to read from or write to\n" +#ifdef __BARRY_BOOST_MODE__ + << "\n" + << " Options to use for 'boost' type:\n" + << " -f file Boost serialization filename to read from or write to\n" + << " Can use - to specify stdin/stdout\n" +#endif + << "\n" + << " Options to use for 'ldif' type:\n" + << " -c dn Convert address book database to LDIF format, using the\n" + << " specified baseDN\n" + << " -C dnattr LDIF attribute name to use when building the FQDN\n" + << " Defaults to 'cn'\n" +/* +LDIF options? + + << " -L List Contact field names\n" + << " -m Map LDIF name to Contact field / Unmap LDIF name\n" + << " Map: ldif,read,write - maps ldif to read/write Contact fields\n" + << " Unmap: ldif name alone\n" + << " -M List current LDIF mapping\n" +*/ + << "\n" + << " Options to use for 'mime' type:\n" + << " -f file Filename to read from or write to. Use - to explicitly\n" + << " specify stdin/stdout, which is default.\n" + << "\n" + << " Options to use for 'dump' to stdout output type:\n" + << " -n Use hex dump parser on all databases.\n" + << "\n" + << " Options to use for 'sha1' sum stdout output type:\n" + << " -t Include DB Name, Type, and Unique record IDs in the checksums\n" + << "\n" + << " Options to use for 'cstore' output type:\n" + << " -l List filenames only\n" + << " -f file Filename from the above list, including path.\n" + << " If found, the file will be written to the current\n" + << " directory, using the base filename from the device.\n" + << "\n" + << " Standalone options:\n" + << " -h This help\n" + << " -I cs International charset for string conversions\n" + << " Valid values here are available with 'iconv --list'\n" + << " -S Show list of supported database parsers and builders\n" + << " -v Dump protocol data during operation\n" + << "\n" + << endl; +} + +class ModeBase +{ +public: + virtual ~ModeBase() {} + + virtual bool ProbeNeeded() const { return false; } + + virtual void SetFilename(const std::string &name) + { + throw runtime_error("Filename not applicable for this mode"); + } + + virtual void AddDB(const std::string &dbname) + { + throw runtime_error("DB not applicable for this mode"); + } + + virtual void AddAllDBs() + { + throw runtime_error("DBs not applicable for this mode"); + } + + virtual void SetPIN(const std::string &pin) + { + throw runtime_error("PIN not applicable for this mode"); + } + + virtual void SetPassword(const std::string &password) + { + throw runtime_error("Password not applicable for this mode"); + } + + virtual void SetWriteMode(DeviceParser::WriteMode mode) + { + throw runtime_error("Device write behaviour not applicable for this mode"); + } + + virtual void SetDN(const std::string &dn) + { + throw runtime_error("DN not applicable for this mode"); + } + + virtual void SetAttribute(const std::string &attr) + { + throw runtime_error("Attribute not applicable for this mode"); + } + + virtual void SetHexDump() + { + throw runtime_error("No hex dump option in this mode"); + } + + virtual void IncludeIDs() + { + throw runtime_error("Including record IDs in the SHA1 sum is not applicable in this mode"); + } + + virtual void SetList() + { + throw runtime_error("List option not applicable for this mode"); + } +}; + +class DeviceBase : public virtual ModeBase +{ +protected: + Barry::Pin m_pin; + std::string m_password; + +public: + bool ProbeNeeded() const { return true; } + + void SetPIN(const std::string &pin) + { + istringstream iss(pin); + iss >> m_pin; + if( !m_pin.Valid() ) + throw runtime_error("Invalid PIN: " + pin); + } + + void SetPassword(const std::string &password) + { + m_password = password; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Base class for Input Mode + +class InputBase : public virtual ModeBase +{ +public: + virtual Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) = 0; +}; + +class DeviceInputBase : public DeviceBase, public InputBase +{ +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Input, Type: device + +class DeviceInput : public DeviceInputBase +{ + auto_ptr m_con; + auto_ptr m_desktop; + auto_ptr m_builder; + vector m_dbnames; + bool m_add_all; + +public: + DeviceInput() + : m_add_all(false) + { + } + + void AddDB(const std::string &dbname) + { + m_dbnames.push_back(dbname); + } + + void AddAllDBs() + { + m_add_all = true; + } + + Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) + { + int i = probe->FindActive(m_pin); + if( i == -1 ) { + if( m_pin.Valid() ) + throw runtime_error("PIN not found: " + m_pin.Str()); + else + throw runtime_error("PIN not specified, and more than one device exists."); + } + + m_con.reset( new Controller(probe->Get(i)) ); + m_desktop.reset( new Mode::Desktop(*m_con, ic) ); + m_desktop->Open(m_password.c_str()); + m_builder.reset( new DeviceBuilder(*m_desktop) ); + + if( m_add_all ) { + m_builder->Add(m_desktop->GetDBDB()); + } + else { + for( size_t i = 0; i < m_dbnames.size(); i++ ) { + m_builder->Add(m_dbnames[i]); + } + } + + return *m_builder; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Input, Type: tar + +class TarInput : public InputBase +{ + auto_ptr m_restore; + string m_tarpath; + vector m_dbnames; + +public: + void SetFilename(const std::string &name) + { + m_tarpath = name; + if( name == "-" ) + throw runtime_error("Cannot use stdin as tar source file, sorry."); + } + + void AddDB(const std::string &dbname) + { + m_dbnames.push_back(dbname); + } + + Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) + { + m_restore.reset( new Restore(m_tarpath, true) ); + for( size_t i = 0; i < m_dbnames.size(); i++ ) { + m_restore->AddDB(m_dbnames[i]); + } + + return *m_restore; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Input, Type: boost + +#ifdef __BARRY_BOOST_MODE__ +class BoostInput : public InputBase +{ + auto_ptr m_builder; + string m_filename; + +public: + BoostInput() + : m_filename("-") // default to stdin/stdout + { + } + + void SetFilename(const std::string &name) + { + m_filename = name; + } + + Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) + { + if( m_filename == "-" ) { + // use stdin + m_builder.reset( new BoostBuilder(cin) ); + } + else { + m_builder.reset( new BoostBuilder(m_filename) ); + } + return *m_builder; + } + +}; +#endif + +////////////////////////////////////////////////////////////////////////////// +// Mode: Input, Type: ldif + +class LdifInput : public InputBase +{ + auto_ptr m_builder; + string m_filename; + +public: + LdifInput() + : m_filename("-") + { + } + + void SetFilename(const std::string &name) + { + m_filename = name; + } + + Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) + { + if( m_filename == "-" ) { + // use stdin + m_builder.reset( + new RecordBuilder( + new LdifStore(cin)) ); + } + else { + m_builder.reset( + new RecordBuilder( + new LdifStore(m_filename)) ); + } + return *m_builder; + } + +}; + + +////////////////////////////////////////////////////////////////////////////// +// Mode: Input, Type: mime + +class MimeInput : public InputBase +{ + auto_ptr m_builder; + string m_filename; + +public: + MimeInput() + : m_filename("-") + { + } + + void SetFilename(const std::string &name) + { + m_filename = name; + } + + Builder& GetBuilder(Barry::Probe *probe, IConverter &ic) + { + if( m_filename == "-" ) { + // use stdin + m_builder.reset( new MimeBuilder(cin) ); + } + else { + m_builder.reset( new MimeBuilder(m_filename) ); + } + return *m_builder; + } + +}; + +////////////////////////////////////////////////////////////////////////////// +// Base class for Output Mode + +class OutputBase : public virtual ModeBase +{ +public: + virtual Parser& GetParser(Barry::Probe *probe, IConverter &ic) = 0; +}; + +class DeviceOutputBase : public DeviceBase, public OutputBase +{ +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: device + +class DeviceOutput : public DeviceOutputBase +{ + auto_ptr m_con; + auto_ptr m_desktop; + auto_ptr m_parser; + DeviceParser::WriteMode m_mode; + +public: + DeviceOutput() + : m_mode(DeviceParser::DROP_RECORD) + { + } + + void SetWriteMode(DeviceParser::WriteMode mode) + { + m_mode = mode; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + int i = probe->FindActive(m_pin); + if( i == -1 ) { + if( m_pin.Valid() ) + throw runtime_error("PIN not found: " + m_pin.Str()); + else + throw runtime_error("PIN not specified, and more than one device exists."); + } + + m_con.reset( new Controller(probe->Get(i)) ); + m_desktop.reset( new Mode::Desktop(*m_con, ic) ); + m_desktop->Open(m_password.c_str()); + m_parser.reset( new DeviceParser(*m_desktop, m_mode) ); + + return *m_parser; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: tar + +class TarOutput : public OutputBase +{ + auto_ptr m_backup; + string m_tarpath; + +public: + void SetFilename(const std::string &name) + { + m_tarpath = name; + if( name == "-" ) + throw runtime_error("Cannot use stdout as tar backup file, sorry."); + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + m_backup.reset( new Backup(m_tarpath) ); + return *m_backup; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: boost + +#ifdef __BARRY_BOOST_MODE__ +class BoostOutput : public OutputBase +{ + auto_ptr m_parser; + string m_filename; + +public: + void SetFilename(const std::string &name) + { + m_filename = name; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + if( !m_filename.size() ) + throw runtime_error("Boost output requires a specific output file (-f switch)"); + + if( m_filename == "-" ) { + // use stdout + m_parser.reset( new BoostParser(cout) ); + } + else { + m_parser.reset( new BoostParser(m_filename) ); + } + return *m_parser; + } + +}; +#endif + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: ldif + +class LdifOutput : public OutputBase +{ + auto_ptr m_parser; + string m_filename; + string m_baseDN; + string m_dnattr; + +public: + LdifOutput() + : m_filename("-") + { + } + + void SetFilename(const std::string &name) + { + m_filename = name; + } + + void SetDN(const std::string &dn) + { + m_baseDN = dn; + } + + void SetAttribute(const std::string &attr) + { + m_dnattr = attr; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + if( m_filename == "-" ) { + // use stdin + m_parser.reset( + new RecordParser( + new LdifStore(cout, m_baseDN, + m_dnattr)) ); + } + else { + m_parser.reset( + new RecordParser( + new LdifStore(m_filename, m_baseDN, + m_dnattr)) ); + } + return *m_parser; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: mime + +class MimeStore : public AllRecordStore +{ + std::ostream &m_os; + +public: + MimeStore(std::ostream &os) + : m_os(os) + { + } + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + void operator() (const Barry::tname &r) \ + { \ + MimeDump::Dump(m_os, r); \ + } + + ALL_KNOWN_PARSER_TYPES +}; + +class MimeOutput : public OutputBase +{ + auto_ptr m_file; + auto_ptr m_parser; + std::string m_filename; + +public: + MimeOutput() + : m_filename("-") // default to stdout + { + } + + void SetFilename(const std::string &name) + { + m_filename = name; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + if( m_filename == "-" ) { + m_parser.reset( new AllRecordParser(cout, + new HexDumpParser(cout), + new MimeStore(cout)) ); + } + else { + m_file.reset( new std::ofstream(m_filename.c_str()) ); + m_parser.reset( new AllRecordParser(*m_file, + new HexDumpParser(*m_file), + new MimeStore(*m_file)) ); + } + return *m_parser; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: dump + +class DumpOutput : public OutputBase +{ + auto_ptr m_parser; + bool m_hex_only; + +public: + DumpOutput() + : m_hex_only(false) + { + } + + void SetHexDump() + { + m_hex_only = true; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + if( m_hex_only ) { + m_parser.reset( new HexDumpParser(cout) ); + } + else { + m_parser.reset( new AllRecordParser(cout, + new HexDumpParser(cout), + new AllRecordDumpStore(cout)) ); + } + return *m_parser; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: sha1 + +class Sha1Output : public OutputBase +{ + auto_ptr m_parser; + bool m_include_ids; + +public: + Sha1Output() + : m_include_ids(false) + { + } + + void IncludeIDs() + { + m_include_ids = true; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + m_parser.reset( new ChecksumParser(m_include_ids) ); + return *m_parser; + } +}; + +////////////////////////////////////////////////////////////////////////////// +// Mode: Output, Type: cstore + +class ContentStoreOutput : public OutputBase +{ + auto_ptr m_parser; + bool m_list_only; + vector m_filenames; + +public: + ContentStoreOutput() + : m_list_only(false) + { + } + + void SetFilename(const std::string &name) + { + m_filenames.push_back(name); + } + + void SetList() + { + m_list_only = true; + } + + Parser& GetParser(Barry::Probe *probe, IConverter &ic) + { + m_parser.reset( new RecordParser(*this) ); + return *m_parser; + } + + // storage operator + void operator() (const ContentStore &rec) + { + if( m_list_only ) { + cout << rec.Filename; + if( rec.FolderFlag ) { + cout << " (folder)"; + } + cout << endl; + } + else { + // check if this record matches one of the filenames + // in the list + vector::iterator i = find(m_filenames.begin(), + m_filenames.end(), rec.Filename); + if( i != m_filenames.end() ) { + SaveFile(rec); + } + } + } + + void SaveFile(const ContentStore &rec) + { + size_t slash = rec.Filename.rfind('/'); + string filename; + if( slash == string::npos ) + filename = rec.Filename; + else + filename = rec.Filename.substr(slash + 1); + + // modify filename until we find one that doesn't + // already exist + string freshname = filename; + int count = 0; + while( access(freshname.c_str(), F_OK) == 0 ) { + ostringstream oss; + oss << filename << count++; + freshname = oss.str(); + } + + // open and write! + cout << "Saving: " << rec.Filename + << " as " << freshname << endl; + ofstream ofs(freshname.c_str()); + ofs << rec.FileContent; + ofs.flush(); + if( !ofs ) { + cout << "Error during write!" << endl; + } + } +}; + + + +////////////////////////////////////////////////////////////////////////////// +// Main application class + +class App +{ +public: + typedef shared_ptr OutputPtr; + typedef vector OutputsType; + +private: + auto_ptr Input; + OutputsType Outputs; + +public: + + bool ParseInMode(const string &mode); + bool ParseOutMode(const string &mode); + DeviceParser::WriteMode ParseWriteMode(const std::string &mode); + static void ShowParsers(); + // returns true if any of the items in Outputs needs a probe + bool OutputsProbeNeeded(); + int main(int argc, char *argv[]); +}; + +bool App::ParseInMode(const string &mode) +{ + if( mode == "device" ) { + Input.reset( new DeviceInput ); + return true; + } + else if( mode == "tar" ) { + Input.reset( new TarInput ); + return true; + } +#ifdef __BARRY_BOOST_MODE__ + else if( mode == "boost" ) { + Input.reset( new BoostInput ); + return true; + } +#endif + else if( mode == "ldif" ) { + Input.reset( new LdifInput ); + return true; + } + else if( mode == "mime" ) { + Input.reset( new MimeInput ); + return true; + } + else + return false; +} + +bool App::ParseOutMode(const string &mode) +{ + if( mode == "device" ) { + Outputs.push_back( OutputPtr(new DeviceOutput) ); + return true; + } + else if( mode == "tar" ) { + Outputs.push_back( OutputPtr(new TarOutput) ); + return true; + } +#ifdef __BARRY_BOOST_MODE__ + else if( mode == "boost" ) { + Outputs.push_back( OutputPtr(new BoostOutput) ); + return true; + } +#endif + else if( mode == "ldif" ) { + Outputs.push_back( OutputPtr(new LdifOutput) ); + return true; + } + else if( mode == "mime" ) { + Outputs.push_back( OutputPtr(new MimeOutput) ); + return true; + } + else if( mode == "dump" ) { + Outputs.push_back( OutputPtr(new DumpOutput) ); + return true; + } + else if( mode == "sha1" ) { + Outputs.push_back( OutputPtr(new Sha1Output) ); + return true; + } + else if( mode == "cstore" ) { + Outputs.push_back( OutputPtr(new ContentStoreOutput) ); + return true; + } + else + return false; +} + +DeviceParser::WriteMode App::ParseWriteMode(const std::string &mode) +{ + if( mode == "erase" ) + return DeviceParser::ERASE_ALL_WRITE_ALL; + else if( mode == "overwrite" ) + return DeviceParser::INDIVIDUAL_OVERWRITE; + else if( mode == "addonly" ) + return DeviceParser::ADD_BUT_NO_OVERWRITE; + else if( mode == "addnew" ) + return DeviceParser::ADD_WITH_NEW_ID; + else + throw runtime_error("Unknown device output mode. Must be one of: erase, overwrite, addonly, addnew"); +} + +void App::ShowParsers() +{ + cout << "Supported Database parsers:\n" + << " (* = can display in vformat MIME mode)\n" + +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) \ + << " " << tname::GetDBName() \ + << (MimeDump::Supported() ? " *" : "") << "\n" + + ALL_KNOWN_PARSER_TYPES + + << "\n" + << "Supported Database builders:\n" + +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(tname) \ + << " " << tname::GetDBName() << "\n" + + ALL_KNOWN_BUILDER_TYPES + + << endl; +} + +bool App::OutputsProbeNeeded() +{ + for( OutputsType::iterator i = Outputs.begin(); + i != Outputs.end(); + ++i ) + { + if( (*i)->ProbeNeeded() ) + return true; + } + return false; +} + +int App::main(int argc, char *argv[]) +{ + bool verbose = false; + string iconvCharset; + + // process command line options + ModeBase *current = 0; + for(;;) { + int cmd = getopt(argc, argv, "hi:o:nvI:f:p:P:d:c:C:ASw:tl"); + if( cmd == -1 ) + break; + + // first option must be in or out, or a global option + if( !current ) { + if( cmd != 'i' && \ + cmd != 'o' && \ + cmd != 'S' && \ + cmd != 'I' && \ + cmd != 'v' ) + { + Usage(); + return 1; + } + } + + switch( cmd ) + { + case 'i': // set input mode + // must be first time used + if( Input.get() || !ParseInMode(optarg) ) { + Usage(); + return 1; + } + current = Input.get(); + break; + + case 'o': // set output mode + // can be used multiple times + if( !ParseOutMode(optarg) ) { + Usage(); + return 1; + } + current = Outputs[Outputs.size() - 1].get(); + break; + + + case 'c': // set ldif dn + current->SetDN(optarg); + break; + + case 'C': // set ldif attr + current->SetAttribute(optarg); + break; + + case 'd': // database name + current->AddDB(optarg); + break; + + case 'f': // filename + current->SetFilename(optarg); + break; + + case 'p': // device PIN + current->SetPIN(optarg); + break; + + case 'P': // password + current->SetPassword(optarg); + break; + + case 'w': // device write mode + current->SetWriteMode(ParseWriteMode(optarg)); + break; + + case 'A': // add all DB names to the device builder + current->AddAllDBs(); + break; + + case 't': // include type and IDs in sha1 mode + current->IncludeIDs(); + break; + + case 'l': // list only + current->SetList(); + break; + + case 'S': // show parsers and builders + ShowParsers(); + return 0; + + case 'I': // international charset (iconv) + iconvCharset = optarg; + break; + + case 'n': // use null hex dump parser only + current->SetHexDump(); + break; + + case 'v': // verbose + verbose = true; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + if( !Input.get() || !Outputs.size() ) { + Usage(); + return 0; + } + + // Initialize the Barry library + Barry::Init(verbose); + + // Create an IConverter object if needed + auto_ptr ic; + if( iconvCharset.size() ) { + ic.reset( new IConverter(iconvCharset.c_str(), true) ); + } + + // Probe for devices only if needed + auto_ptr probe; + if( Input->ProbeNeeded() || OutputsProbeNeeded() ) { + // Probe for available devices + probe.reset( new Probe ); + } + + // Setup the input first (builder) + Builder &builder = Input->GetBuilder(probe.get(), *ic); + + // Setup a TeeParser with all Outputs + TeeParser tee; + for( OutputsType::iterator i = Outputs.begin(); i != Outputs.end(); ++i ) { + Parser &parser = (*i)->GetParser(probe.get(), *ic); + tee.Add(parser); + } + + // Setup the pipe + Pipe pipe(builder); + pipe.PumpFile(tee, ic.get()); + + return 0; +} + +int main(int argc, char *argv[]) +{ + try { + App app; + return app.main(argc, argv); + } + catch( std::exception &e ) { + cerr << "Exception: " << e.what() << endl; + return 1; + } +} + diff -Nru barry-0.14/tools/bjavaloader.cc barry-0.0.20110506/tools/bjavaloader.cc --- barry-0.14/tools/bjavaloader.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bjavaloader.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,487 @@ +/// +/// \file bjavaloader.cc +/// +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + Some parts are inspired from btool.cc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "i18n.h" + +// supported javaloader commands +#define CMD_LIST "dir" +#define CMD_ERASE "erase" +#define CMD_LOAD "load" +#define CMD_SCREENSHOT "screenshot" +#define CMD_SETTIME "settime" +#define CMD_EVENTLOG "eventlog" +#define CMD_CLEAR_LOG "cleareventlog" +#define CMD_SAVE "save" +#define CMD_DEVICEINFO "deviceinfo" +#define CMD_WIPE "wipe" +#define CMD_LOGSTRACES "logstacktraces" +#define CMD_RESETFACTORY "resettofactory" + +// time string format specifier and user friendly description +#define TIME_FMT "%Y-%m-%d %H:%M:%S" +#define TIME_FMT_EXAMPLE "yyyy-mm-dd HH:MM:SS" + +using namespace std; +using namespace Barry; + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "bjavaloader - Command line USB Blackberry Java Loader\n" + << " Copyright 2008-2009, Nicolas VIVIEN.\n" + << " Copyright 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << "\n" + << " -A Save all modules found\n" + << " -a Wipe applications only\n" + << " -i Wipe filesystem only\n" + << " -f Force erase, if module is in use\n" + << " -h This help\n" + << " -s List sibling in module list\n" + << " -p pin PIN of device to talk with\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << " -v Dump protocol data during operation\n" + << "\n" + << "commands\n" + << "\n" + << " " << CMD_LIST << " [-s]\n" + << " Lists modules on the handheld\n" + << "\n" + << " " << CMD_DEVICEINFO << "\n" + << " Provides information on the handheld\n" + << "\n" + << " " << CMD_LOAD << " <.cod file> ...\n" + << " Loads modules onto the handheld\n" + << "\n" + << " " << CMD_SAVE << " [-A] ...\n" + << " Retrieves modules from the handheld and writes to .cod file\n" + << " Note: will overwrite existing files!\n" + << "\n" + << " " << CMD_WIPE << " [-a | -i]\n" + << " Wipes the handheld\n" + << " Use Caution: Wiping filesystem will remove all data\n" + << " such as messages, contacts, etc.\n" + << " Wiping applications will remove all .cod files\n" + << " on the device, including OS .cod files.\n" + << "\n" + << " " << CMD_RESETFACTORY << "\n" + << " Reset IT policy to factory defaults\n" + << " Use Caution: Resetting IT policy to factory defaults will\n" + << " also perform a filesystem wipe which will remove\n" + << " all data such as messages, contacts, etc.\n" + << "\n" + << " " << CMD_ERASE << " [-f] ...\n" + << " Erase module from handheld\n" + << "\n" + << " " << CMD_EVENTLOG << "\n" + << " Retrieves the handheld event log\n" + << "\n" + << " " << CMD_CLEAR_LOG << "\n" + << " Clears the handheld event log\n" + << "\n" + << " " << CMD_LOGSTRACES << "\n" + << " Dump the stack traces for all threads to the event log\n" + << "\n" + << " " << CMD_SCREENSHOT << " <.bmp file>\n" + << " Make a screenshot of handheld\n" + << "\n" + << " " << CMD_SETTIME << " [" << TIME_FMT_EXAMPLE << "]\n" + << " Sets the time on the handheld to the current time\n" + << " Or the time specified as an argument to " << CMD_SETTIME << "\n" + << " If given as argument, current system timezone is assumed\n" + << endl; +} + + +class AutoClose +{ + FILE *fp; + +public: + AutoClose(FILE *fh) : fp(fh) {} + ~AutoClose() + { + fclose(fp); + } +}; + +void SetTime(Barry::Mode::JavaLoader *javaloader, const char *timestr) +{ + time_t when; + + if( timestr ) { + struct tm timeinfo; + memset(&timeinfo, 0, sizeof(timeinfo)); + + // parse time string + char *p = strptime(timestr, TIME_FMT, &timeinfo); + + // NULL is return when strptime fails to match all of the format + // string, and returns a pointer to the NULL byte at the end of + // the input string on success + if( p == NULL || p != (timestr + strlen(timestr)) ) { + throw runtime_error(string("Unable to parse time string: ") + timestr); + } + + when = mktime(&timeinfo); + } else { // time string is NULL, get current time + time(&when); + } + + javaloader->SetTime(when); +} + +void SendAppFile(Barry::Mode::JavaLoader *javaloader, const char *filename) +{ + ifstream file(filename); + javaloader->LoadApp(file); +} + +void GetScreenshot(Barry::Mode::JavaLoader *javaloader, const char *filename) +{ + + // Take a screenshot + // - info object contains the screenshot properties (width, height...) + // - image will be filled with the raw pixel screenshot data + JLScreenInfo info; + Data image; + javaloader->GetScreenshot(info, image); + + + // Convert to BMP format + Data bitmap(-1, GetTotalBitmapSize(info)); + ScreenshotToBitmap(info, image, bitmap); + + // Write BMP file + FILE *fp = fopen(filename, "wb"); + if (fp == NULL) { + throw runtime_error(string("Can't open: ") + filename); + } + AutoClose ac(fp); + + fwrite(bitmap.GetData(), bitmap.GetSize(), 1, fp); +} + +void SaveModule(Barry::Mode::JavaLoader *javaloader, const char *filename) +{ + string fname(filename), module; + + size_t ext_index = fname.rfind(".cod"); + if( ext_index != string::npos ) { + // filename contains .cod extension, strip it for module name + module = fname.substr(0, ext_index); + } + else { + // filename does not contain .cod extension, use it as module name + module = fname; + // append extension to file name + fname.append(".cod"); + } + + ofstream file(fname.c_str(), ios::binary | ios::trunc); + javaloader->Save(module.c_str(), file); +} + + +int main(int argc, char *argv[]) +{ + INIT_I18N(PACKAGE); + + cout.sync_with_stdio(true); // leave this on, since libusb uses + // stdio for debug messages + + try { + + uint32_t pin = 0; + bool list_siblings = false, + force_erase = false, + data_dump = false, + all_modules = false, + wipe_apps = true, + wipe_fs = true; + string password; + vector params; + string busname; + string devname; + string iconvCharset; + Usb::EndpointPair epOverride; + + // process command line options + for(;;) { + int cmd = getopt(argc, argv, "Aaifhsp:P:v"); + if( cmd == -1 ) + break; + + switch( cmd ) + { + case 'p': // Blackberry PIN + pin = strtoul(optarg, NULL, 16); + break; + + case 'P': // Device password + password = optarg; + break; + + case 'f': // turn on 'force' mode for erase + force_erase = true; + break; + + case 's': // turn on listing of sibling modules + list_siblings = true; + break; + + case 'v': // data dump on + data_dump = true; + break; + + case 'A': // save all modules + all_modules = true; + break; + + case 'a': // wipe apps only + wipe_fs = false; + break; + + case 'i': // wipe filesystem + wipe_apps = false; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + argc -= optind; + argv += optind; + + if( argc < 1 ) { + cerr << "missing command" << endl; + Usage(); + return 1; + } + + // Fetch command from remaining arguments + string cmd = argv[0]; + argc --; + argv ++; + + // Put the remaining arguments into an array + for (; argc > 0; argc --, argv ++) { + params.push_back(string(argv[0])); + } + + // Initialize the barry library. Must be called before + // anything else. + Barry::Init(data_dump); + + // Probe the USB bus for Blackberry devices and display. + // If user has specified a PIN, search for it in the + // available device list here as well + Barry::Probe probe; + int activeDevice = probe.FindActive(pin); + if( activeDevice == -1 ) { + cerr << "No device selected, or PIN not found" << endl; + return 1; + } + + // Create our controller object + Barry::Controller con(probe.Get(activeDevice)); + Barry::Mode::JavaLoader javaloader(con); + + // + // execute each mode that was turned on + // + javaloader.Open(password.c_str()); + javaloader.StartStream(); + + if( cmd == CMD_LIST ) { + JLDirectory dir; + javaloader.GetDirectory(dir, list_siblings); + cout << dir; + } + else if( cmd == CMD_LOAD ) { + if( params.size() == 0 ) { + cerr << "specify at least one .cod file to load" << endl; + Usage(); + return 1; + } + + vector::iterator i = params.begin(), end = params.end(); + for( ; i != end; ++i ) { + cout << "loading " << (*i) << "... "; + SendAppFile(&javaloader, (*i).c_str()); + cout << "done." << endl; + } + } + else if( cmd == CMD_ERASE ) { + if( params.size() == 0 ) { + cerr << "specify at least one module to erase" << endl; + Usage(); + return 1; + } + + vector::iterator i = params.begin(), end = params.end(); + for( ; i != end; ++i ) { + cout << "erasing: " << (*i) << "... "; + if( force_erase ) + javaloader.ForceErase((*i)); + else + javaloader.Erase((*i)); + cout << "done." << endl; + } + } + else if( cmd == CMD_SCREENSHOT ) { + if( params.size() == 0 ) { + cerr << "specify a .bmp filename" << endl; + Usage(); + return 1; + } + + GetScreenshot(&javaloader, params[0].c_str()); + } + else if( cmd == CMD_SETTIME ) { + if( params.size() > 0 ) { + SetTime(&javaloader, params[0].c_str()); + } else { + SetTime(&javaloader, NULL); + } + } + else if( cmd == CMD_EVENTLOG ) { + JLEventlog log; + javaloader.GetEventlog(log); + cout << log; + } + else if( cmd == CMD_CLEAR_LOG ) { + javaloader.ClearEventlog(); + } + else if( cmd == CMD_LOGSTRACES ) { + javaloader.LogStackTraces(); + } + else if( cmd == CMD_SAVE ) { + if( all_modules ) { + JLDirectory dir; + javaloader.GetDirectory(dir, false); + JLDirectory::BaseIterator i = dir.begin(); + for( ; i != dir.end(); ++i ) { + cout << "saving: " << i->Name << "... "; + SaveModule(&javaloader,i->Name.c_str()); + cout << "done." << endl; + } + } + else if( params.size() == 0 ) { + cerr << "specify at least one module to save" << endl; + Usage(); + return 1; + } + else { + vector::iterator i = params.begin(), end = params.end(); + for( ; i != end; ++i ) { + cout << "saving: " << (*i) << "... "; + SaveModule(&javaloader, (*i).c_str()); + cout << "done." << endl; + } + } + } + else if( cmd == CMD_DEVICEINFO ) { + JLDeviceInfo info; + javaloader.DeviceInfo(info); + cout << info; + } + else if( cmd == CMD_WIPE ) { + cout + << "Use Caution: Wiping filesystem will remove all data\n" + << " such as messages, contacts, etc.\n" + << " Wiping applications will remove all .cod files\n" + << " on the device, including OS .cod files.\n\n" + << "Continue with wipe? (yes/no) "; + string confirm; + getline(cin, confirm); + if( confirm == "yes" ) { + javaloader.Wipe(wipe_apps, wipe_fs); + } + else { + cout << "Response of 'yes' not received, aborting." << endl; + } + } + else if( cmd == CMD_RESETFACTORY ) { + cout + << "Use Caution: Resetting IT policy to factory defaults will\n" + << " also perform a filesystem wipe which will remove\n" + << " all data such as messages, contacts, etc.\n\n" + << "Continue with wipe? (yes/no) "; + string confirm; + getline(cin, confirm); + if( confirm == "yes" ) { + javaloader.ResetToFactory(); + } + else { + cout << "Response of 'yes' not received, aborting." << endl; + } + } + else { + cerr << "invalid command \"" << cmd << "\"" << endl; + Usage(); + return 1; + } + + // Stop + javaloader.StopStream(); + + } + catch( Usb::Error &ue) { + std::cout << endl; // flush any normal output first + std::cerr << "Usb::Error caught: " << ue.what() << endl; + return 1; + } + catch( Barry::Error &se ) { + std::cout << endl; + std::cerr << "Barry::Error caught: " << se.what() << endl; + return 1; + } + catch( std::exception &e ) { + std::cout << endl; + std::cerr << "std::exception caught: " << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/tools/bjdwp.cc barry-0.0.20110506/tools/bjdwp.cc --- barry-0.14/tools/bjdwp.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bjdwp.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,177 @@ +/// +/// \file bjdwp.cc +/// bjdwp command line tool +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#include +#include +#include +#include "i18n.h" + +using namespace std; +using namespace Barry; + + +void printMessage(const std::string &message); + + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "bjdwp - Command line USB Blackberry JDWP\n" + << " Copyright 2008-2009, Nicolas VIVIEN.\n" + << " Using: " << Version << "\n" + << "\n" + << " -h This help\n" + << " -p pin PIN of device to talk with\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << " -v Dump protocol data during operation\n" + << "\n" + << "arguments\n" + << "\n" + << "
        Interface\n" + << " Listen port\n" + << endl; +} + + +int main(int argc, char *argv[], char *envp[]) +{ + INIT_I18N(PACKAGE); + + try { + uint32_t pin = 0; + bool data_dump = false; + string password; + vector params; + string iconvCharset; + + // process command line options + for(;;) { + int cmd = getopt(argc, argv, "hp:P:v"); + if( cmd == -1 ) + break; + + switch( cmd ) + { + case 'p': // Blackberry PIN + pin = strtoul(optarg, NULL, 16); + break; + + case 'P': // Device password + password = optarg; + break; + + case 'v': // data dump on + data_dump = true; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + argc -= optind; + argv += optind; + + if( argc != 2 ) { + cerr << "missing command" << endl; + Usage(); + return 1; + } + + // Fetch address & port arguments + char *address = argv[0]; + int port = atoi(argv[1]); + + + // Initialize the barry library. Must be called before + // anything else. + Barry::Init(data_dump); + + // Probe the USB bus for Blackberry devices and display. + // If user has specified a PIN, search for it in the + // available device list here as well + Barry::Probe probe; + int activeDevice = probe.FindActive(pin); + if( activeDevice == -1 ) { + cerr << "No device selected, or PIN not found" << endl; + return 1; + } + + Barry::Controller con(probe.Get(activeDevice)); + Barry::Mode::JVMDebug jvmdebug(con); + + // Start JDW daemon... + //--------------------- + + // Create JDWP server and configure + JDWP::JDWServer server(jvmdebug, address, port); + + // Link device + server.SetPasswordDevice(password); + + // Redirect console message + server.SetConsoleCallback(&printMessage); + + server.Start(); + + // FIXME - is this needed... couldn't we do a join here? + while (true) + sleep(1); + + server.Stop(); + } + catch( Usb::Error &ue) { + std::cout << endl; // flush any normal output first + std::cerr << "Usb::Error caught: " << ue.what() << endl; + return 1; + } + catch( Barry::Error &se ) { + std::cout << endl; + std::cerr << "Barry::Error caught: " << se.what() << endl; + return 1; + } + catch( std::exception &e ) { + std::cout << endl; + std::cerr << "std::exception caught: " << e.what() << endl; + return 1; + } + + return 0; +} + + +void printMessage(const std::string &message) +{ + const char esc = 27; + const int green = 32; + const int blue = 34; + + std::cout << esc << '[' << green << "mJVM>" << esc << '[' << blue << "m " << message << esc << "[0m"; +} + diff -Nru barry-0.14/tools/bjvmdebug.cc barry-0.0.20110506/tools/bjvmdebug.cc --- barry-0.14/tools/bjvmdebug.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/bjvmdebug.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,185 @@ +/// +/// \file bjvmdebug.cc +/// +/// + +/* + Copyright (C) 2008-2009, Nicolas VIVIEN + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "i18n.h" + +using namespace std; +using namespace Barry; + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "bjvmdebug - Command line USB Blackberry Java Debugger\n" + << " Copyright 2008-2009, Nicolas VIVIEN.\n" + << " Copyright 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << "\n" + << " -h This help\n" + << " -p pin PIN of device to talk with\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << " -v Dump protocol data during operation\n" + << endl; +} + + +int main(int argc, char *argv[]) +{ + INIT_I18N(PACKAGE); + + try { + + uint32_t pin = 0; + bool data_dump = false; + string password; + vector params; + string iconvCharset; + + // process command line options + for(;;) { + int cmd = getopt(argc, argv, "hp:P:v"); + if( cmd == -1 ) + break; + + switch( cmd ) + { + case 'p': // Blackberry PIN + pin = strtoul(optarg, NULL, 16); + break; + + case 'P': // Device password + password = optarg; + break; + + case 'v': // data dump on + data_dump = true; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + // Initialize the barry library. Must be called before + // anything else. + Barry::Init(data_dump); + + // Probe the USB bus for Blackberry devices and display. + // If user has specified a PIN, search for it in the + // available device list here as well + Barry::Probe probe; + int activeDevice = probe.FindActive(pin); + if( activeDevice == -1 ) { + cerr << "No device selected, or PIN not found" << endl; + return 1; + } + + // Create our controller object + Barry::Controller con(probe.Get(activeDevice)); + Barry::Mode::JVMDebug jvmdebug(con); + + // + // execute each mode that was turned on + // + jvmdebug.Open(password.c_str()); + jvmdebug.Attach(); + + // ...Unit tests... + jvmdebug.Unknown01(); + jvmdebug.Unknown02(); + jvmdebug.Unknown03(); + jvmdebug.Unknown04(); + jvmdebug.Unknown05(); + + { + cout << "Java Modules List :" << endl; + JVMModulesList list; + jvmdebug.GetModulesList(list); + cout << list; + } + + { + cout << "Java Threads currently running :" << endl; + JVMThreadsList list; + jvmdebug.GetThreadsList(list); + cout << list; + } + + jvmdebug.Unknown06(); + jvmdebug.Unknown07(); + jvmdebug.Unknown08(); + jvmdebug.Unknown09(); + jvmdebug.Unknown10(); + + jvmdebug.Go(); + + for (int i=0; i<20; i++) { + int ret; + string msg; + ret = jvmdebug.GetConsoleMessage(msg); + + if (ret < 0) { + int status; + jvmdebug.GetStatus(status); + } + else { + cout << "JVM message : " << msg << endl; + } + } + + // End of session + jvmdebug.Detach(); + } + catch( Usb::Error &ue) { + std::cout << endl; // flush any normal output first + std::cerr << "Usb::Error caught: " << ue.what() << endl; + return 1; + } + catch( Barry::Error &se ) { + std::cout << endl; + std::cerr << "Barry::Error caught: " << se.what() << endl; + return 1; + } + catch( std::exception &e ) { + std::cout << endl; + std::cerr << "std::exception caught: " << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/tools/bktrans.cc barry-0.0.20110506/tools/bktrans.cc --- barry-0.14/tools/bktrans.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/bktrans.cc 2011-05-06 12:20:17.000000000 +0000 @@ -3,7 +3,7 @@ // /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -24,6 +24,7 @@ #include #include #include +#include "i18n.h" using namespace std; @@ -109,6 +110,8 @@ int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(false); if( argc < 2 ) { diff -Nru barry-0.14/tools/brawchannel.cc barry-0.0.20110506/tools/brawchannel.cc --- barry-0.14/tools/brawchannel.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/brawchannel.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,347 @@ +/// +/// \file brawchannel.cc +/// Directs a named raw channel over STDIN/STDOUT +/// + +/* + Copyright (C) 2010, RealVNC Ltd. + + Some parts are inspired from bjavaloader.cc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "i18n.h" +#include "platform.h" + +using namespace std; +using namespace Barry; + +// How long to wait between reads before checking if should shutdown +#define READ_TIMEOUT_SECONDS 1 + +static volatile bool signalReceived = false; + +static void signalHandler(int signum) +{ + signalReceived = true; +} + +class CallbackHandler : public Barry::Mode::RawChannelDataCallback +{ +private: + volatile bool *m_continuePtr; + bool m_verbose; + +public: + CallbackHandler(volatile bool &keepGoing, bool verbose) + : m_continuePtr(&keepGoing) + , m_verbose(verbose) + { + } + + +public: // From RawChannelDataCallback + virtual void DataReceived(Data &data); + virtual void ChannelError(string msg); + virtual void ChannelClose(); +}; + + +void CallbackHandler::DataReceived(Data &data) +{ + if( m_verbose ) { + cerr << "From BB: "; + data.DumpHex(cerr); + cerr << "\n"; + } + + size_t toWrite = data.GetSize(); + size_t written = 0; + + while( written < toWrite && *m_continuePtr ) { + ssize_t writtenThisTime = write(STDOUT_FILENO, &(data.GetData()[written]), toWrite - written); + if( m_verbose ) { + cerr.setf(ios::dec, ios::basefield); + cerr << "Written " << writtenThisTime << " bytes over stdout" << endl; + } + fflush(stdout); + if( writtenThisTime < 0 ) { + ChannelClose(); + } + else { + written += writtenThisTime; + } + } +} + +void CallbackHandler::ChannelError(string msg) +{ + cerr << "CallbackHandler: Received error: " << msg << endl; + ChannelClose(); +} + +void CallbackHandler::ChannelClose() +{ + *m_continuePtr = false; +} + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "brawchannel - Command line USB Blackberry raw channel interface\n" + << " Copyright 2010, RealVNC Ltd.\n" + << " Using: " << Version << "\n" + << "\n" + << "Usage:\n" + << "brawchannel [options] \n" + << "\n" + << " -h This help\n" + << " -p pin PIN of device to talk with\n" + << " If only one device is plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" + << " -v Dump protocol data during operation\n" + << " This will cause libusb output to appear on STDOUT unless\n" + << " the environment variable USB_DEBUG is set to 0,1 or 2.\n" + << endl; +} + +// Helper class to restore signal handlers when shutdown is occuring +// This class isn't responsible for setting up the signal handlers +// as they need to be restored before the Barry::Socket starts closing. +class SignalRestorer +{ +private: + int m_signum; + sighandler_t m_handler; +public: + SignalRestorer(int signum, sighandler_t handler) + : m_signum(signum), m_handler(handler) {} + ~SignalRestorer() { signal(m_signum, m_handler); } +}; + +int main(int argc, char *argv[]) +{ + INIT_I18N(PACKAGE); + + // Setup signal handling + sighandler_t oldSigHup = signal(SIGHUP, &signalHandler); + sighandler_t oldSigTerm = signal(SIGTERM, &signalHandler); + sighandler_t oldSigInt = signal(SIGINT, &signalHandler); + sighandler_t oldSigQuit = signal(SIGQUIT, &signalHandler); + + cerr.sync_with_stdio(true); // since libusb uses + // stdio for debug messages + + // Buffer to hold data read in from STDIN before sending it + // to the BlackBerry. + unsigned char *buf = NULL; + try { + uint32_t pin = 0; + bool data_dump = false; + string password; + + // process command line options + for( ;; ) { + int cmd = getopt(argc, argv, "hp:P:v"); + if( cmd == -1 ) { + break; + } + + switch( cmd ) + { + case 'p': // Blackberry PIN + pin = strtoul(optarg, NULL, 16); + break; + + case 'P': // Device password + password = optarg; + break; + + case 'v': // data dump on + data_dump = true; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + argc -= optind; + argv += optind; + + if( argc < 1 ) { + cerr << "Error: Missing raw channel name." << endl; + Usage(); + return 1; + } + + if( argc > 1 ) { + cerr << "Error: Too many arguments." << endl; + Usage(); + return 1; + } + + // Fetch command from remaining arguments + string channelName = argv[0]; + argc --; + argv ++; + + + if( data_dump ) { + // Warn if USB_DEBUG isn't set to 0, 1 or 2 + // as that usually means libusb will write to STDOUT + char *val = getenv("USB_DEBUG"); + int parsedValue = -1; + if( val ) { + parsedValue = atoi(val); + } + if( parsedValue != 0 && parsedValue != 1 && parsedValue != 2 ) { + cerr << "Warning: Protocol dump enabled without setting USB_DEBUG to 0, 1 or 2.\n" + << " libusb might log to STDOUT and ruin data stream." << endl; + } + } + + // Initialize the barry library. Must be called before + // anything else. + Barry::Init(data_dump, &cerr); + + // Probe the USB bus for Blackberry devices. + // If user has specified a PIN, search for it in the + // available device list here as well + Barry::Probe probe; + int activeDevice = probe.FindActive(pin); + if( activeDevice == -1 ) { + cerr << "No device selected, or PIN not found" << endl; + return 1; + } + + // Now get setup to open the channel. + if( data_dump ) { + cerr << "Connected to device, starting read/write\n"; + } + + volatile bool running = true; + + // Create the thing which will write onto stdout + // and perform other callback duties. + CallbackHandler callbackHandler(running, data_dump); + + // Start a thread to handle any data arriving from + // the BlackBerry. + auto_ptr router; + router.reset(new SocketRoutingQueue()); + router->SpinoffSimpleReadThread(); + + // Create our controller object + Barry::Controller con(probe.Get(activeDevice), *router); + + Barry::Mode::RawChannel rawChannel(con, callbackHandler); + + // Try to open the requested channel now everything is setup + rawChannel.Open(password.c_str(), channelName.c_str()); + + // We now have a thread running to read from the + // BB and write over stdout; in this thread we'll + // read from stdin and write to the BB. + const size_t bufSize = rawChannel.MaximumSendSize(); + buf = new unsigned char[bufSize]; + fd_set rfds; + struct timeval tv; + FD_ZERO(&rfds); + + // Set up the signal restorers to restore signal + // handling (in their destructors) before the socket + // starts to be closed. This allows, for example, + // double control-c presses to stop graceful close + // down. + SignalRestorer srh(SIGHUP, oldSigHup); + SignalRestorer srt(SIGTERM, oldSigTerm); + SignalRestorer sri(SIGINT, oldSigInt); + SignalRestorer srq(SIGQUIT, oldSigQuit); + + while( running && !signalReceived ) { + FD_SET(STDIN_FILENO, &rfds); + tv.tv_sec = READ_TIMEOUT_SECONDS; + tv.tv_usec = 0; + + int ret = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv); + if( ret < 0 ) { + cerr << "Select failed with errno: " << errno << endl; + running = false; + } + else if ( ret && FD_ISSET(STDIN_FILENO, &rfds) ) { + ssize_t haveRead = read(STDIN_FILENO, buf, bufSize); + if( haveRead > 0 ) { + Data toWrite(buf, haveRead); + if( data_dump ) { + cerr.setf(ios::dec, ios::basefield); + cerr << "Sending " << haveRead << " bytes stdin->USB\n"; + cerr << "To BB: "; + toWrite.DumpHex(cerr); + cerr << "\n"; + } + rawChannel.Send(toWrite); + if( data_dump ) { + cerr.setf(ios::dec, ios::basefield); + cerr << "Sent " << haveRead << " bytes stdin->USB\n"; + } + } + else if( haveRead < 0 ) { + running = false; + } + } + } + } + catch( Usb::Error &ue ) { + cerr << "Usb::Error caught: " << ue.what() << endl; + return 1; + } + catch( Barry::Error &se ) { + cerr << "Barry::Error caught: " << se.what() << endl; + return 1; + } + catch( exception &e ) { + cerr << "exception caught: " << e.what() << endl; + return 1; + } + + delete[] buf; + + return 0; +} + diff -Nru barry-0.14/tools/brecsum.cc barry-0.0.20110506/tools/brecsum.cc --- barry-0.14/tools/brecsum.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/brecsum.cc 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,24 +26,26 @@ #include #include #include +#include "i18n.h" +#include "brecsum.h" using namespace std; using namespace Barry; void Usage() { - int major, minor; - const char *Version = Barry::Version(major, minor); + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); cerr << "brecsum - Generate SHA1 sums of raw Blackberry database records.\n" - << " Copyright 2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Copyright 2008-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" << " Using: " << Version << "\n" << "\n" << " -d db Read database 'db' and sum all its records.\n" << " Can be used multiple times to fetch more than one DB\n" << " -h This help\n" - << " -i Include Type and Unique record IDs in the checksums\n" + << " -i Include DB Name, Type, and Unique record IDs in the checksums\n" << " -p pin PIN of device to talk with\n" << " If only one device is plugged in, this flag is optional\n" << " -P pass Simplistic method to specify device password\n" @@ -51,50 +53,10 @@ << endl; } -class ChecksumParser : public Barry::Parser -{ - bool m_IncludeIds; - SHA_CTX m_ctx; - -public: - explicit ChecksumParser(bool IncludeIds) - : m_IncludeIds(IncludeIds) - {} - - virtual void Clear() - { - SHA1_Init(&m_ctx); - } - - virtual void SetIds(uint8_t RecType, uint32_t UniqueId) - { - if( m_IncludeIds ) { - SHA1_Update(&m_ctx, &RecType, sizeof(RecType)); - SHA1_Update(&m_ctx, &UniqueId, sizeof(UniqueId)); - } - } - virtual void ParseFields(const Barry::Data &data, size_t &offset) - { - int len = data.GetSize() - offset; - SHA1_Update(&m_ctx, data.GetData() + offset, len); - offset += len; - } - - virtual void Store() - { - unsigned char sha1[SHA_DIGEST_LENGTH]; - SHA1_Final(sha1, &m_ctx); - - for( int i = 0; i < SHA_DIGEST_LENGTH; i++ ) { - cout << hex << setfill('0') << setw(2) - << (unsigned int) sha1[i]; - } - cout << endl; - } -}; - int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(true); // leave this on, since libusb uses // stdio for debug messages diff -Nru barry-0.14/tools/brecsum.h barry-0.0.20110506/tools/brecsum.h --- barry-0.14/tools/brecsum.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/brecsum.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,70 @@ +/// +/// \file brecsum.h +/// The Parser class for brecsum. +/// + +/* + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_TOOLS_BRECSUM_H__ +#define __BARRY_TOOLS_BRECSUM_H__ + +class ChecksumParser : public Barry::Parser +{ + bool m_IncludeIds; + Barry::SHA_CTX m_ctx; + +public: + explicit ChecksumParser(bool IncludeIds) + : m_IncludeIds(IncludeIds) + {} + + virtual void ParseRecord(const Barry::DBData &data, + const Barry::IConverter *ic) + { + using namespace std; + using namespace Barry; + + SHA1_Init(&m_ctx); + + if( m_IncludeIds ) { + SHA1_Update(&m_ctx, data.GetDBName().c_str(), + data.GetDBName().size()); + + uint8_t recType = data.GetRecType(); + SHA1_Update(&m_ctx, &recType, sizeof(recType)); + + uint32_t uniqueId = data.GetUniqueId(); + SHA1_Update(&m_ctx, &uniqueId, sizeof(uniqueId)); + } + + int len = data.GetData().GetSize() - data.GetOffset(); + SHA1_Update(&m_ctx, + data.GetData().GetData() + data.GetOffset(), len); + + unsigned char sha1[SHA_DIGEST_LENGTH]; + SHA1_Final(sha1, &m_ctx); + + for( int i = 0; i < SHA_DIGEST_LENGTH; i++ ) { + cout << hex << setfill('0') << setw(2) + << (unsigned int) sha1[i]; + } + cout << endl; + } +}; + +#endif + diff -Nru barry-0.14/tools/breset.cc barry-0.0.20110506/tools/breset.cc --- barry-0.14/tools/breset.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/breset.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /// This file is part of the Barry project: /// -/// http://www.netdirect.ca/software/packages/barry/index.php +/// http://www.netdirect.ca/software/packages/barry /// http://sourceforge.net/projects/barry /// /// Compile with the following command (needs libusb): @@ -13,7 +13,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -31,6 +31,7 @@ #include #include #include +#include "i18n.h" #define VENDOR_RIM 0x0fca #define PRODUCT_RIM_BLACKBERRY 0x0001 @@ -56,12 +57,14 @@ { struct usb_bus *busses; + INIT_I18N(PACKAGE); + usb_init(); usb_find_busses(); usb_find_devices(); busses = usb_get_busses(); - printf("Scanning for Blackberry devices...\n"); + printf(_("Scanning for Blackberry devices...\n")); int found = 0; struct usb_bus *bus; @@ -75,16 +78,16 @@ dev->descriptor.idProduct == PRODUCT_RIM_PEARL || dev->descriptor.idProduct == PRODUCT_RIM_PEARL_8120 || dev->descriptor.idProduct == PRODUCT_RIM_PEARL_DUAL ) ) { - printf("Found..."); - printf("attempting to reset.\n"); + printf(_("Found...")); + printf(_("attempting to reset.\n")); if( reset(dev) ) found++; else - printf("Can't reset device on bus %s, devnum %u\n", bus->dirname, (unsigned int) dev->devnum); + printf(_("Can't reset device on bus %s, devnum %u\n"), bus->dirname, (unsigned int) dev->devnum); } } } - printf("%d device%s reset.\n", found, found > 1 ? "s" : ""); + printf(_("%d device%s reset.\n"), found, found > 1 ? "s" : ""); } diff -Nru barry-0.14/tools/brimtrans.cc barry-0.0.20110506/tools/brimtrans.cc --- barry-0.14/tools/brimtrans.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/brimtrans.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,143 @@ +/// +/// \file brimtrans.cc +/// Translates log files generated by RIM's USB driver +/// into something more or less readable. +/// + +/* + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2009, Josh Kropf + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "i18n.h" + +using namespace std; + +string trim_right(const string& source , const string& t = " "); +string trim_data_line(const string& line); +void dump(const list& event); +void parse_hex(const string& source, vector& data); +void print_hex(const vector& data); + +int main(int argc, char* argv[]) +{ + list* event = NULL; + string line; + + INIT_I18N(PACKAGE); + + while( !getline(cin, line).eof() ) { + size_t pos = line.find_first_of(':'); + + // skip lines missing colon + if( pos == string::npos ) + continue; + + line = trim_right(line.substr(pos + 2), "\n\r "); + + // each sequence of write/read packets begins with this line + if( line == "BbUsbDevice: WriteToDevice" ) { + if( event != NULL ) { + dump(*event); + delete event; + } + + event = new list; + } + else if( line.substr(0, 3) == "<-:" ) { // send to device + event->push_front(trim_data_line(line.erase(0, 3))); + } + else if( line.substr(0, 3) == "->:" ) { // receive from device + event->push_back(trim_data_line(line.erase(0, 3))); + } + } + + if( event != NULL ) { + dump(*event); + delete event; + } + + return 0; +} + +string trim_right(const string& source , const string& t) +{ + string str = source; + return str.erase(str.find_last_not_of(t) + 1); +} + +string trim_data_line(const string& line) +{ + size_t pos = line.find_first_of(':'); + return line.substr(pos + 2); +} + +void dump(const list& event) +{ + vector data; + list::const_iterator i, begin = event.begin(), end = event.end(); + for( i=begin; i != end; ++i ) { + data.clear(); + parse_hex(*i, data); + cout << (i == begin? "Send" : "Receive") << endl; + print_hex(data); + } + cout << endl; +} + +void parse_hex(const string& source, vector& data) +{ + istringstream ss(source); + uint16_t byte; + + while( !ss.eof() ) { + ss >> hex >> byte; + data.push_back(byte); + } +} + +void print_hex(const vector& data) +{ + int remaining = data.size(), offset = 0; + do { + cout << " " << hex << setfill('0') << setw(8) << offset; + int margin = 13; + + for( int i=0, stop=min(16, remaining); i 0 ); +} diff -Nru barry-0.14/tools/bs11nread.cc barry-0.0.20110506/tools/bs11nread.cc --- barry-0.14/tools/bs11nread.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/bs11nread.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2008-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -29,6 +29,7 @@ #include #include #include +#include "i18n.h" using namespace std; @@ -36,13 +37,13 @@ void Usage() { - int major, minor; - const char *Version = Barry::Version(major, minor); + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); cerr << "bs11nread - Reads a boost serialization file (from btool)\n" << " and dumps data to stdout\n" - << " Copyright 2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Copyright 2008-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" << " Using: " << Version << "\n" << "\n" << " -f file Filename to save or load handheld data to/from\n" @@ -81,37 +82,25 @@ getline(ifs, dbName); // check for recognized database names - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || - Dump (dbName, ifs) || +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) Dump(dbName, ifs) || + ALL_KNOWN_PARSER_TYPES cerr << "Unknown database name: " << dbName << endl; } void ShowParsers() { cout << "Supported Database parsers:\n" - << " Address Book\n" - << " Messages\n" - << " Calendar\n" - << " Service Book\n" - << " Memos\n" - << " Tasks\n" - << " PIN Messages\n" - << " Saved Email Messages\n" - << " Folders\n" - << " Time Zones\n" +#undef HANDLE_PARSER +#define HANDLE_PARSER(tname) << " " << tname::GetDBName() << "\n" + ALL_KNOWN_PARSER_TYPES << endl; } int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + try { string filename; diff -Nru barry-0.14/tools/btardump.cc barry-0.0.20110506/tools/btardump.cc --- barry-0.14/tools/btardump.cc 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/btardump.cc 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,190 @@ +/// +/// \file tardump.cc +/// Utility to dump tarball backup records to stdout. +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#include +#ifdef __BARRY_SYNC_MODE__ +#include +#include "mimedump.h" +#endif +#include +#include +#include +#include + +using namespace std; +using namespace Barry; + +void Usage() +{ + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + + cerr + << "btardump - Command line parser for Barry backup files\n" + << " Copyright 2010-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Using: " << Version << "\n" + << "\n" + << " -d db Name of database to dump. Can be used multiple times\n" + << " to parse multiple databases at once. If not specified\n" + << " at all, all available databases from the backup are\n" + << " dumped.\n" + << " -h This help\n" + << " -i cs International charset for string conversions\n" + << " Valid values here are available with 'iconv --list'\n" +#ifdef __BARRY_SYNC_MODE__ + << " -V Dump records using MIME vformats where possible\n" +#endif + << "\n" + << " [files...] Backup file(s), created by btool or the backup GUI.\n" + << endl; +} + +class MyAllRecordDumpStore : public AllRecordStore +{ + bool m_vformat_mode; + std::ostream &m_os; + +public: + explicit MyAllRecordDumpStore(std::ostream &os, bool vformat_mode=false) + : m_vformat_mode(vformat_mode) + , m_os(os) + { + } + +#undef HANDLE_PARSER + +#ifdef __BARRY_SYNC_MODE__ + +#define HANDLE_PARSER(tname) \ + void operator() (const Barry::tname &r) \ + { \ + if( m_vformat_mode ) \ + MimeDump::Dump(m_os, r); \ + else \ + m_os << r << std::endl; \ + } + +#else + +#define HANDLE_PARSER(tname) \ + void operator() (const Barry::tname &r) \ + { \ + m_os << r << std::endl; \ + } + +#endif + + ALL_KNOWN_PARSER_TYPES +}; + +int main(int argc, char *argv[]) +{ + try { + bool vformat_mode = false; + + vector db_names; + vector backup_files; + string iconvCharset; + + // process command line options + for(;;) { + int cmd = getopt(argc, argv, "d:hi:V"); + if( cmd == -1 ) + break; + + switch( cmd ) + { + case 'd': // show dbname + db_names.push_back(string(optarg)); + break; + + case 'V': // vformat MIME mode +#ifdef __BARRY_SYNC_MODE__ + vformat_mode = true; +#else + cerr << "-V option not supported - no Sync " + "library support available\n"; + return 1; +#endif + break; + + case 'i': // international charset (iconv) + iconvCharset = optarg; + break; + + case 'h': // help + default: + Usage(); + return 0; + } + } + + // grab all backup filenames + while( optind < argc ) { + backup_files.push_back(string(argv[optind++])); + } + + if( backup_files.size() == 0 ) { + Usage(); + return 0; + } + + + + Barry::Init(); + + // Create an IConverter object if needed + auto_ptr ic; + if( iconvCharset.size() ) { + ic.reset( new IConverter(iconvCharset.c_str(), true) ); + } + + // create the parser, and use stdout dump objects for output + AllRecordParser parser(cout, + new HexDumpParser(cout), + new MyAllRecordDumpStore(cout, vformat_mode)); + + for( size_t i = 0; i < backup_files.size(); i++ ) { + + cout << "Reading file: " << backup_files[i] << endl; + + Restore builder(backup_files[i]); + + // add desired database names + for( size_t j = 0; j < db_names.size(); j++ ) { + builder.AddDB(db_names[i]); + } + + // create the pipe to connect builder to parser and + // move the data + Pipe pipe(builder); + pipe.PumpFile(parser, ic.get()); + } + + } + catch( exception &e ) { + cerr << e.what() << endl; + return 1; + } + + return 0; +} + diff -Nru barry-0.14/tools/btool.cc barry-0.0.20110506/tools/btool.cc --- barry-0.14/tools/btool.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/btool.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,6 +20,14 @@ */ #include +#ifdef __BARRY_SYNC_MODE__ +#include +#include "mimedump.h" +#endif +#ifdef __BARRY_BACKUP_MODE__ +#include +#endif + #include #include #include @@ -28,19 +36,22 @@ #include #include #include +#include +#include "i18n.h" using namespace std; +using namespace std::tr1; using namespace Barry; void Usage() { - int major, minor; - const char *Version = Barry::Version(major, minor); + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); cerr << "btool - Command line USB Blackberry Test Tool\n" - << " Copyright 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Copyright 2005-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" << " Using: " << Version << "\n" << " Compiled " #ifdef __BARRY_BOOST_MODE__ @@ -50,9 +61,13 @@ #endif << " Boost support\n" << "\n" + << " -b file Filename to save or load a Barry Backup to (tar.gz)\n" << " -B bus Specify which USB bus to search on\n" << " -N dev Specify which system device, using system specific string\n" << "\n" + << " -a db Erase / clear database 'db' FROM device, deleting all\n" + << " its records. Can be used multiple times to clear more\n" + << " than one DB.\n" << " -c dn Convert address book database to LDIF format, using the\n" << " specified baseDN\n" << " -C dnattr LDIF attribute name to use when building the FQDN\n" @@ -68,6 +83,9 @@ << " -f file Filename to save or load handheld data to/from\n" #endif << " -h This help\n" + << " -i cs International charset for string conversions\n" + << " Valid values here are available with 'iconv --list'\n" + << " -I Sort records before output\n" << " -l List devices\n" << " -L List Contact field names\n" << " -m Map LDIF name to Contact field / Unmap LDIF name\n" @@ -83,6 +101,9 @@ << " -t Show database database table\n" << " -T db Show record state table for given database\n" << " -v Dump protocol data during operation\n" +#ifdef __BARRY_SYNC_MODE__ + << " -V Dump records using MIME vformats where possible\n" +#endif << " -X Reset device\n" << " -z Use non-threaded sockets\n" << " -Z Use threaded socket router (default)\n" @@ -119,12 +140,17 @@ mutable typename std::vector::const_iterator rec_it; std::string filename; bool load; + bool immediate_display; + bool vformat_mode; int count; - Store(const string &filename, bool load) + Store(const string &filename, bool load, bool immediate_display, + bool vformat_mode) : rec_it(records.end()), filename(filename), load(load), + immediate_display(immediate_display), + vformat_mode(vformat_mode), count(0) { #ifdef __BARRY_BOOST_MODE__ @@ -157,8 +183,15 @@ } #endif } + ~Store() { + if( !immediate_display ) { + // not dumped yet, sort then dump + sort(records.begin(), records.end()); + DumpAll(); + } + cout << "Store counted " << dec << count << " records." << endl; #ifdef __BARRY_BOOST_MODE__ try { @@ -182,16 +215,38 @@ #endif } + void DumpAll() + { + typename vector::const_iterator i = records.begin(); + for( ; i != records.end(); ++i ) { + Dump(*i); + } + } + + void Dump(const Record &rec) + { + if( vformat_mode ) { +#ifdef __BARRY_SYNC_MODE__ + MimeDump md; + md.Dump(cout, rec); +#endif + } + else { + cout << rec << endl; + } + } + // storage operator void operator()(const Record &rec) { count++; - std::cout << rec << std::endl; + if( immediate_display ) + Dump(rec); records.push_back(rec); } // retrieval operator - bool operator()(Record &rec, unsigned int databaseId) const + bool operator()(Record &rec, Builder &builder) const { if( rec_it == records.end() ) return false; @@ -201,121 +256,153 @@ } }; -class DataDumpParser : public Barry::Parser +shared_ptr GetParser(const string &name, + const string &filename, + bool null_parser, + bool immediate_display, + bool vformat_mode, + bool bbackup_mode) { - uint32_t m_id; - -public: - virtual void SetIds(uint8_t RecType, uint32_t UniqueId) - { - m_id = UniqueId; - } - - virtual void ParseFields(const Barry::Data &data, size_t &offset) - { - std::cout << "Raw record dump for record: " - << std::hex << m_id << std::endl; - std::cout << data << std::endl; - } -}; + bool dnow = immediate_display; + bool vmode = vformat_mode; -auto_ptr GetParser(const string &name, const string &filename, bool null_parser) -{ if( null_parser ) { // use null parser - return auto_ptr( new DataDumpParser ); + return shared_ptr( new Barry::HexDumpParser(cout) ); + } + else if( bbackup_mode ) { +#ifdef __BARRY_BACKUP_MODE__ + // Only one backup file per run + static shared_ptr backup; + if( !backup.get() ) { + backup.reset( new Backup(filename) ); + } + return backup; +#else + return shared_ptr( new Barry::HexDumpParser(cout) ); +#endif } // check for recognized database names else if( name == Contact::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == Message::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == Calendar::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); + } + else if( name == CalendarAll::GetDBName() ) { + return shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == CallLog::GetDBName() ) { + return shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); + } + else if( name == Bookmark::GetDBName() ) { + return shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); } else if( name == ServiceBook::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == Memo::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == Task::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == PINMessage::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == SavedMessage::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); + } + else if( name == Sms::GetDBName() ) { + return shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); } else if( name == Folder::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); } else if( name == Timezone::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, false))); + new Store(filename, false, dnow, vmode))); + } + else if( name == HandheldAgent::GetDBName() ) { + return shared_ptr( + new RecordParser > ( + new Store(filename, false, dnow, vmode))); } else { // unknown database, use null parser - return auto_ptr( new DataDumpParser ); + return shared_ptr( new Barry::HexDumpParser(cout) ); } } -auto_ptr GetBuilder(const string &name, const string &filename) +shared_ptr GetBuilder(const string &name, const string &filename) { // check for recognized database names if( name == Contact::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordBuilder > ( - new Store(filename, true))); + new Store(filename, true, true, false))); } else if( name == Calendar::GetDBName() ) { - return auto_ptr( + return shared_ptr( new RecordBuilder > ( - new Store(filename, true))); + new Store(filename, true, true, false))); + } + else if( name == CalendarAll::GetDBName() ) { + return shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == Memo::GetDBName() ) { + return shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); + } + else if( name == Task::GetDBName() ) { + return shared_ptr( + new RecordBuilder > ( + new Store(filename, true, true, false))); } /* else if( name == "Messages" ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, true))); + new Store(filename, true, true, false))); } else if( name == "Service Book" ) { - return auto_ptr( + return shared_ptr( new RecordParser > ( - new Store(filename, true))); - } - else if( name == "Memos" ) { - return auto_ptr( - new RecordParser > ( - new Store(filename, true))); - } - else if( name == "Tasks" ) { - return auto_ptr( - new RecordParser > ( - new Store(filename, true))); + new Store(filename, true, true, false))); } */ else { @@ -326,20 +413,23 @@ void ShowParsers() { cout << "Supported Database parsers:\n" - << " Address Book\n" - << " Messages\n" - << " Calendar\n" - << " Service Book\n" - << " Memos\n" - << " Tasks\n" - << " PIN Messages\n" - << " Saved Email Messages\n" - << " Folders\n" - << " Time Zones (read only)\n" +#undef HANDLE_PARSER +#ifdef __BARRY_SYNC_MODE__ + << " (* = can display in vformat MIME mode)\n" +#define HANDLE_PARSER(tname) << " " << tname::GetDBName() << (MimeDump::Supported() ? " *" : "") << "\n" + +#else +#define HANDLE_PARSER(tname) << " " << tname::GetDBName() << "\n" + +#endif + ALL_KNOWN_PARSER_TYPES + << "\n" + << "Supported Database builders:\n" - << " Address Book\n" - << " Calendar\n" +#undef HANDLE_BUILDER +#define HANDLE_BUILDER(tname) << " " << tname::GetDBName() << "\n" + ALL_KNOWN_BUILDER_TYPES << endl; } @@ -414,6 +504,8 @@ int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(true); // leave this on, since libusb uses // stdio for debug messages @@ -424,30 +516,57 @@ show_dbdb = false, ldif_contacts = false, data_dump = false, + vformat_mode = false, reset_device = false, list_contact_fields = false, list_ldif_map = false, epp_override = false, threaded_sockets = true, - record_state = false, - null_parser = false; + record_state_table = false, + clear_database = false, + null_parser = false, + bbackup_mode = false, + sort_records = false; string ldifBaseDN, ldifDnAttr; string filename; string password; string busname; string devname; - vector dbNames, saveDbNames, mapCommands; + string iconvCharset; + vector dbNames, saveDbNames, mapCommands, clearDbNames; vector stCommands; Usb::EndpointPair epOverride; // process command line options for(;;) { - int cmd = getopt(argc, argv, "B:c:C:d:D:e:f:hlLm:MnN:p:P:r:R:Ss:tT:vXzZ"); + int cmd = getopt(argc, argv, "a:b:B:c:C:d:D:e:f:hi:IlLm:MnN:p:P:r:R:Ss:tT:vVXzZ"); if( cmd == -1 ) break; switch( cmd ) { + case 'a': // Clear Database + clear_database = true; + clearDbNames.push_back(string(optarg)); + break; + + case 'b': // Barry backup filename (tar.gz) +#ifdef __BARRY_BACKUP_MODE__ + if( filename.size() == 0 ) { + filename = optarg; + bbackup_mode = true; + } + else { + cerr << "Do not use -f with -b\n"; + return 1; + } +#else + cerr << "-b option not supported - no Barry " + "Backup library support available\n"; + return 1; +#endif + break; + case 'B': // busname busname = optarg; break; @@ -480,13 +599,28 @@ case 'f': // filename #ifdef __BARRY_BOOST_MODE__ - filename = optarg; + if( !bbackup_mode && filename.size() == 0 ) { + filename = optarg; + } + else { + cerr << "Do not use -f with -b\n"; + return 1; + } #else cerr << "-f option not supported - no Boost " "serialization support available\n"; return 1; #endif break; + + case 'i': // international charset (iconv) + iconvCharset = optarg; + break; + + case 'I': // sort before dump + sort_records = true; + break; + case 'l': // list only list_only = true; break; @@ -542,7 +676,7 @@ break; case 'T': // show RecordStateTable - record_state = true; + record_state_table = true; dbNames.push_back(string(optarg)); break; @@ -550,6 +684,16 @@ data_dump = true; break; + case 'V': // vformat MIME mode +#ifdef __BARRY_SYNC_MODE__ + vformat_mode = true; +#else + cerr << "-V option not supported - no Sync " + "library support available\n"; + return 1; +#endif + break; + case 'X': // reset device reset_device = true; break; @@ -572,6 +716,17 @@ // Initialize the barry library. Must be called before // anything else. Barry::Init(data_dump); + if( data_dump ) { + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + cout << Version << endl; + } + + // Create an IConverter object if needed + auto_ptr ic; + if( iconvCharset.size() ) { + ic.reset( new IConverter(iconvCharset.c_str(), true) ); + } // LDIF class... only needed if ldif output turned on ContactLdif ldif(ldifBaseDN); @@ -585,7 +740,8 @@ // Probe the USB bus for Blackberry devices and display. // If user has specified a PIN, search for it in the // available device list here as well - Barry::Probe probe(busname.c_str(), devname.c_str()); + Barry::Probe probe(busname.c_str(), devname.c_str(), + epp_override ? &epOverride : 0); int activeDevice = -1; // show any errors during probe first @@ -638,8 +794,8 @@ if( ldif_contacts ) cout << "# "; - cout << "Using device (PIN): " << setbase(16) - << probe.Get(activeDevice).m_pin << endl; + cout << "Using device (PIN): " + << probe.Get(activeDevice).m_pin.Str() << endl; if( reset_device ) { Usb::Device dev(probe.Get(activeDevice).m_dev); @@ -660,6 +816,35 @@ } // + // execute each mode that was turned on + // + + + // Dump current LDIF mapping + if( list_ldif_map ) { + cout << ldif << endl; + } + + // Dump list of Contact field names + if( list_contact_fields ) { + for( const ContactLdif::NameToFunc *n = ldif.GetFieldNames(); n->name; n++ ) { + cout.fill(' '); + cout << " " << left << setw(20) << n->name << ": " + << n->description << endl; + } + } + + // Check if Desktop access is needed + if( !( show_dbdb || + ldif_contacts || + record_state_table || + clear_database || + stCommands.size() || + dbNames.size() || + saveDbNames.size() ) ) + return 0; // done + + // // Create our controller object // // Order is important in the following auto_ptr<> objects, @@ -670,51 +855,30 @@ // here we want the user to pick. // auto_ptr router; - auto_ptr pcon; if( threaded_sockets ) { router.reset( new SocketRoutingQueue ); router->SpinoffSimpleReadThread(); - pcon.reset( new Barry::Controller(device, *router) ); } - else { - pcon.reset( new Barry::Controller(device) ); - } - - Barry::Controller &con = *pcon; - Barry::Mode::Desktop desktop(con); - // - // execute each mode that was turned on - // + DesktopConnector connector(password.c_str(), + iconvCharset, device, router.get()); + if( !connector.Connect() ) { + // bad password (default action is not to prompt) + cerr << connector.GetBadPassword().what() << endl; + return 1; + } + Barry::Mode::Desktop &desktop = connector.GetDesktop(); // Dump list of all databases to stdout if( show_dbdb ) { // open desktop mode socket - desktop.Open(password.c_str()); cout << desktop.GetDBDB() << endl; } - // Dump list of Contact field names - if( list_contact_fields ) { - for( const ContactLdif::NameToFunc *n = ldif.GetFieldNames(); n->name; n++ ) { - cout.fill(' '); - cout << " " << left << setw(20) << n->name << ": " - << n->description << endl; - } - } - - // Dump current LDIF mapping - if( list_ldif_map ) { - cout << ldif << endl; - } - // Dump list of contacts to an LDAP LDIF file // This uses the Controller convenience templates if( ldif_contacts ) { - // make sure we're in desktop mode - desktop.Open(password.c_str()); - // create a storage functor object that accepts // Barry::Contact objects as input Contact2Ldif storage(ldif); @@ -724,14 +888,12 @@ } // Dump record state table to stdout - if( record_state ) { + if( record_state_table ) { if( dbNames.size() == 0 ) { cout << "No db names to process" << endl; return 1; } - desktop.Open(password.c_str()); - vector::iterator b = dbNames.begin(); for( ; b != dbNames.end(); b++ ) { unsigned int id = desktop.GetDBID(*b); @@ -750,9 +912,9 @@ return 1; } - desktop.Open(password.c_str()); unsigned int id = desktop.GetDBID(dbNames[0]); - auto_ptr parse = GetParser(dbNames[0],filename,null_parser); + shared_ptr parse = GetParser(dbNames[0],filename, + null_parser, true, vformat_mode, bbackup_mode); for( unsigned int i = 0; i < stCommands.size(); i++ ) { desktop.GetRecord(id, stCommands[i].index, *parse.get()); @@ -776,30 +938,48 @@ if( dbNames.size() ) { vector::iterator b = dbNames.begin(); - desktop.Open(password.c_str()); for( ; b != dbNames.end(); b++ ) { - auto_ptr parse = GetParser(*b,filename,null_parser); + shared_ptr parse = GetParser(*b, + filename, null_parser, !sort_records, + vformat_mode, bbackup_mode); unsigned int id = desktop.GetDBID(*b); desktop.LoadDatabase(id, *parse.get()); } } + // Clear databases + if( clear_database ) { + if( clearDbNames.size() == 0 ) { + cout << "No db names to erase" << endl; + return 1; + } + + vector::iterator b = clearDbNames.begin(); + + for( ; b != clearDbNames.end(); b++ ) { + unsigned int id = desktop.GetDBID(*b); + cout << "Deleting all records from " << (*b) << "..." << endl; + desktop.ClearDatabase(id); + } + + return 0; + } + // Save contents of file to specified databases // This is writing data to the Blackberry. if( saveDbNames.size() ) { vector::iterator b = saveDbNames.begin(); - desktop.Open(password.c_str()); for( ; b != saveDbNames.end(); b++ ) { - auto_ptr build = - GetBuilder(*b, filename); + shared_ptr build = GetBuilder(*b, + filename); unsigned int id = desktop.GetDBID(*b); desktop.SaveDatabase(id, *build); } } } - catch( Usb::Error &ue) { + catch( Usb::Error &ue ) { std::cerr << "Usb::Error caught: " << ue.what() << endl; return 1; } diff -Nru barry-0.14/tools/btranslate.cc barry-0.0.20110506/tools/btranslate.cc --- barry-0.14/tools/btranslate.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/btranslate.cc 2011-05-06 12:20:17.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2005-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -20,6 +20,7 @@ #include #include #include +#include "i18n.h" using namespace std; @@ -60,6 +61,8 @@ int main() { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(false); while( cin ) { diff -Nru barry-0.14/tools/gettext.h barry-0.0.20110506/tools/gettext.h --- barry-0.14/tools/gettext.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/gettext.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,271 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + USA. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +#if defined(__sun) +# include +#endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +#endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include + +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ + /* || __STDC_VERSION__ >= 199901L */ ) + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +#include +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (translation != msg_ctxt_id) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (!(translation == msg_ctxt_id || translation == msgid_plural)) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + +#endif /* _LIBGETTEXT_H */ diff -Nru barry-0.14/tools/i18n.h barry-0.0.20110506/tools/i18n.h --- barry-0.14/tools/i18n.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/i18n.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,40 @@ +/// +/// \file i18n.h +/// Common internationalization defines, via gettext +/// + +/* + Copyright (C) 2009, Nicolas VIVIEN + Copyright (C) 2009-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_I18N_H__ +#define __BARRY_I18N_H__ + +#include +#include +#include "gettext.h" + +#define _(String) gettext (String) +#define N_(String) String + +#define INIT_I18N(package) { \ + setlocale(LC_ALL, ""); \ + bindtextdomain(package, LOCALEDIR); \ + textdomain(package); \ + } + +#endif + diff -Nru barry-0.14/tools/Makefile.am barry-0.0.20110506/tools/Makefile.am --- barry-0.14/tools/Makefile.am 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/Makefile.am 2011-05-06 12:20:17.000000000 +0000 @@ -3,60 +3,166 @@ #DEFAULT_INCLUDES = INCLUDES = $(LIBUSB_CFLAGS) #AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g -AM_CXXFLAGS = -ansi -Wall -g +AM_CXXFLAGS = -Wall -g -bin_PROGRAMS = btool bidentify upldif btranslate bktrans brecsum +# To use gettext +datadir = @datadir@ +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +noinst_HEADERS = \ + i18n.h \ + gettext.h \ + mimedump.h \ + brecsum.h \ + platform.h + +bin_PROGRAMS = \ + btool \ + bidentify \ + bjavaloader \ + brawchannel \ + bjvmdebug \ + bdptest \ + bjdwp \ + upldif \ + btranslate \ + bktrans \ + brecsum \ + brimtrans if WITH_BOOST bin_PROGRAMS += bs11nread endif +if WITH_FUSE +bin_PROGRAMS += bfuse +endif +if WITH_BACKUP +bin_PROGRAMS += btardump +endif +if WITH_ALX +bin_PROGRAMS += balxparse +endif +if WITH_BACKUP +if WITH_SYNC +bin_PROGRAMS += bio +endif +endif + sbin_PROGRAMS = bcharge breset pppob btool_SOURCES = btool.cc -btool_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +btool_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread @BOOST_LDADD@ $(LTLIBINTL) $(LTLIBICONV) +if WITH_SYNC +btool_LDADD += ../src/libbarrysync.la $(GLIB2_LIBS) +endif +if WITH_BACKUP +btool_LDADD += ../src/libbarrybackup.la +endif +btool_CXXFLAGS = $(AM_CXXFLAGS) if WITH_BOOST -if WITH_BOOST_PATHS -btool_CXXFLAGS = -D__BARRY_BOOST_MODE__ -D_REENTRANT -I@BOOST_INC_PATH@ $(AM_CXXFLAGS) -btool_LDFLAGS = -L@BOOST_LIB_PATH@ -else -btool_CXXFLAGS = -D__BARRY_BOOST_MODE__ -D_REENTRANT $(AM_CXXFLAGS) +btool_CXXFLAGS += -D__BARRY_BOOST_MODE__ -D_REENTRANT @BOOST_INC_PATH@ endif -btool_LDADD += -lboost_serialization +if WITH_SYNC +btool_CXXFLAGS += -D__BARRY_SYNC_MODE__ $(GLIB2_CFLAGS) endif +if WITH_BACKUP +btool_CXXFLAGS += -D__BARRY_BACKUP_MODE__ +endif +btool_LDFLAGS = @BOOST_LIB_PATH@ if WITH_BOOST bs11nread_SOURCES = bs11nread.cc -bs11nread_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -if WITH_BOOST_PATHS -bs11nread_CXXFLAGS = -D_REENTRANT -I@BOOST_INC_PATH@ $(AM_CXXFLAGS) -bs11nread_LDFLAGS = -L@BOOST_LIB_PATH@ -else -bs11nread_CXXFLAGS = -D_REENTRANT $(AM_CXXFLAGS) -endif -bs11nread_LDADD += -lboost_serialization +bs11nread_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread @BOOST_LDADD@ $(LTLIBINTL) +bs11nread_CXXFLAGS = -D_REENTRANT @BOOST_INC_PATH@ $(AM_CXXFLAGS) +bs11nread_LDFLAGS = @BOOST_LIB_PATH@ endif bidentify_SOURCES = bidentify.cc -bidentify_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +bidentify_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) + +bjavaloader_SOURCES = bjavaloader.cc +bjavaloader_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) + +brawchannel_SOURCES = brawchannel.cc +brawchannel_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) + +bjvmdebug_SOURCES = bjvmdebug.cc +bjvmdebug_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) + +bdptest_SOURCES = bdptest.cc +bdptest_LDADD = ../src/libbarry.la ../src/libbarrydp.la $(LTLIBINTL) + +bjdwp_SOURCES = bjdwp.cc +bjdwp_LDADD = ../src/libbarry.la \ + ../src/libbarrydp.la \ + ../src/libbarryjdwp.la \ + $(LTLIBINTL) upldif_SOURCES = upldif.cc -upldif_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +upldif_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) btranslate_SOURCES = btranslate.cc +btranslate_LDADD = $(LTLIBINTL) bktrans_SOURCES = bktrans.cc -bktrans_LDADD = ../src/libbarry.la -lpthread +bktrans_LDADD = ../src/libbarry.la -lpthread $(LTLIBINTL) bcharge_SOURCES = bcharge.cc -bcharge_LDADD = $(LIBUSB_LIBS) +bcharge_LDADD = $(LIBUSB_LIBS) $(LTLIBINTL) breset_SOURCES = breset.cc -breset_LDADD = $(LIBUSB_LIBS) +breset_LDADD = $(LIBUSB_LIBS) $(LTLIBINTL) pppob_SOURCES = pppob.cc -pppob_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +pppob_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) -#brecsum_CXXFLAGS = $(OPENSSL_CFLAGS) brecsum_SOURCES = brecsum.cc -#brecsum_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) $(OPENSSL_LIBS) -lpthread -brecsum_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread +brecsum_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread $(LTLIBINTL) + +brimtrans_SOURCES = brimtrans.cc +brimtrans_LDADD = $(LTLIBINTL) + +if WITH_FUSE +bfuse_SOURCES = bfuse.cc +bfuse_CXXFLAGS = $(FUSE_CFLAGS) +bfuse_LDADD = ../src/libbarry.la $(FUSE_LIBS) -lpthread $(LTLIBINTL) +endif + +if WITH_BACKUP +btardump_SOURCES = btardump.cc +btardump_CXXFLAGS = $(AM_CXXFLAGS) -D__BARRY_BACKUP_MODE__ +#if WITH_BOOST +#btardump_CXXFLAGS += -D__BARRY_BOOST_MODE__ -D_REENTRANT @BOOST_INC_PATH@ +#endif +if WITH_SYNC +btardump_CXXFLAGS += -D__BARRY_SYNC_MODE__ $(GLIB2_CFLAGS) +endif +btardump_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) \ + ../src/libbarrybackup.la -lpthread $(LTLIBINTL) +if WITH_SYNC +btardump_LDADD += ../src/libbarrysync.la $(GLIB2_LIBS) +endif +endif + +if WITH_ALX +balxparse_SOURCES = balxparse.cc +balxparse_CXXFLAGS = $(AM_CXXFLAGS) $(LIBXMLXX_CFLAGS) +balxparse_LDADD = ../src/libbarry.la ../src/libbarryalx.la $(LTLIBINTL) +endif + +if WITH_BACKUP +if WITH_SYNC +bio_SOURCES = bio.cc +bio_CXXFLAGS = $(AM_CXXFLAGS) $(GLIB2_CFLAGS) +if WITH_BOOST +bio_CXXFLAGS += -D__BARRY_BOOST_MODE__ -D_REENTRANT @BOOST_INC_PATH@ +endif +bio_LDADD = ../src/libbarry.la \ + ../src/libbarrysync.la $(GLIB2_LIBS) \ + ../src/libbarrybackup.la \ + $(LIBUSB_LIBS) -lpthread @BOOST_LDADD@ \ + $(LTLIBINTL) $(LTLIBICONV) +bio_LDFLAGS = @BOOST_LIB_PATH@ +endif +endif diff -Nru barry-0.14/tools/Makefile.in barry-0.0.20110506/tools/Makefile.in --- barry-0.14/tools/Makefile.in 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,637 +0,0 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 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@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -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@ -bin_PROGRAMS = btool$(EXEEXT) bidentify$(EXEEXT) upldif$(EXEEXT) \ - btranslate$(EXEEXT) bktrans$(EXEEXT) brecsum$(EXEEXT) \ - $(am__EXEEXT_1) -@WITH_BOOST_TRUE@am__append_1 = bs11nread -sbin_PROGRAMS = bcharge$(EXEEXT) breset$(EXEEXT) pppob$(EXEEXT) -@WITH_BOOST_TRUE@am__append_2 = -lboost_serialization -subdir = tools -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_c_check_flag.m4 \ - $(top_srcdir)/m4/ax_cxx_check_flag.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 = -@WITH_BOOST_TRUE@am__EXEEXT_1 = bs11nread$(EXEEXT) -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS) -am_bcharge_OBJECTS = bcharge.$(OBJEXT) -bcharge_OBJECTS = $(am_bcharge_OBJECTS) -am__DEPENDENCIES_1 = -bcharge_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_bidentify_OBJECTS = bidentify.$(OBJEXT) -bidentify_OBJECTS = $(am_bidentify_OBJECTS) -bidentify_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -am_bktrans_OBJECTS = bktrans.$(OBJEXT) -bktrans_OBJECTS = $(am_bktrans_OBJECTS) -bktrans_DEPENDENCIES = ../src/libbarry.la -am_brecsum_OBJECTS = brecsum.$(OBJEXT) -brecsum_OBJECTS = $(am_brecsum_OBJECTS) -brecsum_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -am_breset_OBJECTS = breset.$(OBJEXT) -breset_OBJECTS = $(am_breset_OBJECTS) -breset_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__bs11nread_SOURCES_DIST = bs11nread.cc -@WITH_BOOST_TRUE@am_bs11nread_OBJECTS = bs11nread-bs11nread.$(OBJEXT) -bs11nread_OBJECTS = $(am_bs11nread_OBJECTS) -@WITH_BOOST_TRUE@bs11nread_DEPENDENCIES = ../src/libbarry.la \ -@WITH_BOOST_TRUE@ $(am__DEPENDENCIES_1) -am_btool_OBJECTS = btool-btool.$(OBJEXT) -btool_OBJECTS = $(am_btool_OBJECTS) -btool_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_btranslate_OBJECTS = btranslate.$(OBJEXT) -btranslate_OBJECTS = $(am_btranslate_OBJECTS) -btranslate_LDADD = $(LDADD) -am_pppob_OBJECTS = pppob.$(OBJEXT) -pppob_OBJECTS = $(am_pppob_OBJECTS) -pppob_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -am_upldif_OBJECTS = upldif.$(OBJEXT) -upldif_OBJECTS = $(am_upldif_OBJECTS) -upldif_DEPENDENCIES = ../src/libbarry.la $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(bcharge_SOURCES) $(bidentify_SOURCES) $(bktrans_SOURCES) \ - $(brecsum_SOURCES) $(breset_SOURCES) $(bs11nread_SOURCES) \ - $(btool_SOURCES) $(btranslate_SOURCES) $(pppob_SOURCES) \ - $(upldif_SOURCES) -DIST_SOURCES = $(bcharge_SOURCES) $(bidentify_SOURCES) \ - $(bktrans_SOURCES) $(brecsum_SOURCES) $(breset_SOURCES) \ - $(am__bs11nread_SOURCES_DIST) $(btool_SOURCES) \ - $(btranslate_SOURCES) $(pppob_SOURCES) $(upldif_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BOOST_INC_PATH = @BOOST_INC_PATH@ -BOOST_LIB_PATH = @BOOST_LIB_PATH@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ -LIBUSB_LIBS = @LIBUSB_LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ -WITH_BOOST_PATHS_FALSE = @WITH_BOOST_PATHS_FALSE@ -WITH_BOOST_PATHS_TRUE = @WITH_BOOST_PATHS_TRUE@ -WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ -WITH_GCCVISIBILITY_FALSE = @WITH_GCCVISIBILITY_FALSE@ -WITH_GCCVISIBILITY_TRUE = @WITH_GCCVISIBILITY_TRUE@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -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@ -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@ -pkgconfigdir = @pkgconfigdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -EXTRA_DIST = Makefile.plain - -#DEFAULT_INCLUDES = -INCLUDES = $(LIBUSB_CFLAGS) -#AM_CXXFLAGS = -ansi -Wall -fno-strict-aliasing -g -AM_CXXFLAGS = -ansi -Wall -g -btool_SOURCES = btool.cc -btool_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread \ - $(am__append_2) -@WITH_BOOST_PATHS_FALSE@@WITH_BOOST_TRUE@btool_CXXFLAGS = -D__BARRY_BOOST_MODE__ -D_REENTRANT $(AM_CXXFLAGS) -@WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@btool_CXXFLAGS = -D__BARRY_BOOST_MODE__ -D_REENTRANT -I@BOOST_INC_PATH@ $(AM_CXXFLAGS) -@WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@btool_LDFLAGS = -L@BOOST_LIB_PATH@ -@WITH_BOOST_TRUE@bs11nread_SOURCES = bs11nread.cc -@WITH_BOOST_TRUE@bs11nread_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) \ -@WITH_BOOST_TRUE@ -lpthread -lboost_serialization -@WITH_BOOST_PATHS_FALSE@@WITH_BOOST_TRUE@bs11nread_CXXFLAGS = -D_REENTRANT $(AM_CXXFLAGS) -@WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@bs11nread_CXXFLAGS = -D_REENTRANT -I@BOOST_INC_PATH@ $(AM_CXXFLAGS) -@WITH_BOOST_PATHS_TRUE@@WITH_BOOST_TRUE@bs11nread_LDFLAGS = -L@BOOST_LIB_PATH@ -bidentify_SOURCES = bidentify.cc -bidentify_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -upldif_SOURCES = upldif.cc -upldif_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -btranslate_SOURCES = btranslate.cc -bktrans_SOURCES = bktrans.cc -bktrans_LDADD = ../src/libbarry.la -lpthread -bcharge_SOURCES = bcharge.cc -bcharge_LDADD = $(LIBUSB_LIBS) -breset_SOURCES = breset.cc -breset_LDADD = $(LIBUSB_LIBS) -pppob_SOURCES = pppob.cc -pppob_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread - -#brecsum_CXXFLAGS = $(OPENSSL_CFLAGS) -brecsum_SOURCES = brecsum.cc -#brecsum_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) $(OPENSSL_LIBS) -lpthread -brecsum_LDADD = ../src/libbarry.la $(LIBUSB_LIBS) -lpthread -all: all-am - -.SUFFIXES: -.SUFFIXES: .cc .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 \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign tools/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 -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -install-sbinPROGRAMS: $(sbin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-sbinPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ - rm -f "$(DESTDIR)$(sbindir)/$$f"; \ - done - -clean-sbinPROGRAMS: - @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -bcharge$(EXEEXT): $(bcharge_OBJECTS) $(bcharge_DEPENDENCIES) - @rm -f bcharge$(EXEEXT) - $(CXXLINK) $(bcharge_LDFLAGS) $(bcharge_OBJECTS) $(bcharge_LDADD) $(LIBS) -bidentify$(EXEEXT): $(bidentify_OBJECTS) $(bidentify_DEPENDENCIES) - @rm -f bidentify$(EXEEXT) - $(CXXLINK) $(bidentify_LDFLAGS) $(bidentify_OBJECTS) $(bidentify_LDADD) $(LIBS) -bktrans$(EXEEXT): $(bktrans_OBJECTS) $(bktrans_DEPENDENCIES) - @rm -f bktrans$(EXEEXT) - $(CXXLINK) $(bktrans_LDFLAGS) $(bktrans_OBJECTS) $(bktrans_LDADD) $(LIBS) -brecsum$(EXEEXT): $(brecsum_OBJECTS) $(brecsum_DEPENDENCIES) - @rm -f brecsum$(EXEEXT) - $(CXXLINK) $(brecsum_LDFLAGS) $(brecsum_OBJECTS) $(brecsum_LDADD) $(LIBS) -breset$(EXEEXT): $(breset_OBJECTS) $(breset_DEPENDENCIES) - @rm -f breset$(EXEEXT) - $(CXXLINK) $(breset_LDFLAGS) $(breset_OBJECTS) $(breset_LDADD) $(LIBS) -bs11nread$(EXEEXT): $(bs11nread_OBJECTS) $(bs11nread_DEPENDENCIES) - @rm -f bs11nread$(EXEEXT) - $(CXXLINK) $(bs11nread_LDFLAGS) $(bs11nread_OBJECTS) $(bs11nread_LDADD) $(LIBS) -btool$(EXEEXT): $(btool_OBJECTS) $(btool_DEPENDENCIES) - @rm -f btool$(EXEEXT) - $(CXXLINK) $(btool_LDFLAGS) $(btool_OBJECTS) $(btool_LDADD) $(LIBS) -btranslate$(EXEEXT): $(btranslate_OBJECTS) $(btranslate_DEPENDENCIES) - @rm -f btranslate$(EXEEXT) - $(CXXLINK) $(btranslate_LDFLAGS) $(btranslate_OBJECTS) $(btranslate_LDADD) $(LIBS) -pppob$(EXEEXT): $(pppob_OBJECTS) $(pppob_DEPENDENCIES) - @rm -f pppob$(EXEEXT) - $(CXXLINK) $(pppob_LDFLAGS) $(pppob_OBJECTS) $(pppob_LDADD) $(LIBS) -upldif$(EXEEXT): $(upldif_OBJECTS) $(upldif_DEPENDENCIES) - @rm -f upldif$(EXEEXT) - $(CXXLINK) $(upldif_LDFLAGS) $(upldif_OBJECTS) $(upldif_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bcharge.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bidentify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bktrans.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brecsum.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/breset.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bs11nread-bs11nread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btool-btool.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btranslate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pppob.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upldif.Po@am__quote@ - -.cc.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cc.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cc.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -bs11nread-bs11nread.o: bs11nread.cc -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bs11nread_CXXFLAGS) $(CXXFLAGS) -MT bs11nread-bs11nread.o -MD -MP -MF "$(DEPDIR)/bs11nread-bs11nread.Tpo" -c -o bs11nread-bs11nread.o `test -f 'bs11nread.cc' || echo '$(srcdir)/'`bs11nread.cc; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/bs11nread-bs11nread.Tpo" "$(DEPDIR)/bs11nread-bs11nread.Po"; else rm -f "$(DEPDIR)/bs11nread-bs11nread.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='bs11nread.cc' object='bs11nread-bs11nread.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bs11nread_CXXFLAGS) $(CXXFLAGS) -c -o bs11nread-bs11nread.o `test -f 'bs11nread.cc' || echo '$(srcdir)/'`bs11nread.cc - -bs11nread-bs11nread.obj: bs11nread.cc -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bs11nread_CXXFLAGS) $(CXXFLAGS) -MT bs11nread-bs11nread.obj -MD -MP -MF "$(DEPDIR)/bs11nread-bs11nread.Tpo" -c -o bs11nread-bs11nread.obj `if test -f 'bs11nread.cc'; then $(CYGPATH_W) 'bs11nread.cc'; else $(CYGPATH_W) '$(srcdir)/bs11nread.cc'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/bs11nread-bs11nread.Tpo" "$(DEPDIR)/bs11nread-bs11nread.Po"; else rm -f "$(DEPDIR)/bs11nread-bs11nread.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='bs11nread.cc' object='bs11nread-bs11nread.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bs11nread_CXXFLAGS) $(CXXFLAGS) -c -o bs11nread-bs11nread.obj `if test -f 'bs11nread.cc'; then $(CYGPATH_W) 'bs11nread.cc'; else $(CYGPATH_W) '$(srcdir)/bs11nread.cc'; fi` - -btool-btool.o: btool.cc -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(btool_CXXFLAGS) $(CXXFLAGS) -MT btool-btool.o -MD -MP -MF "$(DEPDIR)/btool-btool.Tpo" -c -o btool-btool.o `test -f 'btool.cc' || echo '$(srcdir)/'`btool.cc; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/btool-btool.Tpo" "$(DEPDIR)/btool-btool.Po"; else rm -f "$(DEPDIR)/btool-btool.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='btool.cc' object='btool-btool.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(btool_CXXFLAGS) $(CXXFLAGS) -c -o btool-btool.o `test -f 'btool.cc' || echo '$(srcdir)/'`btool.cc - -btool-btool.obj: btool.cc -@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(btool_CXXFLAGS) $(CXXFLAGS) -MT btool-btool.obj -MD -MP -MF "$(DEPDIR)/btool-btool.Tpo" -c -o btool-btool.obj `if test -f 'btool.cc'; then $(CYGPATH_W) 'btool.cc'; else $(CYGPATH_W) '$(srcdir)/btool.cc'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/btool-btool.Tpo" "$(DEPDIR)/btool-btool.Po"; else rm -f "$(DEPDIR)/btool-btool.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='btool.cc' object='btool-btool.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(btool_CXXFLAGS) $(CXXFLAGS) -c -o btool-btool.obj `if test -f 'btool.cc'; then $(CYGPATH_W) 'btool.cc'; else $(CYGPATH_W) '$(srcdir)/btool.cc'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -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; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - 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; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && 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)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$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 -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; 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: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -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-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-sbinPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-binPROGRAMS install-sbinPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(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-info-am \ - uninstall-sbinPROGRAMS - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool clean-sbinPROGRAMS 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-exec install-exec-am install-info \ - install-info-am install-man install-sbinPROGRAMS 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-info-am uninstall-sbinPROGRAMS - -# 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 barry-0.14/tools/Makefile.plain barry-0.0.20110506/tools/Makefile.plain --- barry-0.14/tools/Makefile.plain 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/Makefile.plain 2011-05-06 12:20:17.000000000 +0000 @@ -1,9 +1,13 @@ all: btool-plain bcharge +# This only works if you have installed the Barry development library files btool-plain: btool.cc - g++ -I../rootdir/include -I../../external/rootdir/libusb/include \ - -o btool-plain btool.cc -L../rootdir/lib -lbarry + g++ -o btool-plain btool.cc -lbarry +# This works whether Barry is installed or not. bcharge: bcharge.cc g++ -Wall -o bcharge bcharge.cc -lusb +clean: + rm -f bcharge btool-plain + diff -Nru barry-0.14/tools/mimedump.h barry-0.0.20110506/tools/mimedump.h --- barry-0.14/tools/mimedump.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/mimedump.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,92 @@ +/// +/// \file mimedump.h +/// Overloaded templates for handling Mime output +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_TOOLS_MIMEDUMP_H__ +#define __BARRY_TOOLS_MIMEDUMP_H__ + +template +class MimeDump +{ +public: + static void Dump(std::ostream &os, const Record &rec) + { + os << rec << std::endl; + } + + static bool Supported() { return false; } +}; + +template <> +class MimeDump +{ +public: + static void Dump(std::ostream &os, const Barry::Contact &rec) + { + Barry::Sync::vCard vcard; + os << vcard.ToVCard(rec) << std::endl; + } + + static bool Supported() { return true; } +}; + +template <> +class MimeDump +{ +public: + static void Dump(std::ostream &os, const Barry::Calendar &rec) + { + Barry::Sync::vTimeConverter vtc; + Barry::Sync::vCalendar vcal(vtc); + os << vcal.ToVCal(rec) << std::endl; + } + + static bool Supported() { return true; } +}; + +template <> +class MimeDump +{ +public: + static void Dump(std::ostream &os, const Barry::Memo &rec) + { + Barry::Sync::vJournal vjournal; + os << vjournal.ToMemo(rec) << std::endl; + } + + static bool Supported() { return true; } +}; + +template <> +class MimeDump +{ +public: + static void Dump(std::ostream &os, const Barry::Task &rec) + { + Barry::Sync::vTimeConverter vtc; + Barry::Sync::vTodo vtodo(vtc); + os << vtodo.ToTask(rec) << std::endl; + } + + static bool Supported() { return true; } +}; + +#endif + diff -Nru barry-0.14/tools/platform.h barry-0.0.20110506/tools/platform.h --- barry-0.14/tools/platform.h 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/tools/platform.h 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,45 @@ +/// +/// \file platform.h +/// Platform-specific details +/// + +/* + Copyright (C) 2010-2011, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2010, RealVNC Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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 in the COPYING file at the + root directory of this project for more details. +*/ + +#ifndef __BARRY_PLATFORM_H__ +#define __BARRY_PLATFORM_H__ + +// All Windows specific detail +#if defined( WIN32 ) +typedef void (*sighandler_t)(int); + +// All FreeBSD / BSD specific detail +#elif defined( __FreeBSD__ ) + +#include +typedef sig_t sighandler_t; + +// All Mac OS X specific detail +#elif defined( __APPLE__ ) && defined( __MACH__ ) + +#include +typedef sig_t sighandler_t; + +#endif + +#endif + diff -Nru barry-0.14/tools/pppob.cc barry-0.0.20110506/tools/pppob.cc --- barry-0.14/tools/pppob.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/pppob.cc 2011-05-06 12:20:17.000000000 +0000 @@ -5,7 +5,7 @@ /// /* - Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2007-2011, Net Direct Inc. (http://www.netdirect.ca/) 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 @@ -33,6 +33,7 @@ #include #include #include +#include "i18n.h" using namespace std; @@ -43,12 +44,12 @@ void Usage() { - int major, minor; - const char *Version = Barry::Version(major, minor); + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); cerr << "pppob - PPP over Barry\n" - << " Copyright 2007-2008, Net Direct Inc. (http://www.netdirect.ca/)\n" + << " Copyright 2007-2011, Net Direct Inc. (http://www.netdirect.ca/)\n" << " Using: " << Version << "\n" << "\n" << " -l file Direct pppob log output to file (useful with -v)\n" @@ -127,6 +128,8 @@ int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(true); // leave this on, since libusb uses // stdio for debug messages @@ -184,6 +187,13 @@ Barry::Init(data_dump, &std::cerr); } + // Display version if in data_dump mode + if( data_dump ) { + int logical, major, minor; + const char *Version = Barry::Version(logical, major, minor); + barryverbose(Version); + } + // Probe the USB bus for Blackberry devices and display. // If user has specified a PIN, search for it in the // available device list here as well @@ -214,7 +224,12 @@ modem.Close(); // graceful close so we can restart without unplugging } else { - barryverbose("Using Serial mode..."); + if( force_serial ) { + barryverbose("Using Serial mode per command line..."); + } + else { + barryverbose("No IpModem mode available, using Serial mode..."); + } // Create our socket router and start thread to handle // the USB reading, instead of creating our own thread. @@ -231,7 +246,7 @@ // Open serial connection Mode::Serial modem(con, SerialDataCallback, 0); - modem.Open(); + modem.Open(password.c_str()); ProcessStdin(modem); } diff -Nru barry-0.14/tools/upldif.cc barry-0.0.20110506/tools/upldif.cc --- barry-0.14/tools/upldif.cc 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/tools/upldif.cc 2011-05-06 12:20:17.000000000 +0000 @@ -4,7 +4,7 @@ /// /* - Copyright (C) 2006-2008, Net Direct Inc. (http://www.netdirect.ca/) + Copyright (C) 2006-2011, Net Direct Inc. (http://www.netdirect.ca/) 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,7 +26,7 @@ #include #include #include - +#include "i18n.h" using namespace std; using namespace Barry; @@ -35,9 +35,10 @@ { cerr << "upldif - Command line LDIF uploader\n" - << " Copyright 2006-2008, Net Direct Inc. (http://www.netdirect.ca/)\n\n" + << " Copyright 2006-2011, Net Direct Inc. (http://www.netdirect.ca/)\n\n" << " -p pin PIN of device to talk with\n" << " If only one device plugged in, this flag is optional\n" + << " -P pass Simplistic method to specify device password\n" << " -u Do the upload. If not specified, only dumps parsed\n" << " LDIF data to stdout.\n" << " -v Dump protocol data during operation\n" @@ -78,7 +79,7 @@ // Retrieval operator -- called by Barry during the upload // process to get the next object - bool operator()(Record &rec, unsigned int databaseId) const + bool operator()(Record &rec, Builder &builder) const { if( rec_it == records.end() ) return false; @@ -106,6 +107,8 @@ int main(int argc, char *argv[]) { + INIT_I18N(PACKAGE); + cout.sync_with_stdio(true); // leave this on, since libusb uses // stdio for debug messages @@ -114,10 +117,11 @@ uint32_t pin = 0; bool data_dump = false, do_upload = false; + string password; // process command line options for(;;) { - int cmd = getopt(argc, argv, "hp:uv"); + int cmd = getopt(argc, argv, "hp:P:uv"); if( cmd == -1 ) break; @@ -127,6 +131,10 @@ pin = strtoul(optarg, NULL, 16); break; + case 'P': // Device password + password = optarg; + break; + case 'u': // do upload do_upload = true; break; @@ -169,7 +177,7 @@ // make sure we're in desktop mode Barry::Mode::Desktop desktop(con); - desktop.Open(); + desktop.Open(password.c_str()); // upload all records to device desktop.SaveDatabaseByType(contactStore); diff -Nru barry-0.14/udev/10-blackberry.perms barry-0.0.20110506/udev/10-blackberry.perms --- barry-0.14/udev/10-blackberry.perms 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/udev/10-blackberry.perms 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -=/dev/bb-* - 0660 0660 root diff -Nru barry-0.14/udev/10-blackberry.rules barry-0.0.20110506/udev/10-blackberry.rules --- barry-0.14/udev/10-blackberry.rules 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/udev/10-blackberry.rules 2011-05-06 12:20:17.000000000 +0000 @@ -9,29 +9,55 @@ # is when the -p argument comes into play, adjusting the device's # autosuspend settings. # -# Note2: the SUBSYSTEM and ENV{DEVTYPE} checks are to prevent bcharge from -# running each time a new endpoint is discovered by udev. -# Both SUBSYSTEM and ENV{DEVTYPE} are included so that the version -# of udev on your system doesn't matter. +# Note: SUBSYSTEM=="usb_device" is not reliably available on all kernels +# and all versions of udev, so instead we use the very first +# kernel message of: SUBSYSTEM=="usb", ENV{DEVTYPE}="usb_device" +# (See the output of 'udevadm monitor --kernel') +# Since the device is likely not created at this point, we +# can't set permissions... so permissions are handled in the +# generic 99-blackberry-perms.rules file. # # # Older devices that only use 0x0001 (no USB Mass Storage) # -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p" +# Classic device, no Dual mode, only autosuspend adjustment +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="0001", \ + RUN="/usr/sbin/bcharge -p %p" -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p" - -# -# Newer devices with USB Mass Storage, 0x8004 + 0x0006 + 0x0004. +# +# Newer devices with USB Mass Storage: +# 0x8007 usually get transformed into 0x8004 +# 0x8004 sometimes get transformed into 0x0004 +# 0x0006 usually get transformed into 0x0004 # -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", RUN="/usr/sbin/bcharge" -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", RUN="/usr/sbin/bcharge" -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p" - -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", RUN="/usr/sbin/bcharge" -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", RUN="/usr/sbin/bcharge" -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", RUN="/usr/sbin/bcharge -p %p" +# Pearl 0x0006 classic, force a change into 0x0004 +# No need to fiddle with autosuspend here, since a reset is +# nearly guaranteed +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="0006", \ + RUN="/usr/sbin/bcharge -d" + +# Storm 9530, ask bcharge to guess best setting +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="8007", \ + RUN="/usr/sbin/bcharge -g -p %p" + +# Pearl 8120 and Storm 9550, ask bcharge to guess best setting +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="8004", \ + RUN="/usr/sbin/bcharge -g -p %p" + +# Pearl Flip... bcharge guesses +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="8001", \ + RUN="/usr/sbin/bcharge -g -p %p" + +# Pearl Dual mode already, so just adjust autosuspend +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", \ + ATTR{idVendor}=="0fca", ATTR{idProduct}=="0004", \ + RUN="/usr/sbin/bcharge -p %p" diff -Nru barry-0.14/udev/10-blackberry.rules.Debian barry-0.0.20110506/udev/10-blackberry.rules.Debian --- barry-0.14/udev/10-blackberry.rules.Debian 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/udev/10-blackberry.rules.Debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -# -# Blackberry devices -# -# Note: the following rules may appear wasteful, in that bcharge is run -# twice: once for changing the mode, and once again after the -# device resets itself to enter this mode. This is required -# in order to support older kernels (approx. 2.6.20 to 2.6.22) with -# CONFIG_USB_SUSPEND enabled. The second time bcharge is run -# is when the -p argument comes into play, adjusting the device's -# autosuspend settings. -# -# Note2: the SUBSYSTEM and ENV{DEVTYPE} checks are to prevent bcharge from -# running each time a new endpoint is discovered by udev. -# Both SUBSYSTEM and ENV{DEVTYPE} are included so that the version -# of udev on your system doesn't matter. -# - -# -# Older devices that only use 0x0001 (no USB Mass Storage) -# -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge -p %p" - -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", SYMLINK+="bb-%k", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge -p %p" - -# -# Newer devices with USB Mass Storage, 0x8004 + 0x0006 + 0x0004. -# - -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge" -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge" -BUS=="usb", SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge -p %p" - -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0006", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge" -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="8004", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge" -BUS=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0004", SYMLINK+="bb-%k", GROUP="plugdev", MODE="0660", RUN="/usr/sbin/bcharge -p %p" - diff -Nru barry-0.14/udev/69-blackberry.rules barry-0.0.20110506/udev/69-blackberry.rules --- barry-0.14/udev/69-blackberry.rules 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/udev/69-blackberry.rules 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,2 @@ +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0fca", ENV{ACL_MANAGE}="1", ENV{ID_PDA}="1" + diff -Nru barry-0.14/udev/99-barry-perms barry-0.0.20110506/udev/99-barry-perms --- barry-0.14/udev/99-barry-perms 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/udev/99-barry-perms 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -# -# To avoid other udev rules changing the permissions again on us, this filename -# is '99-barry-perms' -# -SYSFS{idVendor}=="0fca", SYSFS{idProduct}=="0001", GROUP="barry", MODE="0660" - diff -Nru barry-0.14/udev/99-blackberry-perms.rules barry-0.0.20110506/udev/99-blackberry-perms.rules --- barry-0.14/udev/99-blackberry-perms.rules 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/udev/99-blackberry-perms.rules 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,14 @@ +# +# This file sets the permissions of Blackberry devices, using a very +# broad ruleset. It runs no external commands, so this broad ruleset +# should not impact performance at all. +# +# Note: for opensuse-11.1, use the group 'dialout' +# +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="0001", GROUP="plugdev", MODE="0664" +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="0004", GROUP="plugdev", MODE="0664" +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="0006", GROUP="plugdev", MODE="0664" +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="8001", GROUP="plugdev", MODE="0664" +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="8004", GROUP="plugdev", MODE="0664" +ATTRS{idVendor}=="0fca", ATTRS{idProduct}=="8007", GROUP="plugdev", MODE="0664" + diff -Nru barry-0.14/udev/README barry-0.0.20110506/udev/README --- barry-0.14/udev/README 2008-09-25 01:27:53.000000000 +0000 +++ barry-0.0.20110506/udev/README 2011-05-06 12:20:17.000000000 +0000 @@ -1,39 +1,67 @@ -This describes the udev files in this directory and what they are used for: +10-blackberry.rules + These udev rules run bcharge on matching Blackberry devices + in order to enable 500mA battery charging mode. + +99-blackberry-perms.rules + + These udev rules set the resulting device mode to the + group 'plugdev' and mode '0660' so that Barry can access + the device without being root. + +69-blackberry.rules + + This is for Fedora 12 and friends who have updated to a different + udev rules directory layout. -10-blackberry.rules -10-blackberry.rules.Debian - udev rules for running bcharge when you plugin your Blackberry. - Creates symlinks as well. +Commentary: +----------- - The .Debian file is for Debian Etch, and sets the permissions - as well. This should be the only file you need for Debian Etch. +Yes, I tried to keep this in one file, but the prevailing winds of Linux +keep this very hard to do. +When you run 'udevadm monitor --env' (udevmonitor on some systems) +you will see UEVENT entries and UDEV entries. The UEVENT entries +represent kernel level events, generated when you plugin your device +or remove it. These kernel events are what udev daemons watch for. -10-blackberry.perms +Udev then works on these events and generates "events" of its own. +The results of these events are displayed in the monitor output +as UDEV entries. - For RedHat/Fedora systems, this file goes into: +It seems that the rules in the above rules files only match against +the UEVENT kernel events. - /etc/security/console.perms.d/ +Therefore, the common idiom of: - It will dynamically give ownership of the /dev/bb-* (well, the - target of those symlinks) to the logged in console or xconsole - user. The idea was taken from this page: + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device" - http://gentoo-wiki.com/HOWTO_Griffin_PowerMate_with_UDEV_and_Kernel_2.6.x +is used to select a newly plugged in device. Unfortunately, it doesn't +seem that the /dev/bus/* device node exists yet at this point, since +that appears to happen in /etc/udev/rules.d/50-udev.rules, and on some +systems, *that* rule depends on SUBSYSTEM=="usb_device" to work. This is +not guaranteed to exist on all systems. - Search for 'New alternative'. +Plus, if the kernel event SUBSYSTEM=="usb_device" does exist, it comes +after the one above. +So we have the following behaviour: -99-barry-perms + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device" (always happens first) + SUBSYSTEM=="usb_device" (sometimes happens, and if so, happens last) + /dev/bus/* created (happens based on udev rules, which differ on + each system) - For systems that don't support /etc/security/console.perms.d/, - this udev script utilizes a special group "barry" and sets - the devices to mode "0660". +So... for fans of cross-platform behaviour, and fans of the KISS method, +this behaviour rules out SUBSYSTEM=="usb_device" as a valid keyword. And +since the /dev/bus/* (or /proc or whatevever) device node does not yet exist +at the very beginning of this udev process, that means we have to do the +power adjustment and the permissions in two udev steps. - You will need to create a "barry" group on your system to use this. +And now you know the rest of the story. +- Chris -May 2007 +Sept 2009 diff -Nru barry-0.14/usbmon-6/COPYING barry-0.0.20110506/usbmon-6/COPYING --- barry-0.14/usbmon-6/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/usbmon-6/COPYING 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru barry-0.14/usbmon-6/Makefile barry-0.0.20110506/usbmon-6/Makefile --- barry-0.14/usbmon-6/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/usbmon-6/Makefile 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,19 @@ +## +## usbmon - simple front-end for in-kernel usbmon +## + +#CFLAGS += -Wall -Wp,-D_FORTIFY_SOURCE=2 -O2 +CFLAGS += -Wall -Wshadow -Wmissing-declarations -Wmissing-prototypes +CFLAGS += -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare +CFLAGS += -Wchar-subscripts -Wstrict-prototypes -Wformat=2 -Wtype-limits +CFLAGS += -Wp,-D_FORTIFY_SOURCE=2 +CFLAGS += -O2 + +all: usbmon + +usbmon: usbmon.o + +usbmon.o: usbmon.c + +clean: + rm -f *.o usbmon diff -Nru barry-0.14/usbmon-6/README barry-0.0.20110506/usbmon-6/README --- barry-0.14/usbmon-6/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/usbmon-6/README 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,9 @@ + usbmon + Version 6 + +The usbmon(8) utility is a user interface to its namesake "usbmon", a facility +in Linux kernel. The usbmon facility may also be accessed with tcpdump(1), +Wireshark, or cat(1). Isn't the choice wonderful? + +This software program is licensed for use under terms of GNU General Public +License, version 2. See file "COPYING" for the complete terms. diff -Nru barry-0.14/usbmon-6/usbmon.8 barry-0.0.20110506/usbmon-6/usbmon.8 --- barry-0.14/usbmon-6/usbmon.8 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/usbmon-6/usbmon.8 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,234 @@ +.TH usbmon 8 "10 April 2007" +.IX usbmon +.SH NAME +usbmon \- monitor USB traffic +.SH SYNOPSIS +.B usbmon +[ +.B -i +.I bus_num +] +[ +.B -s +.I length +] +[ +.B -f0 +| +.B -fu +| +.B -fh +] +[ +.B -a0 +| +.B -a1 +] +.SH DESCRIPTION +.B usbmon +allows to capture USB traffic for analysis in the manner similar to +.BR tcpdump +(8). + +To make use of this program, you need to have a Linux kernel +which supports the binary "usbmon" interface +(e.g., Linux kernel 2.6.20 or newer). + +.SH OPTIONS +.TP +.B \-i +Listen on \fIbus_num\fP. If unspecified, +.I usbmon +attempts to listen on the pseudo-bus number zero, +which is supposed to capture all packets on all buses. +The default is a convenient mode because the user does not have to figure out +the bus number where a specific device is attached. +Also, listening on pseudo-bus zero allows to capture events +which happen when a bus is initialized. + +However, it may be necessary to specify a specific bus number to tap. +Kernels before 2.6.22 do not implement the pseudo-bus zero at all. +Performance of USB stack and the usbmon is greater when a specific +bus is monitored. +In such case, +the desired bus number may be determined by examining the output of lsusb(8). + +.TP +.B \-s +Set the maximum length of USB data to print. The default is to +print 32 bytes just like the kernel's text interface would. +The capture size is automatically adjusted to match unless set explicitly. + +.TP +.B \-f +Select the output format as one of: '0' for legacy format, 'u' for so-called +"1u" format, 'h' for "human-readable" format. The human-readable format +is the default. Also, it changes over time, so programs should parse +the "1u" format. + +Selecting the 1u format forces +.I usbmon +to use the API which may not be available in the kernel before version 2.6.22. + +The human-readable format is not intended for a programmatic parsing, +and so changes from release to release. + +.TP +.B \-a +Force the binary API version to use: '0' for the legacy API in kernel +2.6.20 and up, '1' for the newer API in kernels after 2.6.22. +Selection of output format may force the API to the minimum required +to support the format. In general, this option is only used when +testing the kernel component of usbmon. + +.SH OUTPUT FORMAT +.LP +The output of +.I usbmon +contains one text line per an event. The event corresponds to I/O operations +on the boundary of Host Controller Driver (HCD). +This includes events of the following types: +Submission, +Callback, +Error. +Every line consists +of whitespace separated words. The number or position of words may depend +on the event type, but there is a set of words, common for all types. +.LP +Most commonly used format is the human-readable format. Its words, +from left to right, are: +.PP +- URB Tag. +A single URB generates several monitoring events during its life cycle. +The tag allows to corellate events with the URB. +Tag is usually derived from a kernel mode address. +Human-readable format shortens the tag to make the output more readable, +so it's not the complete address. +.PP +- Timestamp. It consistes of the number of seconds, period, and the fraction +in microseconds. +.PP +- Event Type. This type refers to the format of the event, not URB type. +Available types are: S - submission, C - callback, E - submission error. +.PP +- "Pipe word" (the name is historical and has nothing to do with pipes). +This is a composite word. It consists of four fields, separated +by colons: URB type and direction, Bus number, Device address, Endpoint number. +Type and direction are encoded with two bytes in the following manner: +.PP + Ci Co Control input and output + Zi Zo Isochronous input and output + Ii Io Interrupt input and output + Bi Bo Bulk input and output +.PP +The address information fields may contain leading zeros. If the bus is +specified with -i, the Bus number field is redundant, but is kept for +the ease of parsing. +.PP +- Status word. This word may have several fields, depending on the transfer +type. Most transfers only have the status field. Interrupt and Isochronous +transfers add an interval. For Isochronous, start frame and error count +may be present. For callback and error events, +the status field contains an integer number, +which represents a "status" field of the URB. +For a submission event, status makes no sense, +so the field contains a single dash. +.PP +Control submissions are an exception, because they may have a setup +packet. In such case, the event contains a letter in place of the status word. +The letter is called "setup tag". +.PP +- Setup packet, if present, consists of 5 words: one of each for bmRequestType, +bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. +These words are safe to decode if Setup Tag was 's'. Otherwise, the setup +packet was present, but not captured, and the fields contain filler. +.PP +- The number of isochronous frame descriptors (optional). +.PP +- Isochronous descriptors (optional). Like the "pipe word", each descriptor +contains fields separated by colons: status, offset, and length. +.PP +- Data Tag +.PP +- Data (if Data Tag is '=') +.PP +Data stream and its ASCII representation follow on separate lines. +Each line starts with a space for the ease of identification. + +.LP +The following is the list of words for the legacy format, from left to right: +.PP +- URB Tag. This is normally a kernel mode address of the URB structure. +.PP +- Timestamp in microseconds, a decimal number. The timestamp's resolution +depends on available clock, and so it can be much worse than a microsecond +(if the implementation uses jiffies, for example). +The number of microseconds is usually truncated, so it can wrap +if usbmon runs long enough. +.PP +- Event Type. This type refers to the format of the event, not URB type. +Available types are: S - submission, C - callback, E - submission error. +.PP +- "Pipe". The pipe concept is deprecated. This is a composite word, used to +be derived from information in pipes. It consists of three fields, separated +by colons: URB type and direction, Device address, Endpoint number. +Type and direction are encoded with two bytes in the following manner: +.PP + Ci Co Control input and output + Zi Zo Isochronous input and output + Ii Io Interrupt input and output + Bi Bo Bulk input and output +.PP +Device address and Endpoint number are 3-digit and 2-digit (respectively) +decimal numbers, with leading zeroes. +.PP +- URB Status. In most cases, this field contains a number, sometimes negative, +which represents a "status" field of the URB. This field makes no sense for +submissions, but is present anyway to help scripts with parsing. When an +error occurs, the field contains the error code. In case of a submission of +a Control packet, this field contains a Setup Tag instead of an error code. +It is easy to tell whether the Setup Tag is present because it is never a +number. Thus if scripts find a number in this field, they proceed to read +Data Length. If they find something else, like a letter, they read the setup +packet before reading the Data Length. +.PP +- Setup packet, if present, consists of 5 words: one of each for bmRequestType, +bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. +These words are safe to decode if Setup Tag was 's'. Otherwise, the setup +packet was present, but not captured, and the fields contain filler. +.PP +- Data Length. For submissions, this is the requested length. For callbacks, +this is the actual length. +.PP +- Data tag. The usbmon may not always capture data, even if length is nonzero. +The data words are present only if this tag is '='. +.PP +- Data words follow, in big endian hexadecimal format. Notice that they are +not machine words, but really just a byte stream split into words to make +it easier to read. Thus, the last word may contain from one to four bytes. +The length of collected data is limited (see the +.I \-s +parameter) and can be less than the data length +report in the Data Length word. + +.SH FILES +.TP +.B /proc/devices +This file is read to determine the major of /dev/usbmonN if such node does +not exist in the system. +.TP +.B /dev/usbmonN +The +.I usbmon +attempts to open +.I /dev/usbmon{N}, +where N is the bus number. +If the node does not exist, +.I usbmon +creates it. + +.SH SEE ALSO +.BR lsusb (8) + +.SH AUTHOR +Pete Zaitcev, . diff -Nru barry-0.14/usbmon-6/usbmon.c barry-0.0.20110506/usbmon-6/usbmon.c --- barry-0.14/usbmon-6/usbmon.c 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/usbmon-6/usbmon.c 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,1047 @@ +/* + * usbmon-6, from http://people.redhat.com/zaitcev/linux/ + * Modified by Chris Frey to comment out the root requirement + * and change the human hex dump format. + */ + +/* + * usbmon: Front-end for usbmon + * + * Copyright (C) 2005 Pete Zaitcev (zaitcev@redhat.com) + * Copyright (c) 2007 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * The function print_48 is a fork of mon_text_read from ancient kernels + * (thus we are perfectly compatible with '1t' format), so we use GPL v2. + * If someone rewrites print_foo from scratch, we can use any GPL >= 2. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TAG "usbmon" + +#ifdef __GNUC__ +#define __unused __attribute__((unused)) +#else +#define __unused /**/ +#endif + +#define usb_typeint(type) (((type)&0x3) == PIPE_INTERRUPT) +#define usb_typeisoc(type) (((type)&0x3) == PIPE_ISOCHRONOUS) + +struct usbmon_packet { + uint64_t id; /* URB ID - from submission to callback */ + unsigned char type; /* Same as in text API; extensible. */ + unsigned char xfer_type; /* ISO, Intr, Control, Bulk */ + unsigned char epnum; /* Endpoint number; 0x80 IN */ + unsigned char devnum; /* Device address */ + unsigned short busnum; /* Bus number */ + char flag_setup; + char flag_data; + int64_t ts_sec; /* gettimeofday */ + int32_t ts_usec; /* gettimeofday */ + int status; + unsigned int length; /* Length of data (submitted or actual) */ + unsigned int len_cap; /* Delivered length */ + unsigned char setup[8]; /* Only for Control S-type */ +}; + +struct usbmon_packet_1 { + uint64_t id; /* URB ID - from submission to callback */ + unsigned char type; /* Same as in text API; extensible. */ + unsigned char xfer_type; /* ISO, Intr, Control, Bulk */ + unsigned char epnum; /* Endpoint number; 0x80 IN */ + unsigned char devnum; /* Device address */ + unsigned short busnum; /* Bus number */ + char flag_setup; + char flag_data; + int64_t ts_sec; /* gettimeofday */ + int32_t ts_usec; /* gettimeofday */ + int status; + unsigned int length; /* Length of data (submitted or actual) */ + unsigned int len_cap; /* Delivered length */ + union { + unsigned char setup[8]; /* Only for Control S-type */ + struct iso_rec { + int error_count; + int numdesc; /* Number from the URB */ + } iso; + } s; + int interval; + int start_frame; + unsigned int xfer_flags; + unsigned int ndesc; /* Actual number of ISO descriptors */ +}; + +struct usbmon_isodesc { + int iso_stat; + unsigned int iso_off; + unsigned int iso_len; + int iso_pad; +}; + +/* + * Size this so that we see data even if many descriptors are used. + * Notice that we reserve enough print buffer for all of them. + */ +#define ISODESC_MAX 8 + +#define PIPE_ISOCHRONOUS 0 +#define PIPE_INTERRUPT 1 +#define PIPE_CONTROL 2 +#define PIPE_BULK 3 + +#define MON_IOC_MAGIC 0x92 + +#define MON_IOCG_STATS _IOR(MON_IOC_MAGIC, 3, struct usbmon_stats) + +#define MON_IOCT_RING_SIZE _IO(MON_IOC_MAGIC, 4) + +#define MON_IOCQ_RING_SIZE _IO(MON_IOC_MAGIC, 5) + +struct usbmon_get_arg { + struct usbmon_packet_1 *hdr; /* Only 48 bytes, not 64. */ + void *data; + size_t alloc; /* Length of data (can be zero) */ +}; + +#define MON_IOCX_GET _IOW(MON_IOC_MAGIC, 6, struct usbmon_get_arg) + +#define MON_IOCX_GETX _IOW(MON_IOC_MAGIC, 10, struct usbmon_get_arg) + +struct usbmon_mfetch_arg { + unsigned int *offvec; /* Vector of events fetched */ + unsigned int nfetch; /* Num. of events to fetch / fetched */ + unsigned int nflush; /* Number of events to flush */ +}; + +#define MON_IOCX_MFETCH _IOWR(MON_IOC_MAGIC, 7, struct usbmon_mfetch_arg) + +/* + */ +enum text_format { + TFMT_OLD, /* The v0 text API aka "1t" */ + TFMT_1U, /* The "1u" text format */ + TFMT_HUMAN /* Human-oriented format, changes over time. */ +}; + +enum usbmon_api { + API_ANY, + API_B0, /* Old binary (48 bytes usbmon_packet) */ + API_B1, /* New binary (64 bytes usbmon_packet_1) */ + API_B1M /* New binary (64 bytes usbmon_packet_1) + mmap(2) */ +}; + +struct params { + int ifnum; /* USB bus number */ + char *devname; /* /dev/usbmonN */ + int data_size; /* How many bytes to fetch, including ISO descriptors */ + int data_max; /* How many bytes to print as data (<= data_size) */ + enum text_format format; + enum usbmon_api api; + + int map_size; + + char *print_buf; + int print_size; +}; + +enum { DATA_MAX = 32 }; /* Old limit used with 1t format (print_48) */ + +struct print_cursor { + char *pbuf; + int size; + int count; /* without the terminating nul */ +}; + +void Usage(void); + +void print(const struct params *, const struct usbmon_packet_1 *ep, + const unsigned char *data); +void print_48(const struct params *, const struct usbmon_packet *ep, + const unsigned char *data); +void print_1u(const struct params *, const struct usbmon_packet_1 *ep, + const unsigned char *data); +void print_human(const struct params *, const struct usbmon_packet_1 *ep, + const unsigned char *data, uint64_t start_sec); +static void print_human_data(struct print_cursor *curp, + const struct usbmon_packet_1 *ep, const unsigned char *data, int data_len); +static void print_start(struct print_cursor *, char *buf, int size0); +static void print_safe(struct print_cursor *, const char *fmt, ...); +static int print_done(struct print_cursor *); +void parse_params(struct params *p, char **argv); +void make_device(const struct params *p); +int find_major(void); + +struct params par; + +int main(int argc __unused, char **argv) +{ + int fd; + struct usbmon_packet_1 hdrb; + struct usbmon_packet_1 *hdr; + struct usbmon_get_arg getb; + enum { MFETCH_NM = 3 }; + unsigned int offs[MFETCH_NM]; + unsigned int off; + struct usbmon_mfetch_arg mfb; + unsigned char *data_buff; + unsigned int toflush; + int i; + int rc; + + if (sizeof(struct usbmon_packet) != 48) { + extern void usbmon_packet_size_is_bolixed(void); + usbmon_packet_size_is_bolixed(); /* link-time error */ + } + if (sizeof(struct usbmon_packet_1) != 64) { + extern void usbmon_packet_1_size_is_bolixed(void); + usbmon_packet_1_size_is_bolixed(); /* link-time error */ + } + + parse_params(&par, argv+1); + + /* + * Two reasons to do this: + * 1. Reduce weird error messages. + * 2. If we create device nodes, we want them owned by root. + */ +// if (geteuid() != 0) { +// fprintf(stderr, TAG ": Must run as root\n"); +// exit(1); +// } + + if ((fd = open(par.devname, O_RDWR)) == -1) { + if (errno == ENOENT) { + make_device(&par); + fd = open(par.devname, O_RDWR); + } + if (fd == -1) { + if (errno == ENODEV && par.ifnum == 0) { + fprintf(stderr, TAG + ": Can't open pseudo-bus zero at %s" + " (probably not supported by kernel)\n", + par.devname); + } else { + fprintf(stderr, TAG ": Can't open %s: %s\n", + par.devname, strerror(errno)); + } + exit(1); + } + } + + + if (par.api == API_B1M) { + rc = ioctl(fd, MON_IOCQ_RING_SIZE, 0); + if (rc == -1) { + fprintf(stderr, TAG ": Cannot get ring size: %s\n", + strerror(errno)); + exit(1); + } + printf("Ring size: %d\n", rc); /* P3 */ + par.map_size = rc; + data_buff = mmap(0, par.map_size, PROT_READ, MAP_SHARED, fd, 0); + if (data_buff == MAP_FAILED) { + fprintf(stderr, TAG ": Cannot mmap: %s\n", + strerror(errno)); + exit(1); + } + } else { + if ((data_buff = malloc(par.data_size)) == NULL) { + fprintf(stderr, TAG ": No core\n"); + exit(1); + } + } + + if (par.format == TFMT_HUMAN && par.api == API_B0) { + /* + * Zero fields which are not present in old (zero) API + */ + memset(&hdrb, 0, sizeof(struct usbmon_packet_1)); + } else { + /* + * Make uninitialized fields visible. + */ + memset(&hdrb, 0xdb, sizeof(struct usbmon_packet_1)); + } + + toflush = 0; + for (;;) { + if (par.api == API_B0) { + getb.hdr = &hdrb; + getb.data = data_buff; + getb.alloc = par.data_size; + if ((rc = ioctl(fd, MON_IOCX_GET, &getb)) != 0) { + fprintf(stderr, TAG ": MON_IOCX_GET: %s\n", + strerror(errno)); + exit(1); + } + print(&par, &hdrb, data_buff); + } else if (par.api == API_B1) { + getb.hdr = &hdrb; + getb.data = data_buff; + getb.alloc = par.data_size; + if ((rc = ioctl(fd, MON_IOCX_GETX, &getb)) != 0) { + fprintf(stderr, TAG ": MON_IOCX_GETX: %s\n", + strerror(errno)); + exit(1); + } + print(&par, &hdrb, data_buff); + } else if (par.api == API_B1M) { + mfb.offvec = offs; + mfb.nfetch = MFETCH_NM; + mfb.nflush = toflush; + if ((rc = ioctl(fd, MON_IOCX_MFETCH, &mfb)) != 0) { + fprintf(stderr, TAG ": MON_IOCX_MFETCH: %s\n", + strerror(errno)); + exit(1); + } + for (i = 0; i < mfb.nfetch; i++) { + off = offs[i]; + if (off >= par.map_size) { + fprintf(stderr, TAG ": offset\n"); + continue; + } + hdr = (struct usbmon_packet_1 *)(data_buff + off); + if (hdr->type == '@') + continue; + print(&par, hdr, (const unsigned char *)(hdr + 1)); + } + toflush = mfb.nfetch; + } else { + getb.hdr = &hdrb; + getb.data = data_buff; + getb.alloc = par.data_size; + if ((rc = ioctl(fd, MON_IOCX_GETX, &getb)) != 0) { + if (errno == ENOTTY) { + par.api = API_B0; + rc = ioctl(fd, MON_IOCX_GET, &getb); + if (rc != 0) { + fprintf(stderr, TAG + ": MON_IOCX_GET: %s\n", + strerror(errno)); + exit(1); + } + } else { + fprintf(stderr, TAG + ": MON_IOCX_GETX: %s\n", + strerror(errno)); + exit(1); + } + } + print(&par, &hdrb, data_buff); + } + } + + // return 0; +} + +void print(const struct params *prm, const struct usbmon_packet_1 *ep, + const unsigned char *data) +{ + static uint64_t start_sec = 0; + + switch (par.format) { + case TFMT_OLD: + /* + * Old and new APIs are made compatible just so we + * can cast like this. + */ + print_48(&par, (struct usbmon_packet *) ep, data); + break; + case TFMT_1U: + print_1u(&par, ep, data); + break; + default: /* TFMT_HUMAN */ + if (start_sec == 0) + start_sec = ep->ts_sec; + print_human(&par, ep, data, start_sec); + } +} + +void print_48(const struct params *prm, const struct usbmon_packet *ep, + const unsigned char *data) +{ + struct print_cursor pcur; + char udir, utype; + int data_len, i; + int cnt; + ssize_t rc; + + print_start(&pcur, prm->print_buf, prm->print_size); + + udir = ((ep->epnum & 0x80) != 0) ? 'i' : 'o'; + switch (ep->xfer_type & 0x3) { + case PIPE_ISOCHRONOUS: utype = 'Z'; break; + case PIPE_INTERRUPT: utype = 'I'; break; + case PIPE_CONTROL: utype = 'C'; break; + default: /* PIPE_BULK */ utype = 'B'; + } + print_safe(&pcur, + "%llx %u %c %c%c:%03u:%02u", + (long long) ep->id, + (unsigned int)(ep->ts_sec & 0xFFF) * 1000000 + ep->ts_usec, + ep->type, + utype, udir, ep->devnum, ep->epnum & 0x7f); + + if (ep->flag_setup == 0) { /* Setup packet is present and captured */ + print_safe(&pcur, + " s %02x %02x %04x %04x %04x", + ep->setup[0], + ep->setup[1], + (ep->setup[3] << 8) | ep->setup[2], + (ep->setup[5] << 8) | ep->setup[4], + (ep->setup[7] << 8) | ep->setup[6]); + } else if (ep->flag_setup != '-') { /* Unable to capture setup packet */ + print_safe(&pcur, + " %c __ __ ____ ____ ____", ep->flag_setup); + } else { /* No setup for this kind of URB */ + print_safe(&pcur, " %d", ep->status); + } + print_safe(&pcur, " %d", ep->length); + + if (ep->length > 0) { + if (ep->flag_data == 0) { + print_safe(&pcur, " ="); + if ((data_len = ep->len_cap) >= DATA_MAX) + data_len = DATA_MAX; + for (i = 0; i < data_len; i++) { + if (i % 4 == 0) { + print_safe(&pcur, " "); + } + print_safe(&pcur, "%02x", data[i]); + } + print_safe(&pcur, "\n"); + } else { + print_safe(&pcur, " %c\n", ep->flag_data); + } + } else { + print_safe(&pcur, "\n"); + } + + cnt = print_done(&pcur); + if ((rc = write(1, prm->print_buf, cnt)) < cnt) { + if (rc < 0) { + fprintf(stderr, TAG ": Write error: %s\n", + strerror(errno)); + } else { + fprintf(stderr, TAG ": Short write\n"); + } + exit(1); + } +} + +void print_1u(const struct params *prm, const struct usbmon_packet_1 *ep, + const unsigned char *data) +{ + struct print_cursor pcur; + char udir, utype; + int data_len, i; + int ndesc; /* Display this many */ + const struct usbmon_isodesc *dp; + int cnt; + ssize_t rc; + + print_start(&pcur, prm->print_buf, prm->print_size); + + if ((data_len = ep->len_cap) < 0) { /* Overflow */ + data_len = 0; + } + + udir = ((ep->epnum & 0x80) != 0) ? 'i' : 'o'; + switch (ep->xfer_type & 0x3) { + case PIPE_ISOCHRONOUS: utype = 'Z'; break; + case PIPE_INTERRUPT: utype = 'I'; break; + case PIPE_CONTROL: utype = 'C'; break; + default: /* PIPE_BULK */ utype = 'B'; + } + print_safe(&pcur, + "%llx %u %c %c%c:%u:%03u:%u", + (long long) ep->id, + (unsigned int)(ep->ts_sec & 0xFFF) * 1000000 + ep->ts_usec, + ep->type, + utype, udir, ep->busnum, ep->devnum, ep->epnum & 0x7f); + + if (ep->type == 'E') { + print_safe(&pcur, " %d", ep->status); + } else { + if (ep->flag_setup == 0) { + /* Setup packet is present and captured */ + print_safe(&pcur, + " s %02x %02x %04x %04x %04x", + ep->s.setup[0], + ep->s.setup[1], + (ep->s.setup[3] << 8) | ep->s.setup[2], + (ep->s.setup[5] << 8) | ep->s.setup[4], + (ep->s.setup[7] << 8) | ep->s.setup[6]); + } else if (ep->flag_setup != '-') { + /* Unable to capture setup packet */ + print_safe(&pcur, + " %c __ __ ____ ____ ____", ep->flag_setup); + } else { + /* No setup for this kind of URB */ + print_safe(&pcur, " %d", ep->status); + if (usb_typeisoc(ep->xfer_type) || + usb_typeint(ep->xfer_type)) { + print_safe(&pcur, ":%d", ep->interval); + } + if (usb_typeisoc(ep->xfer_type)) { + print_safe(&pcur, ":%d", ep->start_frame); + if (ep->type == 'C') { + print_safe(&pcur, + ":%d", ep->s.iso.error_count); + } + } + } + if (usb_typeisoc(ep->xfer_type)) { + /* + * This is the number of descriptors used by HC. + */ + print_safe(&pcur, " %d", ep->s.iso.numdesc); + + /* + * This is the number of descriptors which we print. + */ + ndesc = ep->ndesc; + if (ndesc > ISODESC_MAX) + ndesc = ISODESC_MAX; + if (ndesc * sizeof(struct usbmon_isodesc) > data_len) { + ndesc = data_len / sizeof(struct usbmon_isodesc); + } + /* This is aligned by malloc */ + dp = (struct usbmon_isodesc *) data; + for (i = 0; i < ndesc; i++) { + print_safe(&pcur, + " %d:%u:%u", + dp->iso_stat, dp->iso_off, dp->iso_len); + dp++; + } + + /* + * The number of descriptors captured is used to + * find where the data starts. + */ + ndesc = ep->ndesc; + if (ndesc * sizeof(struct usbmon_isodesc) > data_len) { + data_len = 0; + } else { + data += ndesc * sizeof(struct usbmon_isodesc); + data_len -= ndesc * sizeof(struct usbmon_isodesc); + } + } + } + + print_safe(&pcur, " %d", ep->length); + + if (ep->length > 0) { + if (ep->flag_data == 0) { + print_safe(&pcur, " ="); + if (data_len >= prm->data_max) + data_len = prm->data_max; + for (i = 0; i < data_len; i++) { + if (i % 4 == 0) { + print_safe(&pcur, " "); + } + print_safe(&pcur, "%02x", data[i]); + } + print_safe(&pcur, "\n"); + } else { + print_safe(&pcur, " %c\n", ep->flag_data); + } + } else { + print_safe(&pcur, "\n"); + } + + cnt = print_done(&pcur); + if ((rc = write(1, prm->print_buf, cnt)) < cnt) { + if (rc < 0) { + fprintf(stderr, TAG ": Write error: %s\n", + strerror(errno)); + } else { + fprintf(stderr, TAG ": Short write\n"); + } + exit(1); + } +} + +void print_human(const struct params *prm, const struct usbmon_packet_1 *ep, + const unsigned char *data, uint64_t start_sec) +{ + struct print_cursor pcur; + char udir, utype; + int data_len, i; + int ndesc; /* Display this many */ + const struct usbmon_isodesc *dp; + int cnt; + ssize_t rc; + + print_start(&pcur, prm->print_buf, prm->print_size); + + if ((data_len = ep->len_cap) < 0) { /* Overflow */ + data_len = 0; + } + +#if 0 + enum { TAG_BUF_SIZE = 17 }; + char tag_buf[TAG_BUF_SIZE]; + print_human_tag(tag_buf, TAG_BUF_SIZE, prm->tagp, ep); +#endif + /* + * We cast into a truncated type for readability. + * The danger of collisions is negligible. + */ + print_safe(&pcur, "%08x", (unsigned int) ep->id); + + udir = ((ep->epnum & 0x80) != 0) ? 'i' : 'o'; + switch (ep->xfer_type & 0x3) { + case PIPE_ISOCHRONOUS: utype = 'Z'; break; + case PIPE_INTERRUPT: utype = 'I'; break; + case PIPE_CONTROL: utype = 'C'; break; + default: /* PIPE_BULK */ utype = 'B'; + } + print_safe(&pcur, + " %u.%06u %c %c%c:%u:%03u:%u", + (unsigned int)(ep->ts_sec - start_sec), ep->ts_usec, + ep->type, + utype, udir, ep->busnum, ep->devnum, ep->epnum & 0x7f); + + if (ep->type == 'E') { + print_safe(&pcur, " %d", ep->status); + } else { + if (ep->flag_setup == 0) { + /* Setup packet is present and captured */ + print_safe(&pcur, + " s %02x %02x %04x %04x %04x", + ep->s.setup[0], + ep->s.setup[1], + (ep->s.setup[3] << 8) | ep->s.setup[2], + (ep->s.setup[5] << 8) | ep->s.setup[4], + (ep->s.setup[7] << 8) | ep->s.setup[6]); + } else if (ep->flag_setup != '-') { + /* Unable to capture setup packet */ + print_safe(&pcur, + " %c __ __ ____ ____ ____", ep->flag_setup); + } else { + /* No setup for this kind of URB */ + if (ep->type == 'S' && ep->status == -EINPROGRESS) { + print_safe(&pcur, " -"); + } else { + print_safe(&pcur, " %d", ep->status); + } + if (usb_typeisoc(ep->xfer_type) || + usb_typeint(ep->xfer_type)) { + print_safe(&pcur, ":%d", ep->interval); + } + if (usb_typeisoc(ep->xfer_type)) { + print_safe(&pcur, ":%d", ep->start_frame); + if (ep->type == 'C') { + print_safe(&pcur, + ":%d", ep->s.iso.error_count); + } + } + } + if (usb_typeisoc(ep->xfer_type)) { + /* + * This is the number of descriptors used by HC. + */ + print_safe(&pcur, " %d", ep->s.iso.numdesc); + + /* + * This is the number of descriptors which we print. + */ + ndesc = ep->ndesc; + if (ndesc > ISODESC_MAX) + ndesc = ISODESC_MAX; + if (ndesc * sizeof(struct usbmon_isodesc) > data_len) { + ndesc = data_len / sizeof(struct usbmon_isodesc); + } + /* This is aligned by malloc */ + dp = (struct usbmon_isodesc *) data; + for (i = 0; i < ndesc; i++) { + print_safe(&pcur, + " %d:%u:%u", + dp->iso_stat, dp->iso_off, dp->iso_len); + dp++; + } + + /* + * The number of descriptors captured is used to + * find where the data starts. + */ + ndesc = ep->ndesc; + if (ndesc * sizeof(struct usbmon_isodesc) > data_len) { + data_len = 0; + } else { + data += ndesc * sizeof(struct usbmon_isodesc); + data_len -= ndesc * sizeof(struct usbmon_isodesc); + } + } + } + + print_safe(&pcur, " %d", ep->length); + + if (ep->length > 0) { + if (ep->flag_data == 0) { + print_safe(&pcur, " =\n"); + if (data_len >= prm->data_max) + data_len = prm->data_max; + print_human_data(&pcur, ep, data, data_len); + } else { + print_safe(&pcur, " %c\n", ep->flag_data); + } + } else { + print_safe(&pcur, "\n"); + } + + cnt = print_done(&pcur); + if ((rc = write(1, prm->print_buf, cnt)) < cnt) { + if (rc < 0) { + fprintf(stderr, TAG ": Write error: %s\n", + strerror(errno)); + } else { + fprintf(stderr, TAG ": Short write\n"); + } + exit(1); + } +} + +static void print_human_data(struct print_cursor *curs, + const struct usbmon_packet_1 *ep, const unsigned char *data, int data_len) +{ + int i, j; + + for (i = 0; i < data_len; i++) { + print_safe(curs, " "); + + for (j = 0; j < 16; j++) { + if (i+j < data_len) + print_safe(curs, "%02x ", data[i+j]); + else + print_safe(curs, " "); + if (j == 7) + print_safe(curs, " "); + } + + print_safe(curs, " "); + + for (j = 0; j < 16; j++, i++) { + if (i < data_len) + print_safe(curs, "%c", + isprint(data[i]) ? data[i] : '.'); + else + print_safe(curs, " "); + if (j == 7) + print_safe(curs, " "); + } + print_safe(curs, "\n"); + } + print_safe(curs, "\n"); +} + +/* + * This code works perfectly, but it's a stupendously bad idea. The reason is, + * everyone doing any serious investigation uses a text editor. And in such + * a case, omitting a variable size prefix from a tag makes searching hard. + * Hit "*" in vim to highlight identical tags. + */ +#if 0 + +struct tag_state { + uint64_t common_bits; + unsigned int mask_length; /* Mask for common_bits */ + char format[sizeof("..%0NNllx")]; +}; + +/* + * Print a usbmon event tag into a buffer. + */ +static void print_human_tag(char *tag_buf, int tag_buf_size, + struct tag_state *p, const struct usbmon_packet_1 *ep) +{ + uint64_t mask = (~(uint64_t)0) << (64 - p->mask_length); + + if (p->common_bits == 0) { + snprintf(tag_buf, tag_buf_size, "%016llx", (long long) ep->id); + p->common_bits = ep->id; + p->mask_length = 48; + sprintf(p->format, + "..%%0%dllx", (64 - p->mask_length) / 4); + return; + } + + if ((ep->id & mask) != (p->common_bits & mask)) { + while ((ep->id & mask) != (p->common_bits & mask) && + p->mask_length != 0) { + mask <<= 8; + p->mask_length -= 8; + } + if (p->mask_length != 0) { + sprintf(p->format, + "..%%0%dllx", (64 - p->mask_length) / 4); + } else { + strcpy(p->format, "%016llx"); + } + } + snprintf(tag_buf, tag_buf_size, p->format, (long long) ep->id & ~mask); +} +#endif + +static void print_start(struct print_cursor *t, char *buf, int size0) +{ + t->pbuf = buf; + t->size = size0; + t->count = 0; +} + +static void print_safe(struct print_cursor *t, const char *fmt, ...) +{ + va_list ap; + int len; + + if (t->count+1 >= t->size) + return; + + va_start(ap, fmt); + len = vsnprintf(t->pbuf + t->count, t->size - t->count, fmt, ap); + t->count += len; + va_end(ap); +} + +static int print_done(struct print_cursor *t) +{ + return t->count; +} + +void parse_params(struct params *p, char **argv) +{ + char *arg; + long num; + + memset(p, 0, sizeof(struct params)); + p->data_max = DATA_MAX; /* Same as 1t text API. */ + p->format = TFMT_HUMAN; + p->api = API_ANY; + + while ((arg = *argv++) != NULL) { + if (arg[0] == '-') { + if (arg[1] == 0) + Usage(); + switch (arg[1]) { + case 'i': + if (arg[2] != 0) + Usage(); + if ((arg = *argv++) == NULL) + Usage(); + if (strncmp(arg, "usb", 3) == 0) + arg += 3; + if (!isdigit(arg[0])) + Usage(); + errno = 0; + num = strtol(arg, NULL, 10); + if (errno != 0) + Usage(); + if (num < 0 || num >= 128) { + fprintf(stderr, TAG ": Bus number %ld" + " is out of bounds\n", num); + exit(2); + } + p->ifnum = num; + break; + case 'f': + switch (arg[2]) { + case '0': + p->format = TFMT_OLD; + break; + case 'u': + p->format = TFMT_1U; + break; + case 'h': + p->format = TFMT_HUMAN; + break; + default: + Usage(); + } + break; + case 'a': + switch (arg[2]) { + case '0': + p->api = API_B0; + break; + case '1': + p->api = API_B1; + break; + case 'm': + p->api = API_B1M; + break; + default: + Usage(); + } + break; + case 's': + if (arg[2] != 0) + Usage(); + if ((arg = *argv++) == NULL) + Usage(); + if (!isdigit(arg[0])) + Usage(); + errno = 0; + num = strtol(arg, NULL, 10); + if (errno != 0) + Usage(); + if (num < 0) { + fprintf(stderr, TAG + ": negative size %ld\n", num); + exit(1); + } + p->data_max = num; + break; + default: + Usage(); + } + } else { + Usage(); + } + } + + if (p->data_size == 0) { + p->data_size = p->data_max + 96; + } + + if (p->devname == NULL) { + if ((p->devname = malloc(100)) == NULL) { + fprintf(stderr, TAG ": No core\n"); + exit(1); + } + snprintf(p->devname, 100, "/dev/usbmon%d", p->ifnum); + } + + if (p->format == TFMT_1U) + p->api = API_B1; + + /* + * This is somewhat approximate, but seems like not overflowing. + * We cannot rely on print_safe, because when it triggers it violates + * the documented output format. It only exists to prevent crashes. + */ + if (p->format == TFMT_OLD) { + if (p->data_max != DATA_MAX) { + fprintf(stderr, TAG ": -f0 requires -s 32\n"); + exit(1); + } + p->print_size = 160; + } else { + p->print_size = 100; + p->print_size += (((p->data_max+3)/4 * 9) + 5) * 2; + p->print_size += 10 + ISODESC_MAX*26; /* " %d:%u:%u" */ + } + if ((p->print_buf = malloc(p->print_size)) == NULL) { + fprintf(stderr, TAG ": No core\n"); + exit(1); + } +} + +void make_device(const struct params *p) +{ + int major; + dev_t dev; + + major = find_major(); + dev = makedev(major, p->ifnum); + if (mknod(p->devname, S_IFCHR|S_IRUSR|S_IWUSR, dev) != 0) { + fprintf(stderr, TAG ": Can't make device %s: %s\n", + p->devname, strerror(errno)); + exit(1); + } +} + +int find_major(void) +{ + long num; + FILE *df; + enum { LEN = 50 }; + char buff[LEN], c, *p; + char *major, *mname; + + if ((df = fopen("/proc/devices", "r")) == NULL) { + fprintf(stderr, TAG ": Can't open /proc/devices\n"); + exit(1); + } + num = -1; + while (fgets(buff, LEN, df) != NULL) { + p = buff; + major = NULL; + mname = NULL; + for (p = buff; (c = *p) != 0; p++) { + if (major == NULL) { + if (c != ' ') { + major = p; + } + } else if (mname == NULL) { + if (!isdigit(c) && c != ' ') { + mname = p; + } + } else { + if (c == '\n') { + *p = 0; + break; + } + } + } + if (major != NULL && mname != NULL) { + if (strcmp(mname, "usbmon") == 0) { + errno = 0; + num = strtol(major, NULL, 10); + if (errno != 0) { + fprintf(stderr, TAG ": Syntax error " + "in /proc/devices\n"); + exit(1); + } + break; + } + } + } + fclose(df); + + if (num == -1) { + fprintf(stderr, TAG ": Can't find usbmon in /proc/devices\n"); + exit(1); + } + + if (num <= 0 || num > INT_MAX) { + fprintf(stderr, TAG ": Weird major %ld in /proc/devices\n", + num); + exit(1); + } + + return (int) num; +} + +void Usage(void) +{ + fprintf(stderr, "Usage: " + "usbmon [-i usbN] [-f0|-fu|-fh] [-a0|-a1|-am] [-s len]\n"); + exit(2); +} diff -Nru barry-0.14/zsh/_bjavaloader barry-0.0.20110506/zsh/_bjavaloader --- barry-0.14/zsh/_bjavaloader 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/zsh/_bjavaloader 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,134 @@ +#compdef bjavaloader + +local ret=1 +local state cmds + + +local _bjavaloader_commands +local _bjavaloader_options +local _bjavaloader_dir +local _bjavaloader_erase +local _bjavaloader_wipe + + +_bjavaloader_commands=( + 'cleareventlog:Clears the handheld event log' + 'deviceinfo:Provides information on the handheld' + 'dir:Lists modules on the handheld' + 'erase:Erase module from handheld' + 'eventlog:Retrieves the handheld event log' + 'load:Loads modules onto the handheld' + 'logstacktraces:Dump the stack traces for all threads to the event log' + 'resettofactory:Reset IT policy to factory defaults' + 'save:Retrieves modules from the handheld' + 'screenshot:Make a screenshot of handheld' + 'settime:Sets the time on the handheld' + 'wipe:Wipes the handheld' +) + +_bjavaloader_options=( + '-h[Show the most relevant command line options]' + '-p[PIN of device to talk with]:PIN device' + '-P[Simplistic method to specify device password]:Device password' + '-v[Dump protocol data during operation]' + '*::arg:->cmd_or_options' +) + +_bjavaloader_dir=( + '-s[List sibling in module list]' +) + +_bjavaloader_erase=( + '-f[Force to erase an application current running]' +) + +_bjavaloader_wipe=( + '-a[Wipe applications only]' + '-i[Wipe filesystem only]' +) + + + +declare -A opt_args + + +_arguments -C -s "$_bjavaloader_options[@]" && return 0 + + +case "$state" in + cmd_or_options) + if (( CURRENT == 1)); then + _describe -t commands 'bjavaloader command' _bjavaloader_commands && ret=0 + else + case $words[1] in + cleareventlog) + _message 'no more arguments' && ret=0 + ;; + + deviceinfo) + _message 'no more arguments' && ret=0 + ;; + + dir) + _message 'no more arguments' && ret=0 + + _arguments -C -A '-*' -s \ + "$_bjavaloader_dir[@]" && ret=0 + ;; + + erase) + _message 'modules name from the handheld' + + _arguments -C -A '-*' -s \ + "$_bjavaloader_erase[@]" \ + - recur \ + '*:directory:_path_files -/' \ + - nonrecur \ + '*:COD files:_path_files -g "*.cod(-.)"' && ret=0 + ;; + + eventlog) + _message 'no more arguments' && ret=0 + ;; + + load) + _arguments -C -A '-*' -s \ + - recur \ + '*:directory:_path_files -/' \ + - nonrecur \ + '*:COD files:_path_files -g "*.cod(-.)"' && ret=0 + ;; + + logstacktraces) + _message 'no more arguments' && ret=0 + ;; + + save) + _message 'modules name from the handheld' && ret=0 + ;; + + screenshot) + _arguments -C -A '-*' -s \ + - recur \ + '*:directory:_path_files -/' \ + - nonrecur \ + '*:BMP files:_path_files -g "*.bmp(-.)"' && ret=0 + ;; + + settime) + _message 'time format [yyyy-mm-dd HH:MM:SS]' && ret=0 + ;; + + wipe) + _message 'no more arguments' && ret=0 + + _arguments -C -A '-*' -s \ + "$_bjavaloader_wipe[@]" && ret=0 + ;; + esac + fi + ;; +esac + +return ret + diff -Nru barry-0.14/zsh/_btardump barry-0.0.20110506/zsh/_btardump --- barry-0.14/zsh/_btardump 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/zsh/_btardump 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,38 @@ +#compdef btardump + +local _btardump_options + +local state + + +_btardump_options=( + '-h[Show the most relevant command line options]' \ + '-d=[Load database FROM device and dump to screen]:Database:' \ + '-i=[International charset for string conversions]:International charset:->iconv' \ + '-V[Dump records using MIME vformats where possible]' \ + '*:archive file:->archive' +) + + +_btardump_iconv() { + local result + + result=( ${${${(f)"$(_call_program codesets iconv --list)"}## #}%//} ) + + compadd -a "$@" - result +} + + +_arguments -C -s "$_btardump_options[@]" && return 0 + + +case $state in + iconv) + _btardump_iconv && return 0 + ;; + + archive) + _files -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' && return 0 + ;; +esac + diff -Nru barry-0.14/zsh/_btool barry-0.0.20110506/zsh/_btool --- barry-0.14/zsh/_btool 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/zsh/_btool 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,61 @@ +#compdef btool + +local _btool_options + +local state + + +_btool_options=( + '-h[Show the most relevant command line options]' \ + '-B=[Specify which USB bus to search on]:USB bus:' \ + '-N=[Specify which system device, using system specific string]:Device:' \ + '-c=[Convert address book database to LDIF format, using the specified base DN]:LDIF format:' \ + '-C=[LDIF attribute name to use when building the FQDN]:LDIF attribute:' \ + '-a=[Clear database FROM device]:Database:' \ + '-b=[Filename to save or load a Barry Backup to]:archive:->archive' \ + '-d=[Load database FROM device and dump to screen]:Database:' \ + '-e=[Override endpoint pair detection]:Endpoint:' \ + '-f=[Filename to save or load handheld data to/from]:Filename:_files' \ + '-i=[International charset for string conversions]:International charset:->iconv' \ + '-I[Sort records before output]' \ + '-l[List devices]' \ + '-L[List Contact field names]' \ + '-m[Map LDIF name to Contact field / Unmap LDIF name]' \ + '-M[List current LDIF mapping]' \ + '-n[Use null parser on all databases]' \ + '-p=[PIN of device to talk with]:PIN:' \ + '-P=[Simplistic method to specify device password]:Device password:' \ + '-s=[Save database TO device from data loaded from -f file]:Database:' \ + '-S[Show list of supported database parsers]' \ + '-t[Show database database table]' \ + '-T=[Show record state table for given database]:Database:' \ + '-v[Dump protocol data during operation]' \ + '-V[Dump records using MIME vformats where possible]' \ + '-X[Reset device]' \ + '-z[Use non-threaded sockets]' \ + '-Z[Use threaded socket router (default)]' +) + + +_btool_iconv() { + local result + + result=( ${${${(f)"$(_call_program codesets iconv --list)"}## #}%//} ) + + compadd -a "$@" - result +} + + +_arguments -C -s "$_btool_options[@]" && return 0 + + +case $state in + iconv) + _btool_iconv && return 0 + ;; + + archive) + _files -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' && return 0 + ;; +esac + diff -Nru barry-0.14/zsh/README barry-0.0.20110506/zsh/README --- barry-0.14/zsh/README 1970-01-01 00:00:00.000000000 +0000 +++ barry-0.0.20110506/zsh/README 2011-05-06 12:20:17.000000000 +0000 @@ -0,0 +1,15 @@ +Barry ZSH autocompletion +======================== + +If you use ZSH and you wish that ZSH is able to autocomplete the barry +command lines, you have to add the files : + _bjavaloader + _btool +into the directory : + /usr/share/zsh/functions/Completion/Unix + +You can also add into your $HOME a new directory : + $HOME/.zsh/completions +then add this path at the $FPATH environment variable : + export FPATH=$FPATH:$HOME/.zsh/completions +